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

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