initscripts: tweak mtab reading in checkroot.sh so that r/w ramdisk
authorPhil Blundell <philb@gnu.org>
Sun, 28 Jan 2007 16:45:45 +0000 (16:45 +0000)
committerPhil Blundell <philb@gnu.org>
Sun, 28 Jan 2007 16:45:45 +0000 (16:45 +0000)
works on epia

packages/initscripts/initscripts-1.0/checkroot.sh
packages/initscripts/initscripts_1.0.bb

index cb0a940..8a02aa7 100755 (executable)
@@ -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
index 0648cee..06a6017 100644 (file)
@@ -5,7 +5,7 @@ DEPENDS = "makedevs"
 DEPENDS_openzaurus = "makedevs virtual/kernel"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r85"
+PR = "r86"
 
 SRC_URI = "file://halt \
            file://ramdisk \