From 9d00af25ddaebf2151f6dadbb48e1635d57ba16a Mon Sep 17 00:00:00 2001 From: Andrew Wilcox Date: Wed, 16 Jan 2008 01:42:45 +0000 Subject: Numerous openprotium fixes as we transition to udev based root and task based build --- .../initscripts-1.0/openprotium/checkroot.sh | 2 +- .../initscripts-1.0/openprotium/mountall.sh | 27 ++++++++++++++++++++++ .../initscripts-1.0/openprotium/umountfs | 27 ++++++++++++++++++++++ .../initscripts-1.0/openprotium/umountinitrd.sh | 11 +++++++++ .../initscripts/initscripts-openprotium_1.0.bb | 16 +++++++------ 5 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 packages/initscripts/initscripts-1.0/openprotium/mountall.sh create mode 100755 packages/initscripts/initscripts-1.0/openprotium/umountfs create mode 100644 packages/initscripts/initscripts-1.0/openprotium/umountinitrd.sh (limited to 'packages/initscripts') 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