Changeset 9c9775f for CLFS/master.sh


Ignore:
Timestamp:
09/19/2007 04:50:48 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
3778352
Parents:
0510381
Message:

Updated experimental branch to current trunk code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    • Property mode changed from 100755 to 100644
    r0510381 r9c9775f  
    1 #!/bin/sh
     1#!/bin/bash
    22# $Id$
    33
    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
     
    11622        rm -f /tools && \\
    11723        ln -s \$(MOUNT_PT)/tools /
    118         @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
    119                 mkdir \$(MOUNT_PT)/sources; \\
    120         fi;
    121         @chmod a+wt \$(MOUNT_PT)/sources && \\
    122         touch \$@ && \\
    123         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    124         echo --------------------------------------------------------------------------------\$(WHITE)
     24        @\$(call housekeeping)
    12525
    12626024-creatingcrossdir: 023-creatingtoolsdir
     27        @\$(call echo_message, Building)
    12728        @mkdir -v \$(MOUNT_PT)/cross-tools && \\
    12829        rm -f /cross-tools && \\
    12930        ln -s \$(MOUNT_PT)/cross-tools /
    130         @touch \$@ && \\
    131         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    132         echo --------------------------------------------------------------------------------\$(WHITE)
     31        @\$(call housekeeping)
    13332
    13433025-addinguser:  024-creatingcrossdir
    13534        @\$(call echo_message, Building)
    136         @if [ ! -d /home/\$(LUSER) ]; then \\
     35        @if [ ! -d \$(LUSER_HOME) ]; then \\
    13736                groupadd \$(LGROUP); \\
    13837                useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
     
    14039                touch luser-exist; \\
    14140        fi;
    142         @chown \$(LUSER) \$(MOUNT_PT) && \\
    143         chown \$(LUSER) \$(MOUNT_PT)/tools && \\
     41        @chown \$(LUSER) \$(MOUNT_PT)/tools && \\
    14442        chown \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
    145         chown \$(LUSER) \$(MOUNT_PT)/sources && \\
    146         touch \$@ && \\
    147         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    148         echo --------------------------------------------------------------------------------\$(WHITE)
     43        chmod -R a+wt \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
     44        chmod a+wt \$(SRCSDIR)
     45        @\$(call housekeeping)
    14946
    15047026-settingenvironment:  025-addinguser
    15148        @\$(call echo_message, Building)
    152         @if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
    153                 mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
     49        @if [ -f \$(LUSER_HOME)/.bashrc -a ! -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
     50                mv \$(LUSER_HOME)/.bashrc \$(LUSER_HOME)/.bashrc.XXX; \\
    15451        fi;
    155         @if [ -f /home/\$(LUSER)/.bash_profile  -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
    156                 mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
     52        @if [ -f \$(LUSER_HOME)/.bash_profile  -a ! -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
     53                mv \$(LUSER_HOME)/.bash_profile \$(LUSER_HOME)/.bash_profile.XXX; \\
    15754        fi;
    158         @echo "set +h" > /home/\$(LUSER)/.bashrc && \\
    159         echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
    160         echo "CLFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
    161         echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
    162         echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
    163         echo "export CLFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
    164         echo "" >> /home/\$(LUSER)/.bashrc && \\
    165         echo "unset CFLAGS" >> /home/\$(LUSER)/.bashrc && \\
    166         echo "unset CXXFLAGS" >> /home/\$(LUSER)/.bashrc && \\
    167         echo "" >> /home/\$(LUSER)/.bashrc && \\
    168         echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> /home/\$(LUSER)/.bashrc && \\
    169         echo "export CLFS_TARGET=\"${TARGET}\"" >> /home/\$(LUSER)/.bashrc && \\
    170         echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/\$(LUSER)/.bashrc && \\
    171         echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
    172         @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
     55        @echo "set +h" > \$(LUSER_HOME)/.bashrc && \\
     56        echo "umask 022" >> \$(LUSER_HOME)/.bashrc && \\
     57        echo "CLFS=\$(MOUNT_PT)" >> \$(LUSER_HOME)/.bashrc && \\
     58        echo "LC_ALL=POSIX" >> \$(LUSER_HOME)/.bashrc && \\
     59        echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> \$(LUSER_HOME)/.bashrc && \\
     60        echo "export CLFS LC_ALL PATH" >> \$(LUSER_HOME)/.bashrc && \\
     61        echo "" >> \$(LUSER_HOME)/.bashrc && \\
     62        echo "unset CFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
     63        echo "unset CXXFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
     64        echo "" >> \$(LUSER_HOME)/.bashrc && \\
     65        echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> \$(LUSER_HOME)/.bashrc && \\
     66        echo "export CLFS_TARGET=\"${TARGET}\"" >> \$(LUSER_HOME)/.bashrc && \\
     67        echo "export CLFS_TARGET32=\"${TARGET32}\"" >> \$(LUSER_HOME)/.bashrc && \\
     68        echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc
     69        @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
    17370        touch envars && \\
    17471        chmod -R a+wt \$(MOUNT_PT) && \\
    175         chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
    176         touch \$@ && \\
    177         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    178         echo --------------------------------------------------------------------------------\$(WHITE)
     72        chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT)
     73        @\$(call housekeeping)
    17974EOF
    18075) >> $MKFILE.tmp
     
    211106                                  -e 's@-static@@' \
    212107                                  -e 's@-final@@' \
    213                                   -e 's@-64@@' \
     108                                  -e 's@-64@@' \
    214109                                  -e 's@-n32@@'`
    215110    pkg_tarball=$(get_package_tarball_name $name)
     
    321216    # the names of the targets in the Makefile
    322217    case "${this_script}" in
    323       *util-linux) orphan_scripts="${orphan_scripts} ${this_script}"  ;;
    324218      *kernfs)     orphan_scripts="${orphan_scripts} ${this_script}"  ;;
    325219      *)           chroottools="$chroottools $this_script"            ;;
     
    341235         LUSER_RemoveBuildDirs "${name}"
    342236         wrt_touch
    343         temptools="$temptools $this_script"
    344         continue ;;
     237        temptools="$temptools $this_script"
     238        continue ;;
    345239     esac
    346240
     
    358252    #
    359253    if [ "$pkg_tarball" != "" ] ; then
    360       case $this_script in
    361         *util-linux)      ROOT_Unpack  "$pkg_tarball"  ;;
    362         *)              CHROOT_Unpack "$pkg_tarball"  ;;
    363       esac
     254      CHROOT_Unpack "$pkg_tarball"
    364255      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    365256    fi
     
    367258    # Select a script execution method
    368259    case $this_script in
    369       *kernfs)      wrt_RunAsRoot         "${this_script}" "${file}"  ;;
    370       *util-linux)  ROOT_RunAsRoot        "${file}"  ;;
     260      *kernfs)      wrt_RunAsRoot         "${file}"  ;;
    371261      *)            CHROOT_wrt_RunAsRoot  "${file}"  ;;
    372262    esac
     
    404294    # A little housekeeping on the scripts
    405295    case $this_script in
    406       *grub | *aboot | *colo | *silo | *arcload | *lilo )     continue    ;;
     296      *grub | *aboot | *colo | *silo | *arcload | *lilo | *introduction ) continue ;;
    407297      *whatnext*) continue     ;;
    408298      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
     
    457347       # The following 2 scripts are defined in the /boot directory but need
    458348       # to be run as a root user. Set them up here but run them in another phase
    459       *changingowner*)  wrt_RunAsRoot "${this_script}" "${file}"    ;;
    460       *devices*)        wrt_RunAsRoot "${this_script}" "${file}"    ;;
     349      *changingowner*)  wrt_RunAsRoot "${file}"    ;;
     350      *devices*)        wrt_RunAsRoot "${file}"    ;;
    461351      *fstab*)   if [[ -n "$FSTAB" ]]; then
    462352                   LUSER_wrt_CopyFstab
     
    486376
    487377#--------------------------------------#
    488 chroot_testsuite_tools_Makefiles() {   #
    489 #--------------------------------------#
    490   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools  ( CHROOT ) ${R_arrow}"
     378testsuite_tools_Makefiles() {          #
     379#--------------------------------------#
     380
     381  if [[ "${METHOD}" = "chroot" ]]; then
     382    echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools  ( CHROOT ) ${R_arrow}"
     383  else
     384    echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools ( ROOT ) ${R_arrow}"
     385    PREV=""
     386  fi
    491387
    492388  for file in testsuite-tools/* ; do
     
    535431}
    536432
    537 #--------------------------------------#
    538 boot_testsuite_tools_Makefiles() {     #
    539 #--------------------------------------#
    540   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools ( ROOT ) ${R_arrow}"
    541   for file in testsuite-tools/* ; do
    542     # Keep the script file name
    543     this_script=`basename $file`
    544 
    545     # First append each name of the script files to a list (this will become
    546     # the names of the targets in the Makefile
    547     PREV=
    548     testsuitetools="$testsuitetools $this_script"
    549 
    550     # Grab the name of the target, strip id number, XXX-script
    551     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
    552                                   -e 's@-64bit@@' \
    553                                   -e 's@-64@@' \
    554                                   -e 's@64@@' \
    555                                   -e 's@n32@@'`
    556 
    557     pkg_tarball=$(get_package_tarball_name $name)
    558 
    559     #--------------------------------------------------------------------#
    560     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
    561     #--------------------------------------------------------------------#
    562     #
    563     # Drop in the name of the target on a new line, and the previous target
    564     # as a dependency. Also call the echo_message function.
    565     BOOT_wrt_target "${this_script}" "$PREV"
    566     #
    567     BOOT_wrt_Unpack "$pkg_tarball"
    568     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    569     #
    570     BOOT_wrt_RunAsRoot "${this_script}" "${file}"
    571     #
    572     BOOT_wrt_RemoveBuildDirs "${name}"
    573     #
    574     # Include a touch of the target name so make can check if it's already been made.
    575     wrt_touch
    576     #
    577     #--------------------------------------------------------------------#
    578     #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
    579     #--------------------------------------------------------------------#
    580     #
    581     # Keep the script file name for Makefile dependencies.
    582     PREV=$this_script
    583 
    584   done
    585 
    586 }
    587 
    588 
    589 #--------------------------------------#
    590 chroot_final_system_Makefiles() {      #
     433
     434#--------------------------------------#
     435final_system_Makefiles() {             #
    591436#--------------------------------------#
    592437  # Set envars and scripts for iteration targets
    593   LOGS="" # Start with an empty global LOGS envar
    594438  if [[ -z "$1" ]] ; then
    595439    local N=""
     440    # In boot method the makesys phase was initiated in testsuite_tools_makefile
     441    [[ "${METHOD}" = "boot" ]] && [[ "$TEST" = 0 ]] && PREV=""
    596442  else
    597443    local N=-build_$1
     
    604450          -e 's/mv -v/&f/g' \
    605451          -e 's/mkdir -v/&p/g' -i ${script}
     452      # Rename the scripts
     453      mv ${script} ${script}$N
    606454    done
    607     # Remove Bzip2 binaries before make install
    608     sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i final-system$N/*-bzip2
     455    # Remove Bzip2 binaries before make install (CLFS-1.0 compatibility)
     456    sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i final-system$N/*-bzip2$N
    609457    # Delete *old Readline libraries just after make install
    610     sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline
     458    sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline$N
    611459  fi
    612460
    613   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N ( CHROOT ) ${R_arrow}"
     461  if [[ "${METHOD}" = "chroot" ]]; then
     462    echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N ( CHROOT ) ${R_arrow}"
     463  else
     464    echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N  ( ROOT ) ${R_arrow}"
     465  fi
    614466
    615467  for file in final-system$N/* ; do
     
    630482                                  -e 's@-64@@' \
    631483                                  -e 's@64@@' \
    632                                   -e 's@n32@@'`
     484                                  -e 's@n32@@' \
     485                                  -e 's,'$N',,'`
    633486
    634487    # Find the version of the command files, if it corresponds with the building of
     
    646499    # Append each name of the script files to a list (this will become
    647500    # the names of the targets in the Makefile
    648     basicsystem="$basicsystem ${this_script}${N}"
    649 
    650     # Append each name of the script files to a list (this will become
    651     # the names of the logs to be moved for each iteration)
    652     LOGS="$LOGS ${this_script}"
     501    basicsystem="$basicsystem ${this_script}"
    653502
    654503    #--------------------------------------------------------------------#
     
    658507    # Drop in the name of the target on a new line, and the previous target
    659508    # as a dependency. Also call the echo_message function.
    660     CHROOT_wrt_target "${this_script}${N}" "$PREV"
     509    CHROOT_wrt_target "${this_script}" "$PREV"
    661510
    662511    # If $pkg_tarball isn't empty, we've got a package...
    663512    if [ "$pkg_tarball" != "" ] ; then
     513      # Touch timestamp file if installed files logs will be created.
     514      # But only for the firt build when running iterative builds.
     515      if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
     516        CHROOT_wrt_TouchTimestamp
     517      fi
    664518      CHROOT_Unpack "$pkg_tarball"
    665519      # If the testsuites must be run, initialize the log file
     
    678532    CHROOT_wrt_RunAsRoot  "${file}"
    679533    #
    680     [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    681     #
    682     # Include a touch of the target name so make can check if it's already been made.
     534    # Write installed files log and remove the build directory(ies)
     535    # except if the package build fails.
     536    if [ "$pkg_tarball" != "" ] ; then
     537      CHROOT_wrt_RemoveBuildDirs "$name"
     538      if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
     539        CHROOT_wrt_LogNewFiles "$name"
     540      fi
     541    fi
     542    #
     543    # Include a touch of the target name so make can check
     544    # if it's already been made.
    683545    wrt_touch
    684546    #
     
    688550    #
    689551    # Keep the script file name for Makefile dependencies.
    690     PREV=${this_script}${N}
     552    PREV=${this_script}
    691553    # Set system_build envar for iteration targets
    692554    system_build=$basicsystem
     
    695557
    696558#--------------------------------------#
    697 boot_final_system_Makefiles() {        #
    698 #--------------------------------------#
    699   # Set envars and scripts for iteration targets
    700   LOGS="" # Start with an empty global LOGS envar
    701   if [[ -z "$1" ]] ; then
    702     local N=""
    703     # The makesys phase was initiated in bm_testsuite_tools_makefile
    704     [[ "$TEST" = 0 ]] && PREV=""
     559bootscripts_Makefiles() {              #
     560#--------------------------------------#
     561
     562  if [[ "${METHOD}" = "chroot" ]]; then
     563    echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts   ( CHROOT ) ${R_arrow}"
    705564  else
    706     local N=-build_$1
    707     local basicsystem=""
    708     mkdir final-system$N
    709     cp final-system/* final-system$N
    710     for script in final-system$N/* ; do
    711       # Overwrite existing symlinks, files, and dirs
    712       sed -e 's/ln -sv/&f/g' \
    713           -e 's/mv -v/&f/g' \
    714           -e 's/mkdir -v/&p/g' -i ${script}
    715     done
    716     # Remove Bzip2 binaries before make install
    717     sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i final-system$N/*-bzip2
    718     # Delete *old Readline libraries just after make install
    719     sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline
     565    echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts     ( ROOT ) ${R_arrow}"
    720566  fi
    721 
    722   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N  ( ROOT ) ${R_arrow}"
    723 
    724   for file in final-system$N/* ; do
    725     # Keep the script file name
    726     this_script=`basename $file`
    727 
    728     # Test if the stripping phase must be skipped
    729     # Skip alsp temp-perl for iterative runs
    730     case $this_script in
    731       *stripping*) [[ "$STRIP" = "n" ]] && continue ;;
    732       *temp-perl*) [[ -n "$N" ]] && continue ;;
    733     esac
    734 
    735     # Grab the name of the target, strip id number, XXX-script
    736     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
    737                                   -e 's@temp-@@' \
    738                                   -e 's@-64bit@@' \
    739                                   -e 's@-64@@' \
    740                                   -e 's@64@@' \
    741                                   -e 's@n32@@'`
    742 
    743     # Find the version of the command files, if it corresponds with the building of
    744     # a specific package. We need this here to can skip scripts not needed for
    745     # iterations rebuilds
    746 
    747     pkg_tarball=$(get_package_tarball_name $name)
    748 
    749     if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
    750       case "${this_script}" in
    751         *stripping*) ;;
    752         *)  continue ;;
    753       esac
    754     fi
    755 
    756     # Append each name of the script files to a list (this will become
    757     # the names of the targets in the Makefile
    758     basicsystem="$basicsystem ${this_script}${N}"
    759 
    760     # Append each name of the script files to a list (this will become
    761     # the names of the logs to be moved for each iteration)
    762     LOGS="$LOGS ${this_script}"
    763 
    764     #--------------------------------------------------------------------#
    765     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
    766     #--------------------------------------------------------------------#
    767     #
    768     # Drop in the name of the target on a new line, and the previous target
    769     # as a dependency. Also call the echo_message function.
    770     BOOT_wrt_target "${this_script}${N}" "$PREV"
    771 
    772     # If $pkg_tarball isn't empty, we've got a package...
    773     if [ "$pkg_tarball" != "" ] ; then
    774       FILE="$pkg_tarball"
    775       BOOT_wrt_Unpack "$FILE"
    776       # If the testsuites must be run, initialize the log file
    777       case $name in
    778         binutils | gcc | glibc )
    779           [[ "$TEST" != "0" ]] && BOOT_wrt_test_log "${this_script}"
    780           ;;
    781         * )
    782           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && BOOT_wrt_test_log "${this_script}"
    783           ;;
    784       esac
    785       # If using optimizations, write the instructions
    786       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    787     fi
    788     #
    789     BOOT_wrt_RunAsRoot "${this_script}" "${file}"
    790     #
    791     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    792     #
    793     # Include a touch of the target name so make can check if it's already been made.
    794     wrt_touch
    795     #
    796     #--------------------------------------------------------------------#
    797     #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
    798     #--------------------------------------------------------------------#
    799     #
    800     # Keep the script file name for Makefile dependencies.
    801     PREV=${this_script}${N}
    802     # Set system_build envar for iteration targets
    803     system_build=$basicsystem
    804   done  # for file in final-system/* ...
    805 
    806 }
    807 
    808 #--------------------------------------#
    809 chroot_bootscripts_Makefiles() {       #
    810 #--------------------------------------#
    811   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts   ( CHROOT ) ${R_arrow}"
    812567
    813568  for file in bootscripts/* ; do
     
    848603    # If $pkg_tarball isn't empty, we've got a package...
    849604    #
    850     [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     605    if [ "$pkg_tarball" != "" ] ; then
     606      if [ "${INSTALL_LOG}" = "y" ] ; then
     607        CHROOT_wrt_LogNewFiles "$name"
     608      fi
     609      CHROOT_Unpack "$pkg_tarball"
     610    fi
    851611    #
    852612    CHROOT_wrt_RunAsRoot "${file}"
    853613    #
    854     [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     614    # Write installed files log and remove the build directory(ies)
     615    # except if the package build fails.
     616    if [ "$pkg_tarball" != "" ] ; then
     617      CHROOT_wrt_RemoveBuildDirs "$name"
     618      if [ "${INSTALL_LOG}" = "y" ] ; then
     619        CHROOT_wrt_LogNewFiles "$name"
     620      fi
     621    fi
    855622    #
    856623    # Include a touch of the target name so make can check if it's already been made.
     
    868635
    869636#--------------------------------------#
    870 boot_bootscripts_Makefiles() {         #
    871 #--------------------------------------#
    872   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts     ( ROOT ) ${R_arrow}"
    873 
    874   for file in bootscripts/* ; do
    875     # Keep the script file name
    876     this_script=`basename $file`
    877 
    878     case $this_script in
    879       *udev) continue    ;;  # This is not a script but a commentary
    880       *console*) continue ;; # Use the files that came with the bootscripts
    881       *)  ;;
    882     esac
    883 
    884     # First append each name of the script files to a list (this will become
    885     # the names of the targets in the Makefile
    886     bootscripttools="$bootscripttools $this_script"
    887 
    888     # Grab the name of the target, strip id number, XXX-script
    889     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
    890                                   -e 's@-64bit@@' \
    891                                   -e 's@-64@@' \
    892                                   -e 's@64@@' \
    893                                   -e 's@n32@@'`
    894     case $name in
    895       *bootscripts*) name=bootscripts-cross-lfs ;;
    896       *udev-rules)   name=udev-cross-lfs ;;
    897     esac
    898 
    899     pkg_tarball=$(get_package_tarball_name $name)
    900 
    901     #--------------------------------------------------------------------#
    902     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
    903     #--------------------------------------------------------------------#
    904     #
    905     # Drop in the name of the target on a new line, and the previous target
    906     # as a dependency. Also call the echo_message function.
    907     BOOT_wrt_target "${this_script}" "$PREV"
    908     #
    909     # If $pkg_tarball isn't empty, we've got a package...
    910     #
    911     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
    912     #
    913     BOOT_wrt_RunAsRoot "${this_script}" "${file}"
    914     #
    915     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    916     #
    917     # Include a touch of the target name so make can check if it's already been made.
    918     wrt_touch
    919     #
    920     #--------------------------------------------------------------------#
    921     #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
    922     #--------------------------------------------------------------------#
    923     #
    924     # Keep the script file name for Makefile dependencies.
    925     PREV=$this_script
    926 
    927   done  # for file in bootscripts/* ...
    928 }
    929 
    930 #--------------------------------------#
    931 chroot_bootable_Makefiles() {          #
    932 #--------------------------------------#
    933   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable ( CHROOT ) ${R_arrow}"
    934 
    935   for file in {bootable,the-end}/* ; do
     637bootable_Makefiles() {                 #
     638#--------------------------------------#
     639
     640  if [[ "${METHOD}" = "chroot" ]]; then
     641    echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable ( CHROOT ) ${R_arrow}"
     642  else
     643    echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable   ( ROOT ) ${R_arrow}"
     644  fi
     645
     646
     647  for file in bootable/* ; do
    936648    # Keep the script file name
    937649    this_script=`basename $file`
     
    972684    # Insert instructions for unpacking the package and changing directories
    973685    #
    974     [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     686    if [ "$pkg_tarball" != "" ] ; then
     687      if [ "${INSTALL_LOG}" = "y" ] ; then
     688        CHROOT_wrt_LogNewFiles "$name"
     689      fi
     690      CHROOT_Unpack "$pkg_tarball"
     691    fi
    975692    #
    976693    # Select a script execution method
     
    986703    esac
    987704    #
    988     # Housekeeping...remove any build directory(ies) except if the package build fails.
    989     [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     705    # Write installed files log and remove the build directory(ies)
     706    # except if the package build fails.
     707    if [ "$pkg_tarball" != "" ] ; then
     708      CHROOT_wrt_RemoveBuildDirs "$name"
     709      if [ "${INSTALL_LOG}" = "y" ] ; then
     710        CHROOT_wrt_LogNewFiles "$name"
     711      fi
     712    fi
    990713    #
    991714    # Include a touch of the target name so make can check if it's already been made.
     
    999722    PREV=$this_script
    1000723
    1001   done
    1002 
    1003 }
    1004 
    1005 #--------------------------------------#
    1006 boot_bootable_Makefiles() {            #
    1007 #--------------------------------------#
    1008   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable   ( ROOT ) ${R_arrow}"
    1009 
    1010   for file in {bootable,the-end}/* ; do
    1011     # Keep the script file name
    1012     this_script=`basename $file`
    1013 
    1014     # A little housekeeping on the scripts
    1015     case $this_script in
    1016       *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue  ;;
    1017       *kernel) # if there is no kernel config file do not build the kernel
    1018                [[ -z $CONFIG ]] && continue
    1019                  # Copy the named config file to /sources with a standardized name
    1020                cp $CONFIG $BUILDDIR/sources/kernel-config
    1021          ;;
    1022     esac
    1023     #
    1024     # First append each name of the script files to a list (this will become
    1025     # the names of the targets in the Makefile
    1026     bootabletools="$bootabletools $this_script"
    1027     #
    1028     # Grab the name of the target, strip id number and misc words.
    1029     case $this_script in
    1030       *kernel) name=linux  ;;
    1031       *)       name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' ` ;;
    1032     esac
    1033 
    1034     pkg_tarball=$(get_package_tarball_name $name)
    1035 
    1036     #--------------------------------------------------------------------#
    1037     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
    1038     #--------------------------------------------------------------------#
    1039     #
    1040     # Drop in the name of the target on a new line, and the previous target
    1041     # as a dependency. Also call the echo_message function.
    1042     BOOT_wrt_target "${this_script}" "$PREV"
    1043     #
    1044     # If $pkg_tarball isn't empty, we've got a package...
    1045     # Insert instructions for unpacking the package and changing directories
    1046     #
    1047     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
    1048     #
    1049     # Select a script execution method
    1050     case $this_script in
    1051       *fstab*)  if [[ -n "$FSTAB" ]]; then
    1052                   # Minimal boot mode has no access to original file, store in /sources
    1053                   cp $FSTAB $BUILDDIR/sources/fstab
    1054                   BOOT_wrt_CopyFstab "${this_script}"
    1055                 else
    1056                   BOOT_wrt_RunAsRoot  "${this_script}" "${file}"
    1057                 fi
    1058           ;;
    1059       *)  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"   ;;
    1060     esac
    1061     #
    1062     # Housekeeping...remove any build directory(ies) except if the package build fails.
    1063     [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    1064     #
    1065     # Include a touch of the target name so make can check if it's already been made.
    1066     wrt_touch
    1067     #
    1068     #--------------------------------------------------------------------#
    1069     #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
    1070     #--------------------------------------------------------------------#
    1071     #
    1072     # Keep the script file name for Makefile dependencies.
    1073     PREV=$this_script
    1074724  done
    1075725
     
    1085735set +e
    1086736  declare -f  method_cmds
    1087   declare -f  testsuite_cmds
    1088   declare -f  final_sys_cmds
    1089   declare -f  bootscripts_cmds
    1090   declare -f  bootable_cmds
    1091737set -e
    1092738
     
    1098744  >$MKFILE.tmp
    1099745
    1100        method_cmds=${METHOD}_Makefiles
    1101     testsuite_cmds=${METHOD}_testsuite_tools_Makefiles
    1102     final_sys_cmds=${METHOD}_final_system_Makefiles
    1103   bootscripts_cmds=${METHOD}_bootscripts_Makefiles
    1104      bootable_cmds=${METHOD}_bootable_Makefiles
     746  method_cmds=${METHOD}_Makefiles
    1105747
    1106748  host_prep_Makefiles        # mk_SETUP      (SETUP)  $host_prep
     
    1109751  $method_cmds               # mk_SYSTOOLS   (CHROOT) $chroottools/$boottools
    1110752  if [[ ! $TEST = "0" ]]; then
    1111     $testsuite_cmds          # mk_SYSTOOLS   (CHROOT) $testsuitetools
     753    testsuite_tools_Makefiles    # mk_SYSTOOLS   (CHROOT) $testsuitetools
    1112754  fi
    1113   $final_sys_cmds            # mk_FINAL      (CHROOT) $basicsystem
     755  final_system_Makefiles         # mk_FINAL      (CHROOT) $basicsystem
    1114756    # Add the iterations targets, if needed
    1115757  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
    1116   $bootscripts_cmds          # mk_BOOTSCRIPT (CHROOT) $bootscripttools
    1117   $bootable_cmds             # mk_BOOTABLE   (CHROOT) $bootabletools
    1118 
     758  bootscripts_Makefiles          # mk_BOOTSCRIPT (CHROOT) $bootscripttools
     759  bootable_Makefiles             # mk_BOOTABLE   (CHROOT) $bootabletools
     760
     761  # Add the CUSTOM_TOOLS targets, if needed
     762  [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
    1119763  # Add the BLFS_TOOL targets, if needed
    1120764  [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
     
    1122766  # Add a header, some variables and include the function file
    1123767  # to the top of the real Makefile.
    1124 (
    1125     cat << EOF
    1126 $HEADER
    1127 
    1128 SRC            = /sources
    1129 MOUNT_PT       = $BUILDDIR
    1130 PKG_LST        = $PKG_LST
    1131 LUSER          = $LUSER
    1132 LGROUP         = $LGROUP
    1133 SCRIPT_ROOT    = $SCRIPT_ROOT
    1134 ADD_BLFS_TOOLS = $BLFS_TOOL
    1135 
    1136 BASEDIR      = \$(MOUNT_PT)
    1137 SRCSDIR      = \$(BASEDIR)/sources
    1138 CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
    1139 LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
    1140 TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
    1141 
    1142 crSRCSDIR    = /sources
    1143 crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
    1144 crLOGDIR     = /\$(SCRIPT_ROOT)/logs
    1145 crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
    1146 
    1147 SU_LUSER     = su - \$(LUSER) -c
    1148 LUSER_HOME   = /home/\$(LUSER)
    1149 PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
    1150 PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
    1151 
    1152 export PATH := \${PATH}:/usr/sbin
    1153 
    1154 include makefile-functions
    1155 
    1156 EOF
    1157 ) > $MKFILE
     768  wrt_Makefile_header
    1158769
    1159770  # Add chroot commands
     
    1162773    chroot=`cat chroot/*chroot* | \
    1163774            sed  -e "s@chroot@$CHROOT_LOC@" \
    1164                  -e '/#!\/tools\/bin\/bash/d' \
     775                 -e '/#!\/bin\/bash/d' \
    1165776                 -e '/^export/d' \
    1166777                 -e '/^logout/d' \
     
    1171782                -e 's|exit||g' \
    1172783                -e 's|$| -c|' \
    1173                 -e 's|"$$CLFS"|$(MOUNT_PT)|'\
    1174                 -e 's|set -e||'`
     784                -e 's|"$${CLFS}"|$(MOUNT_PT)|'\
     785                -e 's|set -e||' \
     786                -e 's|set +h||'`
    1175787    echo -e "CHROOT1= $chroot\n" >> $MKFILE
    1176788  fi
     
    1182794cat << EOF
    1183795
    1184 all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_BLFS_TOOL
     796all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
    1185797        @sudo make do-housekeeping
     798        @echo "$VERSION - jhalfs build" > clfs-release && \\
     799        sudo mv clfs-release \$(MOUNT_PT)/etc
    1186800        @\$(call echo_finished,$VERSION)
    1187801
     
    1197811mk_SETUP:
    1198812        @\$(call echo_SU_request)
    1199         @sudo make SETUP
     813        @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
    1200814        @touch \$@
    1201815
     
    1203817mk_CROSS: mk_SETUP
    1204818        @\$(call echo_PHASE,Cross and Temporary Tools)
    1205         @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" )
     819        @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
    1206820        @sudo make restore-luser-env
    1207821        @touch \$@
    1208822
    1209823mk_SUDO: mk_CROSS
    1210         @sudo make SUDO
    1211         @touch \$@
    1212 #
    1213 # The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
    1214 # chroot environment. (Unless someone knows a different way)
    1215 # Manually create the /bin directory and provide link to the /tools dir.
    1216 # Also change the original symlink creation to include (f)orce to prevent failure due to
    1217 #  pre-existing links.
     824        @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
     825        @touch \$@
    1218826
    1219827#---------------CHROOT JAIL
    1220828mk_SYSTOOLS: mk_SUDO
    1221         @if [ ! -e \$(MOUNT_PT)/bin ]; then \\
    1222           mkdir \$(MOUNT_PT)/bin; \\
    1223           cd \$(MOUNT_PT)/bin && \\
    1224           ln -svf /tools/bin/bash bash; ln -sf bash sh; \\
    1225           sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
    1226         fi;
    1227         @sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chroot/082-createfiles
    1228829        @\$(call echo_CHROOT_request)
    1229830        @\$(call echo_PHASE, CHROOT JAIL )
    1230         @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL")
    1231         @touch \$@
    1232 
    1233 mk_BLFS_TOOL: mk_SYSTOOLS
    1234         @\$(call echo_PHASE,Building BLFS-TOOLS); \\
     831        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) PREP_CHROOT_JAIL")
     832        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT_JAIL")
     833        @touch \$@
     834
     835mk_CUSTOM_TOOLS: create-sbu_du-report
     836        @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
     837          \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
     838          sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
     839          (sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
     840        fi;
     841        @touch \$@
     842
     843mk_BLFS_TOOL: mk_CUSTOM_TOOLS
    1235844        @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
     845          \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
    1236846          sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
    1237           sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\
    1238         fi
    1239         @touch \$@
    1240 
    1241 SETUP:       $host_prep
    1242 AS_LUSER:    $cross_tools $temptools
    1243 SUDO:        $orphan_scripts
    1244 CHROOT_JAIL: ${chroottools}${boottools} $testsuitetools $basicsystem  $bootscripttools  $bootabletools
    1245 BLFS_TOOL:   $blfs_tool
     847          sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"; \\
     848        fi;
     849        @touch \$@
     850
     851SETUP:            $host_prep
     852AS_LUSER:         $cross_tools $temptools
     853SUDO:             $orphan_scripts
     854PREP_CHROOT_JAIL:  SHELL=/tools/bin/bash
     855PREP_CHROOT_JAIL: ${chroottools}
     856CHROOT_JAIL:       SHELL=/tools/bin/bash
     857CHROOT_JAIL:      $testsuitetools $basicsystem  $bootscripttools  $bootabletools
     858CUSTOM_TOOLS:     $custom_list
     859BLFS_TOOL:        $blfs_tool
     860
     861
     862create-sbu_du-report:  mk_SYSTOOLS
     863        @\$(call echo_message, Building)
     864        @if [ "\$(ADD_REPORT)" = "y" ]; then \\
     865          ./create-sbu_du-report.sh logs $VERSION; \\
     866          \$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
     867        fi;
     868        @touch  \$@
    1246869
    1247870do-housekeeping:
     
    1254877        @-if [ ! -f luser-exist ]; then \\
    1255878                userdel \$(LUSER); \\
    1256                 rm -rf /home/\$(LUSER); \\
     879                rm -rf \$(LUSER_HOME); \\
    1257880        fi;
    1258881
    1259882EOF
    1260883) >> $MKFILE
    1261 
    1262   # Add SBU-disk_usage report target
    1263   echo "create-sbu_du-report:" >> $MKFILE
    1264   if [[ "$REPORT" = "y" ]] ; then
    1265 (
    1266     cat << EOF
    1267         @\$(call echo_message, Building)
    1268         @./create-sbu_du-report.sh logs $VERSION
    1269         @\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
    1270         @touch  \$@
    1271 
    1272 EOF
    1273 ) >> $MKFILE
    1274   else echo -e "\t@true\n" >> $MKFILE; fi
    1275 
    1276884
    1277885fi
     
    1288896        @\$(call echo_boot_finished,$VERSION)
    1289897
    1290 makesys: mk_FINAL mk_BLFS_TOOL
     898makesys: mk_FINAL mk_CUSTOM_TOOLS mk_BLFS_TOOL
     899        @echo "$VERSION - jhalfs build" > /etc/clfs-release
    1291900        @\$(call echo_finished,$VERSION)
    1292901
     
    1308917mk_SETUP:
    1309918        @\$(call echo_SU_request)
    1310         @sudo make SETUP
     919        @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
    1311920        @touch \$@
    1312921
     
    1315924mk_CROSS: mk_SETUP
    1316925        @\$(call echo_PHASE,Cross Tool)
    1317         @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" )
     926        @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
    1318927        @touch \$@
    1319928
    1320929mk_SUDO: mk_CROSS
    1321         @sudo make SUDO
     930        @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
    1322931        @touch \$@
    1323932
     
    1326935mk_FINAL:
    1327936        @\$(call echo_PHASE,Final System)
    1328         @( make AS_ROOT )
    1329         @touch \$@
    1330 
    1331 mk_BLFS_TOOL: mk_FINAL
    1332         @\$(call echo_PHASE,Building BLFS-TOOLS)
     937        @( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) AS_ROOT )
     938        @touch \$@
     939
     940mk_CUSTOM_TOOLS: mk_FINAL
     941        @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
     942          \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
     943          mkdir -p ${TRACKING_DIR}; \\
     944          ( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS ); \\
     945        fi;
     946        @touch \$@
     947
     948mk_BLFS_TOOL: mk_CUSTOM_TOOLS
    1333949        @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
     950          \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
    1334951          mkdir -p $TRACKING_DIR; \\
    1335           make BLFS_TOOL; \\
     952          ( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL ); \\
    1336953        fi
    1337954        @touch \$@
    1338955
    1339 SETUP:      $host_prep
    1340 AS_LUSER:   $cross_tools $temptools ${chroottools}${boottools}
    1341 SUDO:       $orphan_scripts
    1342 AS_ROOT:    $testsuitetools $basicsystem $bootscripttools $bootabletools
    1343 BLFS_TOOL:  $blfs_tool
     956SETUP:        $host_prep
     957AS_LUSER:     $cross_tools $temptools ${boottools}
     958SUDO:         $orphan_scripts
     959AS_ROOT:      SHELL=/tools/bin/bash
     960AS_ROOT:      $testsuitetools $basicsystem $bootscripttools $bootabletools
     961CUSTOM_TOOLS: $custom_list
     962BLFS_TOOL:    $blfs_tool
    1344963
    1345964do-housekeeping:
     
    1347966        @-if [ ! -f luser-exist ]; then \\
    1348967                userdel \$(LUSER); \\
    1349                 rm -rf /home/\$(LUSER); \\
     968                rm -rf \$(LUSER_HOME); \\
    1350969        fi;
    1351970
     
    1359978restore-luser-env:
    1360979        @\$(call echo_message, Building)
    1361         @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
    1362                 mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
     980        @if [ -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
     981                mv -f \$(LUSER_HOME)/.bashrc.XXX \$(LUSER_HOME)/.bashrc; \\
    1363982        fi;
    1364         @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
    1365                 mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
     983        @if [ -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
     984                mv \$(LUSER_HOME)/.bash_profile.XXX \$(LUSER_HOME)/.bash_profile; \\
    1366985        fi;
    1367         @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
     986        @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bash* && \\
    1368987        touch \$@ && \\
    1369988        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
Note: See TracChangeset for help on using the changeset viewer.