Skip to content

Commit

Permalink
Allow for generic CentOS install, using original network screen
Browse files Browse the repository at this point in the history
  • Loading branch information
a13m committed Jan 31, 2013
1 parent 0fcdd9f commit 52df8cb
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 3 deletions.
123 changes: 123 additions & 0 deletions 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 <http://www.gnu.org/licenses/>.
#

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)

3 changes: 3 additions & 0 deletions anaconda-updates/6/installclasses/silvereye/__init__.py
Expand Up @@ -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
Expand Down
Expand Up @@ -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")
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions isolinux/6/isolinux.cfg
Expand Up @@ -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
Expand Down

0 comments on commit 52df8cb

Please sign in to comment.