From 8bf9fb6f0a13a0d7f72e88c5a06905bdfd6c300f Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Mon, 23 Mar 2020 14:37:29 +0100 Subject: Check whether /boot is already mounted This commit adds code to check whether /boot is mounted or not, and will skip the mount command if the path is already mounted. This will fix an issue where the script exited prematurely if /boot was already present, as the mount command failed and we use `set -e'. --- kern | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kern b/kern index 83b5cb1..cef14c3 100755 --- a/kern +++ b/kern @@ -14,6 +14,10 @@ has_boot_mount() { awk '{print $2}' /etc/fstab | grep -q ^/boot$ } +is_boot_mounted() { + mountpoint -q /boot +} + get_latest_kernel() { eselect --brief kernel list | tail -n1 } @@ -60,7 +64,7 @@ build_kernel() { } install_kernel() { - if has_boot_mount; then + if has_boot_mount && ! is_boot_mounted; then sudo mount /boot fi sudo make install modules_install -- cgit v1.2.3-2-gb3c3