/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.
[[ $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
}
=== 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
**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**::
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)
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"
}
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
}
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"
}
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"
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.
getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
info "Switching root"
-source_hook cleanup
unset PS4