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 | |
parent | 54a688942b4fc93b03cc9c440f5ca8311871b2fd (diff) |
Numerous openprotium fixes as we transition to udev based root
and task based build
Diffstat (limited to 'packages/initscripts')
5 files changed, 75 insertions, 8 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 diff --git a/packages/initscripts/initscripts-openprotium_1.0.bb b/packages/initscripts/initscripts-openprotium_1.0.bb index 83e89ef7a1..890bbd756c 100644 --- a/packages/initscripts/initscripts-openprotium_1.0.bb +++ b/packages/initscripts/initscripts-openprotium_1.0.bb @@ -24,16 +24,16 @@ SRC_URI += "file://openprotium/halt" SRC_URI += "file://openprotium/reboot" SRC_URI += "file://openprotium/flashclean" SRC_URI += "file://openprotium/checkroot.sh" +SRC_URI += "file://openprotium/mountall.sh" +SRC_URI += "file://openprotium/umountinitrd.sh" +SRC_URI += "file://openprotium/umountfs" # Without this it is not possible to patch checkroot.sh S = "${WORKDIR}" do_install_append() { - # the image build command now installs this for slugos - # except that mine doesn't. we don't need it, but we turnup - # expects it to at least exist - rm ${D}${sysconfdir}/device_table - touch ${D}${sysconfdir}/device_table + #rm ${D}${sysconfdir}/device_table + #touch ${D}${sysconfdir}/device_table # openprotium specific scripts # install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d @@ -44,6 +44,8 @@ do_install_append() { install -m 0755 ${WORKDIR}/openprotium/devices ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/openprotium/flashclean ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/openprotium/checkroot.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/openprotium/mountall.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/openprotium/umountinitrd.sh ${D}${sysconfdir}/init.d # Remove the do install links (this detects a change to the # initscripts .bb file - it will cause a build failure here.) @@ -130,7 +132,7 @@ do_install_append() { # slugos network syslog starts here (44) update-rc.d -r ${D} mountnfs.sh start 45 S . - update-rc.d -r ${D} bootmisc.sh start 55 S . + # update-rc.d -r ${D} bootmisc.sh start 55 S . # urandom is currently disabled from S 55 (and won't work with tmpfs /var) # ipkg-cl configure runs at S 98 @@ -158,7 +160,7 @@ do_install_append() { # This is the special, correct, slugos umountnfs.sh (it looks in # the /proc/mounts information, not /etc/fstab) update-rc.d -r ${D} umountnfs.sh start 31 0 6 . - update-rc.d -r ${D} save-rtc.sh start 25 0 6 . + # update-rc.d -r ${D} save-rtc.sh start 25 0 6 . # portmap stops at 32 # slugos network syslog stops here (39) # networking stops at 40 (nothing else does, believe me.) |