From 5078d9c2fcf172aad91fc652bece082ddddac732 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Mon, 4 Dec 2023 23:25:57 +0100 Subject: [PATCH] Fix false positive and intempestive 'pending kernel update' messages on EndeavourOS with systemd-boot EndeavourOS does not use '/boot' to store 'vmlinuz*' files when using systemd-boot (I couldn't find much details about a specific reason for that, attemps at analyses [here](https://github.com/Antiz96/arch-update/issues/74#issuecomment-1839544849). This commit aims to make the script fallback to '/usr/lib/modules/*/vmlinuz*' if 'vmlinuz*' files are not found under '/boot'. This prevents false positive and intempestive 'pending kernel update' messages on EndeavourOS + systemd-boot --- src/script/arch-update.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 0397341..8e2bad1 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -372,7 +372,11 @@ pacnew_files() { # Definition of the kernel_reboot function: Verify if there's a kernel update waiting for a reboot to be applied kernel_reboot() { - kernel_compare=$(file /boot/vmlinuz* | sed 's/^.*version\ //' | awk '{print $1}' | grep "$(uname -r)") + if [ -f /boot/vmlinuz* ]; then + kernel_compare=$(file /boot/vmlinuz* | sed 's/^.*version\ //' | awk '{print $1}' | grep "$(uname -r)") + else + kernel_compare=$(file /usr/lib/modules/*/vmlinuz* | sed 's/^.*version\ //' | awk '{print $1}' | grep "$(uname -r)") + fi if [ -z "${kernel_compare}" ]; then echo -e "--Reboot required--\nThere's a pending kernel update on your system requiring a reboot to be applied\n"