[PATCH] Don't allow the rootfs on live installs to not match (#493206, #492727)

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

 



Tested now and it works and keeps people from getting into this situation...

Ensure that with live installs that the type of the rootfs matches what we
need it to.  This used to be done behind the user's back in the livecd
code, but it's probably better to handle more generally like this
---
 backend.py          |    1 +
 livecd.py           |    1 +
 storage/__init__.py |    9 +++++++++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/backend.py b/backend.py
index 680f058..729966a 100644
--- a/backend.py
+++ b/backend.py
@@ -54,6 +54,7 @@ class AnacondaBackend:
         # some backends may have a special case for rootfs formatting
         # FIXME: we should handle this a little more elegantly
         self.skipFormatRoot = False
+        self.rootFsType = None
 
         self._loopbackFile = None
 
diff --git a/livecd.py b/livecd.py
index 391b1ce..915c0c1 100644
--- a/livecd.py
+++ b/livecd.py
@@ -112,6 +112,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
                                custom_icon="error",
                                custom_buttons=[_("Exit installer")])
             sys.exit(0)
+        self.rootFsType = isys.readFSType(self.osimg)
 
     def _getLiveBlockDevice(self):
         return os.path.normpath(self.osimg)
diff --git a/storage/__init__.py b/storage/__init__.py
index 7c17ec8..2ddbcf6 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -765,6 +765,15 @@ class Storage(object):
                           %(self.anaconda.backend.getMinimumSizeMB("/"),
                             productName))
 
+        # livecds have to have the rootfs type match up
+        if (root and
+            self.anaconda.backend.rootFsType and
+            root.format.type != self.anaconda.backend.rootFsType):
+            errors.append(_("Your / partition does not match the "
+                            "the live image you are installing from.  "
+                            "It must be formatted as %s.")
+                          % (self.anaconda.backend.rootFsType,))
+
         for (mount, size) in checkSizes:
             if mount in filesystems and filesystems[mount].size < size:
                 warnings.append(_("Your %s partition is less than %s "
-- 
1.6.1

_______________________________________________
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