small speedup fixes

This commit is contained in:
Tobias Powalowski 2023-02-22 16:11:07 +01:00
parent e85f047c36
commit 635d56b5c8

View file

@ -31,8 +31,6 @@ add_module() {
local target='' module='' softdeps=() deps=() field='' value='' firmware=()
local ign_errors=0 found=0
[[ "$KERNELVERSION" == 'none' ]] && return 0
if [[ "$1" == *\? ]]; then
ign_errors=1
set -- "${1%?}"
@ -86,6 +84,20 @@ add_module() {
fi
}
add_checked_modules() {
# Add modules to the initcpio, filtered by the list of autodetected
# modules.
# $@: arguments to all_modules
local mod mods
mapfile -t mods < <(all_modules "$@")
map add_module "${mods[@]}"
return $(( !${#mods[*]} ))
}
add_full_dir() {
# Add a directory and all its contents, recursively, to the initcpio image.
# No parsing is performed and the contents of the directory is added as is.
@ -229,14 +241,6 @@ add_binary() {
install_modules() {
local m
local -a xz_comp gz_comp zst_comp
[[ "$KERNELVERSION" == 'none' ]] && return 0
if (( $# == 0 )); then
warning "No modules were added to the image. This is probably not what you want."
return 0
fi
for m in "$@"; do
add_file "$m" "$m"