2012-02-02 00:29:37 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-11-16 19:16:52 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- $Id$ -->
|
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:stylesheet
|
|
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
xmlns:exsl="http://exslt.org/common"
|
|
|
|
extension-element-prefixes="exsl"
|
|
|
|
version="1.0">
|
2005-09-25 18:56:00 +02:00
|
|
|
|
2017-04-09 12:29:32 +02:00
|
|
|
<!-- Parameters -->
|
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- use package management ?
|
|
|
|
n = no, original behavior
|
|
|
|
y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
|
|
|
-->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:param name="pkgmngt" select="'n'"/>
|
|
|
|
|
|
|
|
<!-- Package management with "porg style" ?
|
|
|
|
n = no, same as pkgmngt description above
|
|
|
|
y = yes, wrap install commands of chapter06-08 into a bash function.
|
|
|
|
note that pkgmngt must be 'y' in this case
|
|
|
|
-->
|
|
|
|
<xsl:param name="wrap-install" select='"n"'/>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2006-03-10 19:55:30 +01:00
|
|
|
<!-- Run test suites?
|
|
|
|
0 = none
|
2017-04-09 12:29:32 +02:00
|
|
|
1 = only chapter06 critical testsuites
|
2006-03-10 19:55:30 +01:00
|
|
|
2 = all chapter06 testsuites
|
2006-08-05 16:51:11 +02:00
|
|
|
3 = all chapter05 and chapter06 testsuites
|
|
|
|
-->
|
2006-03-10 19:55:30 +01:00
|
|
|
<xsl:param name="testsuite" select="1"/>
|
2005-10-07 21:13:20 +02:00
|
|
|
|
2006-08-05 16:51:11 +02:00
|
|
|
<!-- Bomb on test suites failures?
|
2006-08-16 19:42:54 +02:00
|
|
|
n = no, I want to build the full system and review the logs
|
|
|
|
y = yes, bomb at the first test suite failure to can review the build dir
|
2006-08-05 16:51:11 +02:00
|
|
|
-->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:param name="bomb-testsuite" select="'n'"/>
|
2006-08-05 16:51:11 +02:00
|
|
|
|
2019-09-05 19:22:04 +02:00
|
|
|
<!-- Install non wide character ncurses 5? -->
|
|
|
|
<xsl:param name="ncurses5" select="'n'"/>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2018-01-12 20:04:19 +01:00
|
|
|
<!-- Should we strip excutables and libraries? -->
|
|
|
|
<xsl:param name='strip' select="'n'"/>
|
|
|
|
|
|
|
|
<!-- Should we remove .la files after chapter 5 and chapter 6? -->
|
|
|
|
<xsl:param name='del-la-files' select="'y'"/>
|
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- Time zone -->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:param name="timezone" select="'GMT'"/>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- Page size -->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:param name="page" select="'letter'"/>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- Locale settings -->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:param name="lang" select="'C'"/>
|
2012-02-10 10:43:23 +01:00
|
|
|
|
|
|
|
<!-- Install the whole set of locales -->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:param name='full-locale' select='"n"'/>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2017-04-09 12:29:32 +02:00
|
|
|
<!-- Hostname -->
|
|
|
|
<xsl:param name='hostname' select='"HOSTNAME"'/>
|
|
|
|
|
|
|
|
<!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
|
|
|
|
and nameservers -->
|
|
|
|
<xsl:param name='interface' select="'eth0'"/>
|
|
|
|
<xsl:param name='ip' select='"10.0.2.9"'/>
|
|
|
|
<xsl:param name='gateway' select='"10.0.2.2"'/>
|
|
|
|
<xsl:param name='prefix' select='24'/>
|
|
|
|
<xsl:param name='broadcast' select='"10.0.2.255"'/>
|
|
|
|
<xsl:param name='domain' select='"lfs.org"'/>
|
|
|
|
<xsl:param name='nameserver1' select='"10.0.2.3"'/>
|
|
|
|
<xsl:param name='nameserver2' select='"8.8.8.8"'/>
|
|
|
|
|
2019-03-09 09:11:37 +01:00
|
|
|
<!-- 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'"/>
|
|
|
|
|
2019-04-11 09:40:50 +02:00
|
|
|
<!-- The scripts root is needed for printing disk usage -->
|
|
|
|
<xsl:param name='script-root' select="'jhalfs'"/>
|
|
|
|
|
2017-04-09 12:29:32 +02:00
|
|
|
<!-- End parameters -->
|
|
|
|
|
2020-03-29 17:13:15 +02:00
|
|
|
<!-- bashdir is used at the beginning of chapter 6, for the #! line.
|
|
|
|
If we created a /tools directory in chapter 4, bash is in /tools/bin,
|
|
|
|
otherwise it is in /bin.-->
|
|
|
|
<xsl:variable name="bashdir">
|
|
|
|
<xsl:choose>
|
2020-03-29 22:35:52 +02:00
|
|
|
<xsl:when test="//sect1[@id='ch-preps-creatingtoolsdir']">
|
2020-03-29 17:13:15 +02:00
|
|
|
<xsl:text>/tools</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text></xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:variable>
|
2020-06-09 09:28:05 +02:00
|
|
|
|
|
|
|
<!-- Start of templates -->
|
2005-09-25 18:56:00 +02:00
|
|
|
<xsl:template match="/">
|
2020-06-09 09:28:05 +02:00
|
|
|
<xsl:apply-templates select="//chapter[
|
|
|
|
@id='chapter-final-preps' or
|
|
|
|
@id='chapter-cross-tools' or
|
|
|
|
@id='chapter-temporary-tools' or
|
|
|
|
@id='chapter-chroot-temporary-tools' or
|
|
|
|
@id='chapter-building-system' or
|
|
|
|
@id='chapter-config' or
|
|
|
|
@id='chapter-bootscripts' or
|
|
|
|
@id='chapter-bootable']"/>
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:template>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2020-06-09 09:28:05 +02:00
|
|
|
<xsl:template match="chapter">
|
|
|
|
<xsl:apply-templates select="./sect1[
|
2020-06-20 19:16:22 +02:00
|
|
|
.//screen[not(@role) or @role != 'nodump']/
|
2020-06-09 09:28:05 +02:00
|
|
|
userinput[not(starts-with(string(),'chroot'))]]">
|
|
|
|
<xsl:with-param name="chap-num" select="position()+3"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
<!-- The last condition is a hack to allow old versions of the
|
2014-01-12 22:40:20 +01:00
|
|
|
book where the chroot commands did not have role="nodump".
|
|
|
|
It only works if the chroot command is the only one on the page -->
|
2020-06-09 09:28:05 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="sect1">
|
|
|
|
<xsl:param name="chap-num" select="'1'"/>
|
|
|
|
<!-- The dirs names -->
|
|
|
|
<xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
|
|
|
<xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
|
|
|
<xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
|
|
|
<xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- The file names -->
|
|
|
|
<xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
|
|
|
<xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
|
|
|
<xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
|
|
|
<!-- The build order -->
|
|
|
|
<xsl:variable name="position" select="position()"/>
|
|
|
|
<xsl:variable name="order">
|
2020-06-09 09:28:05 +02:00
|
|
|
<xsl:value-of select="$chap-num"/>
|
|
|
|
<xsl:if test="string-length($position) = 1">
|
|
|
|
<xsl:text>0</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="$position"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:variable>
|
|
|
|
<!-- Creating dirs and files -->
|
|
|
|
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
2020-03-29 17:13:15 +02:00
|
|
|
<xsl:text>#!</xsl:text>
|
|
|
|
<xsl:if test="@id='ch-system-creatingdirs' or
|
|
|
|
@id='ch-system-createfiles' or
|
|
|
|
@id='ch-system-strippingagain'">
|
|
|
|
<xsl:copy-of select="$bashdir"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>/bin/bash
set +h
</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:if test="not(@id='ch-tools-stripping') and
|
|
|
|
not(@id='ch-system-strippingagain')">
|
|
|
|
<xsl:text>set -e
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
2020-03-29 15:17:38 +02:00
|
|
|
<xsl:if test="ancestor::chapter/@id != 'chapter-final-preps'">
|
|
|
|
<xsl:call-template name="start-script">
|
|
|
|
<xsl:with-param name="order" select="$order"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:if>
|
2020-06-20 19:16:22 +02:00
|
|
|
<xsl:apply-templates
|
|
|
|
select="sect2 |
|
|
|
|
screen[not(@role) or @role!='nodump']/userinput"/>
|
2020-06-24 08:26:05 +02:00
|
|
|
<xsl:if test="contains(@id,'creatingdirs') and $pkgmngt='y'">
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:apply-templates
|
|
|
|
select="document('packageManager.xml')//sect1[
|
|
|
|
@id='ch-pkgmngt-creatingdirs'
|
2014-11-29 21:43:35 +01:00
|
|
|
]//userinput"
|
|
|
|
mode="pkgmngt"/>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
2020-07-07 17:27:54 +02:00
|
|
|
<xsl:if test="contains(@id,'createfiles') and $pkgmngt='y'">
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:apply-templates
|
|
|
|
select="document('packageManager.xml')//sect1[
|
|
|
|
@id='ch-pkgmngt-createfiles'
|
2014-11-29 21:43:35 +01:00
|
|
|
]//userinput"
|
|
|
|
mode="pkgmngt"/>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
2020-03-29 15:17:38 +02:00
|
|
|
<xsl:if test="ancestor::chapter/@id != 'chapter-final-preps'">
|
|
|
|
<xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
|
|
|
<xsl:call-template name="end-script"/>
|
|
|
|
</xsl:if>
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:text>exit
</xsl:text>
|
|
|
|
</exsl:document>
|
2020-06-24 08:26:05 +02:00
|
|
|
<!-- Inclusion of package manager scriptlets -->
|
|
|
|
<xsl:if test="$pkgmngt='y' and
|
|
|
|
following-sibling::sect1[1][@id='ch-tools-stripping']">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$bashdir='/tools'">
|
|
|
|
<xsl:apply-templates
|
|
|
|
select="document('packageManager.xml')//sect1[
|
|
|
|
contains(@id,'ch-tools')]"
|
|
|
|
mode="pkgmngt">
|
|
|
|
<xsl:with-param name="order" select="$order+1"/>
|
|
|
|
<xsl:with-param name="dirname" select="$dirname"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates
|
|
|
|
select="document('packageManager.xml')//sect1[
|
|
|
|
contains(@id,'ch-chroot')]"
|
|
|
|
mode="pkgmngt">
|
|
|
|
<xsl:with-param name="order" select="$order+1"/>
|
|
|
|
<xsl:with-param name="dirname" select="$dirname"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="$pkgmngt='y' and
|
|
|
|
following-sibling::sect1[2][@id='ch-system-strippingagain']">
|
|
|
|
<xsl:apply-templates
|
|
|
|
select="document('packageManager.xml')//sect1[
|
|
|
|
contains(@id,'ch-system')]"
|
|
|
|
mode="pkgmngt">
|
|
|
|
<xsl:with-param name="order" select="$order+1"/>
|
|
|
|
<xsl:with-param name="dirname" select="$dirname"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:if>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="sect2">
|
|
|
|
<xsl:apply-templates
|
2020-06-20 19:16:22 +02:00
|
|
|
select=".//screen[not(@role) or @role != 'nodump']/userinput[
|
2013-03-02 15:10:45 +01:00
|
|
|
@remap = 'pre' or
|
|
|
|
@remap = 'configure' or
|
|
|
|
@remap = 'make' or
|
|
|
|
@remap = 'test' and
|
2015-02-07 22:43:13 +01:00
|
|
|
not(current()/../@id='ch-tools-dejagnu') and
|
|
|
|
not(current()/../@id='ch-system-systemd')]"/>
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:if
|
2020-06-24 08:26:05 +02:00
|
|
|
test="ancestor::chapter[@id = 'chapter-building-system' or
|
|
|
|
@id = 'chapter-config' or
|
2020-07-06 07:51:22 +02:00
|
|
|
@id = 'chapter-bootscripts' or
|
2020-06-24 08:26:05 +02:00
|
|
|
@id = 'chapter-bootable'] and
|
2013-03-02 15:10:45 +01:00
|
|
|
$pkgmngt = 'y' and
|
|
|
|
descendant::screen[not(@role) or
|
|
|
|
@role != 'nodump']/userinput[
|
|
|
|
@remap='install']">
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$wrap-install='y'">
|
|
|
|
<xsl:text>wrapInstall '
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2019-04-08 12:03:26 +02:00
|
|
|
<!-- We cannot know which directory(ies) are needed by the package. Create a
|
|
|
|
reasonable bunch of them. Should be close to "Creating Directories".-->
|
|
|
|
<xsl:text>mkdir -pv $PKG_DEST/{bin,boot,etc,lib,sbin}
|
|
|
|
mkdir -pv $PKG_DEST/usr/{bin,include,lib/pkgconfig,sbin}
|
2019-04-11 09:40:50 +02:00
|
|
|
mkdir -pv $PKG_DEST/usr/share/{doc,info,bash-completion/completions}
|
2012-02-02 00:29:37 +01:00
|
|
|
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
|
|
|
case $(uname -m) in
|
2019-04-08 12:03:26 +02:00
|
|
|
x86_64) mkdir -v $PKG_DEST/lib64 ;;
|
2012-02-02 00:29:37 +01:00
|
|
|
esac
|
|
|
|
</xsl:text>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates
|
2020-06-20 19:16:22 +02:00
|
|
|
select=".//screen[not(@role) or @role != 'nodump']/
|
|
|
|
userinput[@remap = 'install']"/>
|
2020-06-24 08:26:05 +02:00
|
|
|
<xsl:if test="ancestor::chapter[@id = 'chapter-building-system' or
|
|
|
|
@id = 'chapter-config' or
|
2020-07-06 07:51:22 +02:00
|
|
|
@id = 'chapter-bootscripts' or
|
2020-06-24 08:26:05 +02:00
|
|
|
@id = 'chapter-bootable'] and
|
2013-03-02 15:10:45 +01:00
|
|
|
descendant::screen[not(@role) or
|
|
|
|
@role != 'nodump']/userinput[
|
|
|
|
@remap='install']">
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:choose>
|
2018-01-12 20:04:19 +01:00
|
|
|
<xsl:when test="$pkgmngt='n'"/>
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:when test="$wrap-install='y'">
|
|
|
|
<xsl:if test="../@id = 'ch-system-man-pages'">
|
2013-03-13 17:43:37 +01:00
|
|
|
<!-- these files are provided by the shadow package -->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- nologin is installed by util-linux. remove it from shadow -->
|
|
|
|
<xsl:if test="../@id = 'ch-system-shadow'">
|
|
|
|
<xsl:text>rm -fv /usr/share/man/man8/nologin.8
|
|
|
|
rm -fv /sbin/nologin
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>'
|
2017-07-04 14:19:46 +02:00
|
|
|
PREV_SEC=${SECONDS}
|
2017-04-09 12:29:32 +02:00
|
|
|
packInstall
|
2017-07-04 14:19:46 +02:00
|
|
|
SECONDS=${PREV_SEC}
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:if test="../@id = 'ch-system-man-pages'">
|
|
|
|
<!-- these files are provided by the shadow package -->
|
|
|
|
<xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
2014-11-29 22:17:49 +01:00
|
|
|
</xsl:text>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:if>
|
2014-11-29 22:17:49 +01:00
|
|
|
<!-- nologin is installed by util-linux. remove it from shadow -->
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:if test="../@id = 'ch-system-shadow'">
|
|
|
|
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
2014-11-29 22:17:49 +01:00
|
|
|
rm -fv $PKG_DEST/sbin/nologin
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:text>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:if>
|
2019-04-08 12:03:26 +02:00
|
|
|
<!-- remove empty directories -->
|
|
|
|
<xsl:text>for dir in $PKG_DEST/usr/share/man/man{1..8} \
|
2019-04-11 09:40:50 +02:00
|
|
|
$PKG_DEST/usr/share/bash-completion{/completions,} \
|
|
|
|
$PKG_DEST/usr/share/{doc,info,man,} \
|
2019-04-08 12:03:26 +02:00
|
|
|
$PKG_DEST/usr/lib/pkgconfig \
|
|
|
|
$PKG_DEST/usr/{lib,bin,sbin,include} \
|
|
|
|
$PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
|
|
|
[ -d "$dir" ] && [ -z "$(ls $dir)" ] && rmdir -v $dir
|
2012-02-02 00:29:37 +01:00
|
|
|
done
|
2019-04-08 12:03:26 +02:00
|
|
|
[ -d $PKG_DEST/lib64 ] && [ -z "$(ls $PKG_DEST/lib64)" ] &&
|
|
|
|
rmdir -v $PKG_DEST/lib64
|
2020-07-09 19:02:10 +02:00
|
|
|
<!-- prevent overwriting symlinks: if a package install something in
|
|
|
|
these directories, it'll be lost if not using package management,
|
|
|
|
since they are symlinks to tmpfs. So, remove it too if using PM. -->
|
|
|
|
rm -rf $PKG_DEST/var/{run,lock}
|
|
|
|
<!-- Remove /var if it is empty, then -->
|
|
|
|
[ -d $PKG_DEST/var ] && [ -z "$(ls $PKG_DEST/var)" ] && rmdir -v $PKG_DEST/var
|
2017-07-04 14:19:46 +02:00
|
|
|
PREV_SEC=${SECONDS}
|
2012-02-02 00:29:37 +01:00
|
|
|
packInstall
|
2017-07-04 14:19:46 +02:00
|
|
|
SECONDS=${PREV_SEC}
|
2012-02-02 00:29:37 +01:00
|
|
|
rm -rf $PKG_DEST
|
|
|
|
</xsl:text>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="$testsuite='3' and
|
|
|
|
../@id='ch-tools-glibc' and
|
|
|
|
@role='installation'">
|
|
|
|
<xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$full-locale='y'">
|
|
|
|
<xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
<xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
|
|
|
<xsl:text>if LOCALE=`grep "</xsl:text>
|
|
|
|
<xsl:value-of select="$lang"/>
|
|
|
|
<xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
2012-02-10 10:43:23 +01:00
|
|
|
CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
|
|
|
INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
|
|
|
LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
|
|
|
localedef -i $INPUT -f $CHARMAP $LOCALE
|
|
|
|
fi
|
|
|
|
</xsl:text>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2005-09-27 20:08:05 +02:00
|
|
|
</xsl:if>
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:apply-templates
|
2020-06-20 19:16:22 +02:00
|
|
|
select=".//screen[not(@role) or @role != 'nodump']/userinput[
|
2015-02-07 22:43:13 +01:00
|
|
|
not(@remap) or
|
|
|
|
@remap='adjust' or
|
|
|
|
@remap='test' and current()/../@id='ch-tools-dejagnu' or
|
|
|
|
@remap='test' and current()/../@id='ch-system-systemd'
|
2020-06-20 19:16:22 +02:00
|
|
|
]"/>
|
2019-09-05 19:22:04 +02:00
|
|
|
<xsl:if test="../@id='ch-system-ncurses' and $ncurses5='y'">
|
|
|
|
<xsl:apply-templates select=".//screen[@role='nodump']"/>
|
|
|
|
</xsl:if>
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:template match="sect1" mode="pkgmngt">
|
2019-04-11 09:40:50 +02:00
|
|
|
<xsl:param name="dirname" select="'chapter05'"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- The build order -->
|
2019-04-11 09:40:50 +02:00
|
|
|
<xsl:param name="order" select="'062'"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- The file names -->
|
|
|
|
<xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
|
|
|
<xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
|
|
|
<xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
2020-07-06 07:38:54 +02:00
|
|
|
<xsl:variable name="pos">
|
|
|
|
<xsl:if test="string-length(position()) = 1">
|
|
|
|
<xsl:text>0</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="position()"/>
|
|
|
|
</xsl:variable>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- Creating dirs and files -->
|
2013-05-21 22:20:24 +02:00
|
|
|
<xsl:if test="count(descendant::screen/userinput) > 0 and
|
|
|
|
count(descendant::screen/userinput) >
|
|
|
|
count(descendant::screen[@role='nodump'])">
|
2020-07-06 07:38:54 +02:00
|
|
|
<exsl:document href="{$dirname}/{$order}-{$pos}-{$filename}"
|
2013-05-21 22:20:24 +02:00
|
|
|
method="text">
|
|
|
|
<xsl:text>#!/bin/bash
|
2012-02-02 00:29:37 +01:00
|
|
|
set +h
|
|
|
|
set -e
|
|
|
|
</xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
<xsl:call-template name="start-script">
|
2020-07-09 19:04:30 +02:00
|
|
|
<xsl:with-param name="order" select="concat($order,'-',$pos)"/>
|
2019-04-11 09:40:50 +02:00
|
|
|
</xsl:call-template>
|
2013-05-21 22:20:24 +02:00
|
|
|
<xsl:apply-templates
|
|
|
|
select=".//screen[not(@role) or
|
|
|
|
@role != 'nodump']/userinput[@remap != 'adjust']"
|
2012-02-02 00:29:37 +01:00
|
|
|
mode="pkgmngt"/>
|
2020-06-24 08:26:05 +02:00
|
|
|
<xsl:if test="$dirname = 'chapter06' or $dirname = 'chapter08'">
|
2017-07-04 14:19:46 +02:00
|
|
|
<xsl:text>PREV_SEC=${SECONDS}
|
|
|
|
packInstall
|
|
|
|
SECONDS=${PREV_SEC}
|
2017-04-09 12:29:32 +02:00
|
|
|
rm -rf "$PKG_DEST"
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:text>
|
2013-05-21 22:20:24 +02:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates
|
|
|
|
select=".//screen[not(@role) or
|
|
|
|
@role != 'nodump'
|
|
|
|
]/userinput[not(@remap) or
|
|
|
|
@remap='adjust'
|
2012-02-02 00:29:37 +01:00
|
|
|
]"
|
|
|
|
mode="pkgmngt"/>
|
2013-05-21 22:20:24 +02:00
|
|
|
<xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
echo -e "\n\nTotalseconds: $SECONDS\n"
|
2019-04-11 09:40:50 +02:00
|
|
|
</xsl:text>
|
|
|
|
<xsl:call-template name="end-script"/>
|
|
|
|
<xsl:text>exit
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:text>
|
2013-05-21 22:20:24 +02:00
|
|
|
</exsl:document>
|
|
|
|
</xsl:if>
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:template match="userinput" mode="pkgmngt">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:template>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:template match="userinput">
|
2005-10-01 12:26:22 +02:00
|
|
|
<xsl:choose>
|
2005-10-15 17:40:23 +02:00
|
|
|
<!-- Copying the kernel config file -->
|
|
|
|
<xsl:when test="string() = 'make mrproper'">
|
|
|
|
<xsl:text>make mrproper
</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
2008-10-28 14:58:19 +01:00
|
|
|
<xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
|
|
|
</xsl:if>
|
2005-10-08 12:35:21 +02:00
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- test instructions -->
|
2018-01-07 21:20:12 +01:00
|
|
|
<xsl:when test="@remap = 'test'">
|
2018-01-12 10:40:59 +01:00
|
|
|
<xsl:call-template name="comment-test">
|
|
|
|
<xsl:with-param name="instructions" select="string()"/>
|
|
|
|
</xsl:call-template>
|
2007-09-18 23:14:16 +02:00
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- End of test instructions -->
|
2018-01-12 20:04:19 +01:00
|
|
|
<!-- If the instructions contain "strip ", it may mean they contain also .la
|
|
|
|
file removal (and possibly other clean up). We therefore call a template
|
|
|
|
to comment them out appropriately and also to not stop if stripping
|
|
|
|
fails. -->
|
|
|
|
<xsl:when test="contains(string(),'strip ') or
|
|
|
|
contains(string(),'\*.la')">
|
|
|
|
<xsl:call-template name="comment-strip">
|
|
|
|
<xsl:with-param name="instructions" select="string()"/>
|
|
|
|
</xsl:call-template>
|
2005-10-08 16:52:37 +02:00
|
|
|
</xsl:when>
|
2020-07-06 07:51:22 +02:00
|
|
|
<!-- Package management for installation chapters -->
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- Add $PKG_DEST to installation commands -->
|
2020-05-18 10:31:43 +02:00
|
|
|
<!-- Also add -j1 to make install -->
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:when test="@remap='install' and
|
2020-07-06 07:51:22 +02:00
|
|
|
ancestor::chapter[@id='chapter-building-system' or
|
|
|
|
@id = 'chapter-config' or
|
|
|
|
@id = 'chapter-bootscripts' or
|
|
|
|
@id = 'chapter-bootable']">
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$pkgmngt='n'">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(string(),'firmware,udev')">
|
|
|
|
<xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>
fi
</xsl:text>
|
|
|
|
</xsl:when>
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:when test="contains(string(),'make ')">
|
|
|
|
<xsl:copy-of select="substring-before(string(), 'make ')"/>
|
|
|
|
<xsl:text>make -j1 </xsl:text>
|
|
|
|
<xsl:copy-of select="substring-after(string(), 'make ')"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:when test="$wrap-install='y'">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="./literal">
|
|
|
|
<xsl:call-template name="output-wrap">
|
|
|
|
<xsl:with-param name="commands" select="text()[1]"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:apply-templates select="literal"/>
|
|
|
|
<xsl:call-template name="output-wrap">
|
|
|
|
<xsl:with-param name="commands" select="text()[2]"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:call-template name="output-wrap">
|
|
|
|
<xsl:with-param name="commands" select="string()"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'-->
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="./literal">
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
2013-03-13 17:43:37 +01:00
|
|
|
<xsl:with-param name="outputstring" select="text()[1]"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:apply-templates select="literal"/>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
2013-03-13 17:43:37 +01:00
|
|
|
<xsl:with-param name="outputstring" select="text()[2]"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param name="outputstring" select="string()"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2018-02-05 15:56:54 +01:00
|
|
|
<xsl:text>
</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2020-05-18 10:31:43 +02:00
|
|
|
</xsl:when> <!-- @remap='install' and not temporary tools -->
|
2014-12-09 22:01:16 +01:00
|
|
|
<!-- if package management, we should make an independant package for
|
|
|
|
tzdata. -->
|
|
|
|
<xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
|
|
|
<xsl:text>
|
2017-04-09 12:29:32 +02:00
|
|
|
OLD_PKG_DEST="$PKG_DEST"
|
2014-12-09 22:01:16 +01:00
|
|
|
OLD_PKGDIR=$PKGDIR
|
2014-12-21 12:25:47 +01:00
|
|
|
PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
|
2014-12-09 22:01:16 +01:00
|
|
|
PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
|
|
|
<xsl:copy-of select="substring-before(
|
|
|
|
substring-after(string(),'tzdata'),
|
|
|
|
'.tar')"/>
|
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$wrap-install='n'">
|
|
|
|
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
|
|
|
<xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
|
|
|
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
|
|
|
<xsl:text>
|
2017-07-04 14:19:46 +02:00
|
|
|
PREV_SEC=${SECONDS}
|
2014-12-09 22:01:16 +01:00
|
|
|
packInstall
|
2017-07-04 14:19:46 +02:00
|
|
|
SECONDS=${PREV_SEC}
|
2014-12-09 22:01:16 +01:00
|
|
|
rm -rf $PKG_DEST
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise><!-- wrap-install='y' -->
|
|
|
|
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
|
|
|
<xsl:text>
|
|
|
|
wrapInstall '
|
|
|
|
ZONEINFO=</xsl:text>
|
|
|
|
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
|
|
|
<xsl:text>'
|
2017-07-04 14:19:46 +02:00
|
|
|
PREV_SEC=${SECONDS}
|
2017-04-09 12:29:32 +02:00
|
|
|
packInstall
|
2017-07-04 14:19:46 +02:00
|
|
|
SECONDS=${PREV_SEC}
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>
|
2014-12-09 22:01:16 +01:00
|
|
|
PKG_DEST=$OLD_PKG_DEST
|
|
|
|
unset OLD_PKG_DEST
|
|
|
|
PKGDIR=$OLD_PKGDIR
|
|
|
|
unset OLD_PKGDIR
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:when><!-- addition for tzdata + package management -->
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- End addition for package management -->
|
2020-07-06 07:51:22 +02:00
|
|
|
<!-- add -j1 to make install in non final chapters -->
|
|
|
|
<xsl:when test="ancestor::chapter[@id='chapter-temporary-tools' or
|
|
|
|
@id='chapter-chroot-temporary-tools' or
|
|
|
|
@id='chapter-cross-tools'] and
|
2020-05-18 10:31:43 +02:00
|
|
|
@remap='install'">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(string(),'make ')">
|
|
|
|
<xsl:copy-of select="substring-before(string(), 'make ')"/>
|
|
|
|
<xsl:text>make -j1 </xsl:text>
|
|
|
|
<xsl:copy-of select="substring-after(string(), 'make ')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>
</xsl:text>
|
2020-07-06 07:51:22 +02:00
|
|
|
</xsl:when><!-- temp chapters install -->
|
2005-10-15 17:40:23 +02:00
|
|
|
<!-- The rest of commands -->
|
2005-10-08 16:52:37 +02:00
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
2005-10-15 17:40:23 +02:00
|
|
|
<xsl:text>
</xsl:text>
|
2005-10-08 16:52:37 +02:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2005-09-25 18:56:00 +02:00
|
|
|
<xsl:template match="replaceable">
|
2005-10-06 23:09:53 +02:00
|
|
|
<xsl:choose>
|
2005-10-12 12:32:31 +02:00
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
2006-04-06 21:35:22 +02:00
|
|
|
<xsl:value-of select="$timezone"/>
|
2005-10-12 12:32:31 +02:00
|
|
|
</xsl:when>
|
2005-10-06 23:09:53 +02:00
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
2006-04-06 21:35:22 +02:00
|
|
|
<xsl:value-of select="$page"/>
|
2005-10-06 23:09:53 +02:00
|
|
|
</xsl:when>
|
2007-09-21 20:08:16 +02:00
|
|
|
<xsl:when test="contains(string(.),'<ll>_<CC>')">
|
|
|
|
<xsl:value-of select="$lang"/>
|
|
|
|
</xsl:when>
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:when test="contains(string(.),'Domain')">
|
|
|
|
<xsl:value-of select="$domain"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(.),'primary')">
|
|
|
|
<xsl:value-of select="$nameserver1"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(.),'secondary')">
|
|
|
|
<xsl:value-of select="$nameserver2"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(.),'192.168.1.1')">
|
|
|
|
<xsl:value-of select="$ip"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(.),'192.168.0.2')">
|
|
|
|
<xsl:value-of select="$ip"/>
|
|
|
|
</xsl:when>
|
2019-03-10 10:15:10 +01:00
|
|
|
<xsl:when test="contains(string(.),'eth0')">
|
|
|
|
<xsl:value-of select="$interface"/>
|
|
|
|
</xsl:when>
|
2017-04-09 12:29:32 +02:00
|
|
|
<!-- Only adapted to LFS-20170310 and later -->
|
|
|
|
<xsl:when test="contains(string(.),'HOSTNAME')">
|
|
|
|
<xsl:value-of select="$hostname"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(.),'FQDN')">
|
|
|
|
<xsl:value-of select="$hostname"/>
|
|
|
|
<xsl:text>.</xsl:text>
|
|
|
|
<xsl:value-of select="$domain"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(.),'alias')"/>
|
|
|
|
<xsl:when test="contains(string(.),'<lfs>')">
|
|
|
|
<xsl:value-of select="$hostname"/>
|
|
|
|
</xsl:when>
|
2005-10-06 23:09:53 +02:00
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>**EDITME</xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>EDITME**</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:template>
|
2018-01-13 10:08:56 +01:00
|
|
|
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:template match="literal">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(string(),'ONBOOT')">
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring" select="string()"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(),'[Match]')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring" select="string()"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
2019-03-09 09:11:37 +01:00
|
|
|
<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>
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="outputnet">
|
|
|
|
<xsl:param name="netstring" select="''"/>
|
|
|
|
<!-- We suppose that book example has the following values:
|
|
|
|
- interface: eth0
|
|
|
|
- ip: 192.168.1.2
|
|
|
|
- gateway: 192.168.1.1
|
|
|
|
- prefix: 24
|
|
|
|
- broadcast: 192.168.1.255
|
|
|
|
Change below if book changes -->
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($netstring,'eth0')">
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'eth0')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$interface"/>
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'eth0')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'192.168.1.1')">
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'192.168.1.1')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$gateway"/>
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'192.168.1.1')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- must test this before the following, because 192.168.1.255 contains
|
|
|
|
192.168.1.2! -->
|
|
|
|
<xsl:when test="contains($netstring,'192.168.1.255')">
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'192.168.1.255')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$broadcast"/>
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'192.168.1.255')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'192.168.1.2')">
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'192.168.1.2')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$ip"/>
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'192.168.1.2')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'24')">
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'24')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$prefix"/>
|
|
|
|
<xsl:call-template name="outputnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'24')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$netstring"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="outputsysdnet">
|
|
|
|
<xsl:param name="netstring" select="''"/>
|
|
|
|
<!-- We suppose that book example has the following values:
|
2019-03-09 08:18:52 +01:00
|
|
|
- interface: <network-device-name>
|
2017-04-09 12:29:32 +02:00
|
|
|
- ip: 192.168.0.2
|
|
|
|
- gateway: 192.168.0.1
|
|
|
|
- prefix: 24
|
|
|
|
- DNS: 192.168.0.1
|
|
|
|
- Domain: <Your Domain Name>
|
|
|
|
and gateway comes before DNS. Change below if book changes -->
|
|
|
|
<xsl:choose>
|
2019-03-09 08:18:52 +01:00
|
|
|
<xsl:when test="contains($netstring,'<network-device-name>')">
|
2017-04-09 12:29:32 +02:00
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
2019-03-09 08:18:52 +01:00
|
|
|
select="substring-before($netstring,'<network-device-name>')"/>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$interface"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
2019-03-09 08:18:52 +01:00
|
|
|
select="substring-after($netstring,'<network-device-name>')"/>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'192.168.0.1') and
|
|
|
|
contains($netstring,'Gateway')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'192.168.0.1')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$gateway"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'192.168.0.1')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'192.168.0.1') and
|
|
|
|
not(contains($netstring,'Gateway'))">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'192.168.0.1')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$nameserver1"/>
|
|
|
|
<xsl:text>
|
|
|
|
DNS=</xsl:text>
|
|
|
|
<xsl:value-of select="$nameserver2"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'192.168.0.1')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'192.168.0.2')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'192.168.0.2')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$ip"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'192.168.0.2')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'24')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'24')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$prefix"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'24')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($netstring,'<Your Domain Name>')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'<Your Domain Name>')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$domain"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'<Your Domain Name>')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$netstring"/>
|
2019-03-09 09:11:37 +01:00
|
|
|
</xsl:otherwise>
|
|
|
|
</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>"
|
2019-03-15 17:18:48 +01:00
|
|
|
LOGLEVEL="</xsl:text>
|
2019-03-09 09:11:37 +01:00
|
|
|
<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"/>
|
2017-04-09 12:29:32 +02:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:template name="outputpkgdest">
|
|
|
|
<xsl:param name="outputstring" select="foo"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($outputstring,'make ')">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="not(starts-with($outputstring,'make'))">
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param name="outputstring"
|
|
|
|
select="substring-before($outputstring,'make')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param
|
|
|
|
name="outputstring"
|
|
|
|
select="substring-after($outputstring,
|
|
|
|
substring-before($outputstring,'make'))"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- special cases (no DESTDIR) here -->
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
|
|
|
<xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
|
|
|
<xsl:value-of
|
|
|
|
select="substring-before(substring-after(string(),'make'),
|
|
|
|
'install')"/>
|
|
|
|
<xsl:text>install
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:text>make -j1 PREFIX=$PKG_DEST/usr install
</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:text>make -j1 BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:text>make -j1 DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:value-of
|
2014-12-22 22:02:30 +01:00
|
|
|
select="substring-before(substring-after(string(),'DOCDIR='),
|
2012-02-02 00:29:37 +01:00
|
|
|
'install')"/>
|
|
|
|
<xsl:text>install
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:text>make -j1 ROOT=$PKG_DEST</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:value-of
|
|
|
|
select="substring-before(substring-after(string(),'make'),
|
|
|
|
'install')"/>
|
|
|
|
<xsl:text>install
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:text>make -j1 INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:value-of
|
|
|
|
select="substring-before(substring-after(string(),'make'),
|
|
|
|
'install')"/>
|
|
|
|
<xsl:text>install
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2020-05-18 10:31:43 +02:00
|
|
|
<xsl:text>make -j1 DESTDIR=$PKG_DEST</xsl:text>
|
2014-11-29 21:43:35 +01:00
|
|
|
<xsl:call-template name="outputpkgdest">
|
2013-03-13 17:43:37 +01:00
|
|
|
<xsl:with-param
|
2012-02-02 00:29:37 +01:00
|
|
|
name="outputstring"
|
|
|
|
select="substring-after($outputstring,'make')"/>
|
2013-03-13 17:43:37 +01:00
|
|
|
</xsl:call-template>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
2018-02-05 11:30:01 +01:00
|
|
|
<xsl:when test="contains($outputstring,'ninja install')">
|
2018-02-05 10:54:15 +01:00
|
|
|
<xsl:choose>
|
2018-02-05 11:30:01 +01:00
|
|
|
<xsl:when test="not(starts-with($outputstring,'ninja install'))">
|
2018-02-05 10:54:15 +01:00
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param name="outputstring"
|
2018-02-05 11:30:01 +01:00
|
|
|
select="substring-before($outputstring,'ninja install')"/>
|
2018-02-05 10:54:15 +01:00
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param
|
|
|
|
name="outputstring"
|
|
|
|
select="substring-after($outputstring,
|
2018-02-05 11:30:01 +01:00
|
|
|
substring-before($outputstring,'ninja install'))"/>
|
2018-02-05 10:54:15 +01:00
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
2018-02-05 11:30:01 +01:00
|
|
|
<xsl:otherwise> <!-- "ninja" is the first word and is followed by
|
|
|
|
"install"-->
|
2018-02-05 10:54:15 +01:00
|
|
|
<xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param
|
|
|
|
name="outputstring"
|
|
|
|
select="substring-after($outputstring,'ninja')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise> <!-- no make nor ninja in this string -->
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($outputstring,'>/') and
|
|
|
|
not(contains(substring-before($outputstring,'>/'),' /'))">
|
|
|
|
<xsl:value-of select="substring-before($outputstring,'>/')"/>
|
|
|
|
<xsl:text>>$PKG_DEST/</xsl:text>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($outputstring,' /')">
|
|
|
|
<xsl:value-of select="substring-before($outputstring,' /')"/>
|
|
|
|
<xsl:text> $PKG_DEST/</xsl:text>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$outputstring"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
2017-04-09 12:29:32 +02:00
|
|
|
|
|
|
|
<xsl:variable name="APOS">'</xsl:variable>
|
|
|
|
<xsl:template name="output-wrap">
|
|
|
|
<xsl:param name="commands" select="''"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($commands,string($APOS))">
|
|
|
|
<xsl:call-template name="output-wrap">
|
|
|
|
<xsl:with-param name="commands"
|
|
|
|
select="substring-before($commands,string($APOS))"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:text>'\''</xsl:text>
|
|
|
|
<xsl:call-template name="output-wrap">
|
|
|
|
<xsl:with-param name="commands"
|
|
|
|
select="substring-after($commands,string($APOS))"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$commands"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2018-01-12 20:04:19 +01:00
|
|
|
<xsl:template name="comment-strip">
|
|
|
|
<xsl:param name="instructions" select="''"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($instructions,'
')">
|
|
|
|
<xsl:call-template name="comment-strip">
|
|
|
|
<xsl:with-param name="instructions"
|
|
|
|
select="substring-before($instructions,'
')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:call-template name="comment-strip">
|
|
|
|
<xsl:with-param name="instructions"
|
|
|
|
select="substring-after($instructions,'
')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($instructions,'\*.la')">
|
|
|
|
<xsl:if test="$del-la-files='n'">
|
|
|
|
<xsl:text># </xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="$instructions"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($instructions,'strip ')">
|
|
|
|
<xsl:if test="$strip='n'">
|
|
|
|
<xsl:text># </xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="$instructions"/>
|
|
|
|
<xsl:text> || true
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$instructions"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2018-01-12 10:40:59 +01:00
|
|
|
<xsl:template name="comment-test">
|
|
|
|
<xsl:param name="instructions" select="''"/>
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:param name="eof-seen" select="false()"/>
|
2018-01-12 10:40:59 +01:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($instructions,'
')">
|
|
|
|
<xsl:call-template name="comment-test">
|
|
|
|
<xsl:with-param name="instructions"
|
|
|
|
select="substring-before($instructions,'
')"/>
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:with-param name="eof-seen" select="$eof-seen"/>
|
2018-01-12 10:40:59 +01:00
|
|
|
</xsl:call-template>
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(substring-before($instructions,'
'),
|
|
|
|
'EOF')">
|
|
|
|
<xsl:call-template name="comment-test">
|
|
|
|
<xsl:with-param name="instructions"
|
|
|
|
select="substring-after($instructions,'
')"/>
|
|
|
|
<xsl:with-param name="eof-seen" select="not($eof-seen)"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:call-template name="comment-test">
|
|
|
|
<xsl:with-param name="instructions"
|
|
|
|
select="substring-after($instructions,'
')"/>
|
|
|
|
<xsl:with-param name="eof-seen" select="$eof-seen"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2018-01-12 10:40:59 +01:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:if test="$testsuite = '0' or
|
|
|
|
$testsuite = '1' and
|
|
|
|
not(ancestor::sect1[@id='ch-system-gcc']) and
|
|
|
|
not(ancestor::sect1[@id='ch-system-glibc']) and
|
|
|
|
not(ancestor::sect1[@id='ch-system-gmp']) and
|
|
|
|
not(ancestor::sect1[@id='ch-system-mpfr']) and
|
|
|
|
not(ancestor::sect1[@id='ch-system-binutils']) or
|
|
|
|
$testsuite = '2' and
|
|
|
|
ancestor::chapter[@id='chapter-temporary-tools']">
|
|
|
|
<xsl:text># </xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$bomb-testsuite = 'n'">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(string(), 'make -k')">
|
|
|
|
<xsl:value-of select="$instructions"/>
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:if test="not($eof-seen)">
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
2018-01-12 10:40:59 +01:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($instructions, 'make')">
|
|
|
|
<xsl:value-of select="substring-before($instructions, 'make')"/>
|
|
|
|
<xsl:text>make -k</xsl:text>
|
|
|
|
<xsl:value-of select="substring-after($instructions, 'make')"/>
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:if test="not($eof-seen)">
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
2018-01-12 10:40:59 +01:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$instructions"/>
|
2018-01-14 21:19:14 +01:00
|
|
|
<xsl:if
|
|
|
|
test="not(contains($instructions, '>>')) and
|
2020-05-31 09:31:32 +02:00
|
|
|
not($eof-seen) and
|
2018-01-14 21:19:14 +01:00
|
|
|
substring($instructions,
|
|
|
|
string-length($instructions)) != '\'">
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
2018-01-12 10:40:59 +01:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<!-- bomb-testsuite != 'n'-->
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($instructions, 'make -k')">
|
|
|
|
<xsl:value-of select="$instructions"/>
|
2020-05-31 09:31:32 +02:00
|
|
|
<xsl:if test="not($eof-seen)">
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
2018-01-12 10:40:59 +01:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$instructions"/>
|
2018-01-14 21:19:14 +01:00
|
|
|
<xsl:if test="not(contains($instructions, '>>')) and
|
2020-05-31 09:31:32 +02:00
|
|
|
not($eof-seen) and
|
2018-01-14 21:19:14 +01:00
|
|
|
substring($instructions,
|
|
|
|
string-length($instructions)) != '\'">
|
2018-01-12 10:40:59 +01:00
|
|
|
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise> <!-- end not bomb-test=n -->
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2019-04-11 09:40:50 +02:00
|
|
|
<xsl:template name="basename">
|
|
|
|
<xsl:param name="path" select="''"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($path,'/') and substring-after($path,'/')!=''">
|
|
|
|
<xsl:call-template name="basename">
|
|
|
|
<xsl:with-param name="path" select="substring-after($path,'/')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($path,'/') and substring-after($path,'/')=''">
|
|
|
|
<xsl:value-of select="substring-before($path,'/')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$path"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="start-script">
|
|
|
|
<xsl:param name="order" select="'073'"/>
|
|
|
|
<xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
<!-- save the timer, so that unpacking, and du is not counted -->
|
|
|
|
PREV_SEC=${SECONDS}
|
|
|
|
<!-- get the location of the system root -->
|
2020-03-29 15:24:48 +02:00
|
|
|
ROOT=</xsl:text>
|
|
|
|
<xsl:choose>
|
2020-03-29 15:42:43 +02:00
|
|
|
<xsl:when test="starts-with(./@id, 'ch-tools') or
|
|
|
|
contains (./@id, 'kernfs')">
|
2020-03-29 15:24:48 +02:00
|
|
|
<xsl:text>$LFS/
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>/
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
SCRIPT_ROOT=</xsl:text>
|
|
|
|
<xsl:copy-of select="$script-root"/>
|
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
|
|
|
<xsl:if test="sect2[@role='installation']">
|
|
|
|
<xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
SRC_DIR=${ROOT}sources
|
|
|
|
<!-- Set variables, for use by the Makefile and package manager -->
|
|
|
|
VERSION=</xsl:text><!-- needed for Makefile, and may be used in PackInstall-->
|
2019-07-15 22:06:35 +02:00
|
|
|
<xsl:copy-of select=".//sect1info/productnumber/text()"/>
|
|
|
|
<xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
PKG_DEST=${SRC_DIR}/</xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
<xsl:copy-of select="$order"/>
|
|
|
|
<xsl:text>-</xsl:text>
|
|
|
|
<xsl:copy-of select=".//sect1info/productname/text()"/>
|
|
|
|
<xsl:text>
|
|
|
|
<!-- Get the tarball name from sect1info -->
|
2019-04-11 09:40:50 +02:00
|
|
|
PACKAGE=</xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
<xsl:call-template name="basename">
|
|
|
|
<xsl:with-param name="path" select=".//sect1info/address/text()"/>
|
|
|
|
</xsl:call-template>
|
2020-06-24 08:26:05 +02:00
|
|
|
<xsl:if test = "( ../@id = 'chapter-building-system' or
|
2020-07-06 07:51:22 +02:00
|
|
|
../@id = 'chapter-config' or
|
|
|
|
../@id = 'chapter-bootscripts' or
|
|
|
|
../@id = 'chapter-bootable' or
|
2020-06-24 08:26:05 +02:00
|
|
|
starts-with(@id,'ch-system') ) and $pkgmngt = 'y'">
|
|
|
|
<!-- the last alternative for old books where some sections in
|
|
|
|
chapter-config had ch-system -->
|
2019-07-15 22:06:35 +02:00
|
|
|
<xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
source ${ROOT}${SCRIPT_ROOT}/packInstall.sh
|
|
|
|
export -f packInstall</xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
<xsl:if test="$wrap-install='y'">
|
|
|
|
<xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
export -f wrapInstall
|
|
|
|
</xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
</xsl:if>
|
2019-04-11 09:40:50 +02:00
|
|
|
</xsl:if>
|
|
|
|
<!-- Get the build directory name and clean remnants of previous attempts -->
|
2019-07-15 22:06:35 +02:00
|
|
|
<xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
cd $SRC_DIR
|
|
|
|
PKGDIR=$(tar -tf $PACKAGE | head -n1 | sed 's@^./@@;s@/.*@@')
|
|
|
|
export PKGDIR VERSION PKG_DEST
|
|
|
|
|
|
|
|
if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi
|
|
|
|
if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
2019-07-15 22:06:35 +02:00
|
|
|
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
|
|
|
|
echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
|
|
|
</xsl:text>
|
|
|
|
<xsl:if test="sect2[@role='installation']">
|
|
|
|
<xsl:text>
|
2019-04-11 09:40:50 +02:00
|
|
|
<!-- At last unpack and change directory -->
|
|
|
|
tar -xf $PACKAGE
|
|
|
|
cd $PKGDIR
|
2019-07-15 22:06:35 +02:00
|
|
|
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>SECONDS=${PREV_SEC}
|
2019-04-11 09:40:50 +02:00
|
|
|
|
|
|
|
# Start of LFS book script
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="end-script">
|
|
|
|
<xsl:text>
|
|
|
|
# End of LFS book script
|
|
|
|
|
2019-07-15 22:06:35 +02:00
|
|
|
echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
|
|
|
</xsl:text>
|
|
|
|
<xsl:if test="sect2[@role='installation']">
|
|
|
|
<xsl:text>cd $SRC_DIR
|
2019-04-11 09:40:50 +02:00
|
|
|
rm -rf $PKGDIR
|
|
|
|
if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
|
|
|
</xsl:text>
|
2019-07-15 22:06:35 +02:00
|
|
|
</xsl:if>
|
2019-04-11 09:40:50 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:stylesheet>
|