From e35e794b5071039aa76d9e9abc544e965903c683 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sun, 4 Jun 2006 17:59:02 +0000 Subject: [PATCH] Merged r2750 from trunk. --- CLFS/clfs.xsl | 33 ++++++++++++++++++++++----------- CLFS/master.sh | 20 ++++++++++++++++++++ HLFS/hlfs.xsl | 31 ++++++++++++++++++++----------- HLFS/master.sh | 19 ++++++++++++++++--- LFS/lfs.xsl | 34 ++++++++++++++++++++++------------ LFS/master.sh | 13 +++++++++++++ common/common-functions | 26 +++++++++++++++++++++++++- common/config | 5 +++-- master.sh | 8 ++++++-- 9 files changed, 147 insertions(+), 42 deletions(-) diff --git a/CLFS/clfs.xsl b/CLFS/clfs.xsl index dabbe35..d7bc2b5 100644 --- a/CLFS/clfs.xsl +++ b/CLFS/clfs.xsl @@ -30,13 +30,13 @@ - + - + @@ -120,7 +120,7 @@ make -k - || true + >> $TEST_LOG 2>&1 || true @@ -165,27 +165,35 @@ - + contains(string(),'dummy'))"> + + + + + + >> $TEST_LOG 2>&1 || true + + + + + - make -k check || true + make -k check >> $TEST_LOG 2>&1 || true - - || true - - + + >> $TEST_LOG 2>&1 || true @@ -194,6 +202,9 @@ + + >> $TEST_LOG + diff --git a/CLFS/master.sh b/CLFS/master.sh index 0c28f03..a64608a 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -542,6 +542,16 @@ final_system_Makefiles() { # if [ "$vrs" != "" ] ; then FILE="$name-$vrs.tar.*" wrt_unpack2 "$FILE" + # If the testsuites must be run, initialize the log file + case $name in + binutils | gcc | glibc ) + [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}" + ;; + * ) + [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}" + ;; + esac + # If using optimizations, write the instructions [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi # @@ -645,6 +655,16 @@ bm_final_system_Makefiles() { # if [ "$vrs" != "" ] ; then FILE="$name-$vrs.tar.*" wrt_unpack3 "$FILE" + # If the testsuites must be run, initialize the log file + case $name in + binutils | gcc | glibc ) + [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}" + ;; + * ) + [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}" + ;; + esac + # If using optimizations, write the instructions [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi # diff --git a/HLFS/hlfs.xsl b/HLFS/hlfs.xsl index 3ed19a5..0d0ffdc 100644 --- a/HLFS/hlfs.xsl +++ b/HLFS/hlfs.xsl @@ -30,14 +30,14 @@ - + - - + + @@ -144,13 +144,13 @@ $testsuite = '3')"> - make -k check || true + make -k check >> $TEST_LOG 2>&1 || true make -k - || true + >> $TEST_LOG 2>&1 || true @@ -211,12 +211,22 @@ - + contains(string(),'dummy'))"> + + + + + + >> $TEST_LOG 2>&1 || true + + + + + @@ -224,8 +234,7 @@ - make -k check || true - + make -k check >> $TEST_LOG 2>&1 || true @@ -234,7 +243,7 @@ - make -k check || true + make -k check >> $TEST_LOG 2>&1 || true diff --git a/HLFS/master.sh b/HLFS/master.sh index 1e2b13d..38ab547 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -143,10 +143,13 @@ chapter5_Makefiles() { # Bootstrap or temptools phase # Insert instructions for unpacking the package and to set the PKGDIR variable. case $this_script in *binutils* ) - wrt_unpack "$FILE" 1 ;; # Do not delete an existing package directories - *) - wrt_unpack "$FILE" ;; + wrt_unpack "$FILE" 1 ;; # Do not delete an existing package directories + *) + wrt_unpack "$FILE" ;; esac + # If the testsuites must be run, initialize the log file + [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}" + # If using optimizations, write the instructions [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi @@ -314,6 +317,16 @@ chapter6_Makefiles() { # sysroot or chroot build phase esac wrt_unpack2 "$FILE" wrt_target_vars + # If the testsuites must be run, initialize the log file + case $name in + binutils | gcc | glibc ) + [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}" + ;; + * ) + [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}" + ;; + esac + # If using optimizations, write the instructions [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl index b532f5d..7ab84f6 100644 --- a/LFS/lfs.xsl +++ b/LFS/lfs.xsl @@ -24,13 +24,13 @@ - + - + @@ -112,7 +112,7 @@ make -k - || true + >> $TEST_LOG 2>&1 || true @@ -147,11 +147,21 @@ cp -v ../kernel-config .config - + contains(string(),'dummy'))"> + + + + + + >> $TEST_LOG 2>&1 || true + + + + + @@ -159,18 +169,15 @@ - make -k check || true - + make -k check >> $TEST_LOG 2>&1 || true - - || true - - + + >> $TEST_LOG 2>&1 || true @@ -181,6 +188,9 @@ ancestor::chapter[@id='chapter-building-system']) or $testsuite = '3'"> + + >> $TEST_LOG + diff --git a/LFS/master.sh b/LFS/master.sh index f5aecb3..35befda 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -112,6 +112,9 @@ chapter5_Makefiles() { # Insert instructions for unpacking the package and to set the PKGDIR variable. wrt_unpack "$FILE" + # If the testsuites must be run, initialize the log file + [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}" + # If using optimizations, write the instructions [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi @@ -216,6 +219,16 @@ chapter6_Makefiles() { if [ "$vrs" != "" ] ; then FILE="$name-$vrs.tar.*" wrt_unpack2 "$FILE" + # If the testsuites must be run, initialize the log file + case $name in + binutils | gcc | glibc ) + [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}" + ;; + * ) + [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}" + ;; + esac + # If using optimizations, write the instructions [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi diff --git a/common/common-functions b/common/common-functions index 287e02e..c661476 100644 --- a/common/common-functions +++ b/common/common-functions @@ -276,7 +276,7 @@ wrt_unpack2() { # ( cat << EOF @\$(call unpack2,$FILE) - @ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars EOF ) >> $MKFILE.tmp @@ -301,6 +301,30 @@ EOF ) >> $MKFILE.tmp } +#----------------------------------# +wrt_test_log() { # Initialize testsuite log file +#----------------------------------# + local TESTLOGFILE=$1 +( +cat << EOF + @echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\ + su - lfs -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE" +EOF +) >> $MKFILE.tmp +} + +#----------------------------------# +wrt_test_log2() { # +#----------------------------------# + local TESTLOGFILE=$1 +( +cat << EOF + @echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\ + echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE +EOF +) >> $MKFILE.tmp +} + #----------------------------------# wrt_target_vars() { # Target vars for hlfs (cross-build method) #----------------------------------# diff --git a/common/config b/common/config index 53409b8..74bb55e 100644 --- a/common/config +++ b/common/config @@ -89,8 +89,9 @@ RUN_FARCE=0 #--- Working directories SCRIPT_ROOT=jhalfs -JHALFSDIR=$BUILDDIR/$SCRIPT_ROOT - LOGDIR=$JHALFSDIR/logs + JHALFSDIR=$BUILDDIR/$SCRIPT_ROOT + LOGDIR=$JHALFSDIR/logs + TESTLOGDIR=$JHALFSDIR/test-logs #--- File listing package contents (from where package sources dir is extracted) PKG_LST=unpacked diff --git a/master.sh b/master.sh index 79df1e0..ff9118c 100755 --- a/master.sh +++ b/master.sh @@ -138,6 +138,7 @@ while test $# -gt 0 ; do BUILDDIR=$1 JHALFSDIR=$BUILDDIR/${SCRIPT_ROOT} LOGDIR=$JHALFSDIR/logs + TESTLOGDIR=$JHALFSDIR/test-logs MKFILE=$JHALFSDIR/Makefile ;; esac @@ -415,8 +416,8 @@ echo check_version "2.6.2" "`uname -r`" "KERNEL" check_version "3.0" "$BASH_VERSION" "BASH" check_version "3.0" "`gcc -dumpversion`" "GCC" -tarVer=`tar --version` -check_version "1.15.0" "${tarVer##* }" "TAR" +tarVer=`tar --version | head -n1 | cut -d " " -f4` +check_version "1.15.0" "${tarVer}" "TAR" echo "${SD_BORDER}${nl_}" validate_config @@ -479,10 +480,13 @@ if [[ ! -d $LOGDIR ]]; then fi >$LOGDIR/$LOG # +[[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR # if [[ "$PWD" != "$JHALFSDIR" ]]; then cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/ + # [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/ + # if [[ "$COMPARE" != "0" ]] ; then mkdir -p $JHALFSDIR/extras cp extras/* $JHALFSDIR/extras