init: run late/cleanup hooks before checking for init

This commit is contained in:
Tobias Powalowski 2012-06-09 08:44:27 +02:00
parent 23a5b6abeb
commit de51074053

View file

@ -57,6 +57,9 @@ else
# Mount root at /new_root
${mount_handler:-default_mount_handler} /new_root
run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS
run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS
if [ "$(stat -c %D /)" = "$(stat -c %D /new_root)" ]; then
# Nothing got mounted on /new_root. This is the end, we don't know what to do anymore
# We fall back into a shell, but the shell has now PID 1
@ -74,10 +77,6 @@ else
launch_interactive_shell --exec
fi
run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS
run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS
if [ "${break}" = "postmount" ]; then
echo ":: Post-mount break requested, type 'exit' to resume operation"
launch_interactive_shell