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
|
|
|
|
2015-12-13 16:28:33 +01:00
|
|
|
<!-- Parameters -->
|
|
|
|
|
2017-03-27 18:26:14 +02:00
|
|
|
<!-- which revision attribute to include: can only be sysv or systemd,
|
|
|
|
but we leave checking to the caller-->
|
|
|
|
<xsl:param name="revision" select="'sysv'"/>
|
|
|
|
|
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
|
|
|
|
-->
|
2016-07-21 18:43:35 +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"'/>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2006-03-10 19:55:30 +01:00
|
|
|
<!-- Run test suites?
|
|
|
|
0 = none
|
2015-12-13 16:28:33 +01: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
|
|
|
-->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name="bomb-testsuite" select="'n'"/>
|
2006-08-05 16:51:11 +02:00
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name="vim-lang" select="'n'"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- Time zone -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name="timezone" select="'GMT'"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- Page size -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name="page" select="'letter'"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
<!-- Locale settings -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name="lang" select="'C'"/>
|
2012-02-10 10:43:23 +01:00
|
|
|
|
|
|
|
<!-- Install the whole set of locales -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name='full-locale' select='"n"'/>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2015-12-13 16:28:33 +01:00
|
|
|
<!-- Hostname -->
|
|
|
|
<xsl:param name='hostname' select='"HOSTNAME"'/>
|
|
|
|
|
|
|
|
<!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
|
|
|
|
and nameservers -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:param name='interface' select="'eth0'"/>
|
2015-12-13 16:28:33 +01:00
|
|
|
<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"'/>
|
|
|
|
|
|
|
|
<!-- End parameters -->
|
|
|
|
|
2005-09-25 18:56:00 +02:00
|
|
|
<xsl:template match="/">
|
2017-03-27 18:26:14 +02:00
|
|
|
<xsl:apply-templates select="//sect1[not(@revision) or
|
|
|
|
@revision=$revision]"/>
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:template>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2005-09-25 18:56:00 +02:00
|
|
|
<xsl:template match="sect1">
|
2017-03-27 18:26:14 +02:00
|
|
|
<!-- Since this xsl:if tag encloses the whole template, it would
|
|
|
|
be much better to transpose this condition to the select part
|
|
|
|
of the "calling" apply-template. But that would change the numbering,
|
|
|
|
so that it would be difficult to compare to previous versions. So for
|
|
|
|
version 2.4, let us keep this -->
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:if test="(../@id='chapter-temporary-tools' or
|
2006-12-04 14:48:48 +01:00
|
|
|
../@id='chapter-building-system' or
|
|
|
|
../@id='chapter-bootscripts' or
|
|
|
|
../@id='chapter-bootable') and
|
2017-03-27 18:26:14 +02:00
|
|
|
(sect2[not(@revision) or @revision=$revision]//..|.)/
|
|
|
|
screen[(not(@role) or @role != 'nodump') and
|
|
|
|
(not(@revision) or @revision=$revision)]/
|
|
|
|
userinput[not(starts-with(string(),'chroot'))]">
|
2014-01-12 22:40:20 +01:00
|
|
|
<!-- The last condition is a hack to allow previous versions of the
|
|
|
|
book where the chroot commands did not have role="nodump".
|
|
|
|
It only works if the chroot command is the only one on the page -->
|
2005-09-27 20:08:05 +02:00
|
|
|
<!-- 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">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="string-length($position) = 1">
|
|
|
|
<xsl:text>00</xsl:text>
|
|
|
|
<xsl:value-of select="$position"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="string-length($position) = 2">
|
|
|
|
<xsl:text>0</xsl:text>
|
|
|
|
<xsl:value-of select="$position"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$position"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:variable>
|
|
|
|
<!-- Inclusion of package manager scriptlets -->
|
|
|
|
<xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
|
|
|
|
<xsl:apply-templates
|
2012-02-12 19:33:40 +01:00
|
|
|
select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
|
2012-02-02 00:29:37 +01:00
|
|
|
mode="pkgmngt">
|
2012-02-12 19:33:40 +01:00
|
|
|
<xsl:with-param name="order" select="$order"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:with-param name="dirname" select="$dirname"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
|
|
|
|
<xsl:apply-templates
|
2012-02-12 19:33:40 +01:00
|
|
|
select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
|
2012-02-02 00:29:37 +01:00
|
|
|
mode="pkgmngt">
|
2012-02-12 19:33:40 +01:00
|
|
|
<xsl:with-param name="order" select="$order"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:with-param name="dirname" select="$dirname"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- Creating dirs and files -->
|
|
|
|
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@id='ch-system-creatingdirs' or
|
|
|
|
@id='ch-system-createfiles' or
|
|
|
|
@id='ch-system-strippingagain'">
|
|
|
|
<xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>#!/bin/bash
set +h
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<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>
|
|
|
|
<xsl:if test="sect2[@role='installation']">
|
|
|
|
<xsl:text>cd $PKGDIR
</xsl:text>
|
|
|
|
</xsl:if>
|
2017-03-27 18:26:14 +02:00
|
|
|
<xsl:apply-templates select="sect2[not(@revision) or
|
|
|
|
@revision=$revision] |
|
|
|
|
screen[(not(@role) or
|
|
|
|
@role!='nodump') and
|
|
|
|
(not(@revision) or
|
|
|
|
@revision=$revision)]/userinput"/>
|
2014-11-29 21:43:35 +01:00
|
|
|
<xsl:if test="@id='ch-system-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>
|
2014-11-29 21:43:35 +01:00
|
|
|
<xsl:if test="@id='ch-system-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>
|
2014-01-12 22:40:20 +01:00
|
|
|
<xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:text>exit
</xsl:text>
|
|
|
|
</exsl:document>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="sect2">
|
|
|
|
<xsl:apply-templates
|
2017-03-27 18:26:14 +02:00
|
|
|
select=".//screen[(not(@role) or
|
|
|
|
@role != 'nodump') and
|
|
|
|
(not(@revision) or
|
|
|
|
@revision=$revision)]/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
|
|
|
|
test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
|
|
|
$pkgmngt = 'y' and
|
|
|
|
descendant::screen[not(@role) or
|
|
|
|
@role != 'nodump']/userinput[
|
|
|
|
@remap='install']">
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$wrap-install='y'">
|
|
|
|
<xsl:text>wrapInstall '
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
2012-02-02 00:29:37 +01:00
|
|
|
mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
|
|
|
mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
|
|
|
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
|
|
|
ln -sv share/{man,doc,info} $PKG_DEST/usr
|
|
|
|
case $(uname -m) in
|
|
|
|
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
|
|
|
esac
|
|
|
|
</xsl:text>
|
2016-07-21 18:43:35 +02:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="../@id = 'ch-system-glibc' and
|
2013-03-02 20:31:26 +01:00
|
|
|
@role='installation' and
|
2016-07-21 18:43:35 +02:00
|
|
|
$pkgmngt = 'y' and
|
|
|
|
$wrap-install = 'n'">
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:text>
|
2013-03-02 15:10:45 +01:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates
|
2017-03-27 18:26:14 +02:00
|
|
|
select=".//screen[(not(@role) or
|
|
|
|
@role != 'nodump') and
|
|
|
|
(not(@revision) or
|
|
|
|
@revision=$revision)]/userinput[@remap = 'install']"/>
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
|
|
|
$pkgmngt = 'y' and
|
|
|
|
descendant::screen[not(@role) or
|
|
|
|
@role != 'nodump']/userinput[
|
|
|
|
@remap='install']">
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<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 -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
2013-03-13 17:43:37 +01:00
|
|
|
</xsl:text>
|
2016-07-21 18:43:35 +02:00
|
|
|
</xsl:if>
|
2013-03-13 17:43:37 +01:00
|
|
|
<!-- Attr man/man2 pages are already installed by man-pages. As of
|
2015-11-30 10:09:19 +01:00
|
|
|
March 2013, they are the same pages.
|
|
|
|
November 2015: now they are more accurate
|
|
|
|
in man-pages, and the man5 section is also in man-pages... -->
|
2016-07-21 18:43:35 +02:00
|
|
|
<xsl:if test="../@id = 'ch-system-attr'">
|
|
|
|
<xsl:text>rm -fv /usr/share/man/man2/*
|
|
|
|
rm -fv /usr/share/man/man5/*
|
|
|
|
</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>'
|
|
|
|
packInstall
|
|
|
|
</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}
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- Attr man/man2 pages are already installed by man-pages. As of
|
|
|
|
March 2013, they are the same pages.
|
|
|
|
November 2015: now they are more accurate
|
|
|
|
in man-pages, and the man5 section is also in man-pages... -->
|
|
|
|
<xsl:if test="../@id = 'ch-system-attr'">
|
|
|
|
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
2015-11-30 10:09:19 +01:00
|
|
|
rm -fv $PKG_DEST/usr/share/man/man5/*
|
2014-11-29 22:17:49 +01:00
|
|
|
</xsl:text>
|
2016-07-21 18:43:35 +02:00
|
|
|
</xsl:if>
|
2014-11-29 22:17:49 +01:00
|
|
|
<!-- nologin is installed by util-linux. remove it from shadow -->
|
2016-07-21 18:43:35 +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>
|
2016-07-21 18:43:35 +02:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
2012-02-02 00:29:37 +01:00
|
|
|
rm -fv $PKG_DEST/usr/{man,doc,info}
|
|
|
|
for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
|
|
|
[[ -z $(ls $dir) ]] && rmdir -v $dir
|
|
|
|
done
|
|
|
|
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
|
|
|
[[ -z $(ls $dir) ]] && rmdir -v $dir
|
|
|
|
done
|
|
|
|
for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
|
|
|
[[ -z $(ls $dir) ]] && rmdir -v $dir
|
|
|
|
done
|
|
|
|
for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
|
|
|
[[ -z $(ls $dir) ]] && rmdir -v $dir
|
|
|
|
done
|
|
|
|
packInstall
|
|
|
|
rm -rf $PKG_DEST
|
|
|
|
</xsl:text>
|
2016-07-21 18:43:35 +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
|
|
|
|
select=".//screen[
|
2017-03-27 18:26:14 +02:00
|
|
|
(not(@role) or
|
|
|
|
@role != 'nodump') and
|
|
|
|
(not(@revision) or
|
|
|
|
@revision=$revision)
|
2013-03-02 15:10:45 +01:00
|
|
|
]/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'
|
2013-03-02 15:10:45 +01:00
|
|
|
]"/>
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2013-03-02 15:10:45 +01:00
|
|
|
<xsl:template match="sect1" mode="pkgmngt">
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:param name="dirname" select="chapter05"/>
|
|
|
|
<!-- The build order -->
|
2012-02-12 19:33:40 +01: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')"/>
|
|
|
|
<!-- 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'])">
|
|
|
|
<exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
|
|
|
method="text">
|
|
|
|
<xsl:text>#!/bin/bash
|
2012-02-02 00:29:37 +01:00
|
|
|
set +h
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $PKGDIR
|
|
|
|
</xsl:text>
|
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"/>
|
2013-05-21 22:20:24 +02:00
|
|
|
<xsl:if test="$dirname = 'chapter06'">
|
|
|
|
<xsl:text>packInstall
|
2016-07-21 18:43:35 +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"
|
|
|
|
exit
|
|
|
|
</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>
|
|
|
|
|
|
|
|
<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 -->
|
|
|
|
<xsl:when test="@remap = 'test'">
|
2007-09-18 23:14:16 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$testsuite = '0'"/>
|
|
|
|
<xsl:when test="$testsuite = '1' and
|
|
|
|
not(ancestor::sect1[@id='ch-system-gcc']) and
|
|
|
|
not(ancestor::sect1[@id='ch-system-glibc']) and
|
2012-02-02 00:29:37 +01:00
|
|
|
not(ancestor::sect1[@id='ch-system-gmp']) and
|
|
|
|
not(ancestor::sect1[@id='ch-system-mpfr']) and
|
2007-09-18 23:14:16 +02:00
|
|
|
not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
|
|
|
<xsl:when test="$testsuite = '2' and
|
|
|
|
ancestor::chapter[@id='chapter-temporary-tools']"/>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$bomb-testsuite = 'n'">
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:choose>
|
|
|
|
<!-- special case for glibc -->
|
|
|
|
<xsl:when test="contains(string(), 'glibc-check-log')">
|
|
|
|
<xsl:value-of
|
|
|
|
select="substring-before(string(),'2>&1')"/>
|
|
|
|
<xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
|
|
|
</xsl:when>
|
2013-02-20 09:26:35 +01:00
|
|
|
<!-- special case for procps-ng -->
|
|
|
|
<xsl:when test="contains(string(), 'pushd')">
|
|
|
|
<xsl:text>{ </xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:when test="contains(string(), 'make -k')">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(), 'make')">
|
|
|
|
<xsl:value-of select="substring-before(string(),'make')"/>
|
|
|
|
<xsl:text>make -k</xsl:text>
|
|
|
|
<xsl:value-of select="substring-after(string(),'make')"/>
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:if test="not(contains(string(), '>>'))">
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2007-09-18 23:14:16 +02:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- bomb-testsuite != 'n'-->
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- special case for glibc -->
|
|
|
|
<xsl:when test="contains(string(), 'glibc-check-log')">
|
|
|
|
<xsl:value-of
|
|
|
|
select="substring-before(string(),'2>&1')"/>
|
2012-02-02 00:36:34 +01:00
|
|
|
<xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
2012-02-02 00:29:37 +01:00
|
|
|
</xsl:when>
|
2013-02-20 09:26:35 +01:00
|
|
|
<!-- special case for gmp -->
|
2012-02-10 12:20:51 +01:00
|
|
|
<xsl:when test="contains(string(), 'tee gmp-check-log')">
|
|
|
|
<xsl:text>(</xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
|
|
|
</xsl:when>
|
2013-02-20 09:26:35 +01:00
|
|
|
<!-- special case for procps-ng -->
|
|
|
|
<xsl:when test="contains(string(), 'pushd')">
|
|
|
|
<xsl:text>{ </xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
|
|
|
</xsl:when>
|
2012-02-02 00:36:34 +01:00
|
|
|
<xsl:when test="contains(string(), 'make -k')">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:if test="not(contains(string(), '>>'))">
|
|
|
|
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2007-09-18 23:14:16 +02:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- End of test instructions -->
|
2005-10-15 17:40:23 +02:00
|
|
|
<!-- Don't stop on strip run -->
|
|
|
|
<xsl:when test="contains(string(),'strip ')">
|
2005-10-01 12:26:22 +02:00
|
|
|
<xsl:apply-templates/>
|
2005-10-15 17:40:23 +02:00
|
|
|
<xsl:text> || true
</xsl:text>
|
2005-10-08 16:52:37 +02:00
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- Package management -->
|
|
|
|
<!-- Add $PKG_DEST to installation commands -->
|
|
|
|
<xsl:when test="@remap='install' and
|
|
|
|
not(ancestor::chapter[
|
|
|
|
@id='chapter-temporary-tools'
|
|
|
|
])">
|
|
|
|
<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>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
2016-07-21 18:43:35 +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>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
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>
|
2016-07-21 18:43:35 +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>
|
2016-07-21 18:43:35 +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>
|
2014-12-09 22:01:16 +01:00
|
|
|
packInstall
|
|
|
|
rm -rf $PKG_DEST
|
2016-07-21 18:43:35 +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>'
|
|
|
|
packInstall
|
|
|
|
</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 -->
|
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>
|
2012-02-02 00:29:37 +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>
|
2015-12-13 16:28:33 +01: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>
|
2017-03-11 20:37:26 +01:00
|
|
|
<xsl:when test="contains(string(.),'192.168.0.2')">
|
|
|
|
<xsl:value-of select="$ip"/>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Only adapted to LFS-20170310 and later -->
|
2015-12-13 16:28:33 +01:00
|
|
|
<xsl:when test="contains(string(.),'HOSTNAME')">
|
|
|
|
<xsl:value-of select="$hostname"/>
|
|
|
|
</xsl:when>
|
2017-03-11 20:37:26 +01:00
|
|
|
<xsl:when test="contains(string(.),'FQDN')">
|
2015-12-13 16:28:33 +01:00
|
|
|
<xsl:value-of select="$hostname"/>
|
2017-03-11 20:37:26 +01:00
|
|
|
<xsl:text>.</xsl:text>
|
|
|
|
<xsl:value-of select="$domain"/>
|
2015-12-13 16:28:33 +01:00
|
|
|
</xsl:when>
|
2017-03-11 20:37:26 +01:00
|
|
|
<xsl:when test="contains(string(.),'alias')"/>
|
2015-12-13 16:28:33 +01:00
|
|
|
<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>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2015-12-13 16:28:33 +01: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>
|
2017-03-05 09:49:45 +01:00
|
|
|
<xsl:when test="contains(string(),'[Match]')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring" select="string()"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
2015-12-13 16:28:33 +01: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
|
2016-06-25 16:39:47 +02:00
|
|
|
- ip: 192.168.1.2
|
|
|
|
- gateway: 192.168.1.1
|
2015-12-13 16:28:33 +01:00
|
|
|
- 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>
|
2016-06-25 16:39:47 +02:00
|
|
|
<xsl:value-of select="$gateway"/>
|
2015-12-13 16:28:33 +01:00
|
|
|
<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>
|
2016-06-25 16:39:47 +02:00
|
|
|
<xsl:value-of select="$ip"/>
|
2015-12-13 16:28:33 +01:00
|
|
|
<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>
|
|
|
|
|
2017-03-05 09:49:45 +01:00
|
|
|
<xsl:template name="outputsysdnet">
|
|
|
|
<xsl:param name="netstring" select="''"/>
|
|
|
|
<!-- We suppose that book example has the following values:
|
|
|
|
- interface: eth0
|
|
|
|
- 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>
|
|
|
|
<xsl:when test="contains($netstring,'eth0')">
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-before($netstring,'eth0')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:value-of select="$interface"/>
|
|
|
|
<xsl:call-template name="outputsysdnet">
|
|
|
|
<xsl:with-param name="netstring"
|
|
|
|
select="substring-after($netstring,'eth0')"/>
|
|
|
|
</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"/>
|
|
|
|
</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']">
|
|
|
|
<xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
|
|
|
<xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
2014-12-22 22:02:30 +01:00
|
|
|
<xsl:text>make 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']">
|
|
|
|
<xsl:text>make ROOT=$PKG_DEST</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-bootable-kernel']">
|
|
|
|
<xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
|
|
|
<xsl:value-of
|
|
|
|
select="substring-before(substring-after(string(),'make'),
|
|
|
|
'install')"/>
|
|
|
|
<xsl:text>install
</xsl:text>
|
|
|
|
</xsl:when>
|
2013-03-13 17:43:37 +01:00
|
|
|
<xsl:when test="ancestor::sect1[@id='ch-system-attr']">
|
|
|
|
<xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
<xsl:with-param name="outputstring"
|
|
|
|
select="substring-after($outputstring,'make')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:otherwise>
|
2013-03-13 17:43:37 +01:00
|
|
|
<xsl:text>make 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>
|
|
|
|
<xsl:otherwise> <!-- no make in this string -->
|
|
|
|
<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:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
2016-07-21 18:43:35 +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>
|
|
|
|
|
2005-09-25 18:56:00 +02:00
|
|
|
</xsl:stylesheet>
|