Skip to content

Commit cb5e650

Browse files
committed
Support downloading ACK kernels
1 parent 0b8aa37 commit cb5e650

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ linux_download:
180180
ifndef VERSION
181181
$(error VERSION environment variable is not defined)
182182
endif
183-
$(SCRIPT_DIR)/download_linux.sh $(VERSION)
183+
$(SCRIPT_DIR)/download_linux.sh $(VERSION) $(ACK)
184184

185185
.PHONY: linux_checkout
186186
linux_checkout:

scripts/download_linux.sh

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,36 @@
33
set -o errexit
44

55
VERSION="$1"
6+
ACK="${2:-0}"
67
MIN_VERSION=2
78
MAX_VERSION=6
89

10+
LINUX_URL=https://cdn.kernel.org/pub/linux/kernel
11+
ACK_URL=https://android.googlesource.com/kernel/common/+archive/refs/heads
12+
913
if [ -z "$VERSION" ]; then
1014
echo "usage: $0 VERSION"
1115
exit 1
1216
fi
1317

14-
first_char=${VERSION:0:1}
18+
if [ $ACK -eq 0 ]; then
19+
first_char=${VERSION:0:1}
1520

16-
if [ $first_char == v ]; then
17-
VERSION=${VERSION:1}
18-
fi
21+
if [ $first_char == v ]; then
22+
VERSION=${VERSION:1}
23+
fi
1924

20-
first_char=${VERSION:0:1}
25+
first_char=${VERSION:0:1}
2126

22-
if [ $first_char -ge $MIN_VERSION ] && [ $first_char -le $MAX_VERSION ]; then
23-
wget https://cdn.kernel.org/pub/linux/kernel/v${first_char}.x/linux-${VERSION}.tar.xz
24-
tar -xf linux-${VERSION}.tar.xz
27+
if [ $first_char -ge $MIN_VERSION ] && [ $first_char -le $MAX_VERSION ]; then
28+
wget $LINUX_URL/v${first_char}.x/linux-$VERSION.tar.xz
29+
tar -xf linux-$VERSION.tar.xz
30+
else
31+
echo "$first_char is not a valid kernel major version number"
32+
exit 1
33+
fi
2534
else
26-
echo "$first_char is not a valid kernel major version number"
27-
exit 1
35+
wget $ACK_URL/$VERSION.tar.gz
36+
mkdir -p $VERSION
37+
tar -xf $VERSION.tar.gz -C $VERSION
2838
fi

0 commit comments

Comments
 (0)