summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2010-02-09 20:37:38 +0100
committerThomas Bächler <thomas@archlinux.org>2010-02-09 20:37:38 +0100
commit2cc35c56773bc0ee06d32622dd2254f03e52a867 (patch)
tree0536c5128a30abaf30ae01ec683d038a1cbbdb8e
parentb4e4b6f268a293b3093f43afafe005cfccae24ca (diff)
downloadmkinitcpio-2cc35c56773bc0ee06d32622dd2254f03e52a867.tar.gz
mkinitcpio-2cc35c56773bc0ee06d32622dd2254f03e52a867.tar.xz
Honor the "rw" command line flag, but still make "ro" the default if nothing is specified
-rw-r--r--init9
1 files changed, 8 insertions, 1 deletions
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."