From 89f8a766469d049833c5fac749c3fde9e3943b3e Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Mon, 24 Aug 2020 12:03:46 +0100 Subject: [PATCH 1/3] Allow kernel images to be elsewhere - Ubuntu kernel is not at Raspbian location --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 3268e69..2665d29 100755 --- a/install.sh +++ b/install.sh @@ -66,6 +66,7 @@ function get_kernel_version() { _VER_RUN="" [ -z "$_VER_RUN" ] && { ZIMAGE=/boot/kernel.img + [ -f /boot/firmware/vmlinuz ] && ZIMAGE=/boot/firmware/vmlinuz 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)) | zcat | grep -a -m1 "Linux version" | strings | awk '{ print $3; }') } From 53c0db449b711f8e5d7662605837b882827e2450 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Thu, 27 Aug 2020 13:15:03 +0100 Subject: [PATCH 2/3] make the overlay un-install directory configurable, for Ubuntu --- uninstall.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index c9491d6..2d28681 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -55,9 +55,12 @@ echo "remove dtbos" for i in $RPI_HATS; do dtoverlay -r $i done -rm /boot/overlays/seeed-2mic-voicecard.dtbo || true -rm /boot/overlays/seeed-4mic-voicecard.dtbo || true -rm /boot/overlays/seeed-8mic-voicecard.dtbo || true +OVERLAYS=/boot/overlays +[ -d /boot/firmware/overlays ] && OVERLAYS=/boot/firmware/overlays + +rm ${OVERLAYS}/seeed-2mic-voicecard.dtbo || true +rm ${OVERLAYS}/seeed-4mic-voicecard.dtbo || true +rm ${OVERLAYS}/seeed-8mic-voicecard.dtbo || true echo "remove alsa configs" rm -rf /etc/voicecard/ || true From 329c8090ea886243bd3d5ee03ced96550e7851ee Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Thu, 27 Aug 2020 13:17:20 +0100 Subject: [PATCH 3/3] make the config un-install directory configurable, for Ubuntu --- uninstall.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uninstall.sh b/uninstall.sh index 2d28681..6b9f8d1 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -14,6 +14,8 @@ fi uname_r=$(uname -r) CONFIG=/boot/config.txt +[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt + get_overlay() { ov=$1 if grep -q -E "^dtoverlay=$ov" $CONFIG; then