[PATCH] Use rpm to determine how to set bootloader args and default runlevel (#527520).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 livecd.py     |    8 +++-----
 packages.py   |   16 ++++++++++++++++
 yuminstall.py |   10 +---------
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/livecd.py b/livecd.py
index 685e172..795798c 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 3d32a68..02c3c92 100644
--- a/packages.py
+++ b/packages.py
@@ -302,6 +302,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 f3c0e92..7ab61e5 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1673,15 +1673,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()
-- 
1.6.5.rc2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux