Blame 0007-shutdown-call-losetup-D-on-shutdown.patch

Harald Hoyer fe31f8
From d8b627b9dcd12c5d4a967f7e8143ecf63d75be1f Mon Sep 17 00:00:00 2001
Harald Hoyer fe31f8
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer fe31f8
Date: Tue, 5 Feb 2013 11:02:05 +0100
Harald Hoyer fe31f8
Subject: [PATCH] shutdown: call "losetup -D" on shutdown
Harald Hoyer fe31f8
Harald Hoyer fe31f8
---
Harald Hoyer fe31f8
 modules.d/99shutdown/module-setup.sh | 2 +-
Harald Hoyer fe31f8
 modules.d/99shutdown/shutdown.sh     | 1 +
Harald Hoyer fe31f8
 2 files changed, 2 insertions(+), 1 deletion(-)
Harald Hoyer fe31f8
Harald Hoyer fe31f8
diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh
Harald Hoyer fe31f8
index 16e727c..fb0b7ad 100755
Harald Hoyer fe31f8
--- a/modules.d/99shutdown/module-setup.sh
Harald Hoyer fe31f8
+++ b/modules.d/99shutdown/module-setup.sh
Harald Hoyer fe31f8
@@ -13,7 +13,7 @@ depends() {
Harald Hoyer fe31f8
 
Harald Hoyer fe31f8
 install() {
Harald Hoyer fe31f8
     local _d
Harald Hoyer fe31f8
-    dracut_install umount poweroff reboot halt
Harald Hoyer fe31f8
+    dracut_install umount poweroff reboot halt losetup
Harald Hoyer fe31f8
     dracut_install -o kexec
Harald Hoyer fe31f8
     inst "$moddir/shutdown.sh" "$prefix/shutdown"
Harald Hoyer fe31f8
     [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
Harald Hoyer fe31f8
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
Harald Hoyer fe31f8
index bab81f2..202ecb1 100755
Harald Hoyer fe31f8
--- a/modules.d/99shutdown/shutdown.sh
Harald Hoyer fe31f8
+++ b/modules.d/99shutdown/shutdown.sh
Harald Hoyer fe31f8
@@ -46,6 +46,7 @@ umount_a() {
Harald Hoyer fe31f8
             fi
Harald Hoyer fe31f8
         fi
Harald Hoyer fe31f8
     done 
Harald Hoyer fe31f8
+    losetup -D
Harald Hoyer fe31f8
     [ "$_did_umount" = "y" ] && return 0
Harald Hoyer fe31f8
     return 1
Harald Hoyer fe31f8
 }