[PATCH 3/6] atomic: set up atomic specific partitioning defaults

Radek Vykydal rvykydal at redhat.com
Mon Jun 1 15:47:41 UTC 2015


Resolves: rhbz#1155452

/boot will be 300M and / LV will be 3G. LVs for docker will be created by special
service using root's VG.

atomic-rhel-7.1 dist-git patch:
0030-atomic-set-up-atomic-specific-partitioning-defaults.patch
---
 pyanaconda/installclasses/rhel.py | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py
index bc7aa0c..e0a4cd9 100644
--- a/pyanaconda/installclasses/rhel.py
+++ b/pyanaconda/installclasses/rhel.py
@@ -21,11 +21,16 @@ from pyanaconda.installclass import BaseInstallClass
 from pyanaconda.product import productName
 from pyanaconda import network
 from pyanaconda import nm
+from pyanaconda.kickstart import getAvailableDiskSpace
+from blivet.partspec import PartSpec
+from blivet.platform import platform
+from blivet.devicelibs import swap
+from blivet.size import Size
 
 class RHELBaseInstallClass(BaseInstallClass):
     name = "Red Hat Enterprise Linux"
     sortPriority = 10000
-    if not productName.startswith(("Red Hat ", "RHEL Atomic")):
+    if not productName.startswith("Red Hat "):
         hidden = True
     defaultFS = "xfs"
 
@@ -45,7 +50,7 @@ class RHELBaseInstallClass(BaseInstallClass):
 
     def configure(self, anaconda):
         BaseInstallClass.configure(self, anaconda)
-        BaseInstallClass.setDefaultPartitioning(self, anaconda.storage)
+        self.setDefaultPartitioning(anaconda.storage)
 
     def setNetworkOnbootDefault(self, ksdata):
         if ksdata.method.method not in ("url", "nfs"):
@@ -64,3 +69,31 @@ class RHELBaseInstallClass(BaseInstallClass):
 
     def __init__(self):
         BaseInstallClass.__init__(self)
+
+class RHELAtomicInstallClass(RHELBaseInstallClass):
+    name = "RHEL Atomic Host"
+    if productName.startswith("RHEL Atomic"):
+        hidden = False
+
+    def setDefaultPartitioning(self, storage):
+        autorequests = [PartSpec(mountpoint="/", fstype=storage.defaultFSType,
+                                size=Size("1GiB"), maxSize=Size("3GiB"), grow=True, lv=True)]
+
+        bootreqs = platform.setDefaultPartitioning()
+        if bootreqs:
+            autorequests.extend(bootreqs)
+
+        disk_space = getAvailableDiskSpace(storage)
+        swp = swap.swapSuggestion(disk_space=disk_space)
+        autorequests.append(PartSpec(fstype="swap", size=swp, grow=False,
+                                    lv=True, encrypted=True))
+
+        for autoreq in autorequests:
+            if autoreq.fstype is None:
+                if autoreq.mountpoint == "/boot":
+                    autoreq.fstype = storage.defaultBootFSType
+                    autoreq.size = Size("300MiB")
+                else:
+                    autoreq.fstype = storage.defaultFSType
+
+        storage.autoPartitionRequests = autorequests
-- 
1.9.3



More information about the anaconda-patches mailing list