dracut.sh: simplify modalias reading
parent
cce34acace
commit
96d694c0b5
10
dracut.sh
10
dracut.sh
|
|
@ -1179,13 +1179,9 @@ if [[ $hostonly ]]; then
|
||||||
|
|
||||||
# record all host modaliases
|
# record all host modaliases
|
||||||
declare -A host_modalias
|
declare -A host_modalias
|
||||||
find /sys/devices/ -name uevent -print > "$initdir/.modalias"
|
find /sys/devices -name modalias -exec cat '{}' \; > "$initdir/.modalias"
|
||||||
while read m || [ -n "$m" ]; do
|
while read -r modalias || [ -n "$modalias" ]; do
|
||||||
while read line || [ -n "$line" ]; do
|
[[ $modalias ]] && host_modalias["$modalias"]=1
|
||||||
[[ "$line" != MODALIAS\=* ]] && continue
|
|
||||||
modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1
|
|
||||||
break
|
|
||||||
done < "$m"
|
|
||||||
done < "$initdir/.modalias"
|
done < "$initdir/.modalias"
|
||||||
|
|
||||||
rm -f -- "$initdir/.modalias"
|
rm -f -- "$initdir/.modalias"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue