mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-27 17:55:47 +03:00
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:
parent
3c4315fa13
commit
36b2e5e2c2
27
dracut.sh
27
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user