From f10f510cfe351168dcbff70d2e034fdda1f239eb Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Jun 16 2014 22:10:03 +0000 Subject: add centos class to the installer --- diff --git a/SOURCES/anaconda-centos-add-centos-install-class.patch b/SOURCES/anaconda-centos-add-centos-install-class.patch new file mode 100644 index 0000000..227b8a0 --- /dev/null +++ b/SOURCES/anaconda-centos-add-centos-install-class.patch @@ -0,0 +1,104 @@ +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 @@ ++# ++# rhel.py ++# ++# Copyright (C) 2010 Red Hat, Inc. All rights reserved. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++from pyanaconda.installclass import BaseInstallClass ++from pyanaconda.constants import * ++from pyanaconda.product import * ++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 = 5000 ++ if not productName.startswith("CentOS "): ++ hidden = 1 ++ ++ defaultFS = "xfs" ++ ++ bootloaderTimeoutDefault = 5 ++ bootloaderExtraArgs = [] ++ ++ ignoredPackages = ["ntfsprogs", "reiserfs-utils"] ++ ++ installUpdates = False ++ ++ _l10n_domain = "comps" ++ ++ efi_dir = "redhat" ++ ++ def configure(self, anaconda): ++ BaseInstallClass.configure(self, anaconda) ++ BaseInstallClass.setDefaultPartitioning(self, 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: ++ return ++ if nm.nm_device_type_is_wifi(devName): ++ return ++ ifcfg_path = network.find_ifcfg_file_of_device(devName, root_path=ROOT_PATH) ++ if not ifcfg_path: ++ 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 ++ ++ 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" diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec index e54172c..4d9dd10 100644 --- a/SPECS/anaconda.spec +++ b/SPECS/anaconda.spec @@ -14,6 +14,7 @@ URL: http://fedoraproject.org/wiki/Anaconda # ./autogen.sh # make dist Source0: %{name}-%{version}.tar.bz2 +Patch1: anaconda-centos-add-centos-install-class.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -187,6 +188,7 @@ runtime on NFS/HTTP/FTP servers or local disks. %prep %setup -q +%patch1 -p1 %build %configure --disable-static \ @@ -259,6 +261,9 @@ update-desktop-database &> /dev/null || : %{_prefix}/libexec/anaconda/dd_* %changelog +* Mon Jun 16 2014 Karanbir Singh - 19.31.79-1.el7.centos.1 +- Add patch to inject CentOS install class, and make it default + * Tue Apr 29 2014 Brian C. Lane - 19.31.79-1 - network: fix device configuration in text mode (rvykydal) Resolves: rhbz#1091434