usrmount/mount-usr.sh: filter "subvol=" from root rflags
authorHarald Hoyer <harald@redhat.com>
Wed, 2 Jan 2013 12:43:56 +0000 (13:43 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 2 Jan 2013 13:06:44 +0000 (14:06 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=890577

modules.d/98usrmount/mount-usr.sh

index cca41c3..5aaefbc 100755 (executable)
@@ -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