[Fedora-livecd-list] imgcreate/kickstart.py

Brian C. Lane bcl at fedoraproject.org
Mon Jun 17 19:33:19 UTC 2013


 imgcreate/kickstart.py |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit f674482986d701ddc21120fa8f9b0249095cdeec
Author: Brian C. Lane <bcl at redhat.com>
Date:   Mon Jun 17 10:29:11 2013 -0700

    Write vconsole.conf directly
    
    System Config Kickstart has been updated to use localed. This causes
    problems when livecd-creator is used inside a mock (as it is with koji)
    so we need a simpler way to setup the keyboard.
    
    This writes the keyboard value directly to vconsole.conf without any
    attempt to parse or verify it. If it is not included it defaults to us.
    
    It also sets the font to latarcyrheb-sun16 which is the same thing that
    Anaconda does.

diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 1d01ba5..20f2df6 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -138,10 +138,21 @@ class LanguageConfig(KickstartConfig):
 class KeyboardConfig(KickstartConfig):
     """A class to apply a kickstart keyboard configuration to a system."""
     def apply(self, kskeyboard):
-        k = keyboard.Keyboard()
-        if kskeyboard.keyboard:
-            k.set(kskeyboard.keyboard)
-        k.write(self.instroot)
+        vcconf_file = self.path("/etc/vconsole.conf")
+        DEFAULT_VC_FONT = "latarcyrheb-sun16"
+
+        if not kskeyboard.keyboard:
+            kskeyboard.keyboard = "us"
+
+        try:
+            with open(vcconf_file, "w") as f:
+                f.write('KEYMAP="%s"\n' % kskeyboard.keyboard)
+
+                # systemd now defaults to a font that cannot display non-ascii
+                # characters, so we have to tell it to use a better one
+                f.write('FONT="%s"\n' % DEFAULT_VC_FONT)
+        except IOError as e:
+            logging.error("Cannot write vconsole configuration file: %s" % e)
 
 class TimezoneConfig(KickstartConfig):
     """A class to apply a kickstart timezone configuration to a system."""




More information about the livecd mailing list