From b3026647d79cc5c7f1f11a563f0f2ebe17b9131c Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Dec 07 2015 17:49:26 +0000 Subject: update anaconda patchset for 7.1511 --- diff --git a/SOURCES/anaconda-centos-add-centos-install-class.patch b/SOURCES/anaconda-centos-add-centos-install-class.patch index 89d64b5..82fcb8b 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 @@ +diff -uNr anaconda-21.48.22.56__orig/pyanaconda/installclasses/fedora.py anaconda-21.48.22.56/pyanaconda/installclasses/fedora.py +--- anaconda-21.48.22.56__orig/pyanaconda/installclasses/fedora.py 2015-10-22 17:34:02.000000000 +0100 ++++ anaconda-21.48.22.56/pyanaconda/installclasses/fedora.py 2015-12-07 16:40:33.122000000 +0000 +@@ -25,7 +25,7 @@ + class FedoraBaseInstallClass(BaseInstallClass): + name = "Fedora" + sortPriority = 10000 +- if productName.startswith("Red Hat "): ++ if productName.startswith("Red Hat ") or productName.startswith("CentOS"): + hidden = True + + _l10n_domain = "anaconda" +diff -uNr anaconda-21.48.22.56__orig/pyanaconda/installclasses/centos.py anaconda-21.48.22.56/pyanaconda/installclasses/centos.py +--- anaconda-21.48.22.56__orig/pyanaconda/installclasses/centos.py 1970-01-01 01:00:00.000000000 +0100 ++++ anaconda-21.48.22.56/pyanaconda/installclasses/centos.py 2015-12-07 16:52:11.157000000 +0000 +@@ -0,0 +1,97 @@ +# +# rhel.py +# @@ -22,83 +34,80 @@ 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 = 20001 ++ if not productName.startswith("CentOS"): ++ hidden = True + defaultFS = "xfs" + + bootloaderTimeoutDefault = 5 -+ bootloaderExtraArgs = [] + -+ ignoredPackages = ["ntfsprogs", "reiserfs-utils"] ++ ignoredPackages = ["ntfsprogs", "reiserfs-utils", "hfsplus-tools"] + + installUpdates = False + + _l10n_domain = "comps" + -+ efi_dir = "redhat" ++ efi_dir = "centos" ++ ++ help_placeholder = "RHEL7Placeholder.html" ++ help_placeholder_with_links = "RHEL7PlaceholderWithLinks.html" + + 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 Atomic Host" ++ sortPriority=21001 ++ 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 diff --git a/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch b/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch index 31432af..b03ef3a 100644 --- a/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch +++ b/SOURCES/anaconda-centos-bootfs-default-to-xfs.patch @@ -1,7 +1,7 @@ -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 @@ +diff -uNr anaconda-21.48.22.56__orig/pyanaconda/bootloader.py anaconda-21.48.22.56/pyanaconda/bootloader.py +--- anaconda-21.48.22.56__orig/pyanaconda/bootloader.py 2015-10-29 14:23:19.000000000 +0000 ++++ anaconda-21.48.22.56/pyanaconda/bootloader.py 2015-12-07 17:23:41.013000000 +0000 +@@ -1411,7 +1411,7 @@ @property def stage2_format_types(self): @@ -10,7 +10,7 @@ diff -uNr anaconda-19.31.79__orig/pyanaconda/bootloader.py anaconda-19.31.79/pya return ["xfs", "ext4", "ext3", "ext2", "btrfs"] else: return ["ext4", "ext3", "ext2", "btrfs", "xfs"] -@@ -2063,7 +2063,7 @@ +@@ -2105,7 +2105,7 @@ @property def stage2_format_types(self): diff --git a/SOURCES/anaconda-centos-disable-mirrors.patch b/SOURCES/anaconda-centos-disable-mirrors.patch index fb5b2eb..9b5cf00 100644 --- a/SOURCES/anaconda-centos-disable-mirrors.patch +++ b/SOURCES/anaconda-centos-disable-mirrors.patch @@ -1,15 +1,25 @@ -diff -uNr anaconda-19.31.79__orig/pyanaconda/packaging/yumpayload.py anaconda-19.31.79/pyanaconda/packaging/yumpayload.py ---- anaconda-19.31.79__orig/pyanaconda/packaging/yumpayload.py 2014-04-29 01:45:59.000000000 +0100 -+++ anaconda-19.31.79/pyanaconda/packaging/yumpayload.py 2014-07-02 14:36:15.360488588 +0100 -@@ -428,7 +428,10 @@ +diff -uNr anaconda-21.48.22.56__orig/pyanaconda/packaging/yumpayload.py anaconda-21.48.22.56/pyanaconda/packaging/yumpayload.py +--- anaconda-21.48.22.56__orig/pyanaconda/packaging/yumpayload.py 2015-10-29 14:23:19.000000000 +0000 ++++ anaconda-21.48.22.56/pyanaconda/packaging/yumpayload.py 2015-12-07 17:36:49.070000000 +0000 +@@ -481,12 +481,16 @@ @property def mirrorEnabled(self): with _yum_lock: -- return "fastestmirror" in self._yum.plugins._plugins +- # yum initializes with plugins disabled, and when plugins are disabled +- # _yum.plugins is a DummyYumPlugins object, which has no useful attributes. +- if hasattr(self._yum.plugins, "_plugins"): +- return "fastestmirror" in self._yum.plugins._plugins ++ # we just skip this on CentOS since we cant support it yet + if productName.startswith("CentOS"): -+ return 0 -+ else: -+ return "fastestmirror" in self._yum.plugins._plugins ++ return False + else: +- return False ++ # yum initializes with plugins disabled, and when plugins are disabled ++ # _yum.plugins is a DummyYumPlugins object, which has no useful attributes. ++ if hasattr(self._yum.plugins, "_plugins"): ++ return "fastestmirror" in self._yum.plugins._plugins ++ else: ++ return False def getRepo(self, repo_id): """ Return the yum repo object. """ 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-help-text.patch b/SOURCES/anaconda-centos-help-text.patch new file mode 100644 index 0000000..746ce18 --- /dev/null +++ b/SOURCES/anaconda-centos-help-text.patch @@ -0,0 +1,18 @@ +diff -uNr anaconda-21.48.22.56__orig/data/help/en-US/CentOSPlaceholder.html anaconda-21.48.22.56/data/help/en-US/CentOSPlaceholder.html +--- anaconda-21.48.22.56__orig/data/help/en-US/CentOSPlaceholder.html 1970-01-01 01:00:00.000000000 +0100 ++++ anaconda-21.48.22.56/data/help/en-US/CentOSPlaceholder.html 2015-12-07 17:07:05.017000000 +0000 +@@ -0,0 +1,5 @@ ++ ++

The Anaconda built-in help

++

...is not yet available for this screen.

++

You can check out the CentOS Linux resouces online at https://wiki.centos.org/GettingHelp.

++ +diff -uNr anaconda-21.48.22.56__orig/data/help/en-US/CentOSPlaceholderWithLinks.html anaconda-21.48.22.56/data/help/en-US/CentOSPlaceholderWithLinks.html +--- anaconda-21.48.22.56__orig/data/help/en-US/CentOSPlaceholderWithLinks.html 1970-01-01 01:00:00.000000000 +0100 ++++ anaconda-21.48.22.56/data/help/en-US/CentOSPlaceholderWithLinks.html 2015-12-07 17:09:47.845000000 +0000 +@@ -0,0 +1,5 @@ ++ ++

The Anaconda built-in help

++

...is not yet available for this screen.

++

You can check out the CentOS Linux resouces online at https://wiki.centos.org/GettingHelp.

++ diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec index 30aa209..b7c5308 100644 --- a/SPECS/anaconda.spec +++ b/SPECS/anaconda.spec @@ -3,7 +3,7 @@ Summary: Graphical system installer Name: anaconda Version: 21.48.22.56 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT Group: Applications/System URL: http://fedoraproject.org/wiki/Anaconda @@ -16,9 +16,9 @@ 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 +Patch6: anaconda-centos-help-text.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -230,9 +230,9 @@ runtime on NFS/HTTP/FTP servers or local disks. %setup -q %patch1 -p1 %patch2 -p1 -%patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build %configure --disable-static \ @@ -324,6 +324,12 @@ update-desktop-database &> /dev/null || : %{_prefix}/libexec/anaconda/dd_* %changelog +* Mon Dec 7 2015 Karanbir Singh - 21.48.22.56-2.el7.centos +- Forward port existing patch +- discard efivar patch, rolled into install class +- setup new help text +- rebase install class + * Thu Nov 19 2015 CentOS Sources - 21.48.22.56-1.el7.centos - Add CentOS install class as default - use the right path for the EULA string (issue 7165, bstinson)