]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
release any raid/crypt/lvm device assembled, but not in use
authorHarald Hoyer <harald@redhat.com>
Mon, 31 Aug 2009 14:24:50 +0000 (16:24 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 1 Sep 2009 13:51:51 +0000 (15:51 +0200)
modules.d/90crypt/crypt-cleanup.sh [new file with mode: 0755]
modules.d/90crypt/install
modules.d/90dmraid/dmraid-cleanup.sh [new file with mode: 0755]
modules.d/90dmraid/install
modules.d/90lvm/install
modules.d/90lvm/lvm-cleanup.sh [new file with mode: 0755]
modules.d/90mdraid/install
modules.d/90mdraid/mdraid-cleanup.sh [new file with mode: 0755]

diff --git a/modules.d/90crypt/crypt-cleanup.sh b/modules.d/90crypt/crypt-cleanup.sh
new file mode 100755 (executable)
index 0000000..b4003c1
--- /dev/null
@@ -0,0 +1,4 @@
+# close everything which is not busy
+for i in /dev/mapper/luks-*; do
+    cryptsetup luksClose $i &>/dev/null
+done
index 13195039505138b5ee8381168ccbff5423eb9dcb..5108fefa4a01f3fb2305e25364402bf974945a07 100755 (executable)
@@ -3,3 +3,5 @@ inst cryptsetup
 inst_rules "$moddir/70-luks.rules"
 inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
 inst_hook cmdline 30 "$moddir/parse-crypt.sh"
+inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
+inst_hook pre-pivot 60 "$moddir/crypt-cleanup.sh"
diff --git a/modules.d/90dmraid/dmraid-cleanup.sh b/modules.d/90dmraid/dmraid-cleanup.sh
new file mode 100755 (executable)
index 0000000..cd3f0a2
--- /dev/null
@@ -0,0 +1,2 @@
+# close everything which is not busy
+dmraid -an &>/dev/null
index c33b16665a6e2ecfe26c84a7bf7928d1eedcd3cd..704728b638d170ec7085cc8f117dafd40665003b 100755 (executable)
@@ -3,3 +3,5 @@ dracut_install dmraid partx
 inst "$moddir/dmraid.sh" /sbin/dmraid_scan
 inst_rules 64-md-raid.rules
 inst_rules "$moddir/61-dmraid-imsm.rules"
+inst_hook pre-pivot 30 "$moddir/dmraid-cleanup.sh"
+inst_hook pre-pivot 60 "$moddir/dmraid-cleanup.sh"
index 5e789d3b64bbbd15a5c4706a7e9ddd99846e160f..eb271591294e37f301cdf9578a7ab080cf26153f 100755 (executable)
@@ -12,3 +12,5 @@ fi
 
 inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
 inst_hook cmdline 30 "$moddir/parse-lvm.sh"
+inst_hook pre-pivot 30 "$moddir/lvm-cleanup.sh"
+inst_hook pre-pivot 60 "$moddir/lvm-cleanup.sh"
\ No newline at end of file
diff --git a/modules.d/90lvm/lvm-cleanup.sh b/modules.d/90lvm/lvm-cleanup.sh
new file mode 100755 (executable)
index 0000000..3a1cbae
--- /dev/null
@@ -0,0 +1,2 @@
+# stop everything which is not busy
+lvm vgchange -a n &>/dev/null
index 07ca96c06908152efa2643af6ccaf6a07c670ab5..cb9ab29f5cd159cc029fb9176d57a65bc86e5ed1 100755 (executable)
@@ -35,3 +35,5 @@ fi
 
 inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
 inst_hook pre-trigger 30 "$moddir/parse-md.sh"
+inst_hook pre-pivot 30 "$moddir/mdraid-cleanup.sh"
+inst_hook pre-pivot 60 "$moddir/mdraid-cleanup.sh"
\ No newline at end of file
diff --git a/modules.d/90mdraid/mdraid-cleanup.sh b/modules.d/90mdraid/mdraid-cleanup.sh
new file mode 100755 (executable)
index 0000000..8791422
--- /dev/null
@@ -0,0 +1,4 @@
+# stop everything which is not busy
+for i in /dev/md*; do
+    mdadm --stop $i &>/dev/null
+done