diff options
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/rc.sysinit | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index eda79ffa..ea9c6884 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -703,11 +703,27 @@ if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then action $"Checking local filesystem quotas: " /sbin/quotacheck -aRnug 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 |