summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-08-05 15:26:18 +0300
committernl6720 <nl6720@gmail.com>2023-08-08 15:22:53 +0300
commitf90ed9b0df08f9e75ec08ddb9301174c8996f59c (patch)
treec83c67fa73c07c34f13962f573471df1f25f260e
parenta692919cb74cdcb6717d8259dd2664da200e56b6 (diff)
Add optional -c flag to add_module_from_symbol to use add_checked_modules
This allows for it to work together with the autodetect hook. Update and fix the man page. Implements #193
-rw-r--r--functions12
-rw-r--r--man/mkinitcpio.8.adoc10
2 files changed, 16 insertions, 6 deletions
diff --git a/functions b/functions
index cc47594..462fcc1 100644
--- a/functions
+++ b/functions
@@ -1088,8 +1088,18 @@ find_module_from_symbol() {
add_module_from_symbol() {
local mods
+ local -i use_add_checked_modules=0
+
+ if [[ "$1" == '-c' ]]; then
+ use_add_checked_modules=1
+ shift
+ fi
mapfile -t mods < <(find_module_from_symbol "$@")
- map add_module "${mods[@]}"
+ if (( use_add_checked_modules )); then
+ map add_checked_modules "${mods[@]}"
+ else
+ map add_module "${mods[@]}"
+ fi
}
# vim: set ft=sh ts=4 sw=4 et:
diff --git a/man/mkinitcpio.8.adoc b/man/mkinitcpio.8.adoc
index 8f386f0..d3f3c50 100644
--- a/man/mkinitcpio.8.adoc
+++ b/man/mkinitcpio.8.adoc
@@ -272,11 +272,11 @@ functions exist to facilitate this.
and added. The argument can be a rule file name (discovered from well known
udev paths) or an absolute path.
-*add_module_from_symbol* _symbol_ _paths..._::
-
- Adds a udev rule to the image. Dependencies on binaries will be discovered
- and added. The argument can be a rule file name (discovered from well known
- udev paths) or an absolute path.
+*add_module_from_symbol* [ *-c* ] _symbol_ _paths..._::
+ Adds modules from the _paths_ directories containing the _symbol_ to the
+ image.
+ Uses *add_module* by default, but by specifying the *-c* flag,
+ *add_checked_modules* will be used instead.
== About runtime hooks