diff options
author | Jesse Keating <jkeating@redhat.com> | 2012-11-12 15:31:52 -0800 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2012-11-13 08:27:45 -0800 |
commit | 9f991cb4f0303b4e25f25f9064da0e7c3cef6002 (patch) | |
tree | 861394c4ba1fca8db3a5e7e8c45de36f436457d8 /pyanaconda/packaging | |
parent | 195645895470da681c73ee1bff490665caf87799 (diff) | |
download | anaconda-9f991cb4f0303b4e25f25f9064da0e7c3cef6002.tar.gz anaconda-9f991cb4f0303b4e25f25f9064da0e7c3cef6002.tar.xz anaconda-9f991cb4f0303b4e25f25f9064da0e7c3cef6002.zip |
Use ksdata to set default runlevel
This removes code duplicated in desktop.py, and will short circuit the
routine if the user has indicated that they want a graphical boot by way
of kickstart data.
Diffstat (limited to 'pyanaconda/packaging')
-rw-r--r-- | pyanaconda/packaging/__init__.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py index 0108f683c..11865698b 100644 --- a/pyanaconda/packaging/__init__.py +++ b/pyanaconda/packaging/__init__.py @@ -575,11 +575,14 @@ class Payload(object): log.error("systemd is not installed -- can't set default target") return + # If X was already requested we don't have to continue + if self.data.xconfig.startX: + return + try: import rpm except ImportError: - log.info("failed to import rpm -- defaulting to multi-user.target") - default_target = "multi-user.target" + log.info("failed to import rpm -- not adjusting default runlevel") else: ts = rpm.TransactionSet(ROOT_PATH) @@ -587,14 +590,9 @@ class Payload(object): if ts.dbMatch("provides", 'service(graphical-login)').count() and \ ts.dbMatch('provides', 'xorg-x11-server-Xorg').count() and \ not flags.usevnc: - default_target = "graphical.target" - else: - default_target = "multi-user.target" - - symlink_path = ROOT_PATH + '/etc/systemd/system/default.target' - if os.path.islink(symlink_path): - os.unlink(symlink_path) - os.symlink('/usr/lib/systemd/system/' + default_target, symlink_path) + # We only manipulate the ksdata. The symlink is made later + # during the config write out. + self.data.xconfig.startX = True def dracutSetupArgs(self): args = [] |