From: Colin Walters Date: Wed, 11 Sep 2013 13:04:45 +0000 (-0400) Subject: dracut.sh: Fixup previous commit to only read /sys and /proc in hostonly mode X-Git-Tag: 033~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36b2e5e2c27f9e72e9aa40e580b6d9e60799ceae;p=thirdparty%2Fdracut.git dracut.sh: Fixup previous commit to only read /sys and /proc in hostonly mode 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. --- diff --git a/dracut.sh b/dracut.sh index 1442a824a..bd905e321 100755 --- 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 "$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