summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmkinitcpio7
-rw-r--r--mkinitcpio.8.txt7
2 files changed, 11 insertions, 3 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 58979bf..9f39d56 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -109,8 +109,11 @@ get_kernver() {
trap 'cleanup 130' INT
trap 'cleanup 143' TERM
-while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:z:' arg; do
+while getopts ':A:c:k:sb:g:p:m:nvH:LMhS:t:z:' arg; do
case $arg in
+ A) IFS=, read -r -a add <<< "$OPTARG"
+ ADDHOOKS+=("${add[@]}")
+ unset add ;;
c) CONFIG=$OPTARG ;;
k) optkver=$OPTARG ;;
s) SAVELIST=1 ;;
@@ -309,7 +312,7 @@ for var in MODULES BINARIES FILES; do
declare "cfg_$var=${!var}"
done
-for hook in ${HOOKS}; do
+for hook in ${HOOKS} "${ADDHOOKS[@]}"; do
in_array "$hook" "${SKIPHOOKS[@]}" && continue
unset MODULES BINARIES FILES SCRIPT
build() { error "$hook: no build function..."; return 1; }
diff --git a/mkinitcpio.8.txt b/mkinitcpio.8.txt
index 1eb42a8..2b45f3b 100644
--- a/mkinitcpio.8.txt
+++ b/mkinitcpio.8.txt
@@ -24,6 +24,11 @@ other features.
Options
-------
+*-A* 'hooks'::
+ Add the additional 'hooks' to the image. These will be processed in order
+ after all other hooks from the config file. Multiple hooks should be
+ comma-separated. This option can be specified multiple times.
+
*-b* 'basedir'::
Use 'basedir' as a starting point for gathering information about the
currently running system. Default: /.
@@ -63,7 +68,7 @@ Options
file.
*-S* 'hooks'::
- Skip 'hooks' when generating the image. Several hooks should be comma-separated.
+ Skip 'hooks' when generating the image. Multiple hooks should be comma-separated.
This option can be specified multiple times.
*-s*::