[PATCH 4/6] Add cleanup of mounts to ksimage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 ksimage |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ksimage b/ksimage
index f9001fa..4c3335c 100755
--- a/ksimage
+++ b/ksimage
@@ -242,8 +242,23 @@ if __name__ == "__main__":
 
     try:
         anaconda.dispatch.run()
-    except SystemExit, code:
+    finally:
+        # Make sure we let go of logs inside /mnt/sysimage
+        logging.shutdown()
+
+        from pyanaconda.baseudev import udev_trigger, udev_settle
+        udev_trigger()
+        udev_settle()
+
+        anaconda.storage.umountFilesystems()
+        anaconda.storage.devicetree.teardownAll()
+        for name in anaconda.storage.devicetree.diskImages.keys():
+            device = anaconda.storage.devicetree.getDeviceByName(name)
+            if device:
+                device.deactivate(recursive=True)
+            else:
+                print "No device found for (%s)" % (name,)
         anaconda.intf.shutdown()
-
+        os.system("udevadm control --env=ANACONDA=0")
 
 # vim:tw=78:ts=4:et:sw=4
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux