[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 |
|
---|
[945ccaa] | 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 | -->
|
---|
[945ccaa] | 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"'/>
|
---|
[2e1c1c3] | 25 |
|
---|
[31d6944] | 26 | <!-- Run test suites?
|
---|
| 27 | 0 = none
|
---|
[945ccaa] | 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 | -->
|
---|
[945ccaa] | 38 | <xsl:param name="bomb-testsuite" select="'n'"/>
|
---|
[28f4756] | 39 |
|
---|
[085435e] | 40 | <!-- Install non wide character ncurses 5? -->
|
---|
| 41 | <xsl:param name="ncurses5" select="'n'"/>
|
---|
[2e1c1c3] | 42 |
|
---|
[dc7fd7b] | 43 | <!-- Should we strip excutables and libraries? -->
|
---|
| 44 | <xsl:param name='strip' select="'n'"/>
|
---|
| 45 |
|
---|
| 46 | <!-- Should we remove .la files after chapter 5 and chapter 6? -->
|
---|
| 47 | <xsl:param name='del-la-files' select="'y'"/>
|
---|
| 48 |
|
---|
[877cc6a] | 49 | <!-- Time zone -->
|
---|
[945ccaa] | 50 | <xsl:param name="timezone" select="'GMT'"/>
|
---|
[2e1c1c3] | 51 |
|
---|
[877cc6a] | 52 | <!-- Page size -->
|
---|
[945ccaa] | 53 | <xsl:param name="page" select="'letter'"/>
|
---|
[2e1c1c3] | 54 |
|
---|
[877cc6a] | 55 | <!-- Locale settings -->
|
---|
[945ccaa] | 56 | <xsl:param name="lang" select="'C'"/>
|
---|
[b339c94] | 57 |
|
---|
| 58 | <!-- Install the whole set of locales -->
|
---|
[945ccaa] | 59 | <xsl:param name='full-locale' select='"n"'/>
|
---|
[2e1c1c3] | 60 |
|
---|
[945ccaa] | 61 | <!-- Hostname -->
|
---|
| 62 | <xsl:param name='hostname' select='"HOSTNAME"'/>
|
---|
| 63 |
|
---|
| 64 | <!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
|
---|
| 65 | and nameservers -->
|
---|
| 66 | <xsl:param name='interface' select="'eth0'"/>
|
---|
| 67 | <xsl:param name='ip' select='"10.0.2.9"'/>
|
---|
| 68 | <xsl:param name='gateway' select='"10.0.2.2"'/>
|
---|
| 69 | <xsl:param name='prefix' select='24'/>
|
---|
| 70 | <xsl:param name='broadcast' select='"10.0.2.255"'/>
|
---|
| 71 | <xsl:param name='domain' select='"lfs.org"'/>
|
---|
| 72 | <xsl:param name='nameserver1' select='"10.0.2.3"'/>
|
---|
| 73 | <xsl:param name='nameserver2' select='"8.8.8.8"'/>
|
---|
| 74 |
|
---|
[3b43e17b] | 75 | <!-- Console parameters: font, fontmap, unicode (y/n), keymap, local (y:
|
---|
| 76 | hardware clock set to local time/n:hardware clock set to UTC)
|
---|
| 77 | and log-level -->
|
---|
| 78 | <xsl:param name='font' select="'lat0-16'"/>
|
---|
| 79 | <xsl:param name='keymap' select="'us'"/>
|
---|
| 80 | <xsl:param name='local' select="'n'"/>
|
---|
| 81 | <xsl:param name='log-level' select="'4'"/>
|
---|
| 82 |
|
---|
[2758d94] | 83 | <!-- The scripts root is needed for printing disk usage -->
|
---|
| 84 | <xsl:param name='script-root' select="'jhalfs'"/>
|
---|
| 85 |
|
---|
[945ccaa] | 86 | <!-- End parameters -->
|
---|
| 87 |
|
---|
[4762fb9] | 88 | <!-- bashdir is used at the beginning of chapter 6, for the #! line.
|
---|
| 89 | If we created a /tools directory in chapter 4, bash is in /tools/bin,
|
---|
| 90 | otherwise it is in /bin.-->
|
---|
| 91 | <xsl:variable name="bashdir">
|
---|
| 92 | <xsl:choose>
|
---|
[a2b5689] | 93 | <xsl:when test="//sect1[@id='ch-preps-creatingtoolsdir']">
|
---|
[4762fb9] | 94 | <xsl:text>/tools</xsl:text>
|
---|
| 95 | </xsl:when>
|
---|
| 96 | <xsl:otherwise>
|
---|
| 97 | <xsl:text></xsl:text>
|
---|
| 98 | </xsl:otherwise>
|
---|
| 99 | </xsl:choose>
|
---|
| 100 | </xsl:variable>
|
---|
[36f5dce] | 101 |
|
---|
| 102 | <!-- Start of templates -->
|
---|
[557fe91] | 103 | <xsl:template match="/">
|
---|
[36f5dce] | 104 | <xsl:apply-templates select="//chapter[
|
---|
| 105 | @id='chapter-final-preps' or
|
---|
| 106 | @id='chapter-cross-tools' or
|
---|
| 107 | @id='chapter-temporary-tools' or
|
---|
| 108 | @id='chapter-chroot-temporary-tools' or
|
---|
| 109 | @id='chapter-building-system' or
|
---|
| 110 | @id='chapter-config' or
|
---|
| 111 | @id='chapter-bootscripts' or
|
---|
| 112 | @id='chapter-bootable']"/>
|
---|
[557fe91] | 113 | </xsl:template>
|
---|
[2e1c1c3] | 114 |
|
---|
[36f5dce] | 115 | <xsl:template match="chapter">
|
---|
| 116 | <xsl:apply-templates select="./sect1[
|
---|
[13e52a5] | 117 | .//screen[not(@role) or @role != 'nodump']/
|
---|
[36f5dce] | 118 | userinput[not(starts-with(string(),'chroot'))]]">
|
---|
| 119 | <xsl:with-param name="chap-num" select="position()+3"/>
|
---|
| 120 | </xsl:apply-templates>
|
---|
| 121 | <!-- The last condition is a hack to allow old versions of the
|
---|
[d68eb1b] | 122 | book where the chroot commands did not have role="nodump".
|
---|
| 123 | It only works if the chroot command is the only one on the page -->
|
---|
[36f5dce] | 124 | </xsl:template>
|
---|
| 125 |
|
---|
| 126 | <xsl:template match="sect1">
|
---|
| 127 | <xsl:param name="chap-num" select="'1'"/>
|
---|
| 128 | <!-- The dirs names -->
|
---|
| 129 | <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
---|
| 130 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
| 131 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
| 132 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
[7072e1f] | 133 | <!-- The file names -->
|
---|
| 134 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 135 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 136 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 137 | <!-- The build order -->
|
---|
| 138 | <xsl:variable name="position" select="position()"/>
|
---|
| 139 | <xsl:variable name="order">
|
---|
[36f5dce] | 140 | <xsl:value-of select="$chap-num"/>
|
---|
| 141 | <xsl:if test="string-length($position) = 1">
|
---|
| 142 | <xsl:text>0</xsl:text>
|
---|
| 143 | </xsl:if>
|
---|
| 144 | <xsl:value-of select="$position"/>
|
---|
[7072e1f] | 145 | </xsl:variable>
|
---|
| 146 | <!-- Creating dirs and files -->
|
---|
| 147 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
[4762fb9] | 148 | <xsl:text>#!</xsl:text>
|
---|
| 149 | <xsl:if test="@id='ch-system-creatingdirs' or
|
---|
| 150 | @id='ch-system-createfiles' or
|
---|
[bcae37d] | 151 | @id='ch-system-stripping'">
|
---|
[4762fb9] | 152 | <xsl:copy-of select="$bashdir"/>
|
---|
| 153 | </xsl:if>
|
---|
| 154 | <xsl:text>/bin/bash
set +h
</xsl:text>
|
---|
[7072e1f] | 155 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
[bcae37d] | 156 | not(@id='ch-system-stripping')">
|
---|
[7072e1f] | 157 | <xsl:text>set -e
</xsl:text>
|
---|
| 158 | </xsl:if>
|
---|
| 159 | <xsl:text>
</xsl:text>
|
---|
[a131250] | 160 | <xsl:if test="ancestor::chapter/@id != 'chapter-final-preps'">
|
---|
| 161 | <xsl:call-template name="start-script">
|
---|
| 162 | <xsl:with-param name="order" select="$order"/>
|
---|
| 163 | </xsl:call-template>
|
---|
| 164 | </xsl:if>
|
---|
[13e52a5] | 165 | <xsl:apply-templates
|
---|
| 166 | select="sect2 |
|
---|
| 167 | screen[not(@role) or @role!='nodump']/userinput"/>
|
---|
[49f8b03] | 168 | <xsl:if test="contains(@id,'creatingdirs') and $pkgmngt='y'">
|
---|
[f0a31de] | 169 | <xsl:apply-templates
|
---|
| 170 | select="document('packageManager.xml')//sect1[
|
---|
| 171 | @id='ch-pkgmngt-creatingdirs'
|
---|
[e6e0c85] | 172 | ]//userinput"
|
---|
| 173 | mode="pkgmngt"/>
|
---|
[f0a31de] | 174 | </xsl:if>
|
---|
[3484658] | 175 | <xsl:if test="contains(@id,'createfiles') and $pkgmngt='y'">
|
---|
[f0a31de] | 176 | <xsl:apply-templates
|
---|
| 177 | select="document('packageManager.xml')//sect1[
|
---|
| 178 | @id='ch-pkgmngt-createfiles'
|
---|
[e6e0c85] | 179 | ]//userinput"
|
---|
| 180 | mode="pkgmngt"/>
|
---|
[f0a31de] | 181 | </xsl:if>
|
---|
[a131250] | 182 | <xsl:if test="ancestor::chapter/@id != 'chapter-final-preps'">
|
---|
| 183 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
| 184 | <xsl:call-template name="end-script"/>
|
---|
| 185 | </xsl:if>
|
---|
[f0a31de] | 186 | <xsl:text>exit
</xsl:text>
|
---|
| 187 | </exsl:document>
|
---|
[49f8b03] | 188 | <!-- Inclusion of package manager scriptlets -->
|
---|
| 189 | <xsl:if test="$pkgmngt='y' and
|
---|
| 190 | following-sibling::sect1[1][@id='ch-tools-stripping']">
|
---|
| 191 | <xsl:choose>
|
---|
| 192 | <xsl:when test="$bashdir='/tools'">
|
---|
| 193 | <xsl:apply-templates
|
---|
| 194 | select="document('packageManager.xml')//sect1[
|
---|
| 195 | contains(@id,'ch-tools')]"
|
---|
| 196 | mode="pkgmngt">
|
---|
| 197 | <xsl:with-param name="order" select="$order+1"/>
|
---|
| 198 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 199 | </xsl:apply-templates>
|
---|
| 200 | </xsl:when>
|
---|
| 201 | <xsl:otherwise>
|
---|
| 202 | <xsl:apply-templates
|
---|
| 203 | select="document('packageManager.xml')//sect1[
|
---|
| 204 | contains(@id,'ch-chroot')]"
|
---|
| 205 | mode="pkgmngt">
|
---|
| 206 | <xsl:with-param name="order" select="$order+1"/>
|
---|
| 207 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 208 | </xsl:apply-templates>
|
---|
| 209 | </xsl:otherwise>
|
---|
| 210 | </xsl:choose>
|
---|
| 211 | </xsl:if>
|
---|
| 212 | <xsl:if test="$pkgmngt='y' and
|
---|
[bcae37d] | 213 | following-sibling::sect1[2][@id='ch-system-stripping']">
|
---|
[49f8b03] | 214 | <xsl:apply-templates
|
---|
| 215 | select="document('packageManager.xml')//sect1[
|
---|
| 216 | contains(@id,'ch-system')]"
|
---|
| 217 | mode="pkgmngt">
|
---|
| 218 | <xsl:with-param name="order" select="$order+1"/>
|
---|
| 219 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 220 | </xsl:apply-templates>
|
---|
| 221 | </xsl:if>
|
---|
[f0a31de] | 222 | </xsl:template>
|
---|
| 223 |
|
---|
| 224 | <xsl:template match="sect2">
|
---|
| 225 | <xsl:apply-templates
|
---|
[13e52a5] | 226 | select=".//screen[not(@role) or @role != 'nodump']/userinput[
|
---|
[f0a31de] | 227 | @remap = 'pre' or
|
---|
| 228 | @remap = 'configure' or
|
---|
| 229 | @remap = 'make' or
|
---|
| 230 | @remap = 'test' and
|
---|
[f2e80ac] | 231 | not(current()/../@id='ch-tools-dejagnu') and
|
---|
| 232 | not(current()/../@id='ch-system-systemd')]"/>
|
---|
[f0a31de] | 233 | <xsl:if
|
---|
[49f8b03] | 234 | test="ancestor::chapter[@id = 'chapter-building-system' or
|
---|
| 235 | @id = 'chapter-config' or
|
---|
[f017b22] | 236 | @id = 'chapter-bootscripts' or
|
---|
[49f8b03] | 237 | @id = 'chapter-bootable'] and
|
---|
[f0a31de] | 238 | $pkgmngt = 'y' and
|
---|
| 239 | descendant::screen[not(@role) or
|
---|
| 240 | @role != 'nodump']/userinput[
|
---|
| 241 | @remap='install']">
|
---|
[945ccaa] | 242 | <xsl:choose>
|
---|
| 243 | <xsl:when test="$wrap-install='y'">
|
---|
| 244 | <xsl:text>wrapInstall '
|
---|
| 245 | </xsl:text>
|
---|
| 246 | </xsl:when>
|
---|
| 247 | <xsl:otherwise>
|
---|
[adbd09b] | 248 | <!-- We cannot know which directory(ies) are needed by the package. Create a
|
---|
| 249 | reasonable bunch of them. Should be close to "Creating Directories".-->
|
---|
| 250 | <xsl:text>mkdir -pv $PKG_DEST/{bin,boot,etc,lib,sbin}
|
---|
| 251 | mkdir -pv $PKG_DEST/usr/{bin,include,lib/pkgconfig,sbin}
|
---|
[2758d94] | 252 | mkdir -pv $PKG_DEST/usr/share/{doc,info,bash-completion/completions}
|
---|
[7072e1f] | 253 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
| 254 | case $(uname -m) in
|
---|
[adbd09b] | 255 | x86_64) mkdir -v $PKG_DEST/lib64 ;;
|
---|
[7072e1f] | 256 | esac
|
---|
| 257 | </xsl:text>
|
---|
[945ccaa] | 258 | </xsl:otherwise>
|
---|
| 259 | </xsl:choose>
|
---|
[f0a31de] | 260 | </xsl:if>
|
---|
| 261 | <xsl:apply-templates
|
---|
[13e52a5] | 262 | select=".//screen[not(@role) or @role != 'nodump']/
|
---|
| 263 | userinput[@remap = 'install']"/>
|
---|
[49f8b03] | 264 | <xsl:if test="ancestor::chapter[@id = 'chapter-building-system' or
|
---|
| 265 | @id = 'chapter-config' or
|
---|
[f017b22] | 266 | @id = 'chapter-bootscripts' or
|
---|
[49f8b03] | 267 | @id = 'chapter-bootable'] and
|
---|
[f0a31de] | 268 | descendant::screen[not(@role) or
|
---|
| 269 | @role != 'nodump']/userinput[
|
---|
| 270 | @remap='install']">
|
---|
[945ccaa] | 271 | <xsl:choose>
|
---|
[dc7fd7b] | 272 | <xsl:when test="$pkgmngt='n'"/>
|
---|
[945ccaa] | 273 | <xsl:when test="$wrap-install='y'">
|
---|
| 274 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
[560bef1] | 275 | <!-- these files are provided by the shadow package -->
|
---|
[945ccaa] | 276 | <xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
| 277 | </xsl:text>
|
---|
| 278 | </xsl:if>
|
---|
| 279 | <!-- nologin is installed by util-linux. remove it from shadow -->
|
---|
| 280 | <xsl:if test="../@id = 'ch-system-shadow'">
|
---|
| 281 | <xsl:text>rm -fv /usr/share/man/man8/nologin.8
|
---|
| 282 | rm -fv /sbin/nologin
|
---|
| 283 | </xsl:text>
|
---|
| 284 | </xsl:if>
|
---|
| 285 | <xsl:text>'
|
---|
[9bbb9c8] | 286 | PREV_SEC=${SECONDS}
|
---|
[945ccaa] | 287 | packInstall
|
---|
[9bbb9c8] | 288 | SECONDS=${PREV_SEC}
|
---|
[945ccaa] | 289 | </xsl:text>
|
---|
| 290 | </xsl:when>
|
---|
| 291 | <xsl:otherwise>
|
---|
| 292 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
| 293 | <!-- these files are provided by the shadow package -->
|
---|
| 294 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
[a983256] | 295 | </xsl:text>
|
---|
[945ccaa] | 296 | </xsl:if>
|
---|
[a983256] | 297 | <!-- nologin is installed by util-linux. remove it from shadow -->
|
---|
[945ccaa] | 298 | <xsl:if test="../@id = 'ch-system-shadow'">
|
---|
| 299 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
---|
[a983256] | 300 | rm -fv $PKG_DEST/sbin/nologin
|
---|
[7072e1f] | 301 | </xsl:text>
|
---|
[945ccaa] | 302 | </xsl:if>
|
---|
[adbd09b] | 303 | <!-- remove empty directories -->
|
---|
| 304 | <xsl:text>for dir in $PKG_DEST/usr/share/man/man{1..8} \
|
---|
[2758d94] | 305 | $PKG_DEST/usr/share/bash-completion{/completions,} \
|
---|
| 306 | $PKG_DEST/usr/share/{doc,info,man,} \
|
---|
[adbd09b] | 307 | $PKG_DEST/usr/lib/pkgconfig \
|
---|
| 308 | $PKG_DEST/usr/{lib,bin,sbin,include} \
|
---|
| 309 | $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
| 310 | [ -d "$dir" ] && [ -z "$(ls $dir)" ] && rmdir -v $dir
|
---|
[7072e1f] | 311 | done
|
---|
[adbd09b] | 312 | [ -d $PKG_DEST/lib64 ] && [ -z "$(ls $PKG_DEST/lib64)" ] &&
|
---|
| 313 | rmdir -v $PKG_DEST/lib64
|
---|
[46c6113] | 314 | <!-- prevent overwriting symlinks: if a package install something in
|
---|
| 315 | these directories, it'll be lost if not using package management,
|
---|
| 316 | since they are symlinks to tmpfs. So, remove it too if using PM. -->
|
---|
| 317 | rm -rf $PKG_DEST/var/{run,lock}
|
---|
| 318 | <!-- Remove /var if it is empty, then -->
|
---|
| 319 | [ -d $PKG_DEST/var ] && [ -z "$(ls $PKG_DEST/var)" ] && rmdir -v $PKG_DEST/var
|
---|
[9bbb9c8] | 320 | PREV_SEC=${SECONDS}
|
---|
[7072e1f] | 321 | packInstall
|
---|
[9bbb9c8] | 322 | SECONDS=${PREV_SEC}
|
---|
[7072e1f] | 323 | rm -rf $PKG_DEST
|
---|
| 324 | </xsl:text>
|
---|
[945ccaa] | 325 | </xsl:otherwise>
|
---|
| 326 | </xsl:choose>
|
---|
[f0a31de] | 327 | </xsl:if>
|
---|
| 328 | <xsl:if test="$testsuite='3' and
|
---|
| 329 | ../@id='ch-tools-glibc' and
|
---|
| 330 | @role='installation'">
|
---|
| 331 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 332 | <xsl:text>
</xsl:text>
|
---|
| 333 | </xsl:if>
|
---|
| 334 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
| 335 | <xsl:choose>
|
---|
| 336 | <xsl:when test="$full-locale='y'">
|
---|
[cfdb089] | 337 | <xsl:for-each select="//userinput[@remap='locale-full']">
|
---|
| 338 | <xsl:copy-of select="."/>
|
---|
| 339 | <xsl:text>
</xsl:text>
|
---|
| 340 | </xsl:for-each>
|
---|
[f0a31de] | 341 | </xsl:when>
|
---|
| 342 | <xsl:otherwise>
|
---|
| 343 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 344 | <xsl:text>
</xsl:text>
|
---|
| 345 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
| 346 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
| 347 | <xsl:value-of select="$lang"/>
|
---|
| 348 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
[b339c94] | 349 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
| 350 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
| 351 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
| 352 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
| 353 | fi
|
---|
| 354 | </xsl:text>
|
---|
[f0a31de] | 355 | </xsl:if>
|
---|
| 356 | </xsl:otherwise>
|
---|
| 357 | </xsl:choose>
|
---|
[c4cf6de] | 358 | </xsl:if>
|
---|
[f0a31de] | 359 | <xsl:apply-templates
|
---|
[13e52a5] | 360 | select=".//screen[not(@role) or @role != 'nodump']/userinput[
|
---|
[f2e80ac] | 361 | not(@remap) or
|
---|
| 362 | @remap='adjust' or
|
---|
| 363 | @remap='test' and current()/../@id='ch-tools-dejagnu' or
|
---|
| 364 | @remap='test' and current()/../@id='ch-system-systemd'
|
---|
[13e52a5] | 365 | ]"/>
|
---|
[085435e] | 366 | <xsl:if test="../@id='ch-system-ncurses' and $ncurses5='y'">
|
---|
| 367 | <xsl:apply-templates select=".//screen[@role='nodump']"/>
|
---|
| 368 | </xsl:if>
|
---|
[557fe91] | 369 | </xsl:template>
|
---|
| 370 |
|
---|
[f0a31de] | 371 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
[2758d94] | 372 | <xsl:param name="dirname" select="'chapter05'"/>
|
---|
[7072e1f] | 373 | <!-- The build order -->
|
---|
[2758d94] | 374 | <xsl:param name="order" select="'062'"/>
|
---|
[7072e1f] | 375 | <!-- The file names -->
|
---|
| 376 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 377 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 378 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
[3ac3ae1] | 379 | <xsl:variable name="pos">
|
---|
| 380 | <xsl:if test="string-length(position()) = 1">
|
---|
| 381 | <xsl:text>0</xsl:text>
|
---|
| 382 | </xsl:if>
|
---|
| 383 | <xsl:value-of select="position()"/>
|
---|
| 384 | </xsl:variable>
|
---|
[7072e1f] | 385 | <!-- Creating dirs and files -->
|
---|
[8099885] | 386 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
| 387 | count(descendant::screen/userinput) >
|
---|
| 388 | count(descendant::screen[@role='nodump'])">
|
---|
[3ac3ae1] | 389 | <exsl:document href="{$dirname}/{$order}-{$pos}-{$filename}"
|
---|
[8099885] | 390 | method="text">
|
---|
| 391 | <xsl:text>#!/bin/bash
|
---|
[7072e1f] | 392 | set +h
|
---|
| 393 | set -e
|
---|
| 394 | </xsl:text>
|
---|
[2758d94] | 395 | <xsl:call-template name="start-script">
|
---|
[88a8275] | 396 | <xsl:with-param name="order" select="concat($order,'-',$pos)"/>
|
---|
[2758d94] | 397 | </xsl:call-template>
|
---|
[8099885] | 398 | <xsl:apply-templates
|
---|
| 399 | select=".//screen[not(@role) or
|
---|
| 400 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
[7072e1f] | 401 | mode="pkgmngt"/>
|
---|
[49f8b03] | 402 | <xsl:if test="$dirname = 'chapter06' or $dirname = 'chapter08'">
|
---|
[9bbb9c8] | 403 | <xsl:text>PREV_SEC=${SECONDS}
|
---|
| 404 | packInstall
|
---|
| 405 | SECONDS=${PREV_SEC}
|
---|
[945ccaa] | 406 | rm -rf "$PKG_DEST"
|
---|
[7072e1f] | 407 | </xsl:text>
|
---|
[8099885] | 408 | </xsl:if>
|
---|
| 409 | <xsl:apply-templates
|
---|
| 410 | select=".//screen[not(@role) or
|
---|
| 411 | @role != 'nodump'
|
---|
| 412 | ]/userinput[not(@remap) or
|
---|
| 413 | @remap='adjust'
|
---|
[7072e1f] | 414 | ]"
|
---|
| 415 | mode="pkgmngt"/>
|
---|
[8099885] | 416 | <xsl:text>
|
---|
[7072e1f] | 417 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
[2758d94] | 418 | </xsl:text>
|
---|
| 419 | <xsl:call-template name="end-script"/>
|
---|
| 420 | <xsl:text>exit
|
---|
[7072e1f] | 421 | </xsl:text>
|
---|
[8099885] | 422 | </exsl:document>
|
---|
| 423 | </xsl:if>
|
---|
[557fe91] | 424 | </xsl:template>
|
---|
| 425 |
|
---|
[7072e1f] | 426 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
| 427 | <xsl:apply-templates/>
|
---|
| 428 | <xsl:text>
</xsl:text>
|
---|
| 429 | </xsl:template>
|
---|
[2e1c1c3] | 430 |
|
---|
[7072e1f] | 431 | <xsl:template match="userinput">
|
---|
[3eb60fa] | 432 | <xsl:choose>
|
---|
[fd691b4] | 433 | <!-- Copying the kernel config file -->
|
---|
| 434 | <xsl:when test="string() = 'make mrproper'">
|
---|
| 435 | <xsl:text>make mrproper
</xsl:text>
|
---|
[7072e1f] | 436 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
[bcfb3bf] | 437 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
| 438 | </xsl:if>
|
---|
[92568bf] | 439 | </xsl:when>
|
---|
[7072e1f] | 440 | <!-- test instructions -->
|
---|
[1d5f3e3] | 441 | <xsl:when test="@remap = 'test'">
|
---|
[5a8939e] | 442 | <xsl:call-template name="comment-test">
|
---|
| 443 | <xsl:with-param name="instructions" select="string()"/>
|
---|
| 444 | </xsl:call-template>
|
---|
[4afcedb] | 445 | </xsl:when>
|
---|
[7072e1f] | 446 | <!-- End of test instructions -->
|
---|
[dc7fd7b] | 447 | <!-- If the instructions contain "strip ", it may mean they contain also .la
|
---|
| 448 | file removal (and possibly other clean up). We therefore call a template
|
---|
| 449 | to comment them out appropriately and also to not stop if stripping
|
---|
| 450 | fails. -->
|
---|
| 451 | <xsl:when test="contains(string(),'strip ') or
|
---|
| 452 | contains(string(),'\*.la')">
|
---|
| 453 | <xsl:call-template name="comment-strip">
|
---|
| 454 | <xsl:with-param name="instructions" select="string()"/>
|
---|
| 455 | </xsl:call-template>
|
---|
[1f025ca] | 456 | </xsl:when>
|
---|
[f017b22] | 457 | <!-- Package management for installation chapters -->
|
---|
[7072e1f] | 458 | <!-- Add $PKG_DEST to installation commands -->
|
---|
[323ae3e] | 459 | <!-- Also add -j1 to make install -->
|
---|
[7072e1f] | 460 | <xsl:when test="@remap='install' and
|
---|
[f017b22] | 461 | ancestor::chapter[@id='chapter-building-system' or
|
---|
| 462 | @id = 'chapter-config' or
|
---|
| 463 | @id = 'chapter-bootscripts' or
|
---|
| 464 | @id = 'chapter-bootable']">
|
---|
[7072e1f] | 465 | <xsl:choose>
|
---|
| 466 | <xsl:when test="$pkgmngt='n'">
|
---|
| 467 | <xsl:choose>
|
---|
| 468 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
| 469 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 470 | <xsl:apply-templates/>
|
---|
| 471 | <xsl:text>
fi
</xsl:text>
|
---|
| 472 | </xsl:when>
|
---|
[323ae3e] | 473 | <xsl:when test="contains(string(),'make ')">
|
---|
| 474 | <xsl:copy-of select="substring-before(string(), 'make ')"/>
|
---|
| 475 | <xsl:text>make -j1 </xsl:text>
|
---|
| 476 | <xsl:copy-of select="substring-after(string(), 'make ')"/>
|
---|
| 477 | <xsl:text>
</xsl:text>
|
---|
| 478 | </xsl:when>
|
---|
[7072e1f] | 479 | <xsl:otherwise>
|
---|
| 480 | <xsl:apply-templates/>
|
---|
| 481 | <xsl:text>
</xsl:text>
|
---|
| 482 | </xsl:otherwise>
|
---|
| 483 | </xsl:choose>
|
---|
| 484 | </xsl:when>
|
---|
[945ccaa] | 485 | <xsl:when test="$wrap-install='y'">
|
---|
| 486 | <xsl:choose>
|
---|
| 487 | <xsl:when test="./literal">
|
---|
| 488 | <xsl:call-template name="output-wrap">
|
---|
| 489 | <xsl:with-param name="commands" select="text()[1]"/>
|
---|
| 490 | </xsl:call-template>
|
---|
| 491 | <xsl:apply-templates select="literal"/>
|
---|
| 492 | <xsl:call-template name="output-wrap">
|
---|
| 493 | <xsl:with-param name="commands" select="text()[2]"/>
|
---|
| 494 | </xsl:call-template>
|
---|
| 495 | </xsl:when>
|
---|
| 496 | <xsl:otherwise>
|
---|
| 497 | <xsl:call-template name="output-wrap">
|
---|
| 498 | <xsl:with-param name="commands" select="string()"/>
|
---|
| 499 | </xsl:call-template>
|
---|
| 500 | </xsl:otherwise>
|
---|
| 501 | </xsl:choose>
|
---|
| 502 | <xsl:text>
</xsl:text>
|
---|
| 503 | </xsl:when>
|
---|
| 504 | <xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'-->
|
---|
[7072e1f] | 505 | <xsl:choose>
|
---|
| 506 | <xsl:when test="./literal">
|
---|
| 507 | <xsl:call-template name="outputpkgdest">
|
---|
[560bef1] | 508 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
[7072e1f] | 509 | </xsl:call-template>
|
---|
| 510 | <xsl:apply-templates select="literal"/>
|
---|
| 511 | <xsl:call-template name="outputpkgdest">
|
---|
[560bef1] | 512 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
[7072e1f] | 513 | </xsl:call-template>
|
---|
| 514 | </xsl:when>
|
---|
| 515 | <xsl:otherwise>
|
---|
| 516 | <xsl:call-template name="outputpkgdest">
|
---|
| 517 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
| 518 | </xsl:call-template>
|
---|
| 519 | </xsl:otherwise>
|
---|
| 520 | </xsl:choose>
|
---|
[ad747ed] | 521 | <xsl:text>
</xsl:text>
|
---|
[7072e1f] | 522 | </xsl:otherwise>
|
---|
| 523 | </xsl:choose>
|
---|
[323ae3e] | 524 | </xsl:when> <!-- @remap='install' and not temporary tools -->
|
---|
[57ef0c1] | 525 | <!-- if package management, we should make an independant package for
|
---|
| 526 | tzdata. -->
|
---|
| 527 | <xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
---|
| 528 | <xsl:text>
|
---|
[945ccaa] | 529 | OLD_PKG_DEST="$PKG_DEST"
|
---|
[57ef0c1] | 530 | OLD_PKGDIR=$PKGDIR
|
---|
[56d8426] | 531 | PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
|
---|
[57ef0c1] | 532 | PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
---|
| 533 | <xsl:copy-of select="substring-before(
|
---|
| 534 | substring-after(string(),'tzdata'),
|
---|
| 535 | '.tar')"/>
|
---|
| 536 | <xsl:text>
|
---|
| 537 | </xsl:text>
|
---|
[945ccaa] | 538 | <xsl:choose>
|
---|
| 539 | <xsl:when test="$wrap-install='n'">
|
---|
| 540 | <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
---|
| 541 | <xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
---|
| 542 | <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
---|
| 543 | <xsl:text>
|
---|
[9bbb9c8] | 544 | PREV_SEC=${SECONDS}
|
---|
[57ef0c1] | 545 | packInstall
|
---|
[9bbb9c8] | 546 | SECONDS=${PREV_SEC}
|
---|
[57ef0c1] | 547 | rm -rf $PKG_DEST
|
---|
[945ccaa] | 548 | </xsl:text>
|
---|
| 549 | </xsl:when>
|
---|
| 550 | <xsl:otherwise><!-- wrap-install='y' -->
|
---|
| 551 | <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
---|
| 552 | <xsl:text>
|
---|
| 553 | wrapInstall '
|
---|
| 554 | ZONEINFO=</xsl:text>
|
---|
| 555 | <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
---|
| 556 | <xsl:text>'
|
---|
[9bbb9c8] | 557 | PREV_SEC=${SECONDS}
|
---|
[945ccaa] | 558 | packInstall
|
---|
[9bbb9c8] | 559 | SECONDS=${PREV_SEC}
|
---|
[945ccaa] | 560 | </xsl:text>
|
---|
| 561 | </xsl:otherwise>
|
---|
| 562 | </xsl:choose>
|
---|
| 563 | <xsl:text>
|
---|
[57ef0c1] | 564 | PKG_DEST=$OLD_PKG_DEST
|
---|
| 565 | unset OLD_PKG_DEST
|
---|
| 566 | PKGDIR=$OLD_PKGDIR
|
---|
| 567 | unset OLD_PKGDIR
|
---|
| 568 | </xsl:text>
|
---|
| 569 | </xsl:when><!-- addition for tzdata + package management -->
|
---|
[7072e1f] | 570 | <!-- End addition for package management -->
|
---|
[f017b22] | 571 | <!-- add -j1 to make install in non final chapters -->
|
---|
| 572 | <xsl:when test="ancestor::chapter[@id='chapter-temporary-tools' or
|
---|
| 573 | @id='chapter-chroot-temporary-tools' or
|
---|
| 574 | @id='chapter-cross-tools'] and
|
---|
[323ae3e] | 575 | @remap='install'">
|
---|
| 576 | <xsl:choose>
|
---|
| 577 | <xsl:when test="contains(string(),'make ')">
|
---|
| 578 | <xsl:copy-of select="substring-before(string(), 'make ')"/>
|
---|
| 579 | <xsl:text>make -j1 </xsl:text>
|
---|
| 580 | <xsl:copy-of select="substring-after(string(), 'make ')"/>
|
---|
| 581 | </xsl:when>
|
---|
| 582 | <xsl:otherwise>
|
---|
| 583 | <xsl:apply-templates/>
|
---|
| 584 | </xsl:otherwise>
|
---|
| 585 | </xsl:choose>
|
---|
| 586 | <xsl:text>
</xsl:text>
|
---|
[f017b22] | 587 | </xsl:when><!-- temp chapters install -->
|
---|
[fd691b4] | 588 | <!-- The rest of commands -->
|
---|
[1f025ca] | 589 | <xsl:otherwise>
|
---|
| 590 | <xsl:apply-templates/>
|
---|
[fd691b4] | 591 | <xsl:text>
</xsl:text>
|
---|
[1f025ca] | 592 | </xsl:otherwise>
|
---|
| 593 | </xsl:choose>
|
---|
| 594 | </xsl:template>
|
---|
[2e1c1c3] | 595 |
|
---|
[557fe91] | 596 | <xsl:template match="replaceable">
|
---|
[a41ce58] | 597 | <xsl:choose>
|
---|
[2a54650] | 598 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
[877cc6a] | 599 | <xsl:value-of select="$timezone"/>
|
---|
[2a54650] | 600 | </xsl:when>
|
---|
[a41ce58] | 601 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
[877cc6a] | 602 | <xsl:value-of select="$page"/>
|
---|
[a41ce58] | 603 | </xsl:when>
|
---|
[81a7fb8] | 604 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
| 605 | <xsl:value-of select="$lang"/>
|
---|
| 606 | </xsl:when>
|
---|
[945ccaa] | 607 | <xsl:when test="contains(string(.),'Domain')">
|
---|
| 608 | <xsl:value-of select="$domain"/>
|
---|
| 609 | </xsl:when>
|
---|
| 610 | <xsl:when test="contains(string(.),'primary')">
|
---|
| 611 | <xsl:value-of select="$nameserver1"/>
|
---|
| 612 | </xsl:when>
|
---|
| 613 | <xsl:when test="contains(string(.),'secondary')">
|
---|
| 614 | <xsl:value-of select="$nameserver2"/>
|
---|
| 615 | </xsl:when>
|
---|
| 616 | <xsl:when test="contains(string(.),'192.168.1.1')">
|
---|
| 617 | <xsl:value-of select="$ip"/>
|
---|
| 618 | </xsl:when>
|
---|
| 619 | <xsl:when test="contains(string(.),'192.168.0.2')">
|
---|
| 620 | <xsl:value-of select="$ip"/>
|
---|
| 621 | </xsl:when>
|
---|
[f5e658d] | 622 | <xsl:when test="contains(string(.),'eth0')">
|
---|
| 623 | <xsl:value-of select="$interface"/>
|
---|
| 624 | </xsl:when>
|
---|
[945ccaa] | 625 | <!-- Only adapted to LFS-20170310 and later -->
|
---|
| 626 | <xsl:when test="contains(string(.),'HOSTNAME')">
|
---|
| 627 | <xsl:value-of select="$hostname"/>
|
---|
| 628 | </xsl:when>
|
---|
| 629 | <xsl:when test="contains(string(.),'FQDN')">
|
---|
| 630 | <xsl:value-of select="$hostname"/>
|
---|
| 631 | <xsl:text>.</xsl:text>
|
---|
| 632 | <xsl:value-of select="$domain"/>
|
---|
| 633 | </xsl:when>
|
---|
| 634 | <xsl:when test="contains(string(.),'alias')"/>
|
---|
| 635 | <xsl:when test="contains(string(.),'<lfs>')">
|
---|
| 636 | <xsl:value-of select="$hostname"/>
|
---|
| 637 | </xsl:when>
|
---|
[a41ce58] | 638 | <xsl:otherwise>
|
---|
| 639 | <xsl:text>**EDITME</xsl:text>
|
---|
| 640 | <xsl:apply-templates/>
|
---|
| 641 | <xsl:text>EDITME**</xsl:text>
|
---|
| 642 | </xsl:otherwise>
|
---|
| 643 | </xsl:choose>
|
---|
[557fe91] | 644 | </xsl:template>
|
---|
[2e1c1c3] | 645 |
|
---|
[945ccaa] | 646 | <xsl:template match="literal">
|
---|
| 647 | <xsl:choose>
|
---|
| 648 | <xsl:when test="contains(string(),'ONBOOT')">
|
---|
| 649 | <xsl:call-template name="outputnet">
|
---|
| 650 | <xsl:with-param name="netstring" select="string()"/>
|
---|
| 651 | </xsl:call-template>
|
---|
| 652 | </xsl:when>
|
---|
| 653 | <xsl:when test="contains(string(),'[Match]')">
|
---|
| 654 | <xsl:call-template name="outputsysdnet">
|
---|
| 655 | <xsl:with-param name="netstring" select="string()"/>
|
---|
| 656 | </xsl:call-template>
|
---|
| 657 | </xsl:when>
|
---|
[3b43e17b] | 658 | <xsl:when test="contains(string(),'0.0 0 0.0')">
|
---|
| 659 | <xsl:copy-of select="substring-before(string(),'LOCAL')"/>
|
---|
| 660 | <xsl:if test="$local='y'"><xsl:text>LOCAL</xsl:text></xsl:if>
|
---|
| 661 | <xsl:if test="$local='n'"><xsl:text>UTC</xsl:text></xsl:if>
|
---|
| 662 | </xsl:when>
|
---|
| 663 | <xsl:when test="contains(string(),'UTC=1')">
|
---|
| 664 | <xsl:copy-of select="substring-before(string(),'1')"/>
|
---|
| 665 | <xsl:if test="$local='y'"><xsl:text>0</xsl:text></xsl:if>
|
---|
| 666 | <xsl:if test="$local='n'"><xsl:text>1</xsl:text></xsl:if>
|
---|
| 667 | <xsl:copy-of select="substring-after(string(),'1')"/>
|
---|
| 668 | </xsl:when>
|
---|
| 669 | <xsl:when test="contains(string(),'bg_bds-')">
|
---|
| 670 | <xsl:call-template name="outputsysvconsole">
|
---|
| 671 | <xsl:with-param name="consolestring" select="string()"/>
|
---|
| 672 | </xsl:call-template>
|
---|
| 673 | </xsl:when>
|
---|
| 674 | <xsl:when test="contains(string(),'de-latin1')">
|
---|
| 675 | <xsl:call-template name="outputsysdconsole">
|
---|
| 676 | <xsl:with-param name="consolestring" select="string()"/>
|
---|
| 677 | </xsl:call-template>
|
---|
| 678 | </xsl:when>
|
---|
[945ccaa] | 679 | <xsl:otherwise>
|
---|
| 680 | <xsl:apply-templates/>
|
---|
| 681 | </xsl:otherwise>
|
---|
| 682 | </xsl:choose>
|
---|
| 683 | </xsl:template>
|
---|
| 684 |
|
---|
| 685 | <xsl:template name="outputnet">
|
---|
| 686 | <xsl:param name="netstring" select="''"/>
|
---|
| 687 | <!-- We suppose that book example has the following values:
|
---|
| 688 | - interface: eth0
|
---|
| 689 | - ip: 192.168.1.2
|
---|
| 690 | - gateway: 192.168.1.1
|
---|
| 691 | - prefix: 24
|
---|
| 692 | - broadcast: 192.168.1.255
|
---|
| 693 | Change below if book changes -->
|
---|
| 694 | <xsl:choose>
|
---|
| 695 | <xsl:when test="contains($netstring,'eth0')">
|
---|
| 696 | <xsl:call-template name="outputnet">
|
---|
| 697 | <xsl:with-param name="netstring"
|
---|
| 698 | select="substring-before($netstring,'eth0')"/>
|
---|
| 699 | </xsl:call-template>
|
---|
| 700 | <xsl:value-of select="$interface"/>
|
---|
| 701 | <xsl:call-template name="outputnet">
|
---|
| 702 | <xsl:with-param name="netstring"
|
---|
| 703 | select="substring-after($netstring,'eth0')"/>
|
---|
| 704 | </xsl:call-template>
|
---|
| 705 | </xsl:when>
|
---|
| 706 | <xsl:when test="contains($netstring,'192.168.1.1')">
|
---|
| 707 | <xsl:call-template name="outputnet">
|
---|
| 708 | <xsl:with-param name="netstring"
|
---|
| 709 | select="substring-before($netstring,'192.168.1.1')"/>
|
---|
| 710 | </xsl:call-template>
|
---|
| 711 | <xsl:value-of select="$gateway"/>
|
---|
| 712 | <xsl:call-template name="outputnet">
|
---|
| 713 | <xsl:with-param name="netstring"
|
---|
| 714 | select="substring-after($netstring,'192.168.1.1')"/>
|
---|
| 715 | </xsl:call-template>
|
---|
| 716 | </xsl:when>
|
---|
| 717 | <!-- must test this before the following, because 192.168.1.255 contains
|
---|
| 718 | 192.168.1.2! -->
|
---|
| 719 | <xsl:when test="contains($netstring,'192.168.1.255')">
|
---|
| 720 | <xsl:call-template name="outputnet">
|
---|
| 721 | <xsl:with-param name="netstring"
|
---|
| 722 | select="substring-before($netstring,'192.168.1.255')"/>
|
---|
| 723 | </xsl:call-template>
|
---|
| 724 | <xsl:value-of select="$broadcast"/>
|
---|
| 725 | <xsl:call-template name="outputnet">
|
---|
| 726 | <xsl:with-param name="netstring"
|
---|
| 727 | select="substring-after($netstring,'192.168.1.255')"/>
|
---|
| 728 | </xsl:call-template>
|
---|
| 729 | </xsl:when>
|
---|
| 730 | <xsl:when test="contains($netstring,'192.168.1.2')">
|
---|
| 731 | <xsl:call-template name="outputnet">
|
---|
| 732 | <xsl:with-param name="netstring"
|
---|
| 733 | select="substring-before($netstring,'192.168.1.2')"/>
|
---|
| 734 | </xsl:call-template>
|
---|
| 735 | <xsl:value-of select="$ip"/>
|
---|
| 736 | <xsl:call-template name="outputnet">
|
---|
| 737 | <xsl:with-param name="netstring"
|
---|
| 738 | select="substring-after($netstring,'192.168.1.2')"/>
|
---|
| 739 | </xsl:call-template>
|
---|
| 740 | </xsl:when>
|
---|
| 741 | <xsl:when test="contains($netstring,'24')">
|
---|
| 742 | <xsl:call-template name="outputnet">
|
---|
| 743 | <xsl:with-param name="netstring"
|
---|
| 744 | select="substring-before($netstring,'24')"/>
|
---|
| 745 | </xsl:call-template>
|
---|
| 746 | <xsl:value-of select="$prefix"/>
|
---|
| 747 | <xsl:call-template name="outputnet">
|
---|
| 748 | <xsl:with-param name="netstring"
|
---|
| 749 | select="substring-after($netstring,'24')"/>
|
---|
| 750 | </xsl:call-template>
|
---|
| 751 | </xsl:when>
|
---|
| 752 | <xsl:otherwise>
|
---|
| 753 | <xsl:value-of select="$netstring"/>
|
---|
| 754 | </xsl:otherwise>
|
---|
| 755 | </xsl:choose>
|
---|
| 756 | </xsl:template>
|
---|
| 757 |
|
---|
| 758 | <xsl:template name="outputsysdnet">
|
---|
| 759 | <xsl:param name="netstring" select="''"/>
|
---|
| 760 | <!-- We suppose that book example has the following values:
|
---|
[5af9ab4] | 761 | - interface: <network-device-name>
|
---|
[945ccaa] | 762 | - ip: 192.168.0.2
|
---|
| 763 | - gateway: 192.168.0.1
|
---|
| 764 | - prefix: 24
|
---|
| 765 | - DNS: 192.168.0.1
|
---|
| 766 | - Domain: <Your Domain Name>
|
---|
| 767 | and gateway comes before DNS. Change below if book changes -->
|
---|
| 768 | <xsl:choose>
|
---|
[5af9ab4] | 769 | <xsl:when test="contains($netstring,'<network-device-name>')">
|
---|
[945ccaa] | 770 | <xsl:call-template name="outputsysdnet">
|
---|
| 771 | <xsl:with-param name="netstring"
|
---|
[5af9ab4] | 772 | select="substring-before($netstring,'<network-device-name>')"/>
|
---|
[945ccaa] | 773 | </xsl:call-template>
|
---|
| 774 | <xsl:value-of select="$interface"/>
|
---|
| 775 | <xsl:call-template name="outputsysdnet">
|
---|
| 776 | <xsl:with-param name="netstring"
|
---|
[5af9ab4] | 777 | select="substring-after($netstring,'<network-device-name>')"/>
|
---|
[945ccaa] | 778 | </xsl:call-template>
|
---|
| 779 | </xsl:when>
|
---|
| 780 | <xsl:when test="contains($netstring,'192.168.0.1') and
|
---|
| 781 | contains($netstring,'Gateway')">
|
---|
| 782 | <xsl:call-template name="outputsysdnet">
|
---|
| 783 | <xsl:with-param name="netstring"
|
---|
| 784 | select="substring-before($netstring,'192.168.0.1')"/>
|
---|
| 785 | </xsl:call-template>
|
---|
| 786 | <xsl:value-of select="$gateway"/>
|
---|
| 787 | <xsl:call-template name="outputsysdnet">
|
---|
| 788 | <xsl:with-param name="netstring"
|
---|
| 789 | select="substring-after($netstring,'192.168.0.1')"/>
|
---|
| 790 | </xsl:call-template>
|
---|
| 791 | </xsl:when>
|
---|
| 792 | <xsl:when test="contains($netstring,'192.168.0.1') and
|
---|
| 793 | not(contains($netstring,'Gateway'))">
|
---|
| 794 | <xsl:call-template name="outputsysdnet">
|
---|
| 795 | <xsl:with-param name="netstring"
|
---|
| 796 | select="substring-before($netstring,'192.168.0.1')"/>
|
---|
| 797 | </xsl:call-template>
|
---|
| 798 | <xsl:value-of select="$nameserver1"/>
|
---|
| 799 | <xsl:text>
|
---|
| 800 | DNS=</xsl:text>
|
---|
| 801 | <xsl:value-of select="$nameserver2"/>
|
---|
| 802 | <xsl:call-template name="outputsysdnet">
|
---|
| 803 | <xsl:with-param name="netstring"
|
---|
| 804 | select="substring-after($netstring,'192.168.0.1')"/>
|
---|
| 805 | </xsl:call-template>
|
---|
| 806 | </xsl:when>
|
---|
| 807 | <xsl:when test="contains($netstring,'192.168.0.2')">
|
---|
| 808 | <xsl:call-template name="outputsysdnet">
|
---|
| 809 | <xsl:with-param name="netstring"
|
---|
| 810 | select="substring-before($netstring,'192.168.0.2')"/>
|
---|
| 811 | </xsl:call-template>
|
---|
| 812 | <xsl:value-of select="$ip"/>
|
---|
| 813 | <xsl:call-template name="outputsysdnet">
|
---|
| 814 | <xsl:with-param name="netstring"
|
---|
| 815 | select="substring-after($netstring,'192.168.0.2')"/>
|
---|
| 816 | </xsl:call-template>
|
---|
| 817 | </xsl:when>
|
---|
| 818 | <xsl:when test="contains($netstring,'24')">
|
---|
| 819 | <xsl:call-template name="outputsysdnet">
|
---|
| 820 | <xsl:with-param name="netstring"
|
---|
| 821 | select="substring-before($netstring,'24')"/>
|
---|
| 822 | </xsl:call-template>
|
---|
| 823 | <xsl:value-of select="$prefix"/>
|
---|
| 824 | <xsl:call-template name="outputsysdnet">
|
---|
| 825 | <xsl:with-param name="netstring"
|
---|
| 826 | select="substring-after($netstring,'24')"/>
|
---|
| 827 | </xsl:call-template>
|
---|
| 828 | </xsl:when>
|
---|
| 829 | <xsl:when test="contains($netstring,'<Your Domain Name>')">
|
---|
| 830 | <xsl:call-template name="outputsysdnet">
|
---|
| 831 | <xsl:with-param name="netstring"
|
---|
| 832 | select="substring-before($netstring,'<Your Domain Name>')"/>
|
---|
| 833 | </xsl:call-template>
|
---|
| 834 | <xsl:value-of select="$domain"/>
|
---|
| 835 | <xsl:call-template name="outputsysdnet">
|
---|
| 836 | <xsl:with-param name="netstring"
|
---|
| 837 | select="substring-after($netstring,'<Your Domain Name>')"/>
|
---|
| 838 | </xsl:call-template>
|
---|
| 839 | </xsl:when>
|
---|
| 840 | <xsl:otherwise>
|
---|
| 841 | <xsl:value-of select="$netstring"/>
|
---|
[3b43e17b] | 842 | </xsl:otherwise>
|
---|
| 843 | </xsl:choose>
|
---|
| 844 | </xsl:template>
|
---|
| 845 |
|
---|
| 846 | <xsl:template name="outputsysvconsole">
|
---|
| 847 | <!-- We suppose that book example has the following values:
|
---|
| 848 | - KEYMAP: bg_bds-utf8
|
---|
| 849 | - FONT: LatArCyrHeb-16
|
---|
| 850 | Change below if book changes -->
|
---|
| 851 | <xsl:param name="consolestring" select="''"/>
|
---|
| 852 | <xsl:choose>
|
---|
| 853 | <xsl:when test="contains($consolestring,'bg_bds-utf8')">
|
---|
| 854 | <xsl:call-template name="outputsysvconsole">
|
---|
| 855 | <xsl:with-param
|
---|
| 856 | name="consolestring"
|
---|
| 857 | select="substring-before($consolestring,'bg_bds-utf8')"/>
|
---|
| 858 | </xsl:call-template>
|
---|
| 859 | <xsl:value-of select="$keymap"/>
|
---|
| 860 | <xsl:call-template name="outputsysvconsole">
|
---|
| 861 | <xsl:with-param
|
---|
| 862 | name="consolestring"
|
---|
| 863 | select="substring-after($consolestring,'bg_bds-utf8')"/>
|
---|
| 864 | </xsl:call-template>
|
---|
| 865 | </xsl:when>
|
---|
| 866 | <xsl:when test="contains($consolestring,'LatArCyrHeb-16')">
|
---|
| 867 | <xsl:call-template name="outputsysvconsole">
|
---|
| 868 | <xsl:with-param
|
---|
| 869 | name="consolestring"
|
---|
| 870 | select="substring-before($consolestring,'LatArCyrHeb-16')"/>
|
---|
| 871 | </xsl:call-template>
|
---|
| 872 | <xsl:value-of select="$font"/>
|
---|
| 873 | <xsl:text>"
|
---|
[3142368] | 874 | LOGLEVEL="</xsl:text>
|
---|
[3b43e17b] | 875 | <xsl:copy-of select="$log-level"/>
|
---|
| 876 | <xsl:call-template name="outputsysvconsole">
|
---|
| 877 | <xsl:with-param
|
---|
| 878 | name="consolestring"
|
---|
| 879 | select="substring-after($consolestring,'LatArCyrHeb-16')"/>
|
---|
| 880 | </xsl:call-template>
|
---|
| 881 | </xsl:when>
|
---|
| 882 | <xsl:otherwise>
|
---|
| 883 | <xsl:copy-of select="$consolestring"/>
|
---|
| 884 | </xsl:otherwise>
|
---|
| 885 | </xsl:choose>
|
---|
| 886 | </xsl:template>
|
---|
| 887 |
|
---|
| 888 | <xsl:template name="outputsysdconsole">
|
---|
| 889 | <!-- We suppose that book example has the following values:
|
---|
| 890 | - KEYMAP: de-latin1
|
---|
| 891 | - FONT: Lat2-Terminus16
|
---|
| 892 | Change below if book changes -->
|
---|
| 893 | <xsl:param name="consolestring" select="''"/>
|
---|
| 894 | <xsl:choose>
|
---|
| 895 | <xsl:when test="contains($consolestring,'de-latin1')">
|
---|
| 896 | <xsl:call-template name="outputsysdconsole">
|
---|
| 897 | <xsl:with-param
|
---|
| 898 | name="consolestring"
|
---|
| 899 | select="substring-before($consolestring,'de-latin1')"/>
|
---|
| 900 | </xsl:call-template>
|
---|
| 901 | <xsl:value-of select="$keymap"/>
|
---|
| 902 | <xsl:call-template name="outputsysdconsole">
|
---|
| 903 | <xsl:with-param
|
---|
| 904 | name="consolestring"
|
---|
| 905 | select="substring-after($consolestring,'de-latin1')"/>
|
---|
| 906 | </xsl:call-template>
|
---|
| 907 | </xsl:when>
|
---|
| 908 | <xsl:when test="contains($consolestring,'Lat2-Terminus16')">
|
---|
| 909 | <xsl:call-template name="outputsysdconsole">
|
---|
| 910 | <xsl:with-param
|
---|
| 911 | name="consolestring"
|
---|
| 912 | select="substring-before($consolestring,'Lat2-Terminus16')"/>
|
---|
| 913 | </xsl:call-template>
|
---|
| 914 | <xsl:value-of select="$font"/>
|
---|
| 915 | <xsl:call-template name="outputsysdconsole">
|
---|
| 916 | <xsl:with-param
|
---|
| 917 | name="consolestring"
|
---|
| 918 | select="substring-after($consolestring,'Lat2-Terminus16')"/>
|
---|
| 919 | </xsl:call-template>
|
---|
| 920 | </xsl:when>
|
---|
| 921 | <xsl:otherwise>
|
---|
| 922 | <xsl:copy-of select="$consolestring"/>
|
---|
[945ccaa] | 923 | </xsl:otherwise>
|
---|
| 924 | </xsl:choose>
|
---|
| 925 | </xsl:template>
|
---|
| 926 |
|
---|
[7072e1f] | 927 | <xsl:template name="outputpkgdest">
|
---|
| 928 | <xsl:param name="outputstring" select="foo"/>
|
---|
| 929 | <xsl:choose>
|
---|
| 930 | <xsl:when test="contains($outputstring,'make ')">
|
---|
| 931 | <xsl:choose>
|
---|
| 932 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
| 933 | <xsl:call-template name="outputpkgdest">
|
---|
| 934 | <xsl:with-param name="outputstring"
|
---|
| 935 | select="substring-before($outputstring,'make')"/>
|
---|
| 936 | </xsl:call-template>
|
---|
| 937 | <xsl:call-template name="outputpkgdest">
|
---|
| 938 | <xsl:with-param
|
---|
| 939 | name="outputstring"
|
---|
| 940 | select="substring-after($outputstring,
|
---|
| 941 | substring-before($outputstring,'make'))"/>
|
---|
| 942 | </xsl:call-template>
|
---|
| 943 | </xsl:when>
|
---|
| 944 | <xsl:otherwise>
|
---|
| 945 | <xsl:choose>
|
---|
| 946 | <!-- special cases (no DESTDIR) here -->
|
---|
| 947 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
| 948 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
| 949 | <xsl:value-of
|
---|
| 950 | select="substring-before(substring-after(string(),'make'),
|
---|
| 951 | 'install')"/>
|
---|
| 952 | <xsl:text>install
</xsl:text>
|
---|
| 953 | </xsl:when>
|
---|
| 954 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
[323ae3e] | 955 | <xsl:text>make -j1 PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
[7072e1f] | 956 | </xsl:when>
|
---|
| 957 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
[323ae3e] | 958 | <xsl:text>make -j1 BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
[7072e1f] | 959 | </xsl:when>
|
---|
| 960 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
[323ae3e] | 961 | <xsl:text>make -j1 DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
|
---|
[7072e1f] | 962 | <xsl:value-of
|
---|
[b1f4a8d] | 963 | select="substring-before(substring-after(string(),'DOCDIR='),
|
---|
[7072e1f] | 964 | 'install')"/>
|
---|
| 965 | <xsl:text>install
</xsl:text>
|
---|
| 966 | </xsl:when>
|
---|
| 967 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
[323ae3e] | 968 | <xsl:text>make -j1 ROOT=$PKG_DEST</xsl:text>
|
---|
[7072e1f] | 969 | <xsl:value-of
|
---|
| 970 | select="substring-before(substring-after(string(),'make'),
|
---|
| 971 | 'install')"/>
|
---|
| 972 | <xsl:text>install
</xsl:text>
|
---|
| 973 | </xsl:when>
|
---|
| 974 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
[323ae3e] | 975 | <xsl:text>make -j1 INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
[7072e1f] | 976 | <xsl:value-of
|
---|
| 977 | select="substring-before(substring-after(string(),'make'),
|
---|
| 978 | 'install')"/>
|
---|
| 979 | <xsl:text>install
</xsl:text>
|
---|
| 980 | </xsl:when>
|
---|
| 981 | <xsl:otherwise>
|
---|
[323ae3e] | 982 | <xsl:text>make -j1 DESTDIR=$PKG_DEST</xsl:text>
|
---|
[e6e0c85] | 983 | <xsl:call-template name="outputpkgdest">
|
---|
[560bef1] | 984 | <xsl:with-param
|
---|
[7072e1f] | 985 | name="outputstring"
|
---|
| 986 | select="substring-after($outputstring,'make')"/>
|
---|
[560bef1] | 987 | </xsl:call-template>
|
---|
[7072e1f] | 988 | </xsl:otherwise>
|
---|
| 989 | </xsl:choose>
|
---|
| 990 | </xsl:otherwise>
|
---|
| 991 | </xsl:choose>
|
---|
| 992 | </xsl:when>
|
---|
[1cb4c76] | 993 | <xsl:when test="contains($outputstring,'ninja install')">
|
---|
[4696ddd] | 994 | <xsl:choose>
|
---|
[1cb4c76] | 995 | <xsl:when test="not(starts-with($outputstring,'ninja install'))">
|
---|
[4696ddd] | 996 | <xsl:call-template name="outputpkgdest">
|
---|
| 997 | <xsl:with-param name="outputstring"
|
---|
[1cb4c76] | 998 | select="substring-before($outputstring,'ninja install')"/>
|
---|
[4696ddd] | 999 | </xsl:call-template>
|
---|
| 1000 | <xsl:call-template name="outputpkgdest">
|
---|
| 1001 | <xsl:with-param
|
---|
| 1002 | name="outputstring"
|
---|
| 1003 | select="substring-after($outputstring,
|
---|
[1cb4c76] | 1004 | substring-before($outputstring,'ninja install'))"/>
|
---|
[4696ddd] | 1005 | </xsl:call-template>
|
---|
| 1006 | </xsl:when>
|
---|
[1cb4c76] | 1007 | <xsl:otherwise> <!-- "ninja" is the first word and is followed by
|
---|
| 1008 | "install"-->
|
---|
[4696ddd] | 1009 | <xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
|
---|
| 1010 | <xsl:call-template name="outputpkgdest">
|
---|
| 1011 | <xsl:with-param
|
---|
| 1012 | name="outputstring"
|
---|
| 1013 | select="substring-after($outputstring,'ninja')"/>
|
---|
| 1014 | </xsl:call-template>
|
---|
| 1015 | </xsl:otherwise>
|
---|
| 1016 | </xsl:choose>
|
---|
| 1017 | </xsl:when>
|
---|
| 1018 | <xsl:otherwise> <!-- no make nor ninja in this string -->
|
---|
[7072e1f] | 1019 | <xsl:choose>
|
---|
| 1020 | <xsl:when test="contains($outputstring,'>/') and
|
---|
| 1021 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
| 1022 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
| 1023 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
| 1024 | <xsl:call-template name="outputpkgdest">
|
---|
| 1025 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
| 1026 | </xsl:call-template>
|
---|
| 1027 | </xsl:when>
|
---|
| 1028 | <xsl:when test="contains($outputstring,' /')">
|
---|
| 1029 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
| 1030 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
| 1031 | <xsl:call-template name="outputpkgdest">
|
---|
| 1032 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
| 1033 | </xsl:call-template>
|
---|
| 1034 | </xsl:when>
|
---|
| 1035 | <xsl:otherwise>
|
---|
| 1036 | <xsl:value-of select="$outputstring"/>
|
---|
| 1037 | </xsl:otherwise>
|
---|
| 1038 | </xsl:choose>
|
---|
| 1039 | </xsl:otherwise>
|
---|
| 1040 | </xsl:choose>
|
---|
| 1041 | </xsl:template>
|
---|
[945ccaa] | 1042 |
|
---|
| 1043 | <xsl:variable name="APOS">'</xsl:variable>
|
---|
| 1044 | <xsl:template name="output-wrap">
|
---|
| 1045 | <xsl:param name="commands" select="''"/>
|
---|
| 1046 | <xsl:choose>
|
---|
| 1047 | <xsl:when test="contains($commands,string($APOS))">
|
---|
| 1048 | <xsl:call-template name="output-wrap">
|
---|
| 1049 | <xsl:with-param name="commands"
|
---|
| 1050 | select="substring-before($commands,string($APOS))"/>
|
---|
| 1051 | </xsl:call-template>
|
---|
| 1052 | <xsl:text>'\''</xsl:text>
|
---|
| 1053 | <xsl:call-template name="output-wrap">
|
---|
| 1054 | <xsl:with-param name="commands"
|
---|
| 1055 | select="substring-after($commands,string($APOS))"/>
|
---|
| 1056 | </xsl:call-template>
|
---|
| 1057 | </xsl:when>
|
---|
| 1058 | <xsl:otherwise>
|
---|
| 1059 | <xsl:value-of select="$commands"/>
|
---|
| 1060 | </xsl:otherwise>
|
---|
| 1061 | </xsl:choose>
|
---|
| 1062 | </xsl:template>
|
---|
| 1063 |
|
---|
[dc7fd7b] | 1064 | <xsl:template name="comment-strip">
|
---|
| 1065 | <xsl:param name="instructions" select="''"/>
|
---|
| 1066 | <xsl:choose>
|
---|
| 1067 | <xsl:when test="contains($instructions,'
')">
|
---|
| 1068 | <xsl:call-template name="comment-strip">
|
---|
| 1069 | <xsl:with-param name="instructions"
|
---|
| 1070 | select="substring-before($instructions,'
')"/>
|
---|
| 1071 | </xsl:call-template>
|
---|
| 1072 | <xsl:call-template name="comment-strip">
|
---|
| 1073 | <xsl:with-param name="instructions"
|
---|
| 1074 | select="substring-after($instructions,'
')"/>
|
---|
| 1075 | </xsl:call-template>
|
---|
| 1076 | </xsl:when>
|
---|
| 1077 | <xsl:when test="contains($instructions,'\*.la')">
|
---|
| 1078 | <xsl:if test="$del-la-files='n'">
|
---|
| 1079 | <xsl:text># </xsl:text>
|
---|
| 1080 | </xsl:if>
|
---|
| 1081 | <xsl:value-of select="$instructions"/>
|
---|
| 1082 | <xsl:text>
</xsl:text>
|
---|
| 1083 | </xsl:when>
|
---|
| 1084 | <xsl:when test="contains($instructions,'strip ')">
|
---|
| 1085 | <xsl:if test="$strip='n'">
|
---|
| 1086 | <xsl:text># </xsl:text>
|
---|
| 1087 | </xsl:if>
|
---|
| 1088 | <xsl:value-of select="$instructions"/>
|
---|
| 1089 | <xsl:text> || true
</xsl:text>
|
---|
| 1090 | </xsl:when>
|
---|
| 1091 | <xsl:otherwise>
|
---|
| 1092 | <xsl:value-of select="$instructions"/>
|
---|
| 1093 | <xsl:text>
</xsl:text>
|
---|
| 1094 | </xsl:otherwise>
|
---|
| 1095 | </xsl:choose>
|
---|
| 1096 | </xsl:template>
|
---|
| 1097 |
|
---|
[5a8939e] | 1098 | <xsl:template name="comment-test">
|
---|
| 1099 | <xsl:param name="instructions" select="''"/>
|
---|
[6caa5b8] | 1100 | <xsl:param name="eof-seen" select="false()"/>
|
---|
[5a8939e] | 1101 | <xsl:choose>
|
---|
| 1102 | <xsl:when test="contains($instructions,'
')">
|
---|
| 1103 | <xsl:call-template name="comment-test">
|
---|
| 1104 | <xsl:with-param name="instructions"
|
---|
| 1105 | select="substring-before($instructions,'
')"/>
|
---|
[6caa5b8] | 1106 | <xsl:with-param name="eof-seen" select="$eof-seen"/>
|
---|
[5a8939e] | 1107 | </xsl:call-template>
|
---|
[6caa5b8] | 1108 | <xsl:choose>
|
---|
| 1109 | <xsl:when test="contains(substring-before($instructions,'
'),
|
---|
| 1110 | 'EOF')">
|
---|
| 1111 | <xsl:call-template name="comment-test">
|
---|
| 1112 | <xsl:with-param name="instructions"
|
---|
| 1113 | select="substring-after($instructions,'
')"/>
|
---|
| 1114 | <xsl:with-param name="eof-seen" select="not($eof-seen)"/>
|
---|
| 1115 | </xsl:call-template>
|
---|
| 1116 | </xsl:when>
|
---|
| 1117 | <xsl:otherwise>
|
---|
| 1118 | <xsl:call-template name="comment-test">
|
---|
| 1119 | <xsl:with-param name="instructions"
|
---|
| 1120 | select="substring-after($instructions,'
')"/>
|
---|
| 1121 | <xsl:with-param name="eof-seen" select="$eof-seen"/>
|
---|
| 1122 | </xsl:call-template>
|
---|
| 1123 | </xsl:otherwise>
|
---|
| 1124 | </xsl:choose>
|
---|
[5a8939e] | 1125 | </xsl:when>
|
---|
| 1126 | <xsl:otherwise>
|
---|
| 1127 | <xsl:if test="$testsuite = '0' or
|
---|
| 1128 | $testsuite = '1' and
|
---|
| 1129 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 1130 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
| 1131 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
| 1132 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
| 1133 | not(ancestor::sect1[@id='ch-system-binutils']) or
|
---|
| 1134 | $testsuite = '2' and
|
---|
| 1135 | ancestor::chapter[@id='chapter-temporary-tools']">
|
---|
| 1136 | <xsl:text># </xsl:text>
|
---|
| 1137 | </xsl:if>
|
---|
| 1138 | <xsl:choose>
|
---|
| 1139 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
| 1140 | <xsl:choose>
|
---|
| 1141 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 1142 | <xsl:value-of select="$instructions"/>
|
---|
[6caa5b8] | 1143 | <xsl:if test="not($eof-seen)">
|
---|
| 1144 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
| 1145 | </xsl:if>
|
---|
| 1146 | <xsl:text>
</xsl:text>
|
---|
[5a8939e] | 1147 | </xsl:when>
|
---|
| 1148 | <xsl:when test="contains($instructions, 'make')">
|
---|
| 1149 | <xsl:value-of select="substring-before($instructions, 'make')"/>
|
---|
| 1150 | <xsl:text>make -k</xsl:text>
|
---|
| 1151 | <xsl:value-of select="substring-after($instructions, 'make')"/>
|
---|
[6caa5b8] | 1152 | <xsl:if test="not($eof-seen)">
|
---|
| 1153 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
| 1154 | </xsl:if>
|
---|
| 1155 | <xsl:text>
</xsl:text>
|
---|
[5a8939e] | 1156 | </xsl:when>
|
---|
| 1157 | <xsl:otherwise>
|
---|
| 1158 | <xsl:value-of select="$instructions"/>
|
---|
[764a5d7] | 1159 | <xsl:if
|
---|
| 1160 | test="not(contains($instructions, '>>')) and
|
---|
[6caa5b8] | 1161 | not($eof-seen) and
|
---|
[764a5d7] | 1162 | substring($instructions,
|
---|
| 1163 | string-length($instructions)) != '\'">
|
---|
[6caa5b8] | 1164 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
[5a8939e] | 1165 | </xsl:if>
|
---|
| 1166 | <xsl:text>
</xsl:text>
|
---|
| 1167 | </xsl:otherwise>
|
---|
| 1168 | </xsl:choose>
|
---|
| 1169 | </xsl:when>
|
---|
| 1170 | <xsl:otherwise>
|
---|
| 1171 | <!-- bomb-testsuite != 'n'-->
|
---|
| 1172 | <xsl:choose>
|
---|
| 1173 | <xsl:when test="contains($instructions, 'make -k')">
|
---|
| 1174 | <xsl:value-of select="$instructions"/>
|
---|
[6caa5b8] | 1175 | <xsl:if test="not($eof-seen)">
|
---|
| 1176 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
| 1177 | </xsl:if>
|
---|
| 1178 | <xsl:text>
</xsl:text>
|
---|
[5a8939e] | 1179 | </xsl:when>
|
---|
| 1180 | <xsl:otherwise>
|
---|
| 1181 | <xsl:value-of select="$instructions"/>
|
---|
[764a5d7] | 1182 | <xsl:if test="not(contains($instructions, '>>')) and
|
---|
[6caa5b8] | 1183 | not($eof-seen) and
|
---|
[764a5d7] | 1184 | substring($instructions,
|
---|
| 1185 | string-length($instructions)) != '\'">
|
---|
[5a8939e] | 1186 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 1187 | </xsl:if>
|
---|
| 1188 | <xsl:text>
</xsl:text>
|
---|
| 1189 | </xsl:otherwise>
|
---|
| 1190 | </xsl:choose>
|
---|
| 1191 | </xsl:otherwise> <!-- end not bomb-test=n -->
|
---|
| 1192 | </xsl:choose>
|
---|
| 1193 | </xsl:otherwise>
|
---|
| 1194 | </xsl:choose>
|
---|
| 1195 | </xsl:template>
|
---|
| 1196 |
|
---|
[2758d94] | 1197 | <xsl:template name="basename">
|
---|
| 1198 | <xsl:param name="path" select="''"/>
|
---|
| 1199 | <xsl:choose>
|
---|
| 1200 | <xsl:when test="contains($path,'/') and substring-after($path,'/')!=''">
|
---|
| 1201 | <xsl:call-template name="basename">
|
---|
| 1202 | <xsl:with-param name="path" select="substring-after($path,'/')"/>
|
---|
| 1203 | </xsl:call-template>
|
---|
| 1204 | </xsl:when>
|
---|
| 1205 | <xsl:when test="contains($path,'/') and substring-after($path,'/')=''">
|
---|
| 1206 | <xsl:value-of select="substring-before($path,'/')"/>
|
---|
| 1207 | </xsl:when>
|
---|
| 1208 | <xsl:otherwise>
|
---|
| 1209 | <xsl:value-of select="$path"/>
|
---|
| 1210 | </xsl:otherwise>
|
---|
| 1211 | </xsl:choose>
|
---|
| 1212 | </xsl:template>
|
---|
| 1213 |
|
---|
| 1214 | <xsl:template name="start-script">
|
---|
| 1215 | <xsl:param name="order" select="'073'"/>
|
---|
| 1216 | <xsl:text>
|
---|
[5451eae] | 1217 | <!-- save the timer, so that unpacking, and du is not counted -->
|
---|
| 1218 | PREV_SEC=${SECONDS}
|
---|
| 1219 | <!-- get the location of the system root -->
|
---|
[1dce189] | 1220 | ROOT=</xsl:text>
|
---|
| 1221 | <xsl:choose>
|
---|
[123105f] | 1222 | <xsl:when test="starts-with(./@id, 'ch-tools') or
|
---|
| 1223 | contains (./@id, 'kernfs')">
|
---|
[1dce189] | 1224 | <xsl:text>$LFS/
|
---|
| 1225 | </xsl:text>
|
---|
| 1226 | </xsl:when>
|
---|
| 1227 | <xsl:otherwise>
|
---|
| 1228 | <xsl:text>/
|
---|
| 1229 | </xsl:text>
|
---|
| 1230 | </xsl:otherwise>
|
---|
| 1231 | </xsl:choose>
|
---|
| 1232 | <xsl:text>
|
---|
[5451eae] | 1233 | SCRIPT_ROOT=</xsl:text>
|
---|
| 1234 | <xsl:copy-of select="$script-root"/>
|
---|
| 1235 | <xsl:text>
|
---|
| 1236 | </xsl:text>
|
---|
| 1237 | <xsl:if test="sect2[@role='installation']">
|
---|
| 1238 | <xsl:text>
|
---|
[2758d94] | 1239 | SRC_DIR=${ROOT}sources
|
---|
| 1240 | <!-- Set variables, for use by the Makefile and package manager -->
|
---|
| 1241 | VERSION=</xsl:text><!-- needed for Makefile, and may be used in PackInstall-->
|
---|
[5451eae] | 1242 | <xsl:copy-of select=".//sect1info/productnumber/text()"/>
|
---|
| 1243 | <xsl:text>
|
---|
[2758d94] | 1244 | PKG_DEST=${SRC_DIR}/</xsl:text>
|
---|
[5451eae] | 1245 | <xsl:copy-of select="$order"/>
|
---|
| 1246 | <xsl:text>-</xsl:text>
|
---|
| 1247 | <xsl:copy-of select=".//sect1info/productname/text()"/>
|
---|
| 1248 | <xsl:text>
|
---|
| 1249 | <!-- Get the tarball name from sect1info -->
|
---|
[2758d94] | 1250 | PACKAGE=</xsl:text>
|
---|
[5451eae] | 1251 | <xsl:call-template name="basename">
|
---|
| 1252 | <xsl:with-param name="path" select=".//sect1info/address/text()"/>
|
---|
| 1253 | </xsl:call-template>
|
---|
[49f8b03] | 1254 | <xsl:if test = "( ../@id = 'chapter-building-system' or
|
---|
[f017b22] | 1255 | ../@id = 'chapter-config' or
|
---|
| 1256 | ../@id = 'chapter-bootscripts' or
|
---|
| 1257 | ../@id = 'chapter-bootable' or
|
---|
[49f8b03] | 1258 | starts-with(@id,'ch-system') ) and $pkgmngt = 'y'">
|
---|
| 1259 | <!-- the last alternative for old books where some sections in
|
---|
| 1260 | chapter-config had ch-system -->
|
---|
[5451eae] | 1261 | <xsl:text>
|
---|
[2758d94] | 1262 | source ${ROOT}${SCRIPT_ROOT}/packInstall.sh
|
---|
| 1263 | export -f packInstall</xsl:text>
|
---|
[5451eae] | 1264 | <xsl:if test="$wrap-install='y'">
|
---|
| 1265 | <xsl:text>
|
---|
[2758d94] | 1266 | export -f wrapInstall
|
---|
| 1267 | </xsl:text>
|
---|
[5451eae] | 1268 | </xsl:if>
|
---|
[2758d94] | 1269 | </xsl:if>
|
---|
| 1270 | <!-- Get the build directory name and clean remnants of previous attempts -->
|
---|
[5451eae] | 1271 | <xsl:text>
|
---|
[2758d94] | 1272 | cd $SRC_DIR
|
---|
| 1273 | PKGDIR=$(tar -tf $PACKAGE | head -n1 | sed 's@^./@@;s@/.*@@')
|
---|
| 1274 | export PKGDIR VERSION PKG_DEST
|
---|
| 1275 |
|
---|
| 1276 | if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi
|
---|
| 1277 | if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
---|
[5451eae] | 1278 | </xsl:text>
|
---|
| 1279 | </xsl:if>
|
---|
| 1280 | <xsl:text>
|
---|
| 1281 | echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
---|
| 1282 | </xsl:text>
|
---|
| 1283 | <xsl:if test="sect2[@role='installation']">
|
---|
| 1284 | <xsl:text>
|
---|
[2758d94] | 1285 | <!-- At last unpack and change directory -->
|
---|
| 1286 | tar -xf $PACKAGE
|
---|
| 1287 | cd $PKGDIR
|
---|
[5451eae] | 1288 | </xsl:text>
|
---|
| 1289 | </xsl:if>
|
---|
| 1290 | <xsl:text>SECONDS=${PREV_SEC}
|
---|
[2758d94] | 1291 |
|
---|
| 1292 | # Start of LFS book script
|
---|
| 1293 | </xsl:text>
|
---|
| 1294 | </xsl:template>
|
---|
| 1295 |
|
---|
| 1296 | <xsl:template name="end-script">
|
---|
| 1297 | <xsl:text>
|
---|
| 1298 | # End of LFS book script
|
---|
| 1299 |
|
---|
[5451eae] | 1300 | echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
---|
| 1301 | </xsl:text>
|
---|
| 1302 | <xsl:if test="sect2[@role='installation']">
|
---|
| 1303 | <xsl:text>cd $SRC_DIR
|
---|
[2758d94] | 1304 | rm -rf $PKGDIR
|
---|
| 1305 | if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
---|
| 1306 | </xsl:text>
|
---|
[5451eae] | 1307 | </xsl:if>
|
---|
[2758d94] | 1308 | </xsl:template>
|
---|
| 1309 |
|
---|
[557fe91] | 1310 | </xsl:stylesheet>
|
---|