init: add support for early, late and cleanup hooks

This commit is contained in:
Tobias Powalowski 2012-05-28 12:47:16 +02:00
parent 4ccbcedad5
commit f1499cfa4b

View file

@ -29,10 +29,11 @@ for d in ${disablehooks//,/ }; do
[ -e "/hooks/$d" ] && chmod 644 "/hooks/$d" [ -e "/hooks/$d" ] && chmod 644 "/hooks/$d"
done done
[ -n "${earlymodules//[[:space:]]}" ] && modprobe -qab ${earlymodules//,/ }
. /config . /config
run_hookfunctions 'run_earlyhook' 'early hook' $EARLYHOOKS
[ -n "${earlymodules//[[:space:]]}" ] && modprobe -qab ${earlymodules//,/ }
[ -n "${MODULES//[[:space:]]}" ] && modprobe -qab $MODULES [ -n "${MODULES//[[:space:]]}" ] && modprobe -qab $MODULES
# If rootdelay is empty or not a non-negative integer, set it to 10 # If rootdelay is empty or not a non-negative integer, set it to 10
@ -78,6 +79,10 @@ else
launch_interactive_shell --exec launch_interactive_shell --exec
fi fi
run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS
run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS
# mount /usr if it exists # mount /usr if it exists
realtab=/new_root/etc/fstab realtab=/new_root/etc/fstab
if [ -f "$realtab" ]; then if [ -f "$realtab" ]; then