Right now, if you boot the installer with 'text' and install a package set that includes Xorg and a desktop, you'll get a system that boots to graphical mode.
The intended behavior is this: if the installer is in text mode, the installed system should also come up in text mode.
Alternately, if the user specifies 'skipx' in the kickstart, we should boot to text mode, not graphical.
So here's three patches to fix that up a bit:
Patch 1: If you have 'skipx' in kickstart, change the default target to multi-user.target.
Patch 2: If (after setupDisplay has a chance to ask questions etc.) the installer is running in text mode, set skipx to True.
Patch 3: Make sure we write 'text' or 'cmdline' into the resulting kickstart if the installer is in text or cmdline mode.
I've tested these with RHEL7, and they seem to work as expected.
-w
If the user specifies 'skipx', they don't want Xorg to come up. So make sure our default target is 'multi-user.target' when skipx is True.
Note that skipx is executed after xconfig, which means that skipx overrides xconfig. This seems like a sensible arrangement. --- pyanaconda/install.py | 1 + pyanaconda/kickstart.py | 8 ++++++++ 2 files changed, 9 insertions(+)
diff --git a/pyanaconda/install.py b/pyanaconda/install.py index 0742d6f..1c1ece1 100644 --- a/pyanaconda/install.py +++ b/pyanaconda/install.py @@ -72,6 +72,7 @@ def doConfiguration(storage, payload, ksdata, instClass): ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) + ksdata.skipx.execute(storage, ksdata, instClass)
if not flags.flags.imageInstall and not flags.flags.dirInstall: with progress_report(_("Writing network configuration")): diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 7ab7151..f93d815 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -1539,6 +1539,13 @@ class XConfig(commands.xconfig.F14_XConfig): # now write it out desktop.write()
+class SkipX(commands.skipx.FC3_SkipX): + def execute(self, *args): + if self.skipx: + desktop = Desktop() + desktop.runlevel = 3 + desktop.write() + class ZFCP(commands.zfcp.F14_ZFCP): def parse(self, args): fcp = commands.zfcp.F14_ZFCP.parse(self, args) @@ -1622,6 +1629,7 @@ commandMap = { "rootpw": RootPw, "selinux": SELinux, "services": Services, + "skipx": SkipX, "timezone": Timezone, "upgrade": Upgrade, "user": User,
Doing as RHEL once did: if you're installing in text mode, the resulting system should default to text mode.
So, after all the memory checks etc. happen, if you're still not in graphical mode, you're in text mode. So we add 'skipx' to your kickstart data and go from there. --- anaconda | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/anaconda b/anaconda index 994497f..897ddc7 100755 --- a/anaconda +++ b/anaconda @@ -1033,6 +1033,10 @@ if __name__ == "__main__": # now start the interface setupDisplay(anaconda, opts, addon_paths)
+ # if we're in text mode, the resulting system should be too + if anaconda.displayMode != 'g': + anaconda.ksdata.skipx.skipx = True + if anaconda.rescue: from pyanaconda import rescue anaconda.intf = rescue.RescueInterface()
If the install is happening in text/cmdline mode, we should end up with 'text' or 'cmdline' in the resulting anaconda-ks.cfg.
So: once we have determined anaconda.displayMode, set the appropriate ksdata.displaymode.displayMode so that we'll write it to the kickstart later.
(Note that we do this after setupDisplay because setupDisplay can change displayMode - e.g. by forcing text-mode on low-memory systems or by asking the user if they want to use VNC instead.) --- anaconda | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/anaconda b/anaconda index 897ddc7..faea86b 100755 --- a/anaconda +++ b/anaconda @@ -1036,6 +1036,11 @@ if __name__ == "__main__": # if we're in text mode, the resulting system should be too if anaconda.displayMode != 'g': anaconda.ksdata.skipx.skipx = True + from pyanaconda.constants import DISPLAY_MODE_CMDLINE, DISPLAY_MODE_TEXT + if anaconda.displayMode == 'c': + anaconda.ksdata.displaymode.displayMode = DISPLAY_MODE_CMDLINE + else: + anaconda.ksdata.displaymode.displayMode = DISPLAY_MODE_TEXT
if anaconda.rescue: from pyanaconda import rescue
ACK to all of these.
anaconda-patches@lists.fedorahosted.org