[PATCH] Use an alternative image if logo is missing

Martin Kolman mkolman at redhat.com
Mon Mar 24 15:00:58 UTC 2014


If the logo in upper left is missing GTK will start spamming
TT1, making it completely unusable. The image is specified in a CSS
and needs to be present on the given path before the GUI is started.
Therefore we need to check if the logo image is present and symlink
a replacement image to the logo path if the logo image is missing.

By default an Anaconda Fedora header image will be used that looks
quite OK, but might not be always present (comes from the fedora-logos package).
So there is a fallback to a GTK icon, which should be always available as we use
GTK icons for Anaconda UI elements.

Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 anaconda | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/anaconda b/anaconda
index 7e84cf5..42ac732 100755
--- a/anaconda
+++ b/anaconda
@@ -142,6 +142,27 @@ def doStartupX11Actions():
 
     global wm_pid # pid of the anaconda fork where the window manager is running
 
+    # make sure there is a logo image present,
+    # otherwise TTY1 will get spammed by errors
+    import os
+    replacement_image_path = None
+    logo_path = "/usr/share/anaconda/pixmaps/logo.png"
+    header_path = "/usr/share/anaconda/pixmaps/anaconda_header.png"
+    sad_smiley_path = "/usr/share/icons/gnome/48x48/emotes/face-crying.png"
+    if not os.path.exists(logo_path):
+        # first try to replace the missing logo with the Anaconda header image
+        if os.path.exists(header_path):
+            replacement_image_path = header_path
+        # if the header image is not present, use a sad smiley from GTK icons
+        elif os.path.exists(sad_smiley_path):
+            replacement_image_path = sad_smiley_path
+
+        if replacement_image_path:
+            log.warning("logo image is missing, using a substitute")
+            os.symlink(replacement_image_path, logo_path)
+        else:
+            log.warning("logo image is missing")
+
     # now start up the window manager
     wm_pid = startMetacityWM()
     log.info("Starting window manager, pid %s.", wm_pid)
-- 
1.8.5.3



More information about the anaconda-patches mailing list