diff options
author | Martin Sivak <msivak@redhat.com> | 2007-11-22 10:32:49 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2007-11-22 10:32:49 +0100 |
commit | 9a3f783d0826d54705e9a6725fd6777fcd99f562 (patch) | |
tree | 7046da035931e51c3c8aa1c6bdca368136c36a6c | |
parent | 8905e5d37edca1f84f85a4e0e35767ff76b58c45 (diff) | |
download | anaconda-9a3f783d0826d54705e9a6725fd6777fcd99f562.tar.gz anaconda-9a3f783d0826d54705e9a6725fd6777fcd99f562.tar.xz anaconda-9a3f783d0826d54705e9a6725fd6777fcd99f562.zip |
Use input %packages section for anaconda-ks.cfg (#280101)
-rw-r--r-- | backend.py | 4 | ||||
-rw-r--r-- | installclass.py | 2 | ||||
-rw-r--r-- | instdata.py | 43 | ||||
-rw-r--r-- | yuminstall.py | 6 |
4 files changed, 30 insertions, 25 deletions
diff --git a/backend.py b/backend.py index e42477fb1..3efcac86f 100644 --- a/backend.py +++ b/backend.py @@ -152,7 +152,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 @@ -194,5 +194,5 @@ def writeConfiguration(anaconda): log.info("Writing main configuration") if not flags.test: anaconda.backend.writeConfiguration() - anaconda.id.write(anaconda) + anaconda.id.write() diff --git a/installclass.py b/installclass.py index 1e7a277b4..1c132c53b 100644 --- a/installclass.py +++ b/installclass.py @@ -437,7 +437,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 70c875aa3..94190635f 100644 --- a/instdata.py +++ b/instdata.py @@ -44,7 +44,7 @@ log = logging.getLogger("anaconda") class InstallData: - def reset(self, anaconda): + def reset(self): # Reset everything except: # # - The mouse @@ -65,7 +65,7 @@ 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.dependencies = [] @@ -131,18 +131,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"] + self.auth.split() @@ -150,14 +150,14 @@ 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.firewall.write (anaconda.rootPath) - self.security.write (anaconda.rootPath) + self.firewall.write (self.anaconda.rootPath) + self.security.write (self.anaconda.rootPath) self.users = users.Users() @@ -169,7 +169,7 @@ class InstallData: if flags.mpath: svc = 'multipathd' - if anaconda.isKickstart: + if self.anaconda.isKickstart: try: hasSvc = self.ksdata.services["enabled"].index(svc) except: @@ -178,32 +178,32 @@ class InstallData: iutil.execWithRedirect("/sbin/chkconfig", [svc, "on"], stdout="/dev/tty5", stderr="/dev/tty5", - root=anaconda.rootPath) + root=self.anaconda.rootPath) - 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.userList: if self.users.createUser(ud.name, ud.password, ud.isCrypted, ud.groups, ud.homedir, ud.shell, - ud.uid, root=anaconda.rootPath) == None: + ud.uid, root=self.anaconda.rootPath) == None: log.error("User %s already exists, not creating." % ud.name) - if anaconda.id.instClass.installkey and os.path.exists(anaconda.rootPath + "/etc/sysconfig/rhn"): - f = open(anaconda.rootPath + "/etc/sysconfig/rhn/install-num", "w+") - f.write("%s\n" %(anaconda.id.instClass.installkey,)) + if self.anaconda.id.instClass.installkey and os.path.exists(self.anaconda.rootPath + "/etc/sysconfig/rhn"): + f = open(self.anaconda.rootPath + "/etc/sysconfig/rhn/install-num", "w+") + f.write("%s\n" %(self.anaconda.id.instClass.installkey,)) f.close() - os.chmod(anaconda.rootPath + "/etc/sysconfig/rhn/install-num", + os.chmod(self.anaconda.rootPath + "/etc/sysconfig/rhn/install-num", 0600) def writeKS(self, filename): @@ -280,7 +280,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) @@ -292,6 +292,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 @@ -307,4 +308,4 @@ class InstallData: self.excludeDocs = 1 self.methodstr = methodstr - self.reset(anaconda) + self.reset() diff --git a/yuminstall.py b/yuminstall.py index c5511d953..a55719090 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -1866,7 +1866,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 = [] |