Generate console files:

- add variables LOCAL (y is hw clock set to local time) and LOG_LEVEL (sysv)
- generate /etc/sysconfig/console (sysv) or /etc/vconsole.conf (systemd)
- generate /etc/adjtime (only systemd)
- remove UNICODE and FONTMAP variables (jhalfs makes unicode default)
This commit is contained in:
Pierre Labastie 2019-03-09 08:11:37 +00:00
parent 90f5b6de2e
commit 3b43e17bda
5 changed files with 136 additions and 7 deletions

View file

@ -1050,15 +1050,27 @@ menu "System configuration"
config FONT
string "Console font"
default "lat0-16"
config FONTMAP
string "Font map (-m option to setfont)"
default "8859-1"
config UNICODE
bool "Unicode mode"
default y
help
Unicode mode is set by default. Setting FONT_MAP, FONT_UNIMAP,
etc, must be done manually.
config KEYMAP
string "Keymap name"
default "us"
config LOCAL
boolean "Hardware clock is set to local time"
default n
help
If the harware clock is set to local time, answer yes,
If it is set to UTC, answer no
config LOG_LEVEL
string "Default log level (1-8)"
default "4"
depends BOOK_LFS
help
This can be changed using dmesg. 1 means "no message",
8 shows every message sent by the kernel, which is very
noisy. The default at boot time is 7, which is quite
noisy too.
endmenu # Console configuration
endmenu #--- System configuration

View file

@ -76,6 +76,14 @@
<xsl:param name='nameserver1' select='"10.0.2.3"'/>
<xsl:param name='nameserver2' select='"8.8.8.8"'/>
<!-- Console parameters: font, fontmap, unicode (y/n), keymap, local (y:
hardware clock set to local time/n:hardware clock set to UTC)
and log-level -->
<xsl:param name='font' select="'lat0-16'"/>
<xsl:param name='keymap' select="'us'"/>
<xsl:param name='local' select="'n'"/>
<xsl:param name='log-level' select="'4'"/>
<!-- End parameters -->
<xsl:template match="/">
@ -613,6 +621,27 @@ unset OLD_PKGDIR
<xsl:with-param name="netstring" select="string()"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(string(),'0.0 0 0.0')">
<xsl:copy-of select="substring-before(string(),'LOCAL')"/>
<xsl:if test="$local='y'"><xsl:text>LOCAL</xsl:text></xsl:if>
<xsl:if test="$local='n'"><xsl:text>UTC</xsl:text></xsl:if>
</xsl:when>
<xsl:when test="contains(string(),'UTC=1')">
<xsl:copy-of select="substring-before(string(),'1')"/>
<xsl:if test="$local='y'"><xsl:text>0</xsl:text></xsl:if>
<xsl:if test="$local='n'"><xsl:text>1</xsl:text></xsl:if>
<xsl:copy-of select="substring-after(string(),'1')"/>
</xsl:when>
<xsl:when test="contains(string(),'bg_bds-')">
<xsl:call-template name="outputsysvconsole">
<xsl:with-param name="consolestring" select="string()"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(string(),'de-latin1')">
<xsl:call-template name="outputsysdconsole">
<xsl:with-param name="consolestring" select="string()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
@ -780,6 +809,87 @@ DNS=</xsl:text>
</xsl:choose>
</xsl:template>
<xsl:template name="outputsysvconsole">
<!-- We suppose that book example has the following values:
- KEYMAP: bg_bds-utf8
- FONT: LatArCyrHeb-16
Change below if book changes -->
<xsl:param name="consolestring" select="''"/>
<xsl:choose>
<xsl:when test="contains($consolestring,'bg_bds-utf8')">
<xsl:call-template name="outputsysvconsole">
<xsl:with-param
name="consolestring"
select="substring-before($consolestring,'bg_bds-utf8')"/>
</xsl:call-template>
<xsl:value-of select="$keymap"/>
<xsl:call-template name="outputsysvconsole">
<xsl:with-param
name="consolestring"
select="substring-after($consolestring,'bg_bds-utf8')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($consolestring,'LatArCyrHeb-16')">
<xsl:call-template name="outputsysvconsole">
<xsl:with-param
name="consolestring"
select="substring-before($consolestring,'LatArCyrHeb-16')"/>
</xsl:call-template>
<xsl:value-of select="$font"/>
<xsl:text>"
LOG_LEVEL="</xsl:text>
<xsl:copy-of select="$log-level"/>
<xsl:call-template name="outputsysvconsole">
<xsl:with-param
name="consolestring"
select="substring-after($consolestring,'LatArCyrHeb-16')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$consolestring"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="outputsysdconsole">
<!-- We suppose that book example has the following values:
- KEYMAP: de-latin1
- FONT: Lat2-Terminus16
Change below if book changes -->
<xsl:param name="consolestring" select="''"/>
<xsl:choose>
<xsl:when test="contains($consolestring,'de-latin1')">
<xsl:call-template name="outputsysdconsole">
<xsl:with-param
name="consolestring"
select="substring-before($consolestring,'de-latin1')"/>
</xsl:call-template>
<xsl:value-of select="$keymap"/>
<xsl:call-template name="outputsysdconsole">
<xsl:with-param
name="consolestring"
select="substring-after($consolestring,'de-latin1')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($consolestring,'Lat2-Terminus16')">
<xsl:call-template name="outputsysdconsole">
<xsl:with-param
name="consolestring"
select="substring-before($consolestring,'Lat2-Terminus16')"/>
</xsl:call-template>
<xsl:value-of select="$font"/>
<xsl:call-template name="outputsysdconsole">
<xsl:with-param
name="consolestring"
select="substring-after($consolestring,'Lat2-Terminus16')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$consolestring"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="outputpkgdest">
<xsl:param name="outputstring" select="foo"/>
<xsl:choose>

View file

@ -187,6 +187,12 @@ extract_commands() { #
--stringparam domain "$DOMAIN" \
--stringparam nameserver1 "$DNS1" \
--stringparam nameserver2 "$DNS2" \
--stringparam font "$FONT" \
--stringparam fontmap "$FONTMAP" \
--stringparam unicode "$UNICODE" \
--stringparam keymap "$KEYMAP" \
--stringparam local "$LOCAL" \
--stringparam log-level "$LOG_LEVEL" \
--output ./${PROGNAME}-commands/ \
$XSL \
$BOOK/index.xml >> $LOGDIR/$LOG 2>&1

View file

@ -48,7 +48,7 @@ inline_doc
local -r CLFS3_build=" $BUILD_common"
# System Settings by book (only LFS for now)
local -r LFS_system="HOSTNAME INTERFACE IP_ADDR GATEWAY PREFIX BROADCAST DOMAIN DNS1 DNS2 FONT CONSOLE_MAP UNICODE KEYMAP"
local -r LFS_system="HOSTNAME INTERFACE IP_ADDR GATEWAY PREFIX BROADCAST DOMAIN DNS1 DNS2 FONT KEYMAP LOCAL LOG_LEVEL"
# Full list of books settings
local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot REALSBU $ADVANCED_common"

1
jhalfs
View file

@ -146,6 +146,7 @@ SET_WARNINGS=${SET_WARNINGS:=n}
SET_MISC=${SET_MISC:=n}
SET_BLOWFISH=${SET_BLOWFISH:=n}
UNICODE=${UNICODE:=n}
LOCAL=${LOCAL:=n}
REALSBU=${REALSBU:=n}
if [[ "${NO_PROGRESS_BAR}" = "y" ]] ; then