Skip to content

Commit 2c77fe7

Browse files
committed
workflow: add /etc/board-package
1 parent c981b09 commit 2c77fe7

File tree

7 files changed

+87
-5
lines changed

7 files changed

+87
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/*.deb
2+
board-package

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ all-boards: $(patsubst root-%,%-board,$(wildcard root-*))
2222

2323
else
2424

25-
board-package-$(BOARD_TARGET)-$(RELEASE_NAME)_all.deb: root-$(BOARD_TARGET)
25+
root-$(BOARD_TARGET)/etc/board-package:
26+
mkdir -p root-$(BOARD_TARGET)/etc
27+
echo "BOARD=$(BOARD_TARGET)" > root-$(BOARD_TARGET)/etc/board-package
28+
29+
board-package-$(BOARD_TARGET)-$(RELEASE_NAME)_all.deb: root-$(BOARD_TARGET)/etc/board-package
2630
fpm -s dir -t deb -n board-package-$(BOARD_TARGET)-$(RELEASE_NAME) -v $(RELEASE_NAME) \
2731
-p $@ \
2832
--deb-priority optional --category admin \
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
if [[ -e /etc/board_package ]]; then
6+
source /etc/board_package
7+
fi
8+
if [[ -z "$BOARD" ]]; then
9+
echo "The BOARD= is not defined in /etc/board_package"
10+
fi
11+
12+
if [[ "$#" -ne 1 ]]; then
13+
echo "Usage: $0 [latest] [package-version]"
14+
exit 1
15+
fi
16+
17+
find() {
18+
if [[ "$2" != "latest" ]]; then
19+
set -- "$1" "tags/$2"
20+
fi
21+
curl --silent --fail "https://api.github.com/repos/ayufan-rock64/$1/releases/$2" \
22+
| jq -r '.assets | .[] | .browser_download_url' \
23+
| grep -E "board-package-$BOARD-"
24+
}
25+
26+
if FILES=$(find linux-package "$1"); then
27+
echo "Installing $1..."
28+
echo "$FILES"
29+
install_deb $FILES
30+
else
31+
echo "Did not find kernel '$1' in:"
32+
echo "- https://github.com/ayufan-rock64/linux-kernel/releases"
33+
echo "- https://github.com/ayufan-rock64/linux-mainline-kernel/releases"
34+
exit 1
35+
fi
36+
37+
echo 'Now run `change-default-kernel.sh` to switch the used kernel.'
38+
exit 0
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
if [[ -e /etc/board_package ]]; then
6+
source /etc/board_package
7+
fi
8+
if [[ -z "$BOARD" ]]; then
9+
echo "The BOARD= is not defined in /etc/board_package"
10+
fi
11+
12+
if [[ "$#" -ne 1 ]]; then
13+
echo "Usage: $0 [latest] [u-boot-version]"
14+
exit 1
15+
fi
16+
17+
find() {
18+
if [[ "$2" != "latest" ]]; then
19+
set -- "$1" "tags/$2"
20+
fi
21+
curl --silent --fail "https://api.github.com/repos/ayufan-rock64/$1/releases/$2" \
22+
| jq -r '.assets | .[] | .browser_download_url' \
23+
| grep -E "u-boot-$BOARD-"
24+
}
25+
26+
if FILES=$(find linux-mainline-u-boot "$1"); then
27+
echo "Installing $1..."
28+
echo "$FILES"
29+
install_deb $FILES
30+
else
31+
echo "Did not find u-boot '$1' in:"
32+
echo "- https://github.com/ayufan-rock64/linux-mainline-u-boot/releases"
33+
exit 1
34+
fi
35+
36+
exit 0
File renamed without changes.
File renamed without changes.

root/usr/local/sbin/install_kernel renamed to root/usr/local/sbin/install_kernel.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@
33
set -eo pipefail
44

55
if [[ "$#" -ne 1 ]]; then
6-
echo "Usage: $0 <kernel-version>"
6+
echo "Usage: $0 [latest] [kernel-version]"
77
exit 1
88
fi
99

1010
find() {
11-
curl --silent --fail "https://api.github.com/repos/ayufan-rock64/$1/releases/tags/$2" \
11+
if [[ "$2" != "latest" ]]; then
12+
set -- "$1" "tags/$2"
13+
fi
14+
curl --silent --fail "https://api.github.com/repos/ayufan-rock64/$1/releases/$2" \
1215
| jq -r '.assets | .[] | .browser_download_url' \
1316
| grep -E 'linux-image|linux-headers' \
1417
| grep -v '\-dbg'
1518
}
1619

1720
if FILES=$(find linux-mainline-kernel "$1"); then
18-
echo "Installing..."
21+
echo "Installing $1..."
1922
echo "$FILES"
2023
install_deb $FILES
2124
elif FILES=$(find linux-kernel "$1"); then
22-
echo "Installing..."
25+
echo "Installing $1..."
2326
echo "$FILES"
2427
install_deb $FILES
2528
else

0 commit comments

Comments
 (0)