aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-01-10 20:29:45 +0000
committerBill Nottingham <notting@redhat.com>2008-01-10 20:29:45 +0000
commitfbfef504e077f4f6bfd065afea1d7547cfff785d (patch)
tree245e7d6a817cb807fa729a2ff6f90d8a30b5a007
parentf131a0ad6a42218588cc2aa0933fea52f94e59a7 (diff)
downloadinitscripts-fbfef504e077f4f6bfd065afea1d7547cfff785d.tar
initscripts-fbfef504e077f4f6bfd065afea1d7547cfff785d.tar.gz
initscripts-fbfef504e077f4f6bfd065afea1d7547cfff785d.tar.bz2
initscripts-fbfef504e077f4f6bfd065afea1d7547cfff785d.tar.xz
initscripts-fbfef504e077f4f6bfd065afea1d7547cfff785d.zip
fix root fs check to catch 'rw,ordered,noatime,etc.' properly (#334171)
-rwxr-xr-xrc.d/rc.sysinit19
1 files changed, 17 insertions, 2 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 97746d82..2d282b07 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -679,12 +679,27 @@ if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
fi
fi
+remount_needed() {
+ local state oldifs
+ [ "$READONLY" = "yes" ] && return 1
+ state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
+ oldifs=$IFS
+ IFS=","
+ for opt in $state ; do
+ if [ "$opt" = "rw" ]; then
+ IFS=$oldifs
+ return 1
+ fi
+ done
+ IFS=$oldifs
+ return 0
+}
# Remount the root filesystem read-write.
update_boot_stage RCmountfs
-state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
-[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
+if remount_needed ; then
action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
+fi
# Clean up SELinux labels
if [ -n "$SELINUX_STATE" ]; then