diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-03-03 21:08:34 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-03-04 17:59:39 +0100 |
commit | ba954f4ec460e54948c4d20a0187d345a1c6a4de (patch) | |
tree | bc985278e21d66369e5d447c3ff36d4eb48d3468 | |
parent | b9c0480fcd37bf021383a9ba7c3e2e81f925d510 (diff) | |
download | mkinitcpio-ba954f4ec460e54948c4d20a0187d345a1c6a4de.tar.gz mkinitcpio-ba954f4ec460e54948c4d20a0187d345a1c6a4de.tar.xz |
add -A option to specify extra hooks
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-x | mkinitcpio | 7 | ||||
-rw-r--r-- | mkinitcpio.8.txt | 7 |
2 files changed, 11 insertions, 3 deletions
@@ -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*:: |