diff --git a/usr/lib/initcpio/install/archboot b/usr/lib/initcpio/install/archboot index 49ec5a406..f62d3caf1 100644 --- a/usr/lib/initcpio/install/archboot +++ b/usr/lib/initcpio/install/archboot @@ -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"