summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/mkinitcpio.8.txt5
-rwxr-xr-xmkinitcpio12
2 files changed, 16 insertions, 1 deletions
diff --git a/man/mkinitcpio.8.txt b/man/mkinitcpio.8.txt
index 79dbee3..a69cf20 100644
--- a/man/mkinitcpio.8.txt
+++ b/man/mkinitcpio.8.txt
@@ -36,11 +36,14 @@ Options
Set 'directory' as the location where the initramfs is built. This might be
useful to generate a shutdown ramfs in '/run/initramfs'.
+*-D, \--hookdir* 'directory'::
+ Set 'directory' as the location where hooks will be searched for when
+ generating the image.
+
*-g, \--generate* 'filename'::
Generate a CPIO image as 'filename'. Default: no; this means nothing will be
written to the filesystem unless this option is specified.
-
*-H, \--hookhelp* 'hookname'::
Output help for hookname 'hookname'.
diff --git a/mkinitcpio b/mkinitcpio
index db7a61a..9d4357e 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -14,6 +14,7 @@ _f_functions=functions
_f_config=mkinitcpio.conf
_d_hooks="$PWD/hooks:/usr/lib/initcpio/hooks:/lib/initcpio/hooks"
_d_install="$PWD/install:/usr/lib/initcpio/install:/lib/initcpio/install"
+_d_flag_{hooks,install}=
_d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
_d_presets=mkinitcpio.d
@@ -56,6 +57,7 @@ usage: ${0##*/} [options]
-s, --save Save build directory. (default: no)
-d, --generatedir <dir> Write generated image into <dir>
-t, --builddir <dir> Use DIR as the temporary build directory
+ -D, --hookdir <dir> Specify where to look for hooks.
-V, --version Display version information and exit
-v, --verbose Verbose output (default: no)
-z, --compress <program> Use an alternate compressor on the image
@@ -408,6 +410,11 @@ while :; do
shift
_optmoduleroot=$1
;;
+ -D|--hookdir)
+ shift
+ _d_flag_hooks+="$1/hooks:"
+ _d_flag_install+="$1/install:"
+ ;;
--)
shift
break 2
@@ -420,6 +427,11 @@ if [[ -t 1 ]] && (( _optcolor )); then
try_enable_color
fi
+if [[ -n $_d_flag_hooks && -n $_d_flag_install ]]; then
+ _d_hooks=${_d_flag_hooks%:}
+ _d_install=${_d_flag_install%:}
+fi
+
# insist that /proc and /dev be mounted (important for chroots)
# NOTE: avoid using mountpoint for this -- look for the paths that we actually
# use in mkinitcpio. Avoids issues like FS#26344.