From: Will Woods Date: Mon, 1 Aug 2011 20:21:07 +0000 (-0400) Subject: dmsquash-live-root cleanups/mini-fixes X-Git-Tag: 012~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48205bb064930e36cb402836b2abf0c1a5d49d4a;p=thirdparty%2Fdracut.git dmsquash-live-root cleanups/mini-fixes - use last ro/rw cmdline arg rather than favoring 'rw' over 'ro' - don't bother with useless RES variable for holding $? - only do fs check when $livedev is a block device Signed-off-by: Will Woods --- diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root index 4d1d9024a..a76cbc7aa 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root +++ b/modules.d/90dmsquash-live/dmsquash-live-root @@ -25,7 +25,8 @@ getargbool 0 rd.live.overlay.reset -y reset_overlay && reset_overlay="yes" getargbool 0 rd.live.overlay.readonly -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay="" overlay=$(getarg rd.live.overlay overlay) -[ -e $livedev ] && fs=$(blkid -s TYPE -o value $livedev) +# CD/DVD media check +[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev) if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then check="yes" fi @@ -40,9 +41,7 @@ if [ -n "$check" ]; then [ -x /bin/plymouth ] && /bin/plymouth --show-splash fi -getarg ro && liverw=ro -getarg rw && liverw=rw -[ -z "$liverw" ] && liverw=ro +for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done # mount the backing of the live image first mkdir -m 0755 -p /run/initramfs/live if [ -f $livedev ]; then @@ -52,9 +51,8 @@ if [ -f $livedev ]; then *ext3fs.img|*rootfs.img) FSIMG=$livedev ;; esac else - mount -n -t $fstype -o $liverw $livedev /run/initramfs/live - RES=$? - if [ "$RES" != "0" ]; then + mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live + if [ "$?" != "0" ]; then die "Failed to mount block device of live image" exit 1 fi