merge "cleanup" and "pre-pivot-cleanup" hooks

master
Harald Hoyer 2012-04-23 11:31:32 +02:00
parent f8d50f60b3
commit eef7649e71
10 changed files with 13 additions and 14 deletions

View File

@ -105,7 +105,7 @@ init has the following hook points to inject scripts:
/lib/dracut/hooks/pre-pivot/*.sh
scripts to run before latter initramfs cleanups

/lib/dracut/hooks/pre-pivot-cleanup/*.sh
/lib/dracut/hooks/cleanup/*.sh
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.

View File

@ -36,8 +36,8 @@ fi
[[ $hookdirs ]] || {
hookdirs="cmdline pre-udev pre-trigger netroot "
hookdirs+="initqueue initqueue/settled initqueue/online initqueue/finished initqueue/timeout "
hookdirs+="pre-mount pre-pivot pre-pivot-cleanup mount "
hookdirs+="emergency shutdown-emergency shutdown cleanup "
hookdirs+="pre-mount pre-pivot cleanup mount "
hookdirs+="emergency shutdown-emergency shutdown "
export hookdirs
}


View File

@ -854,11 +854,11 @@ This hook is mainly to mount the real root device.

=== Hook: pre-pivot

This hook is called before pre-pivot-cleanup hook, This is a good place for
This hook is called before cleanup hook, This is a good place for
actions other than cleanups which need to be called before pivot.


=== Hook: pre-pivot-cleanup
=== Hook: cleanup

This hook is the last hook and is called before init finally switches root to
the real root device. This is a good place to clean up and kill processes not

View File

@ -105,7 +105,7 @@ Debug
**rd.break**::
drop to a shell at the end

**rd.break=**_{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|pre-pivot-cleanup}_::
**rd.break=**_{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}_::
drop to a shell on defined breakpoint

**rd.udev.info**::

View File

@ -86,7 +86,7 @@ install() {
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
inst_hook pre-pivot-cleanup 10 "$moddir/kill-dhclient.sh"
inst_hook cleanup 10 "$moddir/kill-dhclient.sh"

_arch=$(uname -m)


View File

@ -48,7 +48,7 @@ install() {
inst "$moddir"/probe-keydev.sh /sbin/probe-keydev
inst_hook cmdline 10 "$moddir/parse-keydev.sh"
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
inst_hook pre-pivot-cleanup 30 "$moddir/crypt-cleanup.sh"
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
inst_simple /etc/crypttab
inst "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
}

View File

@ -70,7 +70,7 @@ install() {
inst_libdir_file "multipath/*"

inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook pre-pivot-cleanup 02 "$moddir/multipathd-stop.sh"
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
inst_rules 40-multipath.rules
}


View File

@ -63,7 +63,7 @@ install() {
inst hostname
inst iscsi-iname
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
inst_hook pre-pivot-cleanup 90 "$moddir/cleanup-iscsi.sh"
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
}

View File

@ -58,7 +58,7 @@ install() {

inst_hook cmdline 90 "$moddir/parse-nfsroot.sh"
inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh"
inst_hook pre-pivot-cleanup 99 "$moddir/nfsroot-cleanup.sh"
inst_hook cleanup 99 "$moddir/nfsroot-cleanup.sh"
inst "$moddir/nfsroot.sh" "/sbin/nfsroot"
inst "$moddir/nfs-lib.sh" "/lib/nfs-lib.sh"
mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"

View File

@ -230,8 +230,8 @@ getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot
source_hook pre-pivot

# pre pivot cleanup scripts are sourced just before we switch over to the new root.
getarg 'rd.break=pre-pivot-cleanup' 'rdbreak=pre-pivot-cleanup' && emergency_shell -n pre-pivot-cleanup "Break pre-pivot-cleanup"
source_hook pre-pivot-cleanup
getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
source_hook cleanup

# By the time we get here, the root filesystem should be mounted.
# Try to find init.
@ -332,7 +332,6 @@ wait_for_loginit
getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
info "Switching root"

source_hook cleanup

unset PS4