[virt-tools-list] [libosinfo 2/2] fedora, installer: Set keyboard config for >= F18

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Fri Nov 30 01:00:48 UTC 2012


From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>

Now that we have established what kind of string to expect in
'l10n-keyboard' config, lets correctly set this for F18 and higher.

For F17 and older, we hardcode the layout to 'us'. Those require layout
to be a console layout so we'll need some complicated XSL magic to
translate from X to console layout if we want to properly support those.
---
 data/install-scripts/fedora.xml | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/data/install-scripts/fedora.xml b/data/install-scripts/fedora.xml
index e76f5dd..2d1c961 100644
--- a/data/install-scripts/fedora.xml
+++ b/data/install-scripts/fedora.xml
@@ -59,11 +59,24 @@
 	  </xsl:choose>
 	</xsl:template>
 
+	<xsl:template name="keyboard">
+	  <xsl:choose>
+	    <xsl:when test="os/version > 17">
+              <xsl:value-of select="config/l10n-keyboard"/>
+	    </xsl:when>
+	    <xsl:otherwise>
+              <!-- F17 and older required keyboard layout to be a console layout so we'll need some complicated
+                   code to translate from X to console layout if we want to properly support those. -->
+	      <xsl:text>us</xsl:text>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:template>
+
         <xsl:template match="/install-script-config">
 # Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/>
 install
 text
-keyboard <xsl:value-of select="config/l10n-keyboard"/>
+keyboard '<xsl:call-template name="keyboard"/>'
 lang <xsl:value-of select="config/l10n-language"/>
 <xsl:if test="os/version < 7">
 langsupport --default <xsl:value-of select="config/l10n-language"/> <xsl:value-of select="config/l10n-language"/>
@@ -181,10 +194,23 @@ reboot
 	  </xsl:choose>
 	</xsl:template>
 
+	<xsl:template name="keyboard">
+	  <xsl:choose>
+	    <xsl:when test="os/version > 17">
+              <xsl:value-of select="config/l10n-keyboard"/>
+	    </xsl:when>
+	    <xsl:otherwise>
+              <!-- F17 and older required keyboard layout to be a console layout so we'll need some complicated
+                   code to translate from X to console layout if we want to properly support those. -->
+	      <xsl:text>us</xsl:text>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:template>
+
         <xsl:template match="/install-script-config">
 # Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/>
 install
-keyboard <xsl:value-of select="config/l10n-keyboard"/>
+keyboard '<xsl:call-template name="keyboard"/>'
 lang <xsl:value-of select="config/l10n-language"/>
 network --onboot yes --device eth0 --bootproto dhcp --noipv6 --hostname=<xsl:value-of select="config/hostname"/> --activate
 rootpw dummyPa55w0rd # Actual password set (or unset) in %post below
-- 
1.8.0




More information about the virt-tools-list mailing list