Browse Source

dracut.sh: remove the concept of host_modalias

We can never gather enough information about compiled in modules, so
don't pretend to know and do smart decisions.
master
Harald Hoyer 9 years ago
parent
commit
07a081f352
  1. 14
      dracut-init.sh
  2. 22
      dracut.sh

14
dracut-init.sh

@ -1022,18 +1022,8 @@ module_is_host_only() { @@ -1022,18 +1022,8 @@ module_is_host_only() {
modinfo -F filename "$_mod" &>/dev/null && return 1
fi

_aliases=$(modinfo -k $kernel -F alias $_mod 2>/dev/null)

# if the module has no aliases, install it
[[ $_aliases ]] || return 0

# finally check all modalias
for a in $_aliases; do
for i in "${!host_modalias[@]}"; do
[[ $i == $a ]] && return 0
done
done

# just install the module, better safe than sorry
return 0
fi

return 1

22
dracut.sh

@ -1187,26 +1187,6 @@ if [[ $hostonly ]]; then @@ -1187,26 +1187,6 @@ if [[ $hostonly ]]; then
fi
done < /etc/fstab
fi

# record all host modaliases
declare -A host_modalias
find /sys/devices -name modalias -exec cat '{}' \; > "$initdir/.modalias"
while read -r modalias || [ -n "$modalias" ]; do
[[ $modalias ]] && host_modalias["$modalias"]=1
done < "$initdir/.modalias"

rm -f -- "$initdir/.modalias"

while read _k _s _v || [ -n "$_k" ]; do
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
host_modalias["$_v"]=1
done </proc/crypto

# check /proc/modules
declare -A host_modules
while read m rest || [ -n "$m" ]; do
host_modules["$m"]=1
done </proc/modules
fi

unset m
@ -1293,7 +1273,7 @@ export initdir dracutbasedir \ @@ -1293,7 +1273,7 @@ export initdir dracutbasedir \
debug host_fs_types host_devs swap_devs sshkey add_fstab \
DRACUT_VERSION udevdir prefix filesystems drivers \
systemdutildir systemdsystemunitdir systemdsystemconfdir \
host_modalias host_modules hostonly_cmdline loginstall \
host_modules hostonly_cmdline loginstall \
tmpfilesdir

mods_to_load=""

Loading…
Cancel
Save