Changeset cf7f294


Ignore:
Timestamp:
10/08/2005 07:48:42 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
2b73842
Parents:
ee09e34
Message:

If a package build fails, their sources aren't removed to can review config.cache, config.log, and like.

Added chapters 7, 8 and 9 (but not tested yet.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jhalfs

    ree09e34 rcf7f294  
    3838                                disables also the build of TCL, Expect
    3939                                and DejaGNU
    40 
    41   -M, --run-make                run make on the generated Makefile
    4240
    4341  --page_size PAGE              set PAGE as the default page size (letter,
     
    4543                                build Groff. If not specified, \"letter\"
    4644                                will be used.
     45
     46  -C, --kernel-config FILE      use the kernel configuration file specified
     47                                in FILE to build the kernel. If not found,
     48                                the kernel build is skipped.
     49
     50  -M, --run-make                run make on the generated Makefile
     51 
    4752"
    4853
     
    132137    --no-toolchain-test )
    133138      TOOLCHAINTEST=0
     139      shift
     140      ;;
     141
     142    --kernel-config | -C )
     143      test $# = 1 && eval "$exit_missing_arg"
     144      shift
     145      if [ -f $1 ] ; then
     146        CONFIG=$1
     147      else
     148        echo -e "\nFile $1 not found, Skipping kernel build.\n"
     149      fi
    134150      shift
    135151      ;;
     
    448464) >> $MKFILE.tmp
    449465
    450     # Remove the build directory(ies) even if the package build fails, except for
    451     # Binutils and TCL. In that cases the sources directories are removed
    452     # only if the build fails.
     466    # Remove the build directory(ies) except if the package build fails
     467    # (to can review config.cache, config.log, and like.)
     468    # For Binutils and TCL the sources must be retained some time.
    453469    if [ "$vrs" != "" ] ; then
    454470      if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] && [ "$i" != "036-binutils-pass2" ] ; then
     
    494510) >> $MKFILE.tmp
    495511
    496     # The next two "if" must be after the touch to can check if the sources
    497     # directories should be retained or deleted.
    498     if [ "$i" = "027-binutils-pass1" -o "$i" = "036-binutils-pass2" ] ; then
    499 (
    500     cat << EOF
    501         @if [ ! -e \$@ ] ; then \\
    502                 ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
    503                 rm -r \$(LFS)\$(SRC)/\$\$ROOT && \\
    504                 rm -r \$(LFS)\$(SRC)/binutils-build; \\
    505         fi;
    506 EOF
    507 ) >> $MKFILE.tmp
    508     fi
    509 
    510     if [ "$i" = "032-tcl" ] ; then
    511 (
    512     cat << EOF
    513         @if [ ! -e \$@ ] ; then \\
    514                 ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
    515                 rm -r \$(LFS)\$(SRC)/\$\$ROOT; \\
    516         fi;
    517 EOF
    518 ) >> $MKFILE.tmp
    519     fi
    520 
    521512    # Keep the script file name for Makefile dependencies.
    522513    PREV=$i
     
    614605    fi
    615606
    616     # Remove the build directory(ies) even if the package build fails.
     607    # Remove the build directory(ies) except if the package build fails.
    617608    if [ "$vrs" != "" ] ; then
    618609(
     
    634625        rm -r \$(LFS)\$(SRC)/binutils-build && \\
    635626        rm sources-dir
     627EOF
     628) >> $MKFILE.tmp
     629    fi
     630
     631    # Include a touch of the target name so make can check
     632    # if it's already been made.
     633(
     634    cat << EOF
     635        @touch \$@
     636EOF
     637) >> $MKFILE.tmp
     638
     639    # Keep the script file name for Makefile dependencies.
     640    PREV=$i
     641  done
     642
     643  for file in chapter0{7,8,9}/* ; do
     644    # Keep the script file name
     645    i=`basename $file`
     646
     647    # Grub must be configured manually
     648    if echo $i | grep -q "grub" ; then
     649       continue
     650    fi
     651
     652    # If no .config file is supplied, the kernel build is skipped
     653    if [ -z $CONFIG ] ; then
     654      if echo $i | grep -q "kernel" ; then
     655        continue
     656      fi
     657    fi
     658
     659    # First append each name of the script files to a list (this will become
     660    # the names of the targets in the Makefile
     661    chapter789="$chapter789 $i"
     662
     663    # Set the dependency for the first target.
     664    if [ -z $PREV ] ; then PREV=116-strippingagain ; fi
     665
     666    # Drop in the name of the target on a new line, and the previous target
     667    # as a dependency. Also call the echo_message function.
     668(
     669    cat << EOF
     670
     671$i:  $PREV
     672        @\$(call echo_message, Building)
     673EOF
     674) >> $MKFILE.tmp
     675
     676    # Find the the bootscripts and kernel package names
     677    if [ "$i" = "119-bootscripts" -o "$i" = "132-kernel" ] ; then
     678      if [ "$i" = "119-bootscripts" ] ; then
     679        vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     680        FILE="lfs-bootscripts-$vrs.tar.bz2"
     681      elif [ "$i" = "132-kernel" ] ; then
     682        vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     683        FILE="linux-$vrs.tar.bz2"
     684      fi
     685(
     686    cat  << EOF
     687        @\$(call unpack,$FILE)
     688        @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
     689        echo "PKGDIR=\$(SRC)/\$\$ROOT" > envars && \\
     690        echo "export PKGDIR" >> envars
     691EOF
     692) >> $MKFILE.tmp
     693    fi
     694   
     695    # Put in place the kernel .config file
     696    elif [ "$i" = "132-kernel" ] ; then
     697(
     698    cat << EOF
     699        @source envars && cp $CONFIG \$(LFS)\$(PKGDIR)
     700EOF
     701) >> $MKFILE.tmp
     702    fi
     703
     704    # Initialize the log an run the script
     705(
     706    cat << EOF
     707        @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >logs/$i && \\
     708        \$(CHROOT2) 'cd /jhalfs && source envars && /jhalfs/commands/$file >>/jhalfs/logs/$i 2>&1' && \\
     709        echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >>logs/$i
     710EOF
     711) >> $MKFILE.tmp
     712
     713    # Remove the build directory except if the package build fails.
     714    if [ "$i" = "119-bootscripts" -o "$i" = "132-kernel" ] ; then
     715(
     716    cat << EOF
     717        @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
     718        rm -r \$(LFS)\$(SRC)/\$\$ROOT
    636719EOF
    637720) >> $MKFILE.tmp
     
    679762(
    680763    cat << EOF
    681 all:  chapter4 chapter5 chapter6
     764all:  chapter4 chapter5 chapter6 chapter789
    682765        @echo -e "\n\tYour new LFS system has been successfully built"
    683766
     
    687770
    688771chapter6:  chapter5 $chapter6
     772
     773chapter789:  chapter6 $chapter789
    689774
    690775clean-all:  clean
Note: See TracChangeset for help on using the changeset viewer.