Skip to content

functions: do not fail if no modules with the symbol can be found

functions: deduplicate add_checked_modules_from_symbol and add_all_modules_from_symbol

Use add_all_modules_from_symbol and simply check if it is called from add_checked_modules_from_symbol

functions: do not fail if no modules with the symbol can be found

Prevent triggering the add_* trap in mkinitcpio. Error handling is left up to the hooks themselves, if they need it.

Show a warning with the symbol name and directories if a symbol cannot be found.

Fixes #260 (closed)

functions: fix add_checked_modules_from_symbol

A here string cannot be used as an input to grep. The grep command returns nothing.

If ${#mods[@]} is 0, then (( ${#mods[@]} )) evaluates to false. We need to return 0 in the case it evaluates to true instead.

Fixes: 938741d8 ("functions: add_checked_modules_from_symbol: do not fail if there are no autodetected modules to add")

test/cases/functions.bats: add tests for add_all_modules_from_symbol & add_checked_modules_from_symbol

Edited by nl6720

Merge request reports

Loading