Skip to content

Commit 2da5f79

Browse files
committed
Support downloading the latest kernel with download_linux.sh
1 parent 56208bd commit 2da5f79

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/download_linux.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,21 @@ fi
1818
if [ $ACK -eq 0 ]; then
1919
first_char=${VERSION:0:1}
2020

21+
# Strip any leading 'v'
2122
if [ $first_char == v ]; then
2223
VERSION=${VERSION:1}
2324
fi
24-
2525
first_char=${VERSION:0:1}
2626

27+
# If patch version is 'y', we need to find the latest version of the major.minor release
28+
last_char=${VERSION: -1:1}
29+
if [ $last_char == y ]; then
30+
major_minor=${VERSION: 0:-1}
31+
VERSION=$(curl -s $LINUX_URL/v${first_char}.x/ | sed -e 's/<[^>]*>//g' | grep -oP "linux-${major_minor}[0-9]+" | sort -r -V | head -n1 | cut -d '-' -f2)
32+
fi
33+
34+
echo "Downloading kernel version $VERSION"
35+
2736
if [ $first_char -ge $MIN_VERSION ] && [ $first_char -le $MAX_VERSION ]; then
2837
wget $LINUX_URL/v${first_char}.x/linux-$VERSION.tar.xz
2938
tar -xf linux-$VERSION.tar.xz

0 commit comments

Comments
 (0)