summaryrefslogtreecommitdiff
path: root/packages/slugos-init/files/initscripts/umountinitrd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packages/slugos-init/files/initscripts/umountinitrd.sh')
-rw-r--r--packages/slugos-init/files/initscripts/umountinitrd.sh30
1 files changed, 18 insertions, 12 deletions
diff --git a/packages/slugos-init/files/initscripts/umountinitrd.sh b/packages/slugos-init/files/initscripts/umountinitrd.sh
index da39b425f8..9cb1f7a25d 100644
--- a/packages/slugos-init/files/initscripts/umountinitrd.sh
+++ b/packages/slugos-init/files/initscripts/umountinitrd.sh
@@ -4,15 +4,21 @@
# if the directory /initrd is not present, if this fails
# then the /initrd is mounted and we want to remount that
# ro - this works round the shutdown -r hang problem
-umount /mnt 2>/dev/null || {
- # need the device for a remount
- . /etc/default/functions
- ffspart=Flashdisk
- ffsdev="$(mtblockdev $ffspart)"
- if test -n "$ffsdev" -a -b "$ffsdev"
- then
- mount -o remount,ro "$ffsdev" /initrd
- else
- echo "Flashdisk: $ffsdev: flash device not found" >&2
- fi
-}
+. /etc/default/functions
+while read device directory remainder
+do
+ case "$directory" in
+ /mnt) echo "InitRD: unmount initrd on /mnt" >&2
+ umount /mnt;;
+ /initrd)# need the device for a remount
+ ffspart=Flashdisk
+ ffsdev="$(mtblockdev $ffspart)"
+ echo "InitRD: remount $ffdev read-only on /initrd" >&2
+ if test -n "$ffsdev" -a -b "$ffsdev"
+ then
+ mount -o remount,ro "$ffsdev" /initrd
+ else
+ echo "Flashdisk: $ffsdev: flash device not found" >&2
+ fi;;
+ esac
+done </proc/mounts