summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-11-10 23:42:34 (EST)
committer P. J. McDermott <pj@pehjota.net>2014-11-10 23:42:34 (EST)
commitcf220cca2db53c0cfd23af06621db6dca227729f (patch)
treebb3375d59469dbb879a542a4977dd60e308bc843
parentbcf7ee4ae654a33751980d77e4bdf72960328024 (diff)
install-lilo: More robustly get boot device
-rw-r--r--install-lilo.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/install-lilo.sh b/install-lilo.sh
index a421a36..6ec8555 100644
--- a/install-lilo.sh
+++ b/install-lilo.sh
@@ -21,7 +21,8 @@ main()
'please specify the boot and root devices'
fi
boot="$(mountpoint -n /boot | cut -d ' ' -f 1)"
- boot="${boot%%[0-9]}"
+ boot="$(printf '%s\n' "${boot}" | \
+ sed 's|^\([/a-zA-Z]*\)\([0-9]*\)|\1|')"
root="$(mountpoint -n / | cut -d ' ' -f 1)"
rootdev="$(printf '%s\n' "${root}" | \
sed 's|^\([/a-zA-Z]*\)\([0-9]*\)|\1|')"