From 001a0559cd52d2ab600e31d192198062021e8898 Mon Sep 17 00:00:00 2001 From: Morten Linderud Date: Tue, 17 Sep 2019 20:01:28 +0200 Subject: [mkinitcpio] Support multiple hook paths --- mkinitcpio | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 42e78bf..f40cd6d 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -14,6 +14,8 @@ _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="" +_d_flag_install="" _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware) _d_presets=mkinitcpio.d @@ -411,8 +413,8 @@ while :; do ;; -D|--hookdir) shift - _d_hooks="$(readlink -f "$1")/hooks" - _d_install="$(readlink -f "$1")/install" + _d_flag_hooks+="$1/hooks:" + _d_flag_install+="$1/install:" ;; --) shift @@ -426,6 +428,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. -- cgit v1.2.3-24-g4f1b