summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-28 15:44:54 +0200
committerDave Reisner <dreisner@archlinux.org>2012-04-02 00:29:55 +0200
commit5a309568167623677c6310e7de99c62c273d3de7 (patch)
treec420c50277e46cba4728c07ea4c809231cbfed24
parentcdb5a31f09b3ca88ed1ece7663c69e2e2d630bf8 (diff)
downloadmkinitcpio-5a309568167623677c6310e7de99c62c273d3de7.tar.gz
mkinitcpio-5a309568167623677c6310e7de99c62c273d3de7.tar.xz
shutdown: improve handling of dm devices
- use the 'remove' action for cryptsetup rather than luksClose - handle dm devices with dmsetup, not lvm - disable dmraid devices by name, instead of all at once Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xshutdown12
1 files changed, 8 insertions, 4 deletions
diff --git a/shutdown b/shutdown
index f664d6e..2e6f504 100755
--- a/shutdown
+++ b/shutdown
@@ -14,9 +14,13 @@ stop_device() {
case $devtype in
crypt)
read devname <"$1/dm/name"
- cryptsetup luksClose "$devname"
+ cryptsetup remove "$devname"
;;
- dm|lvm)
+ dm)
+ read devname <"$1/dm/name"
+ dmsetup remove "$devname"
+ ;;
+ lvm)
# disassemble the parent VG
read devname <"$1/dm/name"
lvm lvdisplay -c "/dev/mapper/$devname" | {
@@ -28,8 +32,8 @@ stop_device() {
mdadm --stop "/dev/$1"
;;
dmraid)
- # XXX: i have no idea how dmraid works
- dmraid -an
+ read devname <"$1/dm/name"
+ dmraid -an "$devname"
;;
# silently ignore unstacked devices
esac