From 07a081f352497258862ae164d11d9e6dc2c5b959 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 13 Nov 2015 13:40:38 +0100 Subject: [PATCH] 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. --- dracut-init.sh | 14 ++------------ dracut.sh | 22 +--------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index d254e76..f22256c 100644 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -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 diff --git a/dracut.sh b/dracut.sh index 52a628a..a21295d 100755 --- a/dracut.sh +++ b/dracut.sh @@ -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