From 1007ca6065131eb2770e9a08fac3b19c14527140 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 13 May 2012 12:16:38 -0400 Subject: lsinitcpio: add support for listing new hooks Read this out of the image config for -a output. Signed-off-by: Dave Reisner --- lsinitcpio | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'lsinitcpio') diff --git a/lsinitcpio b/lsinitcpio index 1c52d68..6cb9b07 100755 --- a/lsinitcpio +++ b/lsinitcpio @@ -170,25 +170,6 @@ if (( analyze )); then explicitmod=($MODULES) - for hook in $HOOKS; do - [[ -e $workdir/hooks/$hook ]] || continue - - mapfile -t funcs < \ - <(awk ' - /^[[:space:]]*[[:alnum:]_]+/ && /\([[:space:]]*\)/ { - match($1, /[[:alnum:]_]+/) - print substr($1, RSTART, RLENGTH) - }' "$workdir/hooks/$hook") - - for fn in "${funcs[@]}"; do - case $fn in - run_hook) - hooks+=("$hook") - ;; - esac - done - done - # print results imagename=$image [[ -L $image ]] && imagename+=" -> $(readlink -e "$image")" @@ -218,9 +199,27 @@ if (( analyze )); then printf ' %s\n' "${binaries[@]}" | sort | column -c$columns printf '\n' - if (( ${#hooks[*]} )); then + if [[ $EARLYHOOKS ]]; then + msg 'Early hook run order:' + printf ' %s\n' $EARLYHOOKS + printf '\n' + fi + + if [[ $HOOKS ]]; then msg 'Hook run order:' - printf ' %s\n' "${hooks[@]}" + printf ' %s\n' $HOOKS + printf '\n' + fi + + if [[ $LATEHOOKS ]]; then + msg 'Late hook run order:' + printf ' %s\n' $LATEHOOKS + printf '\n' + fi + + if [[ $CLEANUPHOOKS ]]; then + msg 'Cleanup hook run order:' + printf ' %s\n' $CLEANUPHOOKS printf '\n' fi else -- cgit v1.2.3-24-g4f1b