summaryrefslogtreecommitdiff
path: root/update-me.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-08-22 13:55:28 +0200
committerErich Eckner <git@eckner.net>2019-08-22 13:55:28 +0200
commitfca58bcc06234bddfe4ee25a5f3b47072afcf7c0 (patch)
tree12d6928114da7af89cb24ba10d5b67fc82d41375 /update-me.in
parentc178f41d098318143b04f3fb34e165d856d65d1d (diff)
downloadupdate-all-fca58bcc06234bddfe4ee25a5f3b47072afcf7c0.tar.xz
update-me: check /boot _and_ / for remount
Diffstat (limited to 'update-me.in')
-rw-r--r--update-me.in20
1 files changed, 11 insertions, 9 deletions
diff --git a/update-me.in b/update-me.in
index 09025fc..cff74f3 100644
--- a/update-me.in
+++ b/update-me.in
@@ -4,15 +4,17 @@ preCmds=('hostname')
cmds=()
postCmds=('sync')
-if mountpoint -q /boot \
-&& mount \
- | grep -wF '/boot' \
- | cut -d' ' -f6 \
- | grep -qwF 'ro' \
-&& [ ! -d '#ETCDIR#/ports' ]; then
- preCmds+=('mount -o remount,rw /boot')
- postCmds+=('mount -o remount,ro /boot')
-fi
+for mp in '/' '/boot'; do
+ mountpoint -q "${mp}" || continue
+ mount \
+ | cut -d' ' -f3,6 \
+ | grep "^${mp}\s" \
+ | cut -d' ' -f2 \
+ | grep -qwF 'ro' || continue
+ [ "${mp}" = '/boot' ] && [ -d '#ETCDIR#/ports' ] && continue
+ preCmds+=('mount -o remount,rw '"${mp}")
+ postCmds+=('mount -o remount,ro '"${mp}")
+done
if command -v check-kernel >/dev/null; then
postCmds+=('check-kernel -r')