From 2cc35c56773bc0ee06d32622dd2254f03e52a867 Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Tue, 9 Feb 2010 20:37:38 +0100 Subject: Honor the "rw" command line flag, but still make "ro" the default if nothing is specified --- init | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'init') diff --git a/init b/init index cf55e51..7d4b226 100644 --- a/init +++ b/init @@ -30,6 +30,8 @@ for cmd in ${CMDLINE}; do [0123456Ss]) ;; [0-9]*) ;; single) ;; + rw) readwrite="yes" ;; + ro) readwrite="no" ;; # only export stuff that does work with ash :) *=*) rhs="$(echo "${cmd}" | cut -d= -f2-)" cmd="$(echo "${cmd}" | cut -d= -f1 | sed 's|\.|_|g')" @@ -157,7 +159,12 @@ if [ -z "${nfsroot}" -a "${root}" != "/dev/nfs" ]; then else fstype=$(eval $(/sbin/blkid -o udev -p "${root}"); echo $ID_FS_TYPE) fi - mount ${fstype:+-t ${fstype}} -o ro${rootflags:+,${rootflags}} "${root}" /new_root + if [ "${readwrite}" = "yes" ]; then + rwopt="rw" + else + rwopt="ro" + fi + mount ${fstype:+-t ${fstype}} -o ${rwopt}${rootflags:+,${rootflags}} "${root}" /new_root else if [ -z "$nfs_server" -o -z "$nfs_path" ]; then err "Unable to mount root filesystem over NFS: wrong parameters." -- cgit v1.2.3-24-g4f1b