SVN: rc-scripts/trunk/rc.d/rc.sysinit
glen
glen at pld-linux.org
Thu Oct 5 19:21:30 CEST 2006
Author: glen
Date: Thu Oct 5 19:21:29 2006
New Revision: 7840
Modified:
rc-scripts/trunk/rc.d/rc.sysinit
Log:
There could be multiple entries for root dir.
Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit (original)
+++ rc-scripts/trunk/rc.d/rc.sysinit Thu Oct 5 19:21:29 2006
@@ -370,7 +370,9 @@
fi
# Remount the root filesystem read-write
- rw=$(awk '($1 !~ /^#/ && $2 == "/") { print $4; exit}' /proc/mounts)
+ # There could be multiple entries for rootfs, so if any of them is 'ro' we
+ # assume rootfs is readonly.
+ rw=$(awk '($1 !~ /^#/ && $2 == "/") { if ($4 == "ro") readonly = 1} END { print readonly ? "ro" : "rw"}' /proc/mounts)
if [[ $rw != *rw* ]]; then
run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
fi
More information about the pld-cvs-commit
mailing list