summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-07-24 11:21:02 -0400
committerChris Lumens <clumens@redhat.com>2012-07-24 15:03:20 -0400
commit67bc16294198471a374940dfe0f4bb26651bdfac (patch)
tree2902cadeb05d4f5771ddaa67ef13c2550da013c0 /anaconda
parent7e5b6abfe114243d4317d2a19566443c835e9720 (diff)
downloadanaconda-67bc16294198471a374940dfe0f4bb26651bdfac.tar.gz
anaconda-67bc16294198471a374940dfe0f4bb26651bdfac.tar.xz
anaconda-67bc16294198471a374940dfe0f4bb26651bdfac.zip
Add support for loading defaults for an interactive install from a ks file.
Kickstart and interactive installs differ in certain default settings. This allows loading those differences from somewhere without having to complicate the code with lots of conditionals.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda35
1 files changed, 25 insertions, 10 deletions
diff --git a/anaconda b/anaconda
index 256e7cd3e..cee29164d 100755
--- a/anaconda
+++ b/anaconda
@@ -840,22 +840,37 @@ if __name__ == "__main__":
os.system("udevadm control --env=ANACONDA=1")
- # parse (not execute) kickstart now, the ks commands can affect things like
- # UI interface type or enabling rescue mode
+ # If we were given a kickstart file on the command line, parse (but do not
+ # execute) that now. Otherwise, load in defaults from kickstart files
+ # shipped with the installation media.
+ ksdata = None
if opts.ksfile:
flags.automatedInstall = True
+ files = [opts.ksfile]
+ else:
+ files = ["/tmp/updates/interactive-defaults.ks",
+ "/usr/share/anaconda/interactive-defaults.ks"]
+
+ for f in files:
+ if not os.path.exists(f):
+ continue
- kickstart.preScriptPass(opts.ksfile)
- ksdata = kickstart.parseKickstart(opts.ksfile)
- if ksdata.rescue.rescue:
- anaconda.rescue = True
+ kickstart.preScriptPass(f)
+ ksdata = kickstart.parseKickstart(f)
- # Some kickstart commands must be executed immediately, as they affect
- # how anaconda operates.
- ksdata.logging.execute()
- else:
+ # Only load the first defaults file we find.
+ break
+
+ if not ksdata:
ksdata = kickstart.AnacondaKSHandler()
+ if ksdata.rescue.rescue:
+ anaconda.rescue = True
+
+ # Some kickstart commands must be executed immediately, as they affect
+ # how anaconda operates.
+ ksdata.logging.execute()
+
anaconda.ksdata = ksdata
# Some post-install parts of anaconda are implemented as kickstart