From 19ca5aeb5006801ed3550373da5ce08ceccf38e1 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Sun, 16 Apr 2023 18:56:16 +0100 Subject: [PATCH] 64-bit-only kernel package does not have /boot/kernel.img ; use /boot/kernel8.img for version detection. http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel_1.20230405-1_arm64.deb 9a716f09695f1e6c9f951a6bc9e4ff22 27025792 Apr 5 20:13 6.1.21-v8+ --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 7e8b177..0e65d9e 100755 --- a/install.sh +++ b/install.sh @@ -67,6 +67,8 @@ function get_kernel_version() { [ -z "$_VER_RUN" ] && { ZIMAGE=/boot/kernel.img [ -f /boot/firmware/vmlinuz ] && ZIMAGE=/boot/firmware/vmlinuz + # 64-bit-only kernel package + [ ! -f /boot/kernel.img ] && [ -f /boot/kernel8.img ] && ZIMAGE=/boot/kernel8.img IMG_OFFSET=$(LC_ALL=C grep -abo $'\x1f\x8b\x08\x00' $ZIMAGE | head -n 1 | cut -d ':' -f 1) _VER_RUN=$(dd if=$ZIMAGE obs=64K ibs=4 skip=$(( IMG_OFFSET / 4)) 2>/dev/null | zcat | grep -a -m1 "Linux version" | LC_ALL=C sed -e 's/^.*Linux/Linux/' | strings | awk '{ print $3; }') }