diff options
author | Chris Lumens <clumens@redhat.com> | 2012-07-17 15:08:00 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2012-07-17 15:23:30 -0400 |
commit | b355b5fbb532efc9c2eae70d03d3efd853fbb423 (patch) | |
tree | 77323e06ad02c6df4dd3fe7ae0e14c82d86d7185 /pyanaconda | |
parent | 38a543ea05391a0bff3646d72c5a2b7be2ab071c (diff) | |
download | anaconda-b355b5fbb532efc9c2eae70d03d3efd853fbb423.tar.gz anaconda-b355b5fbb532efc9c2eae70d03d3efd853fbb423.tar.xz anaconda-b355b5fbb532efc9c2eae70d03d3efd853fbb423.zip |
Hook up the kickstart firstboot command so it actually does something.
Note that this does not yet handle the fact that we want to skip firstboot
on most kickstart installs (unless the user specifies otherwise). We need
a place to load those defaults, which will be a separate patch.
Diffstat (limited to 'pyanaconda')
-rw-r--r-- | pyanaconda/__init__.py | 9 | ||||
-rw-r--r-- | pyanaconda/dispatch.py | 2 | ||||
-rw-r--r-- | pyanaconda/install.py | 1 | ||||
-rw-r--r-- | pyanaconda/kickstart.py | 18 | ||||
-rw-r--r-- | pyanaconda/packages.py | 11 | ||||
-rw-r--r-- | pyanaconda/ui/gui/TODO | 2 |
6 files changed, 21 insertions, 22 deletions
diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py index 58ec85253..7991afbf3 100644 --- a/pyanaconda/__init__.py +++ b/pyanaconda/__init__.py @@ -107,15 +107,6 @@ class Anaconda(object): return self._bootloader @property - def firstboot(self): - from pykickstart.constants import FIRSTBOOT_DEFAULT - - if self.ksdata: - return self.ksdata.firstboot.firstboot - else: - return FIRSTBOOT_DEFAULT - - @property def instClass(self): if not self._instClass: from installclass import DefaultInstall diff --git a/pyanaconda/dispatch.py b/pyanaconda/dispatch.py index e04d3a9b6..d8bb6d095 100644 --- a/pyanaconda/dispatch.py +++ b/pyanaconda/dispatch.py @@ -26,7 +26,6 @@ from types import * import indexed_dict from constants import * from packages import doPostAction -from packages import firstbootConfiguration from packages import setupTimezone from storage import storageInitialize from storage import storageComplete @@ -269,7 +268,6 @@ class Dispatcher(object): self.add_step("installpackages", doInstall) self.add_step("postinstallconfig", doPostInstall) self.add_step("writeconfig", writeConfiguration) - self.add_step("firstboot", firstbootConfiguration) self.add_step("instbootloader", writeBootLoader) self.add_step("reipl", doReIPL) self.add_step("methodcomplete", doMethodComplete) diff --git a/pyanaconda/install.py b/pyanaconda/install.py index ac5fe4259..3f43007c9 100644 --- a/pyanaconda/install.py +++ b/pyanaconda/install.py @@ -73,6 +73,7 @@ def doInstall(storage, payload, ksdata, instClass): # Now run the execute methods of ksdata that require an installed system # to be present first. + ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index d3e2924b0..de46e38c4 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -414,6 +414,23 @@ class Fcoe(commands.fcoe.F13_Fcoe): return fc +class Firstboot(commands.firstboot.FC3_Firstboot): + def execute(self, *args): + if not os.path.exists("/lib/systemd/system/firstboot-graphical.service"): + return + + action = "enable" + + if self.firstboot == FIRSTBOOT_SKIP: + action = "disable" + elif self.firstboot == FIRSTBOOT_RECONFIG: + f = open(ROOT_PATH + "/etc/reconfigSys", "w+") + f.close() + + iutil.execWithRedirect("systemctl", [action, "firstboot-graphical.service"], + stdout="/dev/tty5", stderr="/dev/tty5", + root=ROOT_PATH) + class IgnoreDisk(commands.ignoredisk.RHEL6_IgnoreDisk): def parse(self, args): retval = commands.ignoredisk.RHEL6_IgnoreDisk.parse(self, args) @@ -1250,6 +1267,7 @@ commandMap = { "clearpart": ClearPart, "dmraid": DmRaid, "fcoe": Fcoe, + "firstboot": Firstboot, "ignoredisk": IgnoreDisk, "iscsi": Iscsi, "iscsiname": IscsiName, diff --git a/pyanaconda/packages.py b/pyanaconda/packages.py index dc503e5bb..334ee4a51 100644 --- a/pyanaconda/packages.py +++ b/pyanaconda/packages.py @@ -39,17 +39,6 @@ _ = lambda x: gettext.ldgettext("anaconda", x) def doPostAction(anaconda): anaconda.instClass.postAction(anaconda) -def firstbootConfiguration(anaconda): - if anaconda.firstboot == FIRSTBOOT_RECONFIG: - f = open(ROOT_PATH + '/etc/reconfigSys', 'w+') - f.close() - elif anaconda.firstboot == FIRSTBOOT_SKIP: - f = open(ROOT_PATH + '/etc/sysconfig/firstboot', 'w+') - f.write('RUN_FIRSTBOOT=NO') - f.close() - - return - def setupTimezone(anaconda): # we don't need this on an upgrade or going backwards if anaconda.upgrade or flags.imageInstall or anaconda.dir == DISPATCH_BACK: diff --git a/pyanaconda/ui/gui/TODO b/pyanaconda/ui/gui/TODO index b228a30e5..cb5713e84 100644 --- a/pyanaconda/ui/gui/TODO +++ b/pyanaconda/ui/gui/TODO @@ -13,6 +13,8 @@ Fedora 18 where you go next. - The setting on the welcome screen does not get reflected on the language and keyboard spokes. - Something causes the up and down arrows to resize the anaconda window. +- Some interactive install defaults are different from kickstart (firstboot, ?). These need to + be loaded somewhere up front for an interactive install. + Update exception handling. This requires updating python-meh to use gtk3, which also requires updating firstboot and s-c-ks to gtk3. I want to turn s-c-ks into an anaconda wrapper first, though. |