]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: add devices with x-initrd.mount in /etc/fstab to host_devs
authorHarald Hoyer <harald@redhat.com>
Thu, 2 Jul 2015 12:55:31 +0000 (14:55 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 2 Jul 2015 13:16:06 +0000 (15:16 +0200)
otherwise dracut might not even be able to mount those.

(cherry picked from commit 916559e073a49eedbc7b0c58b399d303fb8c2a05)

dracut.sh

index 6e56af50a2d381c7ae6287b0bb0796e2918653d0..0e600220cb6c8a5f8a94f880b2cba8e8b6681147 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1061,6 +1061,20 @@ if [[ $hostonly ]]; then
             done < /etc/fstab
         done < /proc/swaps
     fi
+
+    # collect all "x-initrd.mount" entries from /etc/fstab
+    if [[ -f /etc/fstab ]]; then
+        while read _d _m _t _o _r || [ -n "$_d" ]; do
+            [[ "$_d" == \#* ]] && continue
+            [[ $_d ]] || continue
+            [[ "$_o" != *x-initrd.mount* ]] && continue
+            _dev=$(expand_persistent_dev "$_d")
+            _dev="$(readlink -f "$_dev")"
+            [[ -b $_dev ]] && push host_devs "$_dev"
+        done < /etc/fstab
+    fi
+
+
     # record all host modaliases
     declare -A host_modalias
     find  /sys/devices/ -name uevent -print > "$initdir/.modalias"