[7072e1f] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[db181c47] | 2 |
|
---|
[877cc6a] | 3 | <!-- $Id$ -->
|
---|
| 4 |
|
---|
[7072e1f] | 5 | <xsl:stylesheet
|
---|
| 6 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 7 | xmlns:exsl="http://exslt.org/common"
|
---|
| 8 | extension-element-prefixes="exsl"
|
---|
| 9 | version="1.0">
|
---|
[557fe91] | 10 |
|
---|
[77fa8ba] | 11 | <!-- Parameters -->
|
---|
| 12 |
|
---|
[7072e1f] | 13 | <!-- use package management ?
|
---|
| 14 | n = no, original behavior
|
---|
| 15 | y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
---|
| 16 | -->
|
---|
[df42c7c] | 17 | <xsl:param name="pkgmngt" select="'n'"/>
|
---|
| 18 |
|
---|
| 19 | <!-- Package management with "porg style" ?
|
---|
| 20 | n = no, same as pkgmngt description above
|
---|
| 21 | y = yes, wrap install commands of chapter06-08 into a bash function.
|
---|
| 22 | note that pkgmngt must be 'y' in this case
|
---|
| 23 | -->
|
---|
| 24 | <xsl:param name="wrap-install" select='"n"'/>
|
---|
[7072e1f] | 25 |
|
---|
[31d6944] | 26 | <!-- Run test suites?
|
---|
| 27 | 0 = none
|
---|
[77fa8ba] | 28 | 1 = only chapter06 critical testsuites
|
---|
[31d6944] | 29 | 2 = all chapter06 testsuites
|
---|
[28f4756] | 30 | 3 = all chapter05 and chapter06 testsuites
|
---|
| 31 | -->
|
---|
[31d6944] | 32 | <xsl:param name="testsuite" select="1"/>
|
---|
[01e51a1] | 33 |
|
---|
[28f4756] | 34 | <!-- Bomb on test suites failures?
|
---|
[401f81e] | 35 | n = no, I want to build the full system and review the logs
|
---|
| 36 | y = yes, bomb at the first test suite failure to can review the build dir
|
---|
[28f4756] | 37 | -->
|
---|
[df42c7c] | 38 | <xsl:param name="bomb-testsuite" select="'n'"/>
|
---|
[28f4756] | 39 |
|
---|
[7072e1f] | 40 | <!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
---|
[df42c7c] | 41 | <xsl:param name="vim-lang" select="'n'"/>
|
---|
[7072e1f] | 42 |
|
---|
[877cc6a] | 43 | <!-- Time zone -->
|
---|
[df42c7c] | 44 | <xsl:param name="timezone" select="'GMT'"/>
|
---|
[7072e1f] | 45 |
|
---|
[877cc6a] | 46 | <!-- Page size -->
|
---|
[df42c7c] | 47 | <xsl:param name="page" select="'letter'"/>
|
---|
[7072e1f] | 48 |
|
---|
[877cc6a] | 49 | <!-- Locale settings -->
|
---|
[df42c7c] | 50 | <xsl:param name="lang" select="'C'"/>
|
---|
[b339c94] | 51 |
|
---|
| 52 | <!-- Install the whole set of locales -->
|
---|
[df42c7c] | 53 | <xsl:param name='full-locale' select='"n"'/>
|
---|
[7072e1f] | 54 |
|
---|
[77fa8ba] | 55 | <!-- Hostname -->
|
---|
| 56 | <xsl:param name='hostname' select='"HOSTNAME"'/>
|
---|
| 57 |
|
---|
| 58 | <!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
|
---|
| 59 | and nameservers -->
|
---|
[df42c7c] | 60 | <xsl:param name='interface' select="'eth0'"/>
|
---|
[77fa8ba] | 61 | <xsl:param name='ip' select='"10.0.2.9"'/>
|
---|
| 62 | <xsl:param name='gateway' select='"10.0.2.2"'/>
|
---|
| 63 | <xsl:param name='prefix' select='24'/>
|
---|
| 64 | <xsl:param name='broadcast' select='"10.0.2.255"'/>
|
---|
| 65 | <xsl:param name='domain' select='"lfs.org"'/>
|
---|
| 66 | <xsl:param name='nameserver1' select='"10.0.2.3"'/>
|
---|
| 67 | <xsl:param name='nameserver2' select='"8.8.8.8"'/>
|
---|
| 68 |
|
---|
| 69 | <!-- End parameters -->
|
---|
| 70 |
|
---|
[557fe91] | 71 | <xsl:template match="/">
|
---|
| 72 | <xsl:apply-templates select="//sect1"/>
|
---|
| 73 | </xsl:template>
|
---|
[7072e1f] | 74 |
|
---|
[557fe91] | 75 | <xsl:template match="sect1">
|
---|
[7072e1f] | 76 | <xsl:if test="(../@id='chapter-temporary-tools' or
|
---|
[14eaa9f] | 77 | ../@id='chapter-building-system' or
|
---|
| 78 | ../@id='chapter-bootscripts' or
|
---|
| 79 | ../@id='chapter-bootable') and
|
---|
| 80 | count(descendant::screen/userinput) > 0 and
|
---|
| 81 | count(descendant::screen/userinput) >
|
---|
[d68eb1b] | 82 | count(descendant::screen[@role='nodump']) and
|
---|
| 83 | count(descendant::screen/userinput) >
|
---|
| 84 | count(descendant::screen/userinput[starts-with(string(),'chroot')])">
|
---|
| 85 | <!-- The last condition is a hack to allow previous versions of the
|
---|
| 86 | book where the chroot commands did not have role="nodump".
|
---|
| 87 | It only works if the chroot command is the only one on the page -->
|
---|
[c4cf6de] | 88 | <!-- The dirs names -->
|
---|
| 89 | <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
---|
| 90 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
| 91 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
| 92 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
[7072e1f] | 93 | <!-- The file names -->
|
---|
| 94 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 95 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 96 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 97 | <!-- The build order -->
|
---|
| 98 | <xsl:variable name="position" select="position()"/>
|
---|
| 99 | <xsl:variable name="order">
|
---|
| 100 | <xsl:choose>
|
---|
| 101 | <xsl:when test="string-length($position) = 1">
|
---|
| 102 | <xsl:text>00</xsl:text>
|
---|
| 103 | <xsl:value-of select="$position"/>
|
---|
| 104 | </xsl:when>
|
---|
| 105 | <xsl:when test="string-length($position) = 2">
|
---|
| 106 | <xsl:text>0</xsl:text>
|
---|
| 107 | <xsl:value-of select="$position"/>
|
---|
| 108 | </xsl:when>
|
---|
| 109 | <xsl:otherwise>
|
---|
| 110 | <xsl:value-of select="$position"/>
|
---|
| 111 | </xsl:otherwise>
|
---|
| 112 | </xsl:choose>
|
---|
| 113 | </xsl:variable>
|
---|
| 114 | <!-- Inclusion of package manager scriptlets -->
|
---|
| 115 | <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
|
---|
| 116 | <xsl:apply-templates
|
---|
[575bcf3] | 117 | select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
|
---|
[7072e1f] | 118 | mode="pkgmngt">
|
---|
[575bcf3] | 119 | <xsl:with-param name="order" select="$order"/>
|
---|
[7072e1f] | 120 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 121 | </xsl:apply-templates>
|
---|
| 122 | </xsl:if>
|
---|
| 123 | <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
|
---|
| 124 | <xsl:apply-templates
|
---|
[575bcf3] | 125 | select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
|
---|
[7072e1f] | 126 | mode="pkgmngt">
|
---|
[575bcf3] | 127 | <xsl:with-param name="order" select="$order"/>
|
---|
[7072e1f] | 128 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 129 | </xsl:apply-templates>
|
---|
| 130 | </xsl:if>
|
---|
| 131 | <!-- Creating dirs and files -->
|
---|
| 132 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
| 133 | <xsl:choose>
|
---|
| 134 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
| 135 | @id='ch-system-createfiles' or
|
---|
| 136 | @id='ch-system-strippingagain'">
|
---|
| 137 | <xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
---|
| 138 | </xsl:when>
|
---|
| 139 | <xsl:otherwise>
|
---|
| 140 | <xsl:text>#!/bin/bash
set +h
</xsl:text>
|
---|
| 141 | </xsl:otherwise>
|
---|
| 142 | </xsl:choose>
|
---|
| 143 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
| 144 | not(@id='ch-system-strippingagain')">
|
---|
| 145 | <xsl:text>set -e
</xsl:text>
|
---|
| 146 | </xsl:if>
|
---|
| 147 | <xsl:text>
</xsl:text>
|
---|
| 148 | <xsl:if test="sect2[@role='installation']">
|
---|
| 149 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
| 150 | </xsl:if>
|
---|
[f0a31de] | 151 | <xsl:apply-templates select="sect2|
|
---|
| 152 | screen[not(@role) or
|
---|
| 153 | @role!='nodump']/userinput"/>
|
---|
[e6e0c85] | 154 | <xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
|
---|
[f0a31de] | 155 | <xsl:apply-templates
|
---|
| 156 | select="document('packageManager.xml')//sect1[
|
---|
| 157 | @id='ch-pkgmngt-creatingdirs'
|
---|
[e6e0c85] | 158 | ]//userinput"
|
---|
| 159 | mode="pkgmngt"/>
|
---|
[f0a31de] | 160 | </xsl:if>
|
---|
[e6e0c85] | 161 | <xsl:if test="@id='ch-system-createfiles' and $pkgmngt='y'">
|
---|
[f0a31de] | 162 | <xsl:apply-templates
|
---|
| 163 | select="document('packageManager.xml')//sect1[
|
---|
| 164 | @id='ch-pkgmngt-createfiles'
|
---|
[e6e0c85] | 165 | ]//userinput"
|
---|
| 166 | mode="pkgmngt"/>
|
---|
[f0a31de] | 167 | </xsl:if>
|
---|
[d68eb1b] | 168 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
[f0a31de] | 169 | <xsl:text>exit
</xsl:text>
|
---|
| 170 | </exsl:document>
|
---|
| 171 | </xsl:if>
|
---|
| 172 | </xsl:template>
|
---|
| 173 |
|
---|
| 174 | <xsl:template match="sect2">
|
---|
| 175 | <xsl:apply-templates
|
---|
| 176 | select=".//screen[not(@role) or
|
---|
| 177 | @role != 'nodump']/userinput[
|
---|
| 178 | @remap = 'pre' or
|
---|
| 179 | @remap = 'configure' or
|
---|
| 180 | @remap = 'make' or
|
---|
| 181 | @remap = 'test' and
|
---|
[f2e80ac] | 182 | not(current()/../@id='ch-tools-dejagnu') and
|
---|
| 183 | not(current()/../@id='ch-system-systemd')]"/>
|
---|
[f0a31de] | 184 | <xsl:if
|
---|
| 185 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 186 | $pkgmngt = 'y' and
|
---|
| 187 | descendant::screen[not(@role) or
|
---|
| 188 | @role != 'nodump']/userinput[
|
---|
| 189 | @remap='install']">
|
---|
[df42c7c] | 190 | <xsl:choose>
|
---|
| 191 | <xsl:when test="$wrap-install='y'">
|
---|
| 192 | <xsl:text>wrapInstall '
|
---|
| 193 | </xsl:text>
|
---|
| 194 | </xsl:when>
|
---|
| 195 | <xsl:otherwise>
|
---|
| 196 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
[7072e1f] | 197 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
| 198 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
| 199 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
| 200 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
| 201 | case $(uname -m) in
|
---|
| 202 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
| 203 | esac
|
---|
| 204 | </xsl:text>
|
---|
[df42c7c] | 205 | </xsl:otherwise>
|
---|
| 206 | </xsl:choose>
|
---|
[f0a31de] | 207 | </xsl:if>
|
---|
| 208 | <xsl:if test="../@id = 'ch-system-glibc' and
|
---|
[90f304c] | 209 | @role='installation' and
|
---|
[df42c7c] | 210 | $pkgmngt = 'y' and
|
---|
| 211 | $wrap-install = 'n'">
|
---|
[f0a31de] | 212 | <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
---|
[7072e1f] | 213 | </xsl:text>
|
---|
[f0a31de] | 214 | </xsl:if>
|
---|
| 215 | <xsl:apply-templates
|
---|
| 216 | select=".//screen[not(@role) or
|
---|
| 217 | @role != 'nodump']/userinput[@remap = 'install']"/>
|
---|
| 218 | <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 219 | $pkgmngt = 'y' and
|
---|
| 220 | descendant::screen[not(@role) or
|
---|
| 221 | @role != 'nodump']/userinput[
|
---|
| 222 | @remap='install']">
|
---|
[df42c7c] | 223 | <xsl:choose>
|
---|
| 224 | <xsl:when test="$wrap-install='y'">
|
---|
| 225 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
[560bef1] | 226 | <!-- these files are provided by the shadow package -->
|
---|
[df42c7c] | 227 | <xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
[560bef1] | 228 | </xsl:text>
|
---|
[df42c7c] | 229 | </xsl:if>
|
---|
[560bef1] | 230 | <!-- Attr man/man2 pages are already installed by man-pages. As of
|
---|
[00313dd] | 231 | March 2013, they are the same pages.
|
---|
| 232 | November 2015: now they are more accurate
|
---|
| 233 | in man-pages, and the man5 section is also in man-pages... -->
|
---|
[df42c7c] | 234 | <xsl:if test="../@id = 'ch-system-attr'">
|
---|
| 235 | <xsl:text>rm -fv /usr/share/man/man2/*
|
---|
| 236 | rm -fv /usr/share/man/man5/*
|
---|
| 237 | </xsl:text>
|
---|
| 238 | </xsl:if>
|
---|
| 239 | <!-- nologin is installed by util-linux. remove it from shadow -->
|
---|
| 240 | <xsl:if test="../@id = 'ch-system-shadow'">
|
---|
| 241 | <xsl:text>rm -fv /usr/share/man/man8/nologin.8
|
---|
| 242 | rm -fv /sbin/nologin
|
---|
| 243 | </xsl:text>
|
---|
| 244 | </xsl:if>
|
---|
| 245 | <xsl:text>'
|
---|
| 246 | packInstall
|
---|
| 247 | </xsl:text>
|
---|
| 248 | </xsl:when>
|
---|
| 249 | <xsl:otherwise>
|
---|
| 250 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
| 251 | <!-- these files are provided by the shadow package -->
|
---|
| 252 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
| 253 | </xsl:text>
|
---|
| 254 | </xsl:if>
|
---|
| 255 | <!-- Attr man/man2 pages are already installed by man-pages. As of
|
---|
| 256 | March 2013, they are the same pages.
|
---|
| 257 | November 2015: now they are more accurate
|
---|
| 258 | in man-pages, and the man5 section is also in man-pages... -->
|
---|
| 259 | <xsl:if test="../@id = 'ch-system-attr'">
|
---|
| 260 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
---|
[00313dd] | 261 | rm -fv $PKG_DEST/usr/share/man/man5/*
|
---|
[a983256] | 262 | </xsl:text>
|
---|
[df42c7c] | 263 | </xsl:if>
|
---|
[a983256] | 264 | <!-- nologin is installed by util-linux. remove it from shadow -->
|
---|
[df42c7c] | 265 | <xsl:if test="../@id = 'ch-system-shadow'">
|
---|
| 266 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
---|
[a983256] | 267 | rm -fv $PKG_DEST/sbin/nologin
|
---|
[7072e1f] | 268 | </xsl:text>
|
---|
[df42c7c] | 269 | </xsl:if>
|
---|
| 270 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
[7072e1f] | 271 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
| 272 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
| 273 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 274 | done
|
---|
| 275 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
| 276 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 277 | done
|
---|
| 278 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
| 279 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 280 | done
|
---|
| 281 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
| 282 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 283 | done
|
---|
| 284 | packInstall
|
---|
| 285 | rm -rf $PKG_DEST
|
---|
| 286 | </xsl:text>
|
---|
[df42c7c] | 287 | </xsl:otherwise>
|
---|
| 288 | </xsl:choose>
|
---|
[f0a31de] | 289 | </xsl:if>
|
---|
| 290 | <xsl:if test="$testsuite='3' and
|
---|
| 291 | ../@id='ch-tools-glibc' and
|
---|
| 292 | @role='installation'">
|
---|
| 293 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 294 | <xsl:text>
</xsl:text>
|
---|
| 295 | </xsl:if>
|
---|
| 296 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
| 297 | <xsl:choose>
|
---|
| 298 | <xsl:when test="$full-locale='y'">
|
---|
| 299 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
| 300 | <xsl:text>
</xsl:text>
|
---|
| 301 | </xsl:when>
|
---|
| 302 | <xsl:otherwise>
|
---|
| 303 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 304 | <xsl:text>
</xsl:text>
|
---|
| 305 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
| 306 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
| 307 | <xsl:value-of select="$lang"/>
|
---|
| 308 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
[b339c94] | 309 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
| 310 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
| 311 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
| 312 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
| 313 | fi
|
---|
| 314 | </xsl:text>
|
---|
[f0a31de] | 315 | </xsl:if>
|
---|
| 316 | </xsl:otherwise>
|
---|
| 317 | </xsl:choose>
|
---|
[c4cf6de] | 318 | </xsl:if>
|
---|
[f0a31de] | 319 | <xsl:apply-templates
|
---|
| 320 | select=".//screen[
|
---|
| 321 | not(@role) or
|
---|
| 322 | @role != 'nodump'
|
---|
| 323 | ]/userinput[
|
---|
[f2e80ac] | 324 | not(@remap) or
|
---|
| 325 | @remap='adjust' or
|
---|
| 326 | @remap='test' and current()/../@id='ch-tools-dejagnu' or
|
---|
| 327 | @remap='test' and current()/../@id='ch-system-systemd'
|
---|
[f0a31de] | 328 | ]"/>
|
---|
[557fe91] | 329 | </xsl:template>
|
---|
| 330 |
|
---|
[f0a31de] | 331 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
[7072e1f] | 332 | <xsl:param name="dirname" select="chapter05"/>
|
---|
| 333 | <!-- The build order -->
|
---|
[575bcf3] | 334 | <xsl:param name="order" select="062"/>
|
---|
[7072e1f] | 335 | <!-- The file names -->
|
---|
| 336 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 337 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 338 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 339 | <!-- Creating dirs and files -->
|
---|
[8099885] | 340 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
| 341 | count(descendant::screen/userinput) >
|
---|
| 342 | count(descendant::screen[@role='nodump'])">
|
---|
| 343 | <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
---|
| 344 | method="text">
|
---|
| 345 | <xsl:text>#!/bin/bash
|
---|
[7072e1f] | 346 | set +h
|
---|
| 347 | set -e
|
---|
| 348 |
|
---|
| 349 | cd $PKGDIR
|
---|
| 350 | </xsl:text>
|
---|
[8099885] | 351 | <xsl:apply-templates
|
---|
| 352 | select=".//screen[not(@role) or
|
---|
| 353 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
[7072e1f] | 354 | mode="pkgmngt"/>
|
---|
[8099885] | 355 | <xsl:if test="$dirname = 'chapter06'">
|
---|
| 356 | <xsl:text>packInstall
|
---|
[df42c7c] | 357 | rm -rf "$PKG_DEST"
|
---|
[7072e1f] | 358 | </xsl:text>
|
---|
[8099885] | 359 | </xsl:if>
|
---|
| 360 | <xsl:apply-templates
|
---|
| 361 | select=".//screen[not(@role) or
|
---|
| 362 | @role != 'nodump'
|
---|
| 363 | ]/userinput[not(@remap) or
|
---|
| 364 | @remap='adjust'
|
---|
[7072e1f] | 365 | ]"
|
---|
| 366 | mode="pkgmngt"/>
|
---|
[8099885] | 367 | <xsl:text>
|
---|
[7072e1f] | 368 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
| 369 | exit
|
---|
| 370 | </xsl:text>
|
---|
[8099885] | 371 | </exsl:document>
|
---|
| 372 | </xsl:if>
|
---|
[557fe91] | 373 | </xsl:template>
|
---|
| 374 |
|
---|
[7072e1f] | 375 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
| 376 | <xsl:apply-templates/>
|
---|
| 377 | <xsl:text>
</xsl:text>
|
---|
| 378 | </xsl:template>
|
---|
| 379 |
|
---|
| 380 | <xsl:template match="userinput">
|
---|
[3eb60fa] | 381 | <xsl:choose>
|
---|
[fd691b4] | 382 | <!-- Copying the kernel config file -->
|
---|
| 383 | <xsl:when test="string() = 'make mrproper'">
|
---|
| 384 | <xsl:text>make mrproper
</xsl:text>
|
---|
[7072e1f] | 385 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
[bcfb3bf] | 386 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
| 387 | </xsl:if>
|
---|
[92568bf] | 388 | </xsl:when>
|
---|
[7072e1f] | 389 | <!-- test instructions -->
|
---|
| 390 | <xsl:when test="@remap = 'test'">
|
---|
[4afcedb] | 391 | <xsl:choose>
|
---|
| 392 | <xsl:when test="$testsuite = '0'"/>
|
---|
| 393 | <xsl:when test="$testsuite = '1' and
|
---|
| 394 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 395 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
[7072e1f] | 396 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
| 397 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
[4afcedb] | 398 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
| 399 | <xsl:when test="$testsuite = '2' and
|
---|
| 400 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
| 401 | <xsl:otherwise>
|
---|
| 402 | <xsl:choose>
|
---|
| 403 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
[7072e1f] | 404 | <xsl:choose>
|
---|
| 405 | <!-- special case for glibc -->
|
---|
| 406 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 407 | <xsl:value-of
|
---|
| 408 | select="substring-before(string(),'2>&1')"/>
|
---|
| 409 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 410 | </xsl:when>
|
---|
[e40a68e] | 411 | <!-- special case for procps-ng -->
|
---|
| 412 | <xsl:when test="contains(string(), 'pushd')">
|
---|
| 413 | <xsl:text>{ </xsl:text>
|
---|
| 414 | <xsl:apply-templates/>
|
---|
| 415 | <xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 416 | </xsl:when>
|
---|
[7072e1f] | 417 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 418 | <xsl:apply-templates/>
|
---|
| 419 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 420 | </xsl:when>
|
---|
| 421 | <xsl:when test="contains(string(), 'make')">
|
---|
| 422 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
| 423 | <xsl:text>make -k</xsl:text>
|
---|
| 424 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
| 425 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 426 | </xsl:when>
|
---|
| 427 | <xsl:otherwise>
|
---|
| 428 | <xsl:apply-templates/>
|
---|
| 429 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 430 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 431 | </xsl:if>
|
---|
| 432 | <xsl:text>
</xsl:text>
|
---|
| 433 | </xsl:otherwise>
|
---|
| 434 | </xsl:choose>
|
---|
[4afcedb] | 435 | </xsl:when>
|
---|
| 436 | <xsl:otherwise>
|
---|
[7072e1f] | 437 | <!-- bomb-testsuite != 'n'-->
|
---|
| 438 | <xsl:choose>
|
---|
| 439 | <!-- special case for glibc -->
|
---|
| 440 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 441 | <xsl:value-of
|
---|
| 442 | select="substring-before(string(),'2>&1')"/>
|
---|
[2c9a16b] | 443 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
[7072e1f] | 444 | </xsl:when>
|
---|
[e40a68e] | 445 | <!-- special case for gmp -->
|
---|
[f663589] | 446 | <xsl:when test="contains(string(), 'tee gmp-check-log')">
|
---|
| 447 | <xsl:text>(</xsl:text>
|
---|
| 448 | <xsl:apply-templates/>
|
---|
| 449 | <xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
---|
| 450 | </xsl:when>
|
---|
[e40a68e] | 451 | <!-- special case for procps-ng -->
|
---|
| 452 | <xsl:when test="contains(string(), 'pushd')">
|
---|
| 453 | <xsl:text>{ </xsl:text>
|
---|
| 454 | <xsl:apply-templates/>
|
---|
| 455 | <xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
---|
| 456 | </xsl:when>
|
---|
[2c9a16b] | 457 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 458 | <xsl:apply-templates/>
|
---|
| 459 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 460 | </xsl:when>
|
---|
[7072e1f] | 461 | <xsl:otherwise>
|
---|
| 462 | <xsl:apply-templates/>
|
---|
| 463 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 464 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 465 | </xsl:if>
|
---|
| 466 | <xsl:text>
</xsl:text>
|
---|
| 467 | </xsl:otherwise>
|
---|
| 468 | </xsl:choose>
|
---|
[4afcedb] | 469 | </xsl:otherwise>
|
---|
| 470 | </xsl:choose>
|
---|
| 471 | </xsl:otherwise>
|
---|
| 472 | </xsl:choose>
|
---|
| 473 | </xsl:when>
|
---|
[7072e1f] | 474 | <!-- End of test instructions -->
|
---|
[fd691b4] | 475 | <!-- Don't stop on strip run -->
|
---|
| 476 | <xsl:when test="contains(string(),'strip ')">
|
---|
[3eb60fa] | 477 | <xsl:apply-templates/>
|
---|
[fd691b4] | 478 | <xsl:text> || true
</xsl:text>
|
---|
[1f025ca] | 479 | </xsl:when>
|
---|
[7072e1f] | 480 | <!-- Package management -->
|
---|
| 481 | <!-- Add $PKG_DEST to installation commands -->
|
---|
| 482 | <xsl:when test="@remap='install' and
|
---|
| 483 | not(ancestor::chapter[
|
---|
| 484 | @id='chapter-temporary-tools'
|
---|
| 485 | ])">
|
---|
| 486 | <xsl:choose>
|
---|
| 487 | <xsl:when test="$pkgmngt='n'">
|
---|
| 488 | <xsl:choose>
|
---|
| 489 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
| 490 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 491 | <xsl:apply-templates/>
|
---|
| 492 | <xsl:text>
fi
</xsl:text>
|
---|
| 493 | </xsl:when>
|
---|
| 494 | <xsl:otherwise>
|
---|
| 495 | <xsl:apply-templates/>
|
---|
| 496 | <xsl:text>
</xsl:text>
|
---|
| 497 | </xsl:otherwise>
|
---|
| 498 | </xsl:choose>
|
---|
| 499 | </xsl:when>
|
---|
[df42c7c] | 500 | <xsl:when test="$wrap-install='y'">
|
---|
| 501 | <xsl:choose>
|
---|
| 502 | <xsl:when test="./literal">
|
---|
| 503 | <xsl:call-template name="output-wrap">
|
---|
| 504 | <xsl:with-param name="commands" select="text()[1]"/>
|
---|
| 505 | </xsl:call-template>
|
---|
| 506 | <xsl:apply-templates select="literal"/>
|
---|
| 507 | <xsl:call-template name="output-wrap">
|
---|
| 508 | <xsl:with-param name="commands" select="text()[2]"/>
|
---|
| 509 | </xsl:call-template>
|
---|
| 510 | </xsl:when>
|
---|
| 511 | <xsl:otherwise>
|
---|
| 512 | <xsl:call-template name="output-wrap">
|
---|
| 513 | <xsl:with-param name="commands" select="string()"/>
|
---|
| 514 | </xsl:call-template>
|
---|
| 515 | </xsl:otherwise>
|
---|
| 516 | </xsl:choose>
|
---|
| 517 | <xsl:text>
</xsl:text>
|
---|
| 518 | </xsl:when>
|
---|
| 519 | <xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'-->
|
---|
[7072e1f] | 520 | <xsl:choose>
|
---|
| 521 | <xsl:when test="./literal">
|
---|
| 522 | <xsl:call-template name="outputpkgdest">
|
---|
[560bef1] | 523 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
[7072e1f] | 524 | </xsl:call-template>
|
---|
| 525 | <xsl:apply-templates select="literal"/>
|
---|
| 526 | <xsl:call-template name="outputpkgdest">
|
---|
[560bef1] | 527 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
[7072e1f] | 528 | </xsl:call-template>
|
---|
| 529 | </xsl:when>
|
---|
| 530 | <xsl:otherwise>
|
---|
| 531 | <xsl:call-template name="outputpkgdest">
|
---|
| 532 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
| 533 | </xsl:call-template>
|
---|
| 534 | </xsl:otherwise>
|
---|
| 535 | </xsl:choose>
|
---|
| 536 | </xsl:otherwise>
|
---|
| 537 | </xsl:choose>
|
---|
| 538 | </xsl:when>
|
---|
[57ef0c1] | 539 | <!-- if package management, we should make an independant package for
|
---|
| 540 | tzdata. -->
|
---|
| 541 | <xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
---|
| 542 | <xsl:text>
|
---|
[df42c7c] | 543 | OLD_PKG_DEST="$PKG_DEST"
|
---|
[57ef0c1] | 544 | OLD_PKGDIR=$PKGDIR
|
---|
[56d8426] | 545 | PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
|
---|
[57ef0c1] | 546 | PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
---|
| 547 | <xsl:copy-of select="substring-before(
|
---|
| 548 | substring-after(string(),'tzdata'),
|
---|
| 549 | '.tar')"/>
|
---|
| 550 | <xsl:text>
|
---|
| 551 | </xsl:text>
|
---|
[df42c7c] | 552 | <xsl:choose>
|
---|
| 553 | <xsl:when test="$wrap-install='n'">
|
---|
| 554 | <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
---|
| 555 | <xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
---|
| 556 | <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
---|
| 557 | <xsl:text>
|
---|
[57ef0c1] | 558 | packInstall
|
---|
| 559 | rm -rf $PKG_DEST
|
---|
[df42c7c] | 560 | </xsl:text>
|
---|
| 561 | </xsl:when>
|
---|
| 562 | <xsl:otherwise><!-- wrap-install='y' -->
|
---|
| 563 | <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
---|
| 564 | <xsl:text>
|
---|
| 565 | wrapInstall '
|
---|
| 566 | ZONEINFO=</xsl:text>
|
---|
| 567 | <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
---|
| 568 | <xsl:text>'
|
---|
| 569 | packInstall
|
---|
| 570 | </xsl:text>
|
---|
| 571 | </xsl:otherwise>
|
---|
| 572 | </xsl:choose>
|
---|
| 573 | <xsl:text>
|
---|
[57ef0c1] | 574 | PKG_DEST=$OLD_PKG_DEST
|
---|
| 575 | unset OLD_PKG_DEST
|
---|
| 576 | PKGDIR=$OLD_PKGDIR
|
---|
| 577 | unset OLD_PKGDIR
|
---|
| 578 | </xsl:text>
|
---|
| 579 | </xsl:when><!-- addition for tzdata + package management -->
|
---|
[7072e1f] | 580 | <!-- End addition for package management -->
|
---|
[fd691b4] | 581 | <!-- The rest of commands -->
|
---|
[1f025ca] | 582 | <xsl:otherwise>
|
---|
| 583 | <xsl:apply-templates/>
|
---|
[fd691b4] | 584 | <xsl:text>
</xsl:text>
|
---|
[1f025ca] | 585 | </xsl:otherwise>
|
---|
| 586 | </xsl:choose>
|
---|
| 587 | </xsl:template>
|
---|
[7072e1f] | 588 |
|
---|
[557fe91] | 589 | <xsl:template match="replaceable">
|
---|
[a41ce58] | 590 | <xsl:choose>
|
---|
[2a54650] | 591 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
[877cc6a] | 592 | <xsl:value-of select="$timezone"/>
|
---|
[2a54650] | 593 | </xsl:when>
|
---|
[a41ce58] | 594 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
[877cc6a] | 595 | <xsl:value-of select="$page"/>
|
---|
[a41ce58] | 596 | </xsl:when>
|
---|
[81a7fb8] | 597 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
| 598 | <xsl:value-of select="$lang"/>
|
---|
| 599 | </xsl:when>
|
---|
[77fa8ba] | 600 | <xsl:when test="contains(string(.),'Domain')">
|
---|
| 601 | <xsl:value-of select="$domain"/>
|
---|
| 602 | </xsl:when>
|
---|
| 603 | <xsl:when test="contains(string(.),'primary')">
|
---|
| 604 | <xsl:value-of select="$nameserver1"/>
|
---|
| 605 | </xsl:when>
|
---|
| 606 | <xsl:when test="contains(string(.),'secondary')">
|
---|
| 607 | <xsl:value-of select="$nameserver2"/>
|
---|
| 608 | </xsl:when>
|
---|
| 609 | <xsl:when test="contains(string(.),'192.168.1.1')">
|
---|
| 610 | <xsl:value-of select="$ip"/>
|
---|
| 611 | </xsl:when>
|
---|
[e43d0d0] | 612 | <xsl:when test="contains(string(.),'192.168.0.2')">
|
---|
| 613 | <xsl:value-of select="$ip"/>
|
---|
| 614 | </xsl:when>
|
---|
| 615 | <!-- Only adapted to LFS-20170310 and later -->
|
---|
[77fa8ba] | 616 | <xsl:when test="contains(string(.),'HOSTNAME')">
|
---|
| 617 | <xsl:value-of select="$hostname"/>
|
---|
| 618 | </xsl:when>
|
---|
[e43d0d0] | 619 | <xsl:when test="contains(string(.),'FQDN')">
|
---|
[77fa8ba] | 620 | <xsl:value-of select="$hostname"/>
|
---|
[e43d0d0] | 621 | <xsl:text>.</xsl:text>
|
---|
| 622 | <xsl:value-of select="$domain"/>
|
---|
[77fa8ba] | 623 | </xsl:when>
|
---|
[e43d0d0] | 624 | <xsl:when test="contains(string(.),'alias')"/>
|
---|
[77fa8ba] | 625 | <xsl:when test="contains(string(.),'<lfs>')">
|
---|
| 626 | <xsl:value-of select="$hostname"/>
|
---|
| 627 | </xsl:when>
|
---|
[a41ce58] | 628 | <xsl:otherwise>
|
---|
| 629 | <xsl:text>**EDITME</xsl:text>
|
---|
| 630 | <xsl:apply-templates/>
|
---|
| 631 | <xsl:text>EDITME**</xsl:text>
|
---|
| 632 | </xsl:otherwise>
|
---|
| 633 | </xsl:choose>
|
---|
[557fe91] | 634 | </xsl:template>
|
---|
[7072e1f] | 635 |
|
---|
[77fa8ba] | 636 | <xsl:template match="literal">
|
---|
| 637 | <xsl:choose>
|
---|
| 638 | <xsl:when test="contains(string(),'ONBOOT')">
|
---|
| 639 | <xsl:call-template name="outputnet">
|
---|
| 640 | <xsl:with-param name="netstring" select="string()"/>
|
---|
| 641 | </xsl:call-template>
|
---|
| 642 | </xsl:when>
|
---|
[d8ddcfb] | 643 | <xsl:when test="contains(string(),'[Match]')">
|
---|
| 644 | <xsl:call-template name="outputsysdnet">
|
---|
| 645 | <xsl:with-param name="netstring" select="string()"/>
|
---|
| 646 | </xsl:call-template>
|
---|
| 647 | </xsl:when>
|
---|
[77fa8ba] | 648 | <xsl:otherwise>
|
---|
| 649 | <xsl:apply-templates/>
|
---|
| 650 | </xsl:otherwise>
|
---|
| 651 | </xsl:choose>
|
---|
| 652 | </xsl:template>
|
---|
| 653 |
|
---|
| 654 | <xsl:template name="outputnet">
|
---|
| 655 | <xsl:param name="netstring" select="''"/>
|
---|
| 656 | <!-- We suppose that book example has the following values:
|
---|
| 657 | - interface: eth0
|
---|
[33ff403] | 658 | - ip: 192.168.1.2
|
---|
| 659 | - gateway: 192.168.1.1
|
---|
[77fa8ba] | 660 | - prefix: 24
|
---|
| 661 | - broadcast: 192.168.1.255
|
---|
| 662 | Change below if book changes -->
|
---|
| 663 | <xsl:choose>
|
---|
| 664 | <xsl:when test="contains($netstring,'eth0')">
|
---|
| 665 | <xsl:call-template name="outputnet">
|
---|
| 666 | <xsl:with-param name="netstring"
|
---|
| 667 | select="substring-before($netstring,'eth0')"/>
|
---|
| 668 | </xsl:call-template>
|
---|
| 669 | <xsl:value-of select="$interface"/>
|
---|
| 670 | <xsl:call-template name="outputnet">
|
---|
| 671 | <xsl:with-param name="netstring"
|
---|
| 672 | select="substring-after($netstring,'eth0')"/>
|
---|
| 673 | </xsl:call-template>
|
---|
| 674 | </xsl:when>
|
---|
| 675 | <xsl:when test="contains($netstring,'192.168.1.1')">
|
---|
| 676 | <xsl:call-template name="outputnet">
|
---|
| 677 | <xsl:with-param name="netstring"
|
---|
| 678 | select="substring-before($netstring,'192.168.1.1')"/>
|
---|
| 679 | </xsl:call-template>
|
---|
[33ff403] | 680 | <xsl:value-of select="$gateway"/>
|
---|
[77fa8ba] | 681 | <xsl:call-template name="outputnet">
|
---|
| 682 | <xsl:with-param name="netstring"
|
---|
| 683 | select="substring-after($netstring,'192.168.1.1')"/>
|
---|
| 684 | </xsl:call-template>
|
---|
| 685 | </xsl:when>
|
---|
| 686 | <!-- must test this before the following, because 192.168.1.255 contains
|
---|
| 687 | 192.168.1.2! -->
|
---|
| 688 | <xsl:when test="contains($netstring,'192.168.1.255')">
|
---|
| 689 | <xsl:call-template name="outputnet">
|
---|
| 690 | <xsl:with-param name="netstring"
|
---|
| 691 | select="substring-before($netstring,'192.168.1.255')"/>
|
---|
| 692 | </xsl:call-template>
|
---|
| 693 | <xsl:value-of select="$broadcast"/>
|
---|
| 694 | <xsl:call-template name="outputnet">
|
---|
| 695 | <xsl:with-param name="netstring"
|
---|
| 696 | select="substring-after($netstring,'192.168.1.255')"/>
|
---|
| 697 | </xsl:call-template>
|
---|
| 698 | </xsl:when>
|
---|
| 699 | <xsl:when test="contains($netstring,'192.168.1.2')">
|
---|
| 700 | <xsl:call-template name="outputnet">
|
---|
| 701 | <xsl:with-param name="netstring"
|
---|
| 702 | select="substring-before($netstring,'192.168.1.2')"/>
|
---|
| 703 | </xsl:call-template>
|
---|
[33ff403] | 704 | <xsl:value-of select="$ip"/>
|
---|
[77fa8ba] | 705 | <xsl:call-template name="outputnet">
|
---|
| 706 | <xsl:with-param name="netstring"
|
---|
| 707 | select="substring-after($netstring,'192.168.1.2')"/>
|
---|
| 708 | </xsl:call-template>
|
---|
| 709 | </xsl:when>
|
---|
| 710 | <xsl:when test="contains($netstring,'24')">
|
---|
| 711 | <xsl:call-template name="outputnet">
|
---|
| 712 | <xsl:with-param name="netstring"
|
---|
| 713 | select="substring-before($netstring,'24')"/>
|
---|
| 714 | </xsl:call-template>
|
---|
| 715 | <xsl:value-of select="$prefix"/>
|
---|
| 716 | <xsl:call-template name="outputnet">
|
---|
| 717 | <xsl:with-param name="netstring"
|
---|
| 718 | select="substring-after($netstring,'24')"/>
|
---|
| 719 | </xsl:call-template>
|
---|
| 720 | </xsl:when>
|
---|
| 721 | <xsl:otherwise>
|
---|
| 722 | <xsl:value-of select="$netstring"/>
|
---|
| 723 | </xsl:otherwise>
|
---|
| 724 | </xsl:choose>
|
---|
| 725 | </xsl:template>
|
---|
| 726 |
|
---|
[d8ddcfb] | 727 | <xsl:template name="outputsysdnet">
|
---|
| 728 | <xsl:param name="netstring" select="''"/>
|
---|
| 729 | <!-- We suppose that book example has the following values:
|
---|
| 730 | - interface: eth0
|
---|
| 731 | - ip: 192.168.0.2
|
---|
| 732 | - gateway: 192.168.0.1
|
---|
| 733 | - prefix: 24
|
---|
| 734 | - DNS: 192.168.0.1
|
---|
| 735 | - Domain: <Your Domain Name>
|
---|
| 736 | and gateway comes before DNS. Change below if book changes -->
|
---|
| 737 | <xsl:choose>
|
---|
| 738 | <xsl:when test="contains($netstring,'eth0')">
|
---|
| 739 | <xsl:call-template name="outputsysdnet">
|
---|
| 740 | <xsl:with-param name="netstring"
|
---|
| 741 | select="substring-before($netstring,'eth0')"/>
|
---|
| 742 | </xsl:call-template>
|
---|
| 743 | <xsl:value-of select="$interface"/>
|
---|
| 744 | <xsl:call-template name="outputsysdnet">
|
---|
| 745 | <xsl:with-param name="netstring"
|
---|
| 746 | select="substring-after($netstring,'eth0')"/>
|
---|
| 747 | </xsl:call-template>
|
---|
| 748 | </xsl:when>
|
---|
| 749 | <xsl:when test="contains($netstring,'192.168.0.1') and
|
---|
| 750 | contains($netstring,'Gateway')">
|
---|
| 751 | <xsl:call-template name="outputsysdnet">
|
---|
| 752 | <xsl:with-param name="netstring"
|
---|
| 753 | select="substring-before($netstring,'192.168.0.1')"/>
|
---|
| 754 | </xsl:call-template>
|
---|
| 755 | <xsl:value-of select="$gateway"/>
|
---|
| 756 | <xsl:call-template name="outputsysdnet">
|
---|
| 757 | <xsl:with-param name="netstring"
|
---|
| 758 | select="substring-after($netstring,'192.168.0.1')"/>
|
---|
| 759 | </xsl:call-template>
|
---|
| 760 | </xsl:when>
|
---|
| 761 | <xsl:when test="contains($netstring,'192.168.0.1') and
|
---|
| 762 | not(contains($netstring,'Gateway'))">
|
---|
| 763 | <xsl:call-template name="outputsysdnet">
|
---|
| 764 | <xsl:with-param name="netstring"
|
---|
| 765 | select="substring-before($netstring,'192.168.0.1')"/>
|
---|
| 766 | </xsl:call-template>
|
---|
| 767 | <xsl:value-of select="$nameserver1"/>
|
---|
| 768 | <xsl:text>
|
---|
| 769 | DNS=</xsl:text>
|
---|
| 770 | <xsl:value-of select="$nameserver2"/>
|
---|
| 771 | <xsl:call-template name="outputsysdnet">
|
---|
| 772 | <xsl:with-param name="netstring"
|
---|
| 773 | select="substring-after($netstring,'192.168.0.1')"/>
|
---|
| 774 | </xsl:call-template>
|
---|
| 775 | </xsl:when>
|
---|
| 776 | <xsl:when test="contains($netstring,'192.168.0.2')">
|
---|
| 777 | <xsl:call-template name="outputsysdnet">
|
---|
| 778 | <xsl:with-param name="netstring"
|
---|
| 779 | select="substring-before($netstring,'192.168.0.2')"/>
|
---|
| 780 | </xsl:call-template>
|
---|
| 781 | <xsl:value-of select="$ip"/>
|
---|
| 782 | <xsl:call-template name="outputsysdnet">
|
---|
| 783 | <xsl:with-param name="netstring"
|
---|
| 784 | select="substring-after($netstring,'192.168.0.2')"/>
|
---|
| 785 | </xsl:call-template>
|
---|
| 786 | </xsl:when>
|
---|
| 787 | <xsl:when test="contains($netstring,'24')">
|
---|
| 788 | <xsl:call-template name="outputsysdnet">
|
---|
| 789 | <xsl:with-param name="netstring"
|
---|
| 790 | select="substring-before($netstring,'24')"/>
|
---|
| 791 | </xsl:call-template>
|
---|
| 792 | <xsl:value-of select="$prefix"/>
|
---|
| 793 | <xsl:call-template name="outputsysdnet">
|
---|
| 794 | <xsl:with-param name="netstring"
|
---|
| 795 | select="substring-after($netstring,'24')"/>
|
---|
| 796 | </xsl:call-template>
|
---|
| 797 | </xsl:when>
|
---|
| 798 | <xsl:when test="contains($netstring,'<Your Domain Name>')">
|
---|
| 799 | <xsl:call-template name="outputsysdnet">
|
---|
| 800 | <xsl:with-param name="netstring"
|
---|
| 801 | select="substring-before($netstring,'<Your Domain Name>')"/>
|
---|
| 802 | </xsl:call-template>
|
---|
| 803 | <xsl:value-of select="$domain"/>
|
---|
| 804 | <xsl:call-template name="outputsysdnet">
|
---|
| 805 | <xsl:with-param name="netstring"
|
---|
| 806 | select="substring-after($netstring,'<Your Domain Name>')"/>
|
---|
| 807 | </xsl:call-template>
|
---|
| 808 | </xsl:when>
|
---|
| 809 | <xsl:otherwise>
|
---|
| 810 | <xsl:value-of select="$netstring"/>
|
---|
| 811 | </xsl:otherwise>
|
---|
| 812 | </xsl:choose>
|
---|
| 813 | </xsl:template>
|
---|
| 814 |
|
---|
[7072e1f] | 815 | <xsl:template name="outputpkgdest">
|
---|
| 816 | <xsl:param name="outputstring" select="foo"/>
|
---|
| 817 | <xsl:choose>
|
---|
| 818 | <xsl:when test="contains($outputstring,'make ')">
|
---|
| 819 | <xsl:choose>
|
---|
| 820 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
| 821 | <xsl:call-template name="outputpkgdest">
|
---|
| 822 | <xsl:with-param name="outputstring"
|
---|
| 823 | select="substring-before($outputstring,'make')"/>
|
---|
| 824 | </xsl:call-template>
|
---|
| 825 | <xsl:call-template name="outputpkgdest">
|
---|
| 826 | <xsl:with-param
|
---|
| 827 | name="outputstring"
|
---|
| 828 | select="substring-after($outputstring,
|
---|
| 829 | substring-before($outputstring,'make'))"/>
|
---|
| 830 | </xsl:call-template>
|
---|
| 831 | </xsl:when>
|
---|
| 832 | <xsl:otherwise>
|
---|
| 833 | <xsl:choose>
|
---|
| 834 | <!-- special cases (no DESTDIR) here -->
|
---|
| 835 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
| 836 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
| 837 | <xsl:value-of
|
---|
| 838 | select="substring-before(substring-after(string(),'make'),
|
---|
| 839 | 'install')"/>
|
---|
| 840 | <xsl:text>install
</xsl:text>
|
---|
| 841 | </xsl:when>
|
---|
| 842 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
| 843 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
| 844 | </xsl:when>
|
---|
| 845 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
| 846 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
| 847 | </xsl:when>
|
---|
| 848 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
[b1f4a8d] | 849 | <xsl:text>make DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
|
---|
[7072e1f] | 850 | <xsl:value-of
|
---|
[b1f4a8d] | 851 | select="substring-before(substring-after(string(),'DOCDIR='),
|
---|
[7072e1f] | 852 | 'install')"/>
|
---|
| 853 | <xsl:text>install
</xsl:text>
|
---|
| 854 | </xsl:when>
|
---|
| 855 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
| 856 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
| 857 | <xsl:value-of
|
---|
| 858 | select="substring-before(substring-after(string(),'make'),
|
---|
| 859 | 'install')"/>
|
---|
| 860 | <xsl:text>install
</xsl:text>
|
---|
| 861 | </xsl:when>
|
---|
| 862 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
| 863 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
| 864 | <xsl:value-of
|
---|
| 865 | select="substring-before(substring-after(string(),'make'),
|
---|
| 866 | 'install')"/>
|
---|
| 867 | <xsl:text>install
</xsl:text>
|
---|
| 868 | </xsl:when>
|
---|
[560bef1] | 869 | <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
|
---|
| 870 | <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
|
---|
| 871 | <xsl:call-template name="outputpkgdest">
|
---|
| 872 | <xsl:with-param name="outputstring"
|
---|
| 873 | select="substring-after($outputstring,'make')"/>
|
---|
| 874 | </xsl:call-template>
|
---|
| 875 | </xsl:when>
|
---|
[7072e1f] | 876 | <xsl:otherwise>
|
---|
[560bef1] | 877 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
[e6e0c85] | 878 | <xsl:call-template name="outputpkgdest">
|
---|
[560bef1] | 879 | <xsl:with-param
|
---|
[7072e1f] | 880 | name="outputstring"
|
---|
| 881 | select="substring-after($outputstring,'make')"/>
|
---|
[560bef1] | 882 | </xsl:call-template>
|
---|
[7072e1f] | 883 | </xsl:otherwise>
|
---|
| 884 | </xsl:choose>
|
---|
| 885 | </xsl:otherwise>
|
---|
| 886 | </xsl:choose>
|
---|
| 887 | </xsl:when>
|
---|
| 888 | <xsl:otherwise> <!-- no make in this string -->
|
---|
| 889 | <xsl:choose>
|
---|
| 890 | <xsl:when test="contains($outputstring,'>/') and
|
---|
| 891 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
| 892 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
| 893 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
| 894 | <xsl:call-template name="outputpkgdest">
|
---|
| 895 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
| 896 | </xsl:call-template>
|
---|
| 897 | </xsl:when>
|
---|
| 898 | <xsl:when test="contains($outputstring,' /')">
|
---|
| 899 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
| 900 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
| 901 | <xsl:call-template name="outputpkgdest">
|
---|
| 902 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
| 903 | </xsl:call-template>
|
---|
| 904 | </xsl:when>
|
---|
| 905 | <xsl:otherwise>
|
---|
| 906 | <xsl:value-of select="$outputstring"/>
|
---|
| 907 | <xsl:text>
</xsl:text>
|
---|
| 908 | </xsl:otherwise>
|
---|
| 909 | </xsl:choose>
|
---|
| 910 | </xsl:otherwise>
|
---|
| 911 | </xsl:choose>
|
---|
| 912 | </xsl:template>
|
---|
[df42c7c] | 913 |
|
---|
| 914 | <xsl:variable name="APOS">'</xsl:variable>
|
---|
| 915 | <xsl:template name="output-wrap">
|
---|
| 916 | <xsl:param name="commands" select="''"/>
|
---|
| 917 | <xsl:choose>
|
---|
| 918 | <xsl:when test="contains($commands,string($APOS))">
|
---|
| 919 | <xsl:call-template name="output-wrap">
|
---|
| 920 | <xsl:with-param name="commands"
|
---|
| 921 | select="substring-before($commands,string($APOS))"/>
|
---|
| 922 | </xsl:call-template>
|
---|
| 923 | <xsl:text>'\''</xsl:text>
|
---|
| 924 | <xsl:call-template name="output-wrap">
|
---|
| 925 | <xsl:with-param name="commands"
|
---|
| 926 | select="substring-after($commands,string($APOS))"/>
|
---|
| 927 | </xsl:call-template>
|
---|
| 928 | </xsl:when>
|
---|
| 929 | <xsl:otherwise>
|
---|
| 930 | <xsl:value-of select="$commands"/>
|
---|
| 931 | </xsl:otherwise>
|
---|
| 932 | </xsl:choose>
|
---|
| 933 | </xsl:template>
|
---|
| 934 |
|
---|
[557fe91] | 935 | </xsl:stylesheet>
|
---|