diff options
author | Andrew Wilcox <andy@protium.com> | 2008-01-16 01:42:45 +0000 |
---|---|---|
committer | Andrew Wilcox <andy@protium.com> | 2008-01-16 01:42:45 +0000 |
commit | 9d00af25ddaebf2151f6dadbb48e1635d57ba16a (patch) | |
tree | b4cb2ff9ff483cfa2386bb5b0f03307e815894fa /packages/initscripts/initscripts-1.0/openprotium/umountfs | |
parent | 54a688942b4fc93b03cc9c440f5ca8311871b2fd (diff) |
Numerous openprotium fixes as we transition to udev based root
and task based build
Diffstat (limited to 'packages/initscripts/initscripts-1.0/openprotium/umountfs')
-rwxr-xr-x | packages/initscripts/initscripts-1.0/openprotium/umountfs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/initscripts/initscripts-1.0/openprotium/umountfs b/packages/initscripts/initscripts-1.0/openprotium/umountfs new file mode 100755 index 0000000000..e489c4c1cd --- /dev/null +++ b/packages/initscripts/initscripts-1.0/openprotium/umountfs @@ -0,0 +1,27 @@ +#! /bin/sh +# +# umountfs Turn off swap and unmount all local filesystems. +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +echo "Deactivating swap..." +swapoff -a + +# We leave /proc mounted. +echo "Unmounting local filesystems..." +# umount anything not a pseudo file system, and not root +# doesn't work for nested mounts at a non-root mount point +while read device mountpt fstype options +do + echo "$device" | grep -q "^/" + if [ $? -eq 0 ]; then + if [ "$mountpt" != "/" ] && [ "$mountpt" != "/dev/" ]; then + umount $mountpt + fi + fi +done</proc/mounts + +mount -o remount,ro / + +: exit 0 |