Changeset f5f857d
- Timestamp:
- 09/25/2007 09:34:03 PM (17 years ago)
- Branches:
- experimental
- Children:
- c5ae20a
- Parents:
- 5a4f6a7
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/lfs.xsl
r5a4f6a7 rf5f857d 48 48 49 49 <!-- ########### NAMED USER TEMPLATES TO ALLOW CUSTOMIZATIONS ############## --> 50 <!-- ############ Maybe should be placed on a separate file ################ --> 50 51 51 52 <!-- Hock for user header additions --> … … 145 146 146 147 <!-- Hock for creating a custom tools directory containing scripts 147 to be run after the system has been built --> 148 to be run after the system has been built 149 (to be moved to a separate file) --> 148 150 <xsl:template name="custom-tools"> 149 151 <!-- Fixed directory and ch_order values --> … … 246 248 and reset the seconds counter --> 247 249 <xsl:template name="unpack"> 248 <xsl:choose> 249 <xsl:when test="ancestor::chapter[@id='chapter-temporary-tools']"> 250 <xsl:text>cd $SRCDIR</xsl:text> 251 </xsl:when> 252 <xsl:otherwise> 253 <xsl:text>cd /sources</xsl:text> 254 </xsl:otherwise> 255 </xsl:choose> 256 <xsl:text> 250 <xsl:text>cd </xsl:text> 251 <xsl:if test="ancestor::chapter[@id='chapter-temporary-tools']"> 252 <xsl:text>$LFS</xsl:text> 253 </xsl:if> 254 <xsl:text>/sources 257 255 PKGDIR=`tar -tf $TARBALL | head -n1 | sed -e 's@^./@@;s@/.*@@'` 258 256 if [ -d $PKGDIR ]; then … … 292 290 <!-- Remove sources and build dirs, skipping it from seconds meassurament --> 293 291 <xsl:template name="clean_sources"> 294 <xsl:choose> 295 <xsl:when test="ancestor::chapter[@id='chapter-temporary-tools']"> 296 <xsl:text>cd $SRCDIR</xsl:text> 297 </xsl:when> 298 <xsl:otherwise> 299 <xsl:text>cd /sources</xsl:text> 300 </xsl:otherwise> 301 </xsl:choose> 302 <xsl:text> 292 <xsl:text>cd </xsl:text> 293 <xsl:if test="ancestor::chapter[@id='chapter-temporary-tools']"> 294 <xsl:text>$LFS</xsl:text> 295 </xsl:if> 296 <xsl:text>/sources 303 297 SECS=$SECONDS 304 298 rm -rf $PKGDIR … … 368 362 369 363 370 <!-- Adds blfs-tool support scripts --> 364 <!-- Check if a package testsuite must be run --> 365 <xsl:template name="run_this_test"> 366 <xsl:choose> 367 <xsl:when test=".//userinput[@remap='test']"> 368 <xsl:choose> 369 <!-- No testsuites run on level 0 --> 370 <xsl:when test="$testsuite = '0'">0</xsl:when> 371 <!-- On level 1, only final system toolchain testsuites are run --> 372 <xsl:when test="$testsuite = '1' and 373 not(@id='ch-system-gcc') and 374 not(@id='ch-system-glibc') and 375 not(@id='ch-system-binutils')">0</xsl:when> 376 <!-- On level 2, temp tools testsuites are not run --> 377 <xsl:when test="$testsuite = '2' and 378 ../@id='chapter-temporary-tools'">0</xsl:when> 379 <xsl:otherwise>1</xsl:otherwise> 380 </xsl:choose> 381 </xsl:when> 382 <xsl:otherwise>0</xsl:otherwise> 383 </xsl:choose> 384 </xsl:template> 385 386 387 <!-- Adds blfs-tool support scripts (to be moved to a separate file) --> 371 388 <xsl:template name="blfs-tool"> 372 389 <!-- Fixed directory and ch_order values --> … … 476 493 <!-- Script build order --> 477 494 <xsl:variable name="order" select="concat($dirname,'/',$ch_order,'_',$sect1_order)"/> 495 <!-- Must the package test suite, if any, be run? --> 496 <xsl:variable name="run_this_test"> 497 <xsl:call-template name="run_this_test"/> 498 </xsl:variable> 478 499 <!-- Hock to insert scripts before the current one --> 479 500 <xsl:call-template name="insert_script_before"> … … 487 508 <xsl:apply-templates select="sect1info[@condition='script']"> 488 509 <xsl:with-param name="phase" select="$filename"/> 510 <xsl:with-param name="run_this_test" select="$run_this_test"/> 511 <xsl:with-param name="testlogfile" select="concat($ch_order,'_',$sect1_order,'-',$filename)"/> 489 512 </xsl:apply-templates> 490 513 <xsl:call-template name="disk_usage"/> … … 494 517 <xsl:call-template name="user_pre_commands"/> 495 518 <xsl:call-template name="pre_commands"/> 496 <xsl:apply-templates select=".//screen"/> 519 <xsl:apply-templates select=".//screen"> 520 <xsl:with-param name="run_this_test" select="$run_this_test"/> 521 </xsl:apply-templates> 497 522 <xsl:call-template name="post_commands"/> 498 523 <xsl:call-template name="user_footer"/> … … 514 539 <!-- sect1info --> 515 540 <xsl:template match="sect1info"> 541 <!-- Used to set and initialize the testuite log file --> 542 <xsl:param name="testlogfile" select="foo"/> 543 <xsl:param name="run_this_test" select="foo"/> 516 544 <!-- Build phase (base file name) to be used for PM --> 517 545 <xsl:param name="phase" select="foo"/> … … 524 552 <!-- Tarball name --> 525 553 <xsl:apply-templates select="address"/> 554 <xsl:if test="$run_this_test = '1'"> 555 <xsl:text>
TEST_LOG=</xsl:text> 556 <xsl:if test="ancestor::chapter[@id='chapter-temporary-tools']"> 557 <xsl:text>$LFS</xsl:text> 558 </xsl:if> 559 <xsl:text>/jhalfs/test-logs/</xsl:text> 560 <xsl:value-of select="$testlogfile"/> 561 <xsl:text>
echo -e "\n`date`\n" > $TEST_LOG</xsl:text> 562 </xsl:if> 526 563 <xsl:text>

</xsl:text> 527 564 </xsl:template> … … 568 605 <!-- screen --> 569 606 <xsl:template match="screen"> 607 <xsl:param name="run_this_test" select="foo"/> 570 608 <xsl:if test="child::* = userinput and not(@role = 'nodump')"> 571 609 <xsl:call-template name="top_screen_build_fixes"/> 572 <xsl:apply-templates/> 610 <xsl:apply-templates> 611 <xsl:with-param name="run_this_test" select="$run_this_test"/> 612 </xsl:apply-templates> 573 613 <xsl:call-template name="bottom_screen_build_fixes"/> 574 614 <xsl:text>
</xsl:text> 575 615 </xsl:if> 616 </xsl:template> 617 618 619 <!-- userinput @remap='test' --> 620 <xsl:template match="userinput[@remap='test']"> 621 <xsl:param name="run_this_test" select="foo"/> 622 <xsl:apply-templates select="." mode="test"> 623 <xsl:with-param name="run_this_test" select="$run_this_test"/> 624 </xsl:apply-templates> 576 625 </xsl:template> 577 626 … … 592 641 <xsl:template match="userinput[@remap='make']"> 593 642 <xsl:apply-templates select="." mode="make"/> 594 </xsl:template>595 596 597 <!-- userinput @remap='test' -->598 <xsl:template match="userinput[@remap='test']">599 <xsl:apply-templates select="." mode="test"/>600 643 </xsl:template> 601 644 … … 670 713 <!-- mode test --> 671 714 <xsl:template match="userinput" mode="test"> 672 <xsl:choose> 673 <!-- No testsuites run on level 0 --> 674 <xsl:when test="$testsuite = '0'"/> 675 <!-- On level 1, only final system toolchain testsuites are run --> 676 <xsl:when test="$testsuite = '1' and 677 not(ancestor::sect1[@id='ch-system-gcc']) and 678 not(ancestor::sect1[@id='ch-system-glibc']) and 679 not(ancestor::sect1[@id='ch-system-binutils'])"/> 680 <!-- On level 2, temp tools testsuites are not run --> 681 <xsl:when test="$testsuite = '2' and 682 ancestor::chapter[@id='chapter-temporary-tools']"/> 683 <!-- Start testsuites command fixes --> 684 <xsl:otherwise> 685 <xsl:choose> 686 <!-- Final system Glibc --> 687 <xsl:when test="contains(string(),'glibc-check-log')"> 688 <xsl:value-of select="substring-before(string(),'2>&1')"/> 689 <xsl:text>>> $TEST_LOG 2>&1 || true</xsl:text> 690 </xsl:when> 691 <!-- Module-Init-Tools --> 692 <xsl:when test="ancestor::sect1[@id='ch-system-module-init-tools'] 693 and contains(string(),'make check')"> 694 <xsl:value-of select="substring-before(string(),' check')"/> 695 <xsl:if test="$bomb-testsuite = 'n'"> 696 <xsl:text> -k</xsl:text> 697 </xsl:if> 698 <xsl:text> check >> $TEST_LOG 2>&1</xsl:text> 699 <xsl:if test="$bomb-testsuite = 'n'"> 700 <xsl:text> || true</xsl:text> 701 </xsl:if> 702 <xsl:value-of select="substring-after(string(),' check')"/> 703 </xsl:when> 704 <!-- If the book uses -k, the testsuite should never bomb --> 705 <xsl:when test="contains(string(),'make -k ')"> 706 <xsl:apply-templates select="." mode="default"/> 707 <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text> 708 </xsl:when> 709 <!-- Extra commands in Binutils and GCC --> 710 <xsl:when test="contains(string(),'test_summary') or 711 contains(string(),'expect -c')"> 712 <xsl:apply-templates select="." mode="default"/> 713 <xsl:text> >> $TEST_LOG</xsl:text> 714 </xsl:when> 715 <!-- Remaining extra testsuite commads that don't need be hacked --> 716 <xsl:when test="not(contains(string(),'make '))"> 717 <xsl:apply-templates select="." mode="default"/> 718 </xsl:when> 719 <!-- Normal testsites run --> 720 <xsl:otherwise> 721 <xsl:choose> 722 <!-- No bomb on failures --> 723 <xsl:when test="$bomb-testsuite = 'n'"> 724 <xsl:value-of select="substring-before(string(),'make ')"/> 725 <xsl:text>make -k </xsl:text> 726 <xsl:value-of select="substring-after(string(),'make ')"/> 727 <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text> 728 </xsl:when> 729 <!-- Bomb at the first failure --> 730 <xsl:otherwise> 731 <xsl:apply-templates select="." mode="default"/> 732 <xsl:text> >> $TEST_LOG 2>&1</xsl:text> 733 </xsl:otherwise> 734 </xsl:choose> 735 </xsl:otherwise> 736 </xsl:choose> 737 </xsl:otherwise> 738 </xsl:choose> 715 <xsl:param name="run_this_test" select="foo"/> 716 <xsl:if test="$run_this_test = '1'"> 717 <xsl:choose> 718 <!-- Final system Glibc --> 719 <xsl:when test="contains(string(),'glibc-check-log')"> 720 <xsl:value-of select="substring-before(string(),'2>&1')"/> 721 <xsl:text>>> $TEST_LOG 2>&1 || true</xsl:text> 722 </xsl:when> 723 <!-- Module-Init-Tools --> 724 <xsl:when test="ancestor::sect1[@id='ch-system-module-init-tools'] 725 and contains(string(),'make check')"> 726 <xsl:value-of select="substring-before(string(),' check')"/> 727 <xsl:if test="$bomb-testsuite = 'n'"> 728 <xsl:text> -k</xsl:text> 729 </xsl:if> 730 <xsl:text> check >> $TEST_LOG 2>&1</xsl:text> 731 <xsl:if test="$bomb-testsuite = 'n'"> 732 <xsl:text> || true</xsl:text> 733 </xsl:if> 734 <xsl:value-of select="substring-after(string(),' check')"/> 735 </xsl:when> 736 <!-- If the book uses -k, the testsuite should never bomb --> 737 <xsl:when test="contains(string(),'make -k ')"> 738 <xsl:apply-templates select="." mode="default"/> 739 <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text> 740 </xsl:when> 741 <!-- Extra commands in Binutils and GCC --> 742 <xsl:when test="contains(string(),'test_summary') or 743 contains(string(),'expect -c')"> 744 <xsl:apply-templates select="." mode="default"/> 745 <xsl:text> >> $TEST_LOG</xsl:text> 746 </xsl:when> 747 <!-- Remaining extra testsuite commads that don't need be hacked --> 748 <xsl:when test="not(contains(string(),'make '))"> 749 <xsl:apply-templates select="." mode="default"/> 750 </xsl:when> 751 <!-- Normal testsites run --> 752 <xsl:otherwise> 753 <xsl:choose> 754 <!-- No bomb on failures --> 755 <xsl:when test="$bomb-testsuite = 'n'"> 756 <xsl:value-of select="substring-before(string(),'make ')"/> 757 <xsl:text>make -k </xsl:text> 758 <xsl:value-of select="substring-after(string(),'make ')"/> 759 <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text> 760 </xsl:when> 761 <!-- Bomb at the first failure --> 762 <xsl:otherwise> 763 <xsl:apply-templates select="." mode="default"/> 764 <xsl:text> >> $TEST_LOG 2>&1</xsl:text> 765 </xsl:otherwise> 766 </xsl:choose> 767 </xsl:otherwise> 768 </xsl:choose> 769 </xsl:if> 739 770 </xsl:template> 740 771 -
LFS/master.sh
r5a4f6a7 rf5f857d 52 52 echo "umask 022" >> \$(LUSER_HOME)/.bashrc && \\ 53 53 echo "LFS=\$(MOUNT_PT)" >> \$(LUSER_HOME)/.bashrc && \\ 54 echo "SRCDIR=\$(MOUNT_PT)/sources" >> \$(LUSER_HOME)/.bashrc && \\55 54 echo "LC_ALL=POSIX" >> \$(LUSER_HOME)/.bashrc && \\ 56 55 echo "PATH=/tools/bin:/bin:/usr/bin" >> \$(LUSER_HOME)/.bashrc && \\ 57 56 echo "export LFS LC_ALL PATH" >> \$(LUSER_HOME)/.bashrc && \\ 58 57 echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc && \\ 59 chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\ 60 touch envars && \\ 61 chown \$(LUSER) envars 58 chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc 62 59 @\$(call housekeeping) 63 60 EOF … … 96 93 esac 97 94 98 # Grab the package name, if the script is building a package99 name=`grep "^PACKAGE=" ${file} | sed -e 's@PACKAGE=@@'`100 101 95 # Set the dependency for the first target. 102 96 if [ -z $PREV ] ; then PREV=04_04-settingenvironment ; fi … … 109 103 # as a dependency. Also call the echo_message function. 110 104 LUSER_wrt_target "${this_script}" "$PREV" 111 112 # If $name isn't empty, we've got a package...113 if [ "$name" != "" ] ; then114 # If the testsuites must be run, initialize the log file115 [[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}"116 # If using optimizations, write the instructions117 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"118 fi119 105 120 106 # Run the script. … … 176 162 esac 177 163 178 # Grab the name of the target.164 # Grab the name of the package, if any. 179 165 name=`grep "^PACKAGE=" ${file} | sed -e 's@PACKAGE=@@'` 180 166 … … 208 194 esac 209 195 210 # If $name isn't empty, we've got a package... 211 if [ "$name" != "" ] ; then 212 # Touch timestamp file if installed files logs will be created. 213 # But only for the firt build when running iterative builds. 214 if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then 215 CHROOT_wrt_TouchTimestamp 216 fi 217 # If the testsuites must be run, initialize the log file 218 case $name in 219 binutils | gcc | glibc ) 220 [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" 221 ;; 222 * ) 223 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}" 224 ;; 225 esac 226 # If using optimizations, write the instructions 227 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" 196 # Touch timestamp file if installed files logs will be created. 197 # But only for the firt build when running iterative builds. 198 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then 199 CHROOT_wrt_TouchTimestamp 228 200 fi 229 201 … … 363 335 sed -e "s@chroot@$CHROOT_LOC@" \ 364 336 -e 's@ \\\@ @g' \ 337 -e 's/ */ /g' \ 365 338 -e 's|\\$|&&|g' \ 366 339 -e 's|"$$LFS"|$(MOUNT_PT)|' \ -
common/libs/func_wrt_Makefile
r5a4f6a7 rf5f857d 59 59 60 60 #----------------------------------# 61 LUSER_wrt_target() { # Create target and initialize envars file61 LUSER_wrt_target() { # Create target 62 62 #----------------------------------# 63 63 local i=$1 … … 69 69 @\$(call echo_message, Building) 70 70 @export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID & 71 @rm -f envars && touch envars72 71 EOF 73 72 ) >> $MKFILE.tmp … … 85 84 @\$(call echo_message, Building) 86 85 @export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID & 87 @rm -f envars && touch envars88 EOF89 ) >> $MKFILE.tmp90 }91 92 #=======================93 94 95 #===== TESTS LOGS ======96 97 #----------------------------------#98 LUSER_wrt_test_log() { # Initialize testsuite log file99 #----------------------------------#100 local TESTLOGFILE=$1101 (102 cat << EOF103 @echo "export TEST_LOG=\$(TESTLOGDIR)/$TESTLOGFILE" >> envars && \\104 echo "\$(nl_)\`date\`\$(nl_)" > \$(TESTLOGDIR)/\$@105 EOF106 ) >> $MKFILE.tmp107 }108 109 #----------------------------------#110 CHROOT_wrt_test_log() { #111 #----------------------------------#112 local TESTLOGFILE=$1113 (114 cat << EOF115 @echo "export TEST_LOG=\$(crTESTLOGDIR)/$TESTLOGFILE" >> envars && \\116 echo "\$(nl_)\`date\`\$(nl_)" > test-logs/\$@117 86 EOF 118 87 ) >> $MKFILE.tmp … … 153 122 ( 154 123 cat << EOF 155 @ source ~/.bashrc &&\$(CMDSDIR)/`dirname $file`/\$@ > logs/\$@ 2>&1124 @\$(CMDSDIR)/`dirname $file`/\$@ > logs/\$@ 2>&1 156 125 EOF 157 126 ) >> $MKFILE.tmp … … 164 133 ( 165 134 cat << EOF 166 @ source envars &&\$(crCMDSDIR)/`dirname $file`/\$@ > logs/\$@ 2>&1135 @\$(crCMDSDIR)/`dirname $file`/\$@ > logs/\$@ 2>&1 167 136 EOF 168 137 ) >> $MKFILE.tmp
Note:
See TracChangeset
for help on using the changeset viewer.