summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-13 18:16:38 +0200
committerDave Reisner <dreisner@archlinux.org>2012-05-18 19:09:11 +0200
commit1007ca6065131eb2770e9a08fac3b19c14527140 (patch)
tree8ab929153080998544354326345360f2eeddf1ca
parent6df8511544a6a6b959e2cc6dd038f306d3de9685 (diff)
downloadmkinitcpio-1007ca6065131eb2770e9a08fac3b19c14527140.tar.gz
mkinitcpio-1007ca6065131eb2770e9a08fac3b19c14527140.tar.xz
lsinitcpio: add support for listing new hooks
Read this out of the image config for -a output. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xlsinitcpio41
1 files changed, 20 insertions, 21 deletions
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