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 | |
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')
4 files changed, 66 insertions, 1 deletions
diff --git a/packages/initscripts/initscripts-1.0/openprotium/checkroot.sh b/packages/initscripts/initscripts-1.0/openprotium/checkroot.sh index c69a773482..6b63b07188 100755 --- a/packages/initscripts/initscripts-1.0/openprotium/checkroot.sh +++ b/packages/initscripts/initscripts-1.0/openprotium/checkroot.sh @@ -205,7 +205,7 @@ then : > /etc/mtab fi mount -f -o remount / - mount -f /proc + grep -q '^proc /proc' /etc/mtab || mount -f /proc test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs" fi diff --git a/packages/initscripts/initscripts-1.0/openprotium/mountall.sh b/packages/initscripts/initscripts-1.0/openprotium/mountall.sh new file mode 100644 index 0000000000..94ea8217fd --- /dev/null +++ b/packages/initscripts/initscripts-1.0/openprotium/mountall.sh @@ -0,0 +1,27 @@ +# +# mountall.sh Mount all filesystems. +# +# Version: @(#)mountall.sh 2.83-2 01-Nov-2001 miquels@cistron.nl +# +. /etc/default/rcS + +# +# Mount local filesystems in /etc/fstab. For some reason, people +# might want to mount "proc" several times, and mount -v complains +# about this. So we mount "proc" filesystems without -v. +# +test "$VERBOSE" != no && echo "Mounting local filesystems..." +mount -at nonfs,nosmbfs,noncpfs 2>/dev/null + +# +# We might have mounted something over /dev, see if /dev/initctl is there. +# +if test ! -p /dev/initctl +then + rm -f /dev/initctl + mknod -m 600 /dev/initctl p +fi +kill -USR1 1 + +: exit 0 + 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 diff --git a/packages/initscripts/initscripts-1.0/openprotium/umountinitrd.sh b/packages/initscripts/initscripts-1.0/openprotium/umountinitrd.sh new file mode 100644 index 0000000000..6ee0d50e84 --- /dev/null +++ b/packages/initscripts/initscripts-1.0/openprotium/umountinitrd.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# umount the static dev - we'd probably never use it. +# +[ -d /dev/.static/dev ] && umount /dev/.static/dev +# +# if a root is found on an ext* filesystem, umount the old initrd +# +grep -q "/ ext" /proc/mounts +if [ $? -eq 0 ]; then + umount /initrd +fi |