Changeset ca6b261


Ignore:
Timestamp:
11/12/2006 09:55:20 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
1f81129
Parents:
8f2c086
Message:

Replaced CLFS BOOT_* functions by CHROOT_* functions due that are identical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    r8f2c086 rca6b261  
    44
    55orphan_scripts="" # 2 scripts do not fit BOOT_Makefiles LUSER environment
    6 
    7 ###################################
    8 ###          FUNCTIONS          ###
    9 ###################################
    10 
    11 #--------------------------------------#
    12 BOOT_wrt_target() {                    # "${this_script}" "$PREV"
    13 #--------------------------------------#
    14   local i=$1
    15   local PREV=$2
    16   case $i in
    17     iteration* ) local LOGFILE=$this_script.log ;;
    18              * ) local LOGFILE=$this_script ;;
    19   esac
    20 (
    21 cat << EOF
    22 
    23 $i:  $PREV
    24         @\$(call echo_message, Building)
    25         @./progress_bar.sh \$@ \$\$PPID &
    26         @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
    27 EOF
    28 ) >> $MKFILE.tmp
    29 }
    30 
    31 #--------------------------------------#
    32 BOOT_wrt_Unpack() {                    # "$pkg_tarball"
    33 #--------------------------------------#
    34   local FILE=$1
    35   local optSAVE_PREVIOUS=$2
    36 
    37   if [ "${optSAVE_PREVIOUS}" != "1" ]; then
    38 (
    39 cat << EOF
    40         @\$(call remove_existing_dirs2,$FILE)
    41 EOF
    42 ) >> $MKFILE.tmp
    43   fi
    44 (
    45 cat  << EOF
    46         @\$(call unpack3,$FILE)
    47         @\$(call get_pkg_root2)
    48 EOF
    49 ) >> $MKFILE.tmp
    50 }
    51 
    52 #----------------------------------#
    53 BOOT_wrt_RunAsRoot() {             # "${this_script}" "${file}"
    54 #----------------------------------#
    55   local this_script=$1
    56   local file=$2
    57 (
    58 cat << EOF
    59         @( time { source envars && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
    60         echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/\$@
    61 EOF
    62 ) >> $MKFILE.tmp
    63 }
    64 
    65 #--------------------------------------#
    66 BOOT_wrt_RemoveBuildDirs() {           # "${name}"
    67 #--------------------------------------#
    68   local name=$1
    69 (
    70 cat << EOF
    71         @\$(call remove_build_dirs2,$name)
    72 EOF
    73 ) >> $MKFILE.tmp
    74 }
    75 
    76 #----------------------------------#
    77 BOOT_wrt_test_log() {              #
    78 #----------------------------------#
    79   local TESTLOGFILE=$1
    80 (
    81 cat  << EOF
    82         @echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\
    83         echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
    84 EOF
    85 ) >> $MKFILE.tmp
    86 }
    87 
    88 #----------------------------------#
    89 BOOT_wrt_CopyFstab() {             #
    90 #----------------------------------#
    91 (
    92 cat << EOF
    93         @( time { cp -v /sources/fstab /etc/fstab >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
    94 EOF
    95 ) >> $MKFILE.tmp
    96 }
    97 
    98 
    99 ########################################
    1006
    1017
     
    559465    # Drop in the name of the target on a new line, and the previous target
    560466    # as a dependency. Also call the echo_message function.
    561     BOOT_wrt_target "${this_script}" "$PREV"
    562     #
    563     BOOT_wrt_Unpack "$pkg_tarball"
     467    CHROOT_wrt_target "${this_script}" "$PREV"
     468    #
     469    CHROOT_Unpack "$pkg_tarball"
    564470    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    565471    #
    566     BOOT_wrt_RunAsRoot "${this_script}" "${file}"
    567     #
    568     BOOT_wrt_RemoveBuildDirs "${name}"
     472    CHROOT_wrt_RunAsRoot "${file}"
     473    #
     474    CHROOT_wrt_RemoveBuildDirs "${name}"
    569475    #
    570476    # Include a touch of the target name so make can check if it's already been made.
     
    764670    # Drop in the name of the target on a new line, and the previous target
    765671    # as a dependency. Also call the echo_message function.
    766     BOOT_wrt_target "${this_script}${N}" "$PREV"
     672    CHROOT_wrt_target "${this_script}${N}" "$PREV"
    767673
    768674    # If $pkg_tarball isn't empty, we've got a package...
    769675    if [ "$pkg_tarball" != "" ] ; then
    770676      FILE="$pkg_tarball"
    771       BOOT_wrt_Unpack "$FILE"
     677      CHROOT_Unpack "$FILE"
    772678      # If the testsuites must be run, initialize the log file
    773679      case $name in
    774680        binutils | gcc | glibc )
    775           [[ "$TEST" != "0" ]] && BOOT_wrt_test_log "${this_script}"
     681          [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
    776682          ;;
    777683        * )
    778           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && BOOT_wrt_test_log "${this_script}"
     684          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
    779685          ;;
    780686      esac
     
    783689    fi
    784690    #
    785     BOOT_wrt_RunAsRoot "${this_script}" "${file}"
    786     #
    787     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
     691    CHROOT_wrt_RunAsRoot "${file}"
     692    #
     693    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    788694    #
    789695    # Include a touch of the target name so make can check if it's already been made.
     
    901807    # Drop in the name of the target on a new line, and the previous target
    902808    # as a dependency. Also call the echo_message function.
    903     BOOT_wrt_target "${this_script}" "$PREV"
     809    CHROOT_wrt_target "${this_script}" "$PREV"
    904810    #
    905811    # If $pkg_tarball isn't empty, we've got a package...
    906812    #
    907     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
    908     #
    909     BOOT_wrt_RunAsRoot "${this_script}" "${file}"
    910     #
    911     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
     813    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     814    #
     815    CHROOT_wrt_RunAsRoot "${file}"
     816    #
     817    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    912818    #
    913819    # Include a touch of the target name so make can check if it's already been made.
     
    1036942    # Drop in the name of the target on a new line, and the previous target
    1037943    # as a dependency. Also call the echo_message function.
    1038     BOOT_wrt_target "${this_script}" "$PREV"
     944    CHROOT_wrt_target "${this_script}" "$PREV"
    1039945    #
    1040946    # If $pkg_tarball isn't empty, we've got a package...
    1041947    # Insert instructions for unpacking the package and changing directories
    1042948    #
    1043     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
     949    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
    1044950    #
    1045951    # Select a script execution method
     
    1048954                  # Minimal boot mode has no access to original file, store in /sources
    1049955                  cp $FSTAB $BUILDDIR/sources/fstab
    1050                   BOOT_wrt_CopyFstab "${this_script}"
     956                  CHROOT_wrt_CopyFstab
    1051957                else
    1052                   BOOT_wrt_RunAsRoot  "${this_script}" "${file}"
     958                  CHROOT_wrt_RunAsRoot "${file}"
    1053959                fi
    1054960          ;;
    1055       *)  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"   ;;
     961      *)  CHROOT_wrt_RunAsRoot "${file}"   ;;
    1056962    esac
    1057963    #
    1058964    # Housekeeping...remove any build directory(ies) except if the package build fails.
    1059     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
     965    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    1060966    #
    1061967    # Include a touch of the target name so make can check if it's already been made.
Note: See TracChangeset for help on using the changeset viewer.