Blame 0030-merge-cleanup-and-pre-pivot-cleanup-hooks.patch

Harald Hoyer 2f4f1d
From eef7649e712481aa3bd821d4b11c39541611b4fd Mon Sep 17 00:00:00 2001
Harald Hoyer 2f4f1d
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 2f4f1d
Date: Mon, 23 Apr 2012 11:31:32 +0200
Harald Hoyer 2f4f1d
Subject: [PATCH] merge "cleanup" and "pre-pivot-cleanup" hooks
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
---
Harald Hoyer 2f4f1d
 README.modules                        |    2 +-
Harald Hoyer 2f4f1d
 dracut-functions.sh                   |    4 ++--
Harald Hoyer 2f4f1d
 dracut.asc                            |    4 ++--
Harald Hoyer 2f4f1d
 dracut.cmdline.7.asc                  |    2 +-
Harald Hoyer 2f4f1d
 modules.d/40network/module-setup.sh   |    2 +-
Harald Hoyer 2f4f1d
 modules.d/90crypt/module-setup.sh     |    2 +-
Harald Hoyer 2f4f1d
 modules.d/90multipath/module-setup.sh |    2 +-
Harald Hoyer 2f4f1d
 modules.d/95iscsi/module-setup.sh     |    2 +-
Harald Hoyer 2f4f1d
 modules.d/95nfs/module-setup.sh       |    2 +-
Harald Hoyer 2f4f1d
 modules.d/99base/init.sh              |    5 ++---
Harald Hoyer 0c26bf
 10 Dateien geändert, 13 Zeilen hinzugefügt(+), 14 Zeilen entfernt(-)
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
diff --git a/README.modules b/README.modules
Harald Hoyer 2f4f1d
index 188d011..64d533f 100644
Harald Hoyer 2f4f1d
--- a/README.modules
Harald Hoyer 2f4f1d
+++ b/README.modules
Harald Hoyer 2f4f1d
@@ -105,7 +105,7 @@ init has the following hook points to inject scripts:
Harald Hoyer 2f4f1d
 /lib/dracut/hooks/pre-pivot/*.sh
Harald Hoyer 2f4f1d
    scripts to run before latter initramfs cleanups
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
-/lib/dracut/hooks/pre-pivot-cleanup/*.sh
Harald Hoyer 2f4f1d
+/lib/dracut/hooks/cleanup/*.sh
Harald Hoyer 2f4f1d
    scripts to run before the real init is executed and the initramfs
Harald Hoyer 2f4f1d
    disappears
Harald Hoyer 2f4f1d
    All processes started before should be killed here.
Harald Hoyer 2f4f1d
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer 2f4f1d
index ccf3ba6..ff4e16d 100755
Harald Hoyer 2f4f1d
--- a/dracut-functions.sh
Harald Hoyer 2f4f1d
+++ b/dracut-functions.sh
Harald Hoyer 2f4f1d
@@ -36,8 +36,8 @@ fi
Harald Hoyer 2f4f1d
 [[ $hookdirs ]] || {
Harald Hoyer 2f4f1d
     hookdirs="cmdline pre-udev pre-trigger netroot "
Harald Hoyer 2f4f1d
     hookdirs+="initqueue initqueue/settled initqueue/online initqueue/finished initqueue/timeout "
Harald Hoyer 2f4f1d
-    hookdirs+="pre-mount pre-pivot pre-pivot-cleanup mount "
Harald Hoyer 2f4f1d
-    hookdirs+="emergency shutdown-emergency shutdown cleanup "
Harald Hoyer 2f4f1d
+    hookdirs+="pre-mount pre-pivot cleanup mount "
Harald Hoyer 2f4f1d
+    hookdirs+="emergency shutdown-emergency shutdown "
Harald Hoyer 2f4f1d
     export hookdirs
Harald Hoyer 2f4f1d
 }
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
diff --git a/dracut.asc b/dracut.asc
Harald Hoyer 2f4f1d
index 9621db2..a6e050d 100644
Harald Hoyer 2f4f1d
--- a/dracut.asc
Harald Hoyer 2f4f1d
+++ b/dracut.asc
Harald Hoyer 2f4f1d
@@ -854,11 +854,11 @@ This hook is mainly to mount the real root device.
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 === Hook: pre-pivot
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
-This hook is called before pre-pivot-cleanup hook, This is a good place for
Harald Hoyer 2f4f1d
+This hook is called before cleanup hook, This is a good place for
Harald Hoyer 2f4f1d
 actions other than cleanups which need to be called before pivot.
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
-=== Hook: pre-pivot-cleanup
Harald Hoyer 2f4f1d
+=== Hook: cleanup
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 This hook is the last hook and is called before init finally switches root to
Harald Hoyer 2f4f1d
 the real root device. This is a good place to clean up and kill processes not
Harald Hoyer 2f4f1d
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
Harald Hoyer 2f4f1d
index 76db651..61cd139 100644
Harald Hoyer 2f4f1d
--- a/dracut.cmdline.7.asc
Harald Hoyer 2f4f1d
+++ b/dracut.cmdline.7.asc
Harald Hoyer 2f4f1d
@@ -105,7 +105,7 @@ Debug
Harald Hoyer 2f4f1d
 **rd.break**::
Harald Hoyer 2f4f1d
     drop to a shell at the end
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
-**rd.break=**_{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|pre-pivot-cleanup}_::
Harald Hoyer 2f4f1d
+**rd.break=**_{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}_::
Harald Hoyer 2f4f1d
     drop to a shell on defined breakpoint
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 **rd.udev.info**::
Harald Hoyer 2f4f1d
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
Harald Hoyer 2f4f1d
index c2ad815..d49b594 100755
Harald Hoyer 2f4f1d
--- a/modules.d/40network/module-setup.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/40network/module-setup.sh
Harald Hoyer 2f4f1d
@@ -86,7 +86,7 @@ install() {
Harald Hoyer 2f4f1d
     inst_hook cmdline 97 "$moddir/parse-bridge.sh"
Harald Hoyer 2f4f1d
     inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
Harald Hoyer 2f4f1d
     inst_hook cmdline 99 "$moddir/parse-ifname.sh"
Harald Hoyer 2f4f1d
-    inst_hook pre-pivot-cleanup 10 "$moddir/kill-dhclient.sh"
Harald Hoyer 2f4f1d
+    inst_hook cleanup 10 "$moddir/kill-dhclient.sh"
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
     _arch=$(uname -m)
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
Harald Hoyer 2f4f1d
index 4a66516..5082434 100755
Harald Hoyer 2f4f1d
--- a/modules.d/90crypt/module-setup.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/90crypt/module-setup.sh
Harald Hoyer 2f4f1d
@@ -48,7 +48,7 @@ install() {
Harald Hoyer 2f4f1d
     inst "$moddir"/probe-keydev.sh /sbin/probe-keydev
Harald Hoyer 2f4f1d
     inst_hook cmdline 10 "$moddir/parse-keydev.sh"
Harald Hoyer 2f4f1d
     inst_hook cmdline 30 "$moddir/parse-crypt.sh"
Harald Hoyer 2f4f1d
-    inst_hook pre-pivot-cleanup 30 "$moddir/crypt-cleanup.sh"
Harald Hoyer 2f4f1d
+    inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
Harald Hoyer 2f4f1d
     inst_simple /etc/crypttab
Harald Hoyer 2f4f1d
     inst "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
Harald Hoyer 2f4f1d
 }
Harald Hoyer 2f4f1d
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
Harald Hoyer 2f4f1d
index f044f33..2bc1b41 100755
Harald Hoyer 2f4f1d
--- a/modules.d/90multipath/module-setup.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/90multipath/module-setup.sh
Harald Hoyer 2f4f1d
@@ -70,7 +70,7 @@ install() {
Harald Hoyer 2f4f1d
     inst_libdir_file "multipath/*"
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
     inst_hook pre-trigger 02 "$moddir/multipathd.sh"
Harald Hoyer 2f4f1d
-    inst_hook pre-pivot-cleanup   02 "$moddir/multipathd-stop.sh"
Harald Hoyer 2f4f1d
+    inst_hook cleanup   02 "$moddir/multipathd-stop.sh"
Harald Hoyer 2f4f1d
     inst_rules 40-multipath.rules
Harald Hoyer 2f4f1d
 }
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
Harald Hoyer 2f4f1d
index a001a28..2f343ee 100755
Harald Hoyer 2f4f1d
--- a/modules.d/95iscsi/module-setup.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/95iscsi/module-setup.sh
Harald Hoyer 2f4f1d
@@ -63,7 +63,7 @@ install() {
Harald Hoyer 2f4f1d
     inst hostname
Harald Hoyer 2f4f1d
     inst iscsi-iname
Harald Hoyer 2f4f1d
     inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
Harald Hoyer 2f4f1d
-    inst_hook pre-pivot-cleanup 90 "$moddir/cleanup-iscsi.sh"
Harald Hoyer 2f4f1d
+    inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
Harald Hoyer 2f4f1d
     inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
Harald Hoyer 2f4f1d
     inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
Harald Hoyer 2f4f1d
 }
Harald Hoyer 2f4f1d
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
Harald Hoyer 2f4f1d
index 3587bdd..1d62e95 100755
Harald Hoyer 2f4f1d
--- a/modules.d/95nfs/module-setup.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/95nfs/module-setup.sh
Harald Hoyer 2f4f1d
@@ -58,7 +58,7 @@ install() {
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
     inst_hook cmdline 90 "$moddir/parse-nfsroot.sh"
Harald Hoyer 2f4f1d
     inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh"
Harald Hoyer 2f4f1d
-    inst_hook pre-pivot-cleanup 99 "$moddir/nfsroot-cleanup.sh"
Harald Hoyer 2f4f1d
+    inst_hook cleanup 99 "$moddir/nfsroot-cleanup.sh"
Harald Hoyer 2f4f1d
     inst "$moddir/nfsroot.sh" "/sbin/nfsroot"
Harald Hoyer 2f4f1d
     inst "$moddir/nfs-lib.sh" "/lib/nfs-lib.sh"
Harald Hoyer 2f4f1d
     mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
Harald Hoyer 2f4f1d
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
Harald Hoyer 2f4f1d
index aea739f..cba2e1a 100755
Harald Hoyer 2f4f1d
--- a/modules.d/99base/init.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/99base/init.sh
Harald Hoyer 2f4f1d
@@ -230,8 +230,8 @@ getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot
Harald Hoyer 2f4f1d
 source_hook pre-pivot
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 # pre pivot cleanup scripts are sourced just before we switch over to the new root.
Harald Hoyer 2f4f1d
-getarg 'rd.break=pre-pivot-cleanup' 'rdbreak=pre-pivot-cleanup' && emergency_shell -n pre-pivot-cleanup "Break pre-pivot-cleanup"
Harald Hoyer 2f4f1d
-source_hook pre-pivot-cleanup
Harald Hoyer 2f4f1d
+getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
Harald Hoyer 2f4f1d
+source_hook cleanup
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 # By the time we get here, the root filesystem should be mounted.
Harald Hoyer 2f4f1d
 # Try to find init. 
Harald Hoyer 2f4f1d
@@ -332,7 +332,6 @@ wait_for_loginit
Harald Hoyer 2f4f1d
 getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
Harald Hoyer 2f4f1d
 info "Switching root"
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
-source_hook cleanup
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 unset PS4
Harald Hoyer 2f4f1d