dracut.sh/dracut-functions.sh: use a marker-dir for kernel modules
use "$initdir/.kernelmodseen" to mark kernel modules, which we already handled with install_kmod_with_fw()master
parent
334cc28327
commit
379c34d2cf
|
@ -974,9 +974,14 @@ for_each_module_dir() {
|
||||||
# $1 = full path to kernel module to install
|
# $1 = full path to kernel module to install
|
||||||
install_kmod_with_fw() {
|
install_kmod_with_fw() {
|
||||||
# no need to go further if the module is already installed
|
# no need to go further if the module is already installed
|
||||||
|
|
||||||
[[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \
|
[[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
|
[[ -e "$initdir/.kernelmodseen/${1##*/}" ]] && return 0
|
||||||
|
|
||||||
|
> "$initdir/.kernelmodseen/${1##*/}"
|
||||||
|
|
||||||
if [[ $omit_drivers ]]; then
|
if [[ $omit_drivers ]]; then
|
||||||
local _kmod=${1##*/}
|
local _kmod=${1##*/}
|
||||||
_kmod=${_kmod%.ko}
|
_kmod=${_kmod%.ko}
|
||||||
|
@ -1116,16 +1121,15 @@ instmods() {
|
||||||
--*) _mpargs+=" $_mod" ;;
|
--*) _mpargs+=" $_mod" ;;
|
||||||
i2o_scsi) return ;; # Do not load this diagnostic-only module
|
i2o_scsi) return ;; # Do not load this diagnostic-only module
|
||||||
*)
|
*)
|
||||||
|
_mod=${_mod##*/}
|
||||||
# if we are already installed, skip this module and go on
|
# if we are already installed, skip this module and go on
|
||||||
# to the next one.
|
# to the next one.
|
||||||
[[ -f $initdir/$1 ]] && return
|
[[ -f "$initdir/.kernelmodseen/${_mod%.ko}.ko" ]] && return
|
||||||
|
|
||||||
if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
|
if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
|
||||||
dinfo "Omitting driver ${_mod##$srcmods}"
|
dinfo "Omitting driver ${_mod##$srcmods}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_mod=${_mod##*/}
|
|
||||||
# If we are building a host-specific initramfs and this
|
# If we are building a host-specific initramfs and this
|
||||||
# module is not already loaded, move on to the next one.
|
# module is not already loaded, move on to the next one.
|
||||||
[[ $hostonly ]] && ! grep -qe "\<${_mod//-/_}\>" /proc/modules \
|
[[ $hostonly ]] && ! grep -qe "\<${_mod//-/_}\>" /proc/modules \
|
||||||
|
|
|
@ -676,6 +676,8 @@ if [[ $kernel_only != yes ]]; then
|
||||||
mkdir -p "${initdir}/etc/cmdline.d"
|
mkdir -p "${initdir}/etc/cmdline.d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$initdir/.kernelmodseen"
|
||||||
|
|
||||||
mods_to_load=""
|
mods_to_load=""
|
||||||
# check all our modules to see if they should be sourced.
|
# check all our modules to see if they should be sourced.
|
||||||
# This builds a list of modules that we will install next.
|
# This builds a list of modules that we will install next.
|
||||||
|
@ -766,6 +768,9 @@ if [[ $kernel_only != yes ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -fr "$initdir/.kernelmodseen"
|
||||||
|
|
||||||
|
|
||||||
if (($maxloglvl >= 5)); then
|
if (($maxloglvl >= 5)); then
|
||||||
ddebug "Listing sizes of included files:"
|
ddebug "Listing sizes of included files:"
|
||||||
du -c "$initdir" | sort -n | ddebug
|
du -c "$initdir" | sort -n | ddebug
|
||||||
|
|
Loading…
Reference in New Issue