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.
This commit is contained in:
Colin Walters 2013-09-11 09:04:45 -04:00 committed by Harald Hoyer
parent 3c4315fa13
commit 36b2e5e2c2

View File

@ -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