summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-09-04 15:22:09 +0000
committerChris Lumens <clumens@redhat.com>2007-09-04 15:22:09 +0000
commit68f837317eb7ca1f71687a75380f8f0e9eba6c76 (patch)
tree484314c2083872c629fba9a531f3bbef2fcab07f
parentb6e7d9015d1a5fec9d9dc87e844f88f8a54fcb12 (diff)
downloadanaconda-68f837317eb7ca1f71687a75380f8f0e9eba6c76.tar.gz
anaconda-68f837317eb7ca1f71687a75380f8f0e9eba6c76.tar.xz
anaconda-68f837317eb7ca1f71687a75380f8f0e9eba6c76.zip
If we did a kickstart install, use the %packages section from the ks file
instead of creating a new one.
-rw-r--r--ChangeLog10
-rw-r--r--backend.py5
-rw-r--r--installclass.py2
-rw-r--r--instdata.py35
-rw-r--r--livecd.py2
-rw-r--r--yuminstall.py6
6 files changed, 37 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 02c623140..5450c422b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-09-04 Chris Lumens <clumens@redhat.com>
+
+ * backend.py (AnacondaBackend.writePackagesKS, writeConfiguration):
+ Modify handling of anaconda instance argument.
+ * installclass.py (BaseInstallClass.setInstallData): Likewise.
+ * livecd.py (LiveCDCopyBackend.writePackagesKS): Likewise.
+ * instdata.py (InstData.__init__, InstData.reset): Likewise.
+ * yuminstall.py (YumBackend.writePackagesKS): If we did a kickstart
+ install, write out the %packages section that was used initially.
+
2007-08-31 Jeremy Katz <katzj@redhat.com>
* anaconda.spec: Bump version.
diff --git a/backend.py b/backend.py
index 6bd5593bf..06db80510 100644
--- a/backend.py
+++ b/backend.py
@@ -157,7 +157,7 @@ class AnacondaBackend:
pass
# write out the %packages section of anaconda-ks.cfg
- def writePackagesKS(self, f):
+ def writePackagesKS(self, f, anaconda):
log.warning("writePackagesKS not implemented for backend!")
pass
@@ -206,6 +206,5 @@ def doBasePackageSelect(anaconda):
def writeConfiguration(anaconda):
log.info("Writing main configuration")
if not flags.test:
- anaconda.id.write(anaconda)
+ anaconda.id.write()
anaconda.backend.writeConfiguration()
-
diff --git a/installclass.py b/installclass.py
index 73cdfaea3..40102691e 100644
--- a/installclass.py
+++ b/installclass.py
@@ -453,7 +453,7 @@ class BaseInstallClass:
def setInstallData(self, anaconda):
- anaconda.id.reset(anaconda)
+ anaconda.id.reset()
anaconda.id.instClass = self
# Classes should call these on __init__ to set up install data
diff --git a/instdata.py b/instdata.py
index 045e7f9f3..53066edf5 100644
--- a/instdata.py
+++ b/instdata.py
@@ -45,7 +45,7 @@ log = logging.getLogger("anaconda")
class InstallData:
- def reset(self, anaconda):
+ def reset(self):
# Reset everything except:
#
# - The mouse
@@ -67,14 +67,14 @@ class InstallData:
self.upgrade = None
# XXX move fsset and/or diskset into Partitions object?
self.fsset.reset()
- self.diskset = partedUtils.DiskSet(anaconda)
+ self.diskset = partedUtils.DiskSet(self.anaconda)
self.partitions = partitions.Partitions()
self.bootloader = bootloader.getBootloader()
self.upgradeRoot = None
self.rootParts = None
self.upgradeSwapInfo = None
- if rhpl.getArch() == "s390" or anaconda.isKickstart:
+ if rhpl.getArch() == "s390" or self.anaconda.isKickstart:
self.firstboot = FIRSTBOOT_SKIP
else:
self.firstboot = FIRSTBOOT_DEFAULT
@@ -127,18 +127,18 @@ class InstallData:
def setUpgrade (self, bool):
self.upgrade = bool
- def write(self, anaconda):
+ def write(self):
if self.auth.find("--enablemd5"):
useMD5 = True
else:
useMD5 = False
- self.instLanguage.write (anaconda.rootPath)
+ self.instLanguage.write (self.anaconda.rootPath)
if not self.isHeadless:
- self.keyboard.write (anaconda.rootPath)
+ self.keyboard.write (self.anaconda.rootPath)
- self.timezone.write (anaconda.rootPath)
+ self.timezone.write (self.anaconda.rootPath)
args = ["--update", "--nostart"] + shlex.split(self.auth)
@@ -146,15 +146,15 @@ class InstallData:
if not flags.test:
iutil.execWithRedirect("/usr/sbin/authconfig", args,
stdout = None, stderr = None,
- root = anaconda.rootPath)
+ root = self.anaconda.rootPath)
else:
log.error("Would have run: %s", args)
except RuntimeError, msg:
log.error("Error running %s: %s", args, msg)
- self.network.write (anaconda.rootPath)
- self.firewall.write (anaconda.rootPath)
- self.security.write (anaconda.rootPath)
+ self.network.write (self.anaconda.rootPath)
+ self.firewall.write (self.anaconda.rootPath)
+ self.security.write (self.anaconda.rootPath)
self.users = users.Users()
@@ -163,24 +163,24 @@ class InstallData:
self.rootPassword["isCrypted"], useMD5,
self.rootPassword["lock"])
- if anaconda.isKickstart:
+ if self.anaconda.isKickstart:
for svc in self.ksdata.services.disabled:
iutil.execWithRedirect("/sbin/chkconfig",
[svc, "off"],
stdout="/dev/tty5", stderr="/dev/tty5",
- root=anaconda.rootPath)
+ root=self.anaconda.rootPath)
for svc in self.ksdata.services.enabled:
iutil.execWithRedirect("/sbin/chkconfig",
[svc, "on"],
stdout="/dev/tty5", stderr="/dev/tty5",
- root=anaconda.rootPath)
+ root=self.anaconda.rootPath)
for ud in self.ksdata.user.userList:
if self.users.createUser(ud.name, ud.password, ud.isCrypted,
ud.groups, ud.homedir, ud.shell,
ud.uid, ud.lock,
- root=anaconda.rootPath) == None:
+ root=self.anaconda.rootPath) == None:
log.error("User %s already exists, not creating." % ud.name)
@@ -262,7 +262,7 @@ class InstallData:
if self.backend is not None:
self.backend.writeKS(f)
- self.backend.writePackagesKS(f)
+ self.backend.writePackagesKS(f, self.anaconda)
# make it so only root can read, could have password
os.chmod(filename, 0600)
@@ -274,6 +274,7 @@ class InstallData:
self.instLanguage = language.Language(self.displayMode)
self.keyboard = keyboard.Keyboard()
self.backend = backend
+ self.anaconda = anaconda
self.mouse = None
self.monitor = None
@@ -285,4 +286,4 @@ class InstallData:
self.fsset = fsset.FileSystemSet()
self.methodstr = methodstr
- self.reset(anaconda)
+ self.reset()
diff --git a/livecd.py b/livecd.py
index f290b56f7..17befbfae 100644
--- a/livecd.py
+++ b/livecd.py
@@ -386,5 +386,5 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
return True
def getDefaultGroups(self, anaconda):
return []
- def writePackagesKS(self, f):
+ def writePackagesKS(self, f, anaconda):
pass
diff --git a/yuminstall.py b/yuminstall.py
index dcadf34ef..d08bca208 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1335,7 +1335,11 @@ class YumBackend(AnacondaBackend):
f.write(line)
- def writePackagesKS(self, f):
+ def writePackagesKS(self, f, anaconda):
+ if anaconda.isKickstart:
+ f.write(anaconda.id.ksdata.packages.__str__())
+ return
+
groups = []
installed = []
removed = []