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

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