summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-10-20 11:15:33 -0400
committerChris Lumens <clumens@redhat.com>2009-10-21 13:14:15 -0400
commite7fd45bb9fda8a9dbd05a49005ada7ae2ccac36c (patch)
tree7b0dbaf0a47a6a1de5dffbb2b9dbe6059cb4778a
parent844c4aa143069535a26add515a0a32a2c913c2a1 (diff)
downloadanaconda-e7fd45bb9fda8a9dbd05a49005ada7ae2ccac36c.tar.gz
anaconda-e7fd45bb9fda8a9dbd05a49005ada7ae2ccac36c.tar.xz
anaconda-e7fd45bb9fda8a9dbd05a49005ada7ae2ccac36c.zip
Use rpm to determine how to set bootloader args and default runlevel (#527520).
We were previously using tests that have diverged from what's going on in yuminstall.py, so this brings the two backend tests into using the same concept.
-rw-r--r--livecd.py8
-rw-r--r--packages.py16
-rw-r--r--yuminstall.py10
3 files changed, 20 insertions, 14 deletions
diff --git a/livecd.py b/livecd.py
index 685e172ed..795798c07 100644
--- a/livecd.py
+++ b/livecd.py
@@ -348,6 +348,8 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
rc = proc.poll()
def doPostInstall(self, anaconda):
+ import rpm
+
self._doFilesystemMangling(anaconda)
# setup /etc/rpm/ for the post-install environment
@@ -355,11 +357,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
storage.writeEscrowPackets(anaconda)
- # maybe heavy handed, but it'll do
- if os.path.exists(anaconda.rootPath + "/usr/bin/rhgb") or os.path.exists(anaconda.rootPath + "/usr/bin/plymouth"):
- anaconda.id.bootloader.args.append("rhgb quiet")
- if os.path.exists(anaconda.rootPath + "/usr/sbin/gdm") or os.path.exists(anaconda.rootPath + "/usr/bin/kdm"):
- anaconda.id.desktop.setDefaultRunLevel(5)
+ packages.rpmSetupGraphicalSystem(anaconda)
# now write out the "real" fstab and mtab
anaconda.id.storage.write(anaconda.rootPath)
diff --git a/packages.py b/packages.py
index 074f753a4..2d1ae6419 100644
--- a/packages.py
+++ b/packages.py
@@ -317,6 +317,22 @@ def rpmKernelVersionList(rootPath = "/"):
return versions
+def rpmSetupGraphicalSystem(anaconda):
+ import rpm
+
+ iutil.resetRpmDb(anaconda.rootPath)
+ ts = rpm.TransactionSet(anaconda.rootPath)
+
+ # Only add "rhgb quiet" on non-s390, non-serial installs
+ if iutil.isConsoleOnVirtualTerminal() and \
+ ts.dbMatch('provides', 'rhgb').count() or \
+ ts.dbMatch('provides', 'plymouth').count():
+ anaconda.id.bootloader.args.append("rhgb quiet")
+
+ if ts.dbMatch('provides', 'service(graphical-login)').count() and \
+ anaconda.id.displayMode == 'g' and not flags.usevnc:
+ anaconda.id.desktop.setDefaultRunLevel(5)
+
#Recreate initrd for use when driver disks add modules
def recreateInitrd (kernelTag, instRoot):
log.info("recreating initrd for %s" % (kernelTag,))
diff --git a/yuminstall.py b/yuminstall.py
index 1c54318fa..df3415303 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1606,15 +1606,7 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
w = anaconda.intf.waitWindow(_("Post Installation"),
_("Performing post-installation configuration"))
- # Only add "rhgb quiet" on non-s390, non-serial installs
- if iutil.isConsoleOnVirtualTerminal():
- if len(self.ayum.tsInfo.matchNaevr(name='rhgb')) > 0:
- anaconda.id.bootloader.args.append("rhgb quiet")
- elif len(self.ayum.tsInfo.matchNaevr(name='plymouth')) > 0:
- anaconda.id.bootloader.args.append("rhgb quiet")
-
- if self.ayum.tsInfo.getProvides("service(graphical-login)") != {} and anaconda.id.displayMode == 'g' and not flags.usevnc:
- anaconda.id.desktop.setDefaultRunLevel(5)
+ packages.rpmSetupGraphicalSystem(anaconda)
for repo in self.ayum.repos.listEnabled():
repo.dirCleanup()