mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
small speedup fixes
This commit is contained in:
parent
e85f047c36
commit
635d56b5c8
1 changed files with 14 additions and 10 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue