Re: [PATCH] 473260 - unmount swap files on upgrades

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

 



On Dec 5, 2008, at 5:59 PM, Chris Lumens wrote:
    def umount(self, device, path):
-        # unfortunately, turning off swap is bad.
-        raise RuntimeError, "unable to turn off swap"
+ # Turning off swap devices is bad, but we can get away with turning
+        # off swap files.
+        if device.device.startswith("/dev/"):
+            raise RuntimeError, "unable to turn off swap"
+
+ # path is something stupid like instPath+"swap", which is totally + # useless. But we don't have instPath anywhere else so trim off
+        # the end of path.
+        swapFile = path[:path.rfind("/")] + device.device
+
+        iutil.execWithRedirect("swapoff", [swapFile],
+ stdout="/dev/tty5", stderr="/dev/ tty5",
+                               searchPath=1)

We're just as likely to fail turning off a swap file as a swap partition. But now that we turn them on "earlier", it is more likely to succeed in this case. Maybe we should try for both cases and if it fails, we can fall back to raising a RuntimeError

Jeremy

_______________________________________________
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