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