From f1499cfa4b31e1063bedb8e27e041f7c3f9d847e Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Mon, 28 May 2012 12:47:16 +0200 Subject: [PATCH] init: add support for early, late and cleanup hooks --- usr/share/archboot/base/init | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr/share/archboot/base/init b/usr/share/archboot/base/init index b1584bd6b..9601dc199 100755 --- a/usr/share/archboot/base/init +++ b/usr/share/archboot/base/init @@ -29,10 +29,11 @@ for d in ${disablehooks//,/ }; do [ -e "/hooks/$d" ] && chmod 644 "/hooks/$d" done -[ -n "${earlymodules//[[:space:]]}" ] && modprobe -qab ${earlymodules//,/ } - . /config +run_hookfunctions 'run_earlyhook' 'early hook' $EARLYHOOKS + +[ -n "${earlymodules//[[:space:]]}" ] && modprobe -qab ${earlymodules//,/ } [ -n "${MODULES//[[:space:]]}" ] && modprobe -qab $MODULES # If rootdelay is empty or not a non-negative integer, set it to 10 @@ -78,6 +79,10 @@ else launch_interactive_shell --exec fi + run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS + + run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS + # mount /usr if it exists realtab=/new_root/etc/fstab if [ -f "$realtab" ]; then