]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: Fixup previous commit to only read /sys and /proc in hostonly mode
authorColin Walters <walters@verbum.org>
Wed, 11 Sep 2013 13:04:45 +0000 (09:04 -0400)
committerHarald Hoyer <harald@redhat.com>
Wed, 11 Sep 2013 20:50:22 +0000 (22:50 +0200)
The gnome-ostree build system generates dracut initramfs images on the
build server, therefore not in hostonly mode.  The build system at the
moment doesn't mount /sys, and the previous commit caused a hard
failure due to lack of /sys/devices.

Because we only want /sys/devices in hostonly mode, just move those
bits inside the hostonly conditional above.

dracut.sh

index 1442a824ab1ff24195ba4253405c7f40a1ddb57c..bd905e3214f699908613f9affd377931853abeeb 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -917,22 +917,21 @@ if [[ $hostonly ]]; then
             done < /etc/fstab
         done < /proc/swaps
     fi
+    # record all host modaliases
+    declare -A host_modalias
+    find  /sys/devices/ -name modalias -print > "$initdir/.modalias"
+    while read m; do
+        host_modalias["$(<"$m")"]=1
+    done < "$initdir/.modalias"
+    rm -f -- "$initdir/.modalias"
+
+    # check /proc/modules
+    declare -A host_modules
+    while read m rest; do
+        host_modules["$m"]=1
+    done </proc/modules
 fi
 
-# record all host modaliases
-declare -A host_modalias
-find  /sys/devices/ -name modalias -print > "$initdir/.modalias"
- while read m; do
-    host_modalias["$(<"$m")"]=1
-done < "$initdir/.modalias"
-rm -f -- "$initdir/.modalias"
-
-# check /proc/modules
-declare -A host_modules
-while read m rest; do
-    host_modules["$m"]=1
-done </proc/modules
-
 unset m
 unset rest