From 52df8cbb1cb5baca684c8db74d19dc27d9281354 Mon Sep 17 00:00:00 2001 From: Andy Grimm Date: Thu, 31 Jan 2013 00:03:11 -0500 Subject: [PATCH] Allow for generic CentOS install, using original network screen --- anaconda-updates/6/installclasses/generic.py | 123 ++++++++++++++++++ .../6/installclasses/silvereye/__init__.py | 3 + .../{network_gui.py => network_euca_gui.py} | 2 +- .../ui/{network.glade => network_euca.glade} | 0 isolinux/6/isolinux.cfg | 4 +- 5 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 anaconda-updates/6/installclasses/generic.py rename anaconda-updates/6/iw/{network_gui.py => network_euca_gui.py} (99%) rename anaconda-updates/6/ui/{network.glade => network_euca.glade} (100%) diff --git a/anaconda-updates/6/installclasses/generic.py b/anaconda-updates/6/installclasses/generic.py new file mode 100644 index 0000000..16ecf25 --- /dev/null +++ b/anaconda-updates/6/installclasses/generic.py @@ -0,0 +1,123 @@ +# +# 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 installclass import BaseInstallClass +from constants import * +from product import * +from flags import flags +import os +import types + +import installmethod +import yuminstall + +class InstallClass(BaseInstallClass): + # name has underscore used for mnemonics, strip if you dont need it + id = "centos" + name = N_("CentOS Linux") + _description = N_("The default installation of %s is a minimum install. " + "You can optionally select a different set of software " + "now.") + _descriptionFields = (productName,) + sortPriority = 10005 + hidden = 0 + + bootloaderTimeoutDefault = 5 + bootloaderExtraArgs = ["crashkernel=auto"] + + tasks = [(N_("Minimal"), + ["core"])] + + def getPackagePaths(self, uri): + if not type(uri) == types.ListType: + uri = [uri,] + + return {productName: uri} + + def setInstallData(self, anaconda): + BaseInstallClass.setInstallData(self, anaconda) + BaseInstallClass.setDefaultPartitioning(self, + anaconda.id.storage, + anaconda.platform) + + def setGroupSelection(self, anaconda): + BaseInstallClass.setGroupSelection(self, anaconda) + anaconda.backend.selectGroup("core") + + def setSteps(self, anaconda): + BaseInstallClass.setSteps(self, anaconda) + anaconda.dispatch.skipStep("partition") + anaconda.dispatch.skipStep("betanag",permanent=1) + if anaconda.id.displayMode == 'g': + anaconda.dispatch.skipStep("tasksel", skip = 1, permanent=1) + anaconda.dispatch.skipStep("group-selection", skip = 1, permanent=1) + + def getBackend(self): + if flags.livecdInstall: + import livecd + return livecd.LiveCDCopyBackend + else: + return yuminstall.YumBackend + + def productMatches(self, oldprod): + if oldprod is None: + return False + + if oldprod.startswith(productName): + return True + + productUpgrades = { + "CentOS": ("CentOS release", ), + "Red Hat Enterprise Linux AS": ("Red Hat Linux Advanced Server", ), + "Red Hat Enterprise Linux WS": ("Red Hat Linux Advanced Workstation",), + # FIXME: this probably shouldn't be in a release... + "Red Hat Enterprise Linux": ("Red Hat Linux Advanced Server", + "Red Hat Linux Advanced Workstation", + "Red Hat Enterprise Linux AS", + "Red Hat Enterprise Linux ES", + "Red Hat Enterprise Linux WS"), + "Red Hat Enterprise Linux Server": ("Red Hat Enterprise Linux AS", + "Red Hat Enterprise Linux ES", + "Red Hat Enterprise Linux WS", + "Red Hat Enterprise Linux"), + "Red Hat Enterprise Linux Client": ("Red Hat Enterprise Linux WS", + "Red Hat Enterprise Linux Desktop", + "Red Hat Enterprise Linux"), + } + + if productUpgrades.has_key(productName): + acceptable = productUpgrades[productName] + else: + acceptable = () + + for p in acceptable: + if oldprod.startswith(p): + return True + + return False + + def versionMatches(self, oldver): + oldMajor = oldver.split(".")[0] + newMajor = productVersion.split(".")[0] + + return oldMajor == newMajor + + def __init__(self): + BaseInstallClass.__init__(self) + diff --git a/anaconda-updates/6/installclasses/silvereye/__init__.py b/anaconda-updates/6/installclasses/silvereye/__init__.py index 84aab5c..1e191ad 100644 --- a/anaconda-updates/6/installclasses/silvereye/__init__.py +++ b/anaconda-updates/6/installclasses/silvereye/__init__.py @@ -99,6 +99,9 @@ def setSteps(self, anaconda): anaconda.dispatch.skipStep("partition") # anaconda.dispatch.skipStep("parttype") + from gui import stepToClass + stepToClass['network'] = ('network_euca_gui', 'NetworkWindow') + def getBackend(self): if flags.livecdInstall: import livecd diff --git a/anaconda-updates/6/iw/network_gui.py b/anaconda-updates/6/iw/network_euca_gui.py similarity index 99% rename from anaconda-updates/6/iw/network_gui.py rename to anaconda-updates/6/iw/network_euca_gui.py index 69377f7..9487a29 100644 --- a/anaconda-updates/6/iw/network_gui.py +++ b/anaconda-updates/6/iw/network_euca_gui.py @@ -54,7 +54,7 @@ def getScreen(self, anaconda): self.hostname = network.getDefaultHostname(anaconda) # load the UI - (self.xml, self.align) = gui.getGladeWidget("network.glade", + (self.xml, self.align) = gui.getGladeWidget("network_euca.glade", "network_align") self.icon = self.xml.get_widget("icon") self.hostnameEntry = self.xml.get_widget("hostnameEntry") diff --git a/anaconda-updates/6/ui/network.glade b/anaconda-updates/6/ui/network_euca.glade similarity index 100% rename from anaconda-updates/6/ui/network.glade rename to anaconda-updates/6/ui/network_euca.glade diff --git a/isolinux/6/isolinux.cfg b/isolinux/6/isolinux.cfg index 9f68be2..84c122e 100644 --- a/isolinux/6/isolinux.cfg +++ b/isolinux/6/isolinux.cfg @@ -40,10 +40,10 @@ label sub3 menu label Other Options menu disable label minimal - menu label Install a ^minimal CentOS 6 without Eucalyptus + menu label Install ^generic CentOS 6 without Eucalyptus menu indent 2 kernel vmlinuz - append initrd=initrd.img + append initrd=initrd.img label rescue menu label ^Rescue installed system menu indent 2