Skip to content

Commit

Permalink
Fix false positive and intempestive 'pending kernel update' messages …
Browse files Browse the repository at this point in the history
…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](#74 (comment)).

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
  • Loading branch information
Antiz96 committed Dec 4, 2023
1 parent 71be4a5 commit 5078d9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5078d9c

Please sign in to comment.