Process layout replaceable

This commit is contained in:
Pierre Labastie 2019-08-31 12:47:22 +00:00
parent 0a0b60984c
commit 30732c6a16
3 changed files with 19 additions and 1 deletions

View file

@ -31,6 +31,7 @@ declare -a TARGET
declare DEP_LEVEL declare DEP_LEVEL
declare SUDO declare SUDO
declare LANGUAGE declare LANGUAGE
declare KBLAYOUT
declare WRAP_INSTALL declare WRAP_INSTALL
declare DEL_LA_FILES declare DEL_LA_FILES
declare STATS declare STATS
@ -56,6 +57,7 @@ parse_configuration() { #
DEL_LA_FILES=* | \ DEL_LA_FILES=* | \
STATS=* | \ STATS=* | \
LANGUAGE=* | \ LANGUAGE=* | \
KBLAYOUT=* | \
SUDO=* ) eval ${REPLY} # Define/set a global variable.. SUDO=* ) eval ${REPLY} # Define/set a global variable..
continue ;; continue ;;
esac esac
@ -83,7 +85,7 @@ parse_configuration() { #
validate_configuration() { # validate_configuration() { #
#--------------------------# #--------------------------#
local -r dotSTR=".................." local -r dotSTR=".................."
local -r PARAM_LIST="DEP_LEVEL SUDO LANGUAGE MAIL_SERVER WRAP_INSTALL DEL_LA_FILES STATS" local -r PARAM_LIST="DEP_LEVEL SUDO LANGUAGE KBLAYOUT MAIL_SERVER WRAP_INSTALL DEL_LA_FILES STATS"
local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
local config_param local config_param
local -i index local -i index
@ -216,6 +218,7 @@ xsltproc --xinclude --nonet \
--stringparam del-la-files "$DEL_LA_FILES" \ --stringparam del-la-files "$DEL_LA_FILES" \
--stringparam list-stat "$LIST_STAT" \ --stringparam list-stat "$LIST_STAT" \
--stringparam language "$LANGUAGE" \ --stringparam language "$LANGUAGE" \
--stringparam xkblayout "$KBLAYOUT" \
--stringparam fqdn "$(hostname -f)" \ --stringparam fqdn "$(hostname -f)" \
-o ./scripts/ ${MakeScripts} \ -o ./scripts/ ${MakeScripts} \
${BookXml} ${BookXml}

View file

@ -62,6 +62,13 @@ config LANGUAGE
Because of the book layout, the 3 fields, ll, CC and charmap are Because of the book layout, the 3 fields, ll, CC and charmap are
mandatory. The @modfier is honoured if present. mandatory. The @modfier is honoured if present.
config KBLAYOUT
string "Keyboard layout (to be used in GDM)"
default "us"
help
Used in GDM for setting the login screen keyboard layout.
See the GDM page in the book for what to put into this field
config SUDO config SUDO
bool "Build as User" bool "Build as User"
default y default y

View file

@ -53,6 +53,10 @@
'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<!-- end of host/domain name variables --> <!-- end of host/domain name variables -->
<!--===================================================================-->
<!-- keyboard layout for the gdm page (as of BLFS 9.0) -->
<xsl:param name="xkblayout" select="'us'"/>
<!--===================================================================--> <!--===================================================================-->
<!-- the main template: to be adjusted depending on the book --> <!-- the main template: to be adjusted depending on the book -->
<xsl:template match="replaceable"> <xsl:template match="replaceable">
@ -85,6 +89,10 @@
<xsl:when test="contains(string(),'@modifier')"> <xsl:when test="contains(string(),'@modifier')">
<xsl:copy-of select="$lang-modifier"/> <xsl:copy-of select="$lang-modifier"/>
</xsl:when> </xsl:when>
<!-- keyboard layout for X/waylang (only GDM as of BLFS-9.0) -->
<xsl:when test="contains(string(),'layout')">
<xsl:copy-of select="$xkblayout"/>
</xsl:when>
<!-- At several places, the number of jobs is given as "N" in a replaceable <!-- At several places, the number of jobs is given as "N" in a replaceable
tag. We either detect "N" alone or &lt;N&gt; Replace N with 4. --> tag. We either detect "N" alone or &lt;N&gt; Replace N with 4. -->
<xsl:when test="contains(string(),'&lt;N&gt;') or string()='N'"> <xsl:when test="contains(string(),'&lt;N&gt;') or string()='N'">