From 8f5f3f87a526b585717f3064a8db5a2e6ae849ec Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Sun, 28 Jan 2007 16:45:45 +0000 Subject: initscripts: tweak mtab reading in checkroot.sh so that r/w ramdisk works on epia --- packages/initscripts/initscripts-1.0/checkroot.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'packages/initscripts/initscripts-1.0') diff --git a/packages/initscripts/initscripts-1.0/checkroot.sh b/packages/initscripts/initscripts-1.0/checkroot.sh index cb0a940c7d..8a02aa7b58 100755 --- a/packages/initscripts/initscripts-1.0/checkroot.sh +++ b/packages/initscripts/initscripts-1.0/checkroot.sh @@ -189,16 +189,15 @@ fi # and finally write the new mtab. # This part is only needed if the rootfs was mounted ro. # -if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then - exit 0 +ROOTFSDEV="/dev/root" +if ! grep -q "^$ROOTFSDEV\w" /proc/mounts; then + ROOTFSDEV="rootfs" fi - -# Add a second check, which seems to be needed for some kernel versions -if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then - exit 0 +if [ $(grep "^$ROOTFSDEV\w" /proc/mounts | awk '{print $4}') = rw ]; then + echo "Root filesystem already read-write, not remounting" + exit 0 fi - echo "Remounting root file system..." mount -n -o remount,$rootmode / if test "$rootmode" = rw -- cgit 1.2.3-korg