From 5e8d54eef7048304170e86a8c58d006ce63f9a5d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Nov 2006 17:46:55 +0000 Subject: [PATCH] * Remove /etc/mtab on boot. * Start an emergency shell if we can't remount / read-writable. svn path=/nixu/trunk/; revision=7097 --- test/boot-stage-2-init.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/boot-stage-2-init.sh b/test/boot-stage-2-init.sh index 75ff879883e..9edb255f3d5 100644 --- a/test/boot-stage-2-init.sh +++ b/test/boot-stage-2-init.sh @@ -21,11 +21,12 @@ done # Mount special file systems, initialise required directories. -rm -f /etc/mtab - if test -z "@readOnlyRoot@"; then #rootDev=$(grep "/dev/.* / " /proc/mounts | sed 's/^\([^ ]*\) .*/\1/') - mount -o remount,rw /dontcare / # !!! check for failure + if mount -t dontcare -o remount,rw /dontcare /; then + echo "Couldn't remount / read-writable, starting emergency shell!" + exec @shell@ + fi fi needWritableDir() { @@ -40,7 +41,8 @@ needWritableDir /etc 0755 -n # to shut up mount test -e /etc/fstab || touch /etc/fstab # idem -mount -t proc none /proc +mount -n -t proc none /proc +cp /proc/mounts /etc/mtab mount -t sysfs none /sys mount -t tmpfs -o "mode=0755" none /dev needWritableDir /tmp 01777