Blame SOURCES/0248-dracut.sh-add-devices-with-x-initrd.mount-in-etc-fst.patch

18971c
From 90b5b48734b8738fac217df1b2846997f532a0ea Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Thu, 2 Jul 2015 14:55:31 +0200
18971c
Subject: [PATCH] dracut.sh: add devices with x-initrd.mount in /etc/fstab to
18971c
 host_devs
18971c
18971c
otherwise dracut might not even be able to mount those.
18971c
18971c
(cherry picked from commit 916559e073a49eedbc7b0c58b399d303fb8c2a05)
18971c
---
18971c
 dracut.sh | 14 ++++++++++++++
18971c
 1 file changed, 14 insertions(+)
18971c
18971c
diff --git a/dracut.sh b/dracut.sh
18971c
index 6e56af50..0e600220 100755
18971c
--- a/dracut.sh
18971c
+++ b/dracut.sh
18971c
@@ -1061,6 +1061,20 @@ if [[ $hostonly ]]; then
18971c
             done < /etc/fstab
18971c
         done < /proc/swaps
18971c
     fi
18971c
+
18971c
+    # collect all "x-initrd.mount" entries from /etc/fstab
18971c
+    if [[ -f /etc/fstab ]]; then
18971c
+        while read _d _m _t _o _r || [ -n "$_d" ]; do
18971c
+            [[ "$_d" == \#* ]] && continue
18971c
+            [[ $_d ]] || continue
18971c
+            [[ "$_o" != *x-initrd.mount* ]] && continue
18971c
+            _dev=$(expand_persistent_dev "$_d")
18971c
+            _dev="$(readlink -f "$_dev")"
18971c
+            [[ -b $_dev ]] && push host_devs "$_dev"
18971c
+        done < /etc/fstab
18971c
+    fi
18971c
+
18971c
+
18971c
     # record all host modaliases
18971c
     declare -A host_modalias
18971c
     find  /sys/devices/ -name uevent -print > "$initdir/.modalias"