aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWynn Wolf Arbor2020-03-23 14:37:29 +0100
committerWynn Wolf Arbor2020-03-23 14:37:29 +0100
commit8bf9fb6f0a13a0d7f72e88c5a06905bdfd6c300f (patch)
treee82fd380df5b63241c823a235f29e59baf9279ea
parent110bf234790288036f208889cd9d5fd967993c38 (diff)
downloadkern-8bf9fb6f0a13a0d7f72e88c5a06905bdfd6c300f.tar.gz
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'.
-rwxr-xr-xkern6
1 files changed, 5 insertions, 1 deletions
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