SVN: rc-scripts/trunk/rc.d/rc.sysinit
zbyniu
zbyniu at pld-linux.org
Mon Mar 2 13:28:20 CET 2009
Author: zbyniu
Date: Mon Mar 2 13:28:20 2009
New Revision: 10158
Modified:
rc-scripts/trunk/rc.d/rc.sysinit
Log:
- remount rootfs rw only if no option 'ro' in fstab
- hide remove errors on /etc/*mtab~* /fastboot etc
Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit (original)
+++ rc-scripts/trunk/rc.d/rc.sysinit Mon Mar 2 13:28:20 2009
@@ -431,8 +431,11 @@
fi
fi
+ _ROOTFS_RO=$(awk '($1 !~ /^#/ && $2 == "/" && ($4 == "ro" || $4 ~ /,ro$// || $4 ~ /^ro,/ || $4 ~ /,ro,/ ) && NF >= 6) { print "ro" }' /etc/fstab)
# Remount the root filesystem read-write
- run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
+ if [ "x$_ROOTFS_RO" == "x" ] ; then
+ run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
+ fi
# Update quotas if fsck was run on /
if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
@@ -459,7 +462,7 @@
fi
# Remove stale backups
-rm -f /etc/mtab~ /etc/mtab~~ /etc/cryptomtab~ /etc/cryptomtab~~
+rm -f /etc/mtab~ /etc/mtab~~ /etc/cryptomtab~ /etc/cryptomtab~~ >/dev/null 2>&1
# Remove /etc/nologin when starting system
[ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
@@ -906,7 +909,7 @@
[ -n "$SELINUX" ] && [ -f /.autorelabel ] && relabel_selinux
# Clean up /.
-rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
+rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff >/dev/null 2>&1
# Clean up /var
# /usr could be still not mounted if it is on NFS.
More information about the pld-cvs-commit
mailing list