From: Harald Hoyer Date: Wed, 2 Jan 2013 12:43:56 +0000 (+0100) Subject: usrmount/mount-usr.sh: filter "subvol=" from root rflags X-Git-Tag: 025~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e6fcec9173cb08f98abc59a77817948486c42ed5;p=thirdparty%2Fdracut.git usrmount/mount-usr.sh: filter "subvol=" from root rflags https://bugzilla.redhat.com/show_bug.cgi?id=890577 --- diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh index cca41c35f..5aaefbcb6 100755 --- a/modules.d/98usrmount/mount-usr.sh +++ b/modules.d/98usrmount/mount-usr.sh @@ -5,6 +5,21 @@ type info >/dev/null 2>&1 || . /lib/dracut-lib.sh type fsck_single >/dev/null 2>&1 || . /lib/fs-lib.sh +filtersubvol() { + local _oldifs + _oldifs="$IFS" + IFS="," + set $* + IFS="$_oldifs" + while [ $# -gt 0 ]; do + case $1 in + subvol\=*) :;; + *) echo -n "${1}," ;; + esac + shift + done +} + fsck_usr() { local _dev=$1 @@ -56,6 +71,8 @@ mount_usr() [ "${root#block:}" -ef $_dev ] [ -n "$rflags" ]; then # for btrfs subvolumes we have to mount /usr with the same rflags + rflags=$(filtersubvol "$rflags") + rflags=${rflags%%,} _opts="${_opts:+${_opts},}${rflags}" elif getargbool 0 ro; then # if "ro" is specified, we want /usr to be mounted read-only