diff --git a/SOURCES/anaconda-centos-add-centos-install-class.patch b/SOURCES/anaconda-centos-add-centos-install-class.patch index 89d64b5..fb8e190 100644 --- a/SOURCES/anaconda-centos-add-centos-install-class.patch +++ b/SOURCES/anaconda-centos-add-centos-install-class.patch @@ -1,7 +1,19 @@ -diff -uNr anaconda-19.31.79__orig/pyanaconda/installclasses/centos.py anaconda-19.31.79/pyanaconda/installclasses/centos.py ---- anaconda-19.31.79__orig/pyanaconda/installclasses/centos.py 1970-01-01 01:00:00.000000000 +0100 -+++ anaconda-19.31.79/pyanaconda/installclasses/centos.py 2014-06-16 22:47:16.033891088 +0100 -@@ -0,0 +1,88 @@ +From f8a9fe6ffe25d5a9b07be899b0ebe52556d2ecd4 Mon Sep 17 00:00:00 2001 +From: Jim Perrin +Date: Fri, 20 Nov 2015 15:01:37 -0600 +Subject: [PATCH] add centos install class + +--- + pyanaconda/installclasses/centos.py | 95 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 95 insertions(+) + create mode 100644 pyanaconda/installclasses/centos.py + +diff --git a/pyanaconda/installclasses/centos.py b/pyanaconda/installclasses/centos.py +new file mode 100644 +index 0000000..14a178d +--- /dev/null ++++ b/pyanaconda/installclasses/centos.py +@@ -0,0 +1,95 @@ +# +# rhel.py +# @@ -22,24 +34,23 @@ diff -uNr anaconda-19.31.79__orig/pyanaconda/installclasses/centos.py anaconda-1 +# + +from pyanaconda.installclass import BaseInstallClass -+from pyanaconda.constants import * -+from pyanaconda.product import * ++from pyanaconda.product import productName +from pyanaconda import network +from pyanaconda import nm -+import types -+ -+class InstallClass(BaseInstallClass): -+ # name has underscore used for mnemonics, strip if you dont need it -+ id = "centos" -+ name = N_("CentOS Linux") -+ sortPriority = 25000 -+ if productName.startswith("Red Hat ") or productName.startswith("Fedora "): -+ hidden = 1 ++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 = "CentOS Linux" ++ sortPriority = 20000 ++ if not productName.startswith("CentOS "): ++ hidden = True + defaultFS = "xfs" + + bootloaderTimeoutDefault = 5 -+ bootloaderExtraArgs = [] + + ignoredPackages = ["ntfsprogs", "reiserfs-utils"] + @@ -47,58 +58,57 @@ diff -uNr anaconda-19.31.79__orig/pyanaconda/installclasses/centos.py anaconda-1 + + _l10n_domain = "comps" + -+ efi_dir = "redhat" ++ efi_dir = "centos" ++ + + def configure(self, anaconda): + BaseInstallClass.configure(self, anaconda) -+ BaseInstallClass.setDefaultPartitioning(self, anaconda.storage) ++ self.setDefaultPartitioning(anaconda.storage) + -+ # Set first boot policy regarding ONBOOT value -+ # (i.e. which network devices should be activated automatically after reboot) -+ # After switch root we set ONBOOT=no as default for all devices not activated -+ # in initramfs. Here, at the end of installation, we check and modify it eventually. + def setNetworkOnbootDefault(self, ksdata): -+ # if there is no device to be autoactivated after reboot -+ for devName in nm.nm_devices(): -+ if nm.nm_device_type_is_wifi(devName): -+ continue -+ try: -+ onboot = nm.nm_device_setting_value(devName, "connection", "autoconnect") -+ except nm.SettingsNotFoundError: -+ continue -+ if not onboot == False: -+ return -+ -+ # set ONBOOT=yes for the device used during installation -+ # (ie for majority of cases the one having the default route) -+ devName = network.default_route_device() -+ if not devName: ++ if network.has_some_wired_autoconnect_device(): + return -+ if nm.nm_device_type_is_wifi(devName): ++ # choose the device used during installation ++ # (ie for majority of cases the one having the default route) ++ dev = network.default_route_device() \ ++ or network.default_route_device(family="inet6") ++ if not dev: + return -+ ifcfg_path = network.find_ifcfg_file_of_device(devName, root_path=ROOT_PATH) -+ if not ifcfg_path: ++ # ignore wireless (its ifcfgs would need to be handled differently) ++ if nm.nm_device_type_is_wifi(dev): + return -+ ifcfg = network.IfcfgFile(ifcfg_path) -+ ifcfg.read() -+ ifcfg.set(('ONBOOT', 'yes')) -+ ifcfg.write() -+ for nd in ksdata.network.network: -+ if nd.device == devName: -+ nd.onboot = True -+ break ++ network.update_onboot_value(dev, "yes", ksdata) + + def __init__(self): + BaseInstallClass.__init__(self) -diff -uNr anaconda-19.31.79__orig/pyanaconda/installclasses/fedora.py anaconda-19.31.79/pyanaconda/installclasses/fedora.py ---- anaconda-19.31.79__orig/pyanaconda/installclasses/fedora.py 2014-04-29 01:45:59.000000000 +0100 -+++ anaconda-19.31.79/pyanaconda/installclasses/fedora.py 2014-06-16 22:57:40.525890315 +0100 -@@ -31,7 +31,7 @@ - id = "fedora" - name = N_("_Fedora") - sortPriority = 10000 -- if productName.startswith("Red Hat "): -+ if productName.startswith("Red Hat ") or productName.startswith("CentOS"): - hidden = 1 - - _l10n_domain = "anaconda" ++ ++class RHELAtomicInstallClass(RHELBaseInstallClass): ++ name = "CentOS Linux Atomic Host" ++ sortPriority=21000 ++ hidden = not productName.startswith(("CentOS Atomic Host", "CentOS Linux Atomic")) ++ ++ 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.8.3.1 + diff --git a/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch b/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch index 31432af..a765b1a 100644 --- a/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch +++ b/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch @@ -1,21 +1,34 @@ -diff -uNr anaconda-19.31.79__orig/pyanaconda/bootloader.py anaconda-19.31.79/pyanaconda/bootloader.py ---- anaconda-19.31.79__orig/pyanaconda/bootloader.py 2014-04-29 01:45:59.000000000 +0100 -+++ anaconda-19.31.79/pyanaconda/bootloader.py 2014-06-30 17:19:19.197386280 +0100 -@@ -1404,7 +1404,7 @@ +From 34d53918f0ff053c5d0b3a50166bda9b9d6da913 Mon Sep 17 00:00:00 2001 +From: Jim Perrin +Date: Fri, 20 Nov 2015 15:43:53 -0600 +Subject: [PATCH] bootfs default to xfs + +--- + pyanaconda/bootloader.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py +index ff9c2d5..1dd274a 100644 +--- a/pyanaconda/bootloader.py ++++ b/pyanaconda/bootloader.py +@@ -1411,7 +1411,7 @@ class GRUB2(GRUB): @property def stage2_format_types(self): - if productName.startswith("Red Hat "): -+ if productName.startswith("Red Hat ") or productName.startswith("CentOS"): ++ if productName.startswith("CentOS "): return ["xfs", "ext4", "ext3", "ext2", "btrfs"] else: return ["ext4", "ext3", "ext2", "btrfs", "xfs"] -@@ -2063,7 +2063,7 @@ +@@ -2105,7 +2105,7 @@ class ZIPL(BootLoader): @property def stage2_format_types(self): - if productName.startswith("Red Hat "): -+ if productName.startswith("Red Hat ") or productName.startswith("CentOS"): ++ if productName.startswith("CentOS "): return ["xfs", "ext4", "ext3", "ext2"] else: return ["ext4", "ext3", "ext2", "xfs"] +-- +1.8.3.1 + diff --git a/SOURCES/anaconda-centos-efidir-centos.patch b/SOURCES/anaconda-centos-efidir-centos.patch deleted file mode 100644 index 79d58f7..0000000 --- a/SOURCES/anaconda-centos-efidir-centos.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr anaconda-19.31.79__orig/pyanaconda/installclasses/centos.py anaconda-19.31.79/pyanaconda/installclasses/centos.py ---- anaconda-19.31.79__orig/pyanaconda/installclasses/centos.py 2014-06-30 17:13:18.111386761 +0100 -+++ anaconda-19.31.79/pyanaconda/installclasses/centos.py 2014-06-30 17:13:43.071386726 +0100 -@@ -43,7 +43,7 @@ - - _l10n_domain = "comps" - -- efi_dir = "redhat" -+ efi_dir = "centos" - - def configure(self, anaconda): - BaseInstallClass.configure(self, anaconda) diff --git a/SOURCES/anaconda-centos-set-right-eula-location.patch b/SOURCES/anaconda-centos-set-right-eula-location.patch index e33eb4e..02f0d60 100644 --- a/SOURCES/anaconda-centos-set-right-eula-location.patch +++ b/SOURCES/anaconda-centos-set-right-eula-location.patch @@ -1,7 +1,17 @@ -diff -uNr anaconda-19.31.79__orig/pyanaconda/constants.py anaconda-19.31.79/pyanaconda/constants.py ---- anaconda-19.31.79__orig/pyanaconda/constants.py 2014-04-29 01:45:59.000000000 +0100 -+++ anaconda-19.31.79/pyanaconda/constants.py 2014-06-18 23:42:35.944668381 +0100 -@@ -50,7 +50,7 @@ +From a8cc52ee114d87aa156d148b912dd377c4763fb3 Mon Sep 17 00:00:00 2001 +From: Jim Perrin +Date: Fri, 20 Nov 2015 15:10:34 -0600 +Subject: [PATCH] set right eula location + +--- + pyanaconda/constants.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py +index 8376fc2..1e828bf 100644 +--- a/pyanaconda/constants.py ++++ b/pyanaconda/constants.py +@@ -37,7 +37,7 @@ productVersion = product.productVersion productArch = product.productArch bugzillaUrl = product.bugUrl isFinal = product.isFinal @@ -10,3 +20,6 @@ diff -uNr anaconda-19.31.79__orig/pyanaconda/constants.py anaconda-19.31.79/pyan # for use in device names, eg: "fedora", "rhel" shortProductName = productName.lower() +-- +1.8.3.1 + diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec index 30aa209..7f8a95c 100644 --- a/SPECS/anaconda.spec +++ b/SPECS/anaconda.spec @@ -16,9 +16,7 @@ URL: http://fedoraproject.org/wiki/Anaconda Source0: %{name}-%{version}.tar.bz2 Patch1: anaconda-centos-add-centos-install-class.patch Patch2: anaconda-centos-set-right-eula-location.patch -Patch3: anaconda-centos-efidir-centos.patch -Patch4: anaconda-centos-disable-mirrors.patch -Patch5: anaconda-centos-bootfs-default-to-xfs.patch +Patch3: anaconda-centos-bootfs-default-to-xfs.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -231,8 +229,6 @@ runtime on NFS/HTTP/FTP servers or local disks. %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 -%patch5 -p1 %build %configure --disable-static \