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

[PATCH 3/3] Support /boot on logical volume on s390x (#618376)



Support /boot on logical volumes on s390x.  Change autopart to favor a
logvol for /boot on s390x.  Users can still put /boot elsewhere.
---
 booty/s390.py |   10 +++++-----
 iutil.py      |    2 +-
 platform.py   |   16 ++++++++++++++--
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/booty/s390.py b/booty/s390.py
index f5fdaa8..00e9c08 100644
--- a/booty/s390.py
+++ b/booty/s390.py
@@ -154,11 +154,11 @@ class s390BootloaderInfo(bootloaderInfo):
         f.close()
 
         if not justConfigFile:
-            rc = iutil.execWithRedirect("/sbin/zipl", [], root = instRoot,
-                                        stdout = "/dev/stdout",
-                                        stderr = "/dev/stderr")
-            if rc:
-                return rc
+            rc = iutil.execWithCapture("zipl", [], root = instRoot,
+                                       stderr = "/dev/stderr")
+            for line in rc.splitlines():
+                if line.startswith("Preparing boot device: "):
+                    self.setDevice(line.split()[-1].replace('.', ''))
 
         return 0
 
diff --git a/iutil.py b/iutil.py
index 989177b..3a2f7de 100644
--- a/iutil.py
+++ b/iutil.py
@@ -804,7 +804,7 @@ def numeric_type(num):
 
 def reIPL(anaconda, loader_pid):
     try:
-        ipldev = anaconda.platform.bootDevice().disk.name
+        ipldev = anaconda.id.bootloader.getDevice()
     except:
         message = _("Error determining boot device's disk name")
         log.warning(message)
diff --git a/platform.py b/platform.py
index bfea119..d18278a 100644
--- a/platform.py
+++ b/platform.py
@@ -43,6 +43,7 @@ class Platform(object):
     _isEfi = iutil.isEfi()
     _minimumSector = 0
     _packages = []
+    _supportsLvmBoot = False
     _supportsMdRaidBoot = False
     _minBootPartSize = 50
     _maxBootPartSize = 0
@@ -115,8 +116,8 @@ class Platform(object):
         if req.type == "mdarray" and req.level != 1:
             errors.append(_("Bootable partitions can only be on RAID1 devices."))
 
-        # can't have bootable partition on LV
-        if req.type == "lvmlv":
+        # most arches can't have boot on a logical volume
+        if req.type == "lvmlv" and not self.supportsLvmBoot:
             errors.append(_("Bootable partitions cannot be on a logical volume."))
 
         # most arches can't have boot on RAID
@@ -164,6 +165,11 @@ class Platform(object):
                          weight=self.weight(mountpoint="/boot"))]
 
     @property
+    def supportsLvmBoot(self):
+        """Does the platform support /boot on LVM logical volume?"""
+        return self._supportsLvmBoot
+
+    @property
     def supportsMdRaidBoot(self):
         """Does the platform support /boot on MD RAID?"""
         return self._supportsMdRaidBoot
@@ -461,6 +467,7 @@ class PS3(PPC):
 class S390(Platform):
     _bootFSTypes = ["ext4", "ext3", "ext2"]
     _packages = ["s390utils"]
+    _supportsLvmBoot = True
 
     def __init__(self, anaconda):
         Platform.__init__(self, anaconda)
@@ -472,6 +479,11 @@ class S390(Platform):
         else:
             return Platform.diskLabelType(self, deviceType)
 
+    def setDefaultPartitioning(self):
+        """Return the default platform-specific partitioning information."""
+        return [PartSpec(mountpoint="/boot", fstype=self.defaultBootFSType, size=500,
+                         weight=self.weight(mountpoint="/boot"), asVol=True)]
+
 class Sparc(Platform):
     _diskLabelType = "sun"
 
-- 
1.7.3.4


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