[oe-commits] Brian Bloniarz : initscripts: correct checkroot rootfs read-write check
git version control
git at git.openembedded.org
Fri Jul 3 10:13:01 UTC 2009
Module: openembedded.git
Branch: org.openembedded.dev
Commit: 8c2db6479de9bc12e548e80a92b33ab81837b953
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=8c2db6479de9bc12e548e80a92b33ab81837b953
Author: Brian Bloniarz <phunge0 at hotmail.com>
Date: Thu Jul 2 22:10:36 2009 -0400
initscripts: correct checkroot rootfs read-write check
initscripts: correct checkroot rootfs read-write check
Fixes a regexp typo when checking whether the rootfs needs
to be remounted. Also alters the remount logic to not
assume that the root will be mounted RW.
Signed-off-by: Brian Bloniarz <phunge0 at hotmail.com>
recipes/initscripts/initscripts-1.0/checkroot | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
recipes/initscripts/initscripts-1.0/checkroot | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/recipes/initscripts/initscripts-1.0/checkroot b/recipes/initscripts/initscripts-1.0/checkroot
index e5aa9aa..7ad00d0 100755
--- a/recipes/initscripts/initscripts-1.0/checkroot
+++ b/recipes/initscripts/initscripts-1.0/checkroot
@@ -182,6 +182,15 @@ else
fi
fi
+ROOTFSDEV="/dev/root"
+if ! grep -q "^$ROOTFSDEV\>" /proc/mounts; then
+ ROOTFSDEV="rootfs"
+fi
+if [ x$(grep "^$ROOTFSDEV\>" /proc/mounts | awk '{print $4}') = "x$rootmode" ]; then
+ echo "Root filesystem already $rootmode, not remounting"
+ exit 0
+fi
+
#
# If the root filesystem was not marked as read-only in /etc/fstab,
# remount the rootfs rw but do not try to change mtab because it
@@ -189,15 +198,6 @@ fi
# and finally write the new mtab.
# This part is only needed if the rootfs was mounted ro.
#
-ROOTFSDEV="/dev/root"
-if ! grep -q "^$ROOTFSDEV\w" /proc/mounts; then
- ROOTFSDEV="rootfs"
-fi
-if [ x$(grep "^$ROOTFSDEV\w" /proc/mounts | awk '{print $4}') = "xrw" ]; 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
More information about the Openembedded-commits
mailing list