Changeset 045b2dc for CLFS/master.sh


Ignore:
Timestamp:
10/02/2006 07:32:06 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
f5fc83d
Parents:
6f75d64
Message:

Merged r3043:3145 from experimental:
New Makefile code and other improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    r6f75d64 r045b2dc  
    11#!/bin/sh
    22# $Id$
     3
     4
     5orphan_scripts="" # 2 scripts do not fit BOOT_Makefiles LUSER environment
    36
    47###################################
     
    69###################################
    710
    8 
    9 #----------------------------#
    10 host_prep_Makefiles() {      # Initialization of the system
    11 #----------------------------#
     11#--------------------------------------#
     12BOOT_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(
     21cat << 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
     27EOF
     28) >> $MKFILE.tmp
     29}
     30
     31#--------------------------------------#
     32BOOT_wrt_Unpack() {                    # "$pkg_tarball"
     33#--------------------------------------#
     34  local FILE=$1
     35  local optSAVE_PREVIOUS=$2
     36
     37  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
     38(
     39cat << EOF
     40        @\$(call remove_existing_dirs2,$FILE)
     41EOF
     42) >> $MKFILE.tmp
     43  fi
     44(
     45cat  << EOF
     46        @\$(call unpack3,$FILE)
     47        @\$(call get_pkg_root2)
     48EOF
     49) >> $MKFILE.tmp
     50}
     51
     52#----------------------------------#
     53BOOT_wrt_RunAsRoot() {             # "${this_script}" "${file}"
     54#----------------------------------#
     55  local this_script=$1
     56  local file=$2
     57(
     58cat << 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/\$@
     61EOF
     62) >> $MKFILE.tmp
     63}
     64
     65#--------------------------------------#
     66BOOT_wrt_RemoveBuildDirs() {           # "${name}"
     67#--------------------------------------#
     68  local name=$1
     69(
     70cat << EOF
     71        @\$(call remove_build_dirs2,$name)
     72EOF
     73) >> $MKFILE.tmp
     74}
     75
     76#----------------------------------#
     77BOOT_wrt_test_log() {              #
     78#----------------------------------#
     79  local TESTLOGFILE=$1
     80(
     81cat  << EOF
     82        @echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\
     83        echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
     84EOF
     85) >> $MKFILE.tmp
     86}
     87
     88#----------------------------------#
     89BOOT_wrt_CopyFstab() {             #
     90#----------------------------------#
     91(
     92cat << EOF
     93        @( time { cp -v /sources/fstab /etc/fstab >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
     94EOF
     95) >> $MKFILE.tmp
     96}
     97
     98
     99########################################
     100
     101
     102#--------------------------------------#
     103host_prep_Makefiles() {                #
     104#--------------------------------------#
    12105  local   CLFS_HOST
    13106
    14   echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
     107  echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files  ( SETUP ) ${R_arrow}"
    15108
    16109  # defined here, only for ease of reading
     
    79172        @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
    80173        touch envars && \\
     174        chmod -R a+wt \$(MOUNT_PT) && \\
     175        chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
    81176        touch \$@ && \\
    82177        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    84179EOF
    85180) >> $MKFILE.tmp
    86 
    87 }
    88 
    89 
    90 
    91 #-----------------------------#
    92 cross_tools_Makefiles() {     #
    93 #-----------------------------#
    94   echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
     181  host_prep=" 023-creatingtoolsdir 024-creatingcrossdir 026-settingenvironment"
     182
     183}
     184
     185#--------------------------------------#
     186cross_tools_Makefiles() {              #
     187#--------------------------------------#
     188  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools  ( LUSER ) ${R_arrow}"
    95189
    96190  for file in cross-tools/* ; do
     
    127221    # Drop in the name of the target on a new line, and the previous target
    128222    # as a dependency. Also call the echo_message function.
    129     wrt_target "${this_script}" "$PREV"
     223    LUSER_wrt_target "${this_script}" "$PREV"
    130224    #
    131225    # If $pkg_tarball isn't empty, we've got a package...
    132226    #
    133     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
    134     #
    135     wrt_RunAsUser "${this_script}" "${file}"
    136     #
    137     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     227    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     228    #
     229    LUSER_wrt_RunAsUser "${file}"
     230    #
     231    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    138232    #
    139233    # Include a touch of the target name so make can check if it's already been made.
     
    150244}
    151245
    152 
    153 #-----------------------------#
    154 temptools_Makefiles() {       #
    155 #-----------------------------#
    156   echo "${tab_}${GREEN}Processing... ${L_arrow}temp system${R_arrow}"
     246#--------------------------------------#
     247temptools_Makefiles() {                #
     248#--------------------------------------#
     249  echo "${tab_}${GREEN}Processing... ${L_arrow}temp system  ( LUSER ) ${R_arrow}"
    157250
    158251  for file in temp-system/* ; do
     
    185278    # Drop in the name of the target on a new line, and the previous target
    186279    # as a dependency. Also call the echo_message function.
    187     wrt_target "${this_script}" "$PREV"
     280    LUSER_wrt_target "${this_script}" "$PREV"
    188281    #
    189282    # If $pkg_tarball isn't empty, we've got a package...
    190283    # Insert instructions for unpacking the package and to set the PKGDIR variable.
    191284    #
    192     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     285    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
    193286    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    194287    #
    195     wrt_RunAsUser "${this_script}" "${file}"
    196     #
    197     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     288    LUSER_wrt_RunAsUser "${file}"
     289    #
     290    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    198291    #
    199292    # Include a touch of the target name so make can check if it's already been made.
     
    210303
    211304
    212 #-----------------------------#
    213 boot_Makefiles() {            #
    214 #-----------------------------#
    215   echo "${tab_}${GREEN}Processing... ${L_arrow}boot${R_arrow}"
    216 
     305#--------------------------------------#
     306chroot_Makefiles() {                   #
     307#--------------------------------------#
     308  echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools CHROOT        ( CHROOT ) ${R_arrow}"
     309
     310  for file in chroot/* ; do
     311    # Keep the script file name
     312    this_script=`basename $file`
     313    #
     314    # Skipping scripts is done now and not included in the build tree.
     315    case $this_script in
     316      *chroot*) continue ;;
     317    esac
     318
     319    #
     320    # First append each name of the script files to a list (this will become
     321    # the names of the targets in the Makefile
     322    case "${this_script}" in
     323      *util-linux) orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     324      *kernfs)     orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     325      *)           chroottools="$chroottools $this_script"            ;;
     326    esac
     327
     328    # Grab the name of the target, strip id number, XXX-script
     329    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
     330
     331    pkg_tarball=$(get_package_tarball_name $name)
     332
     333    # This is very ugly:: util-linux is in /chroot but must be run under LUSER
     334    # .. Customized makefile entry
     335    case "${this_script}" in
     336      *util-linux)
     337         LUSER_wrt_target "${this_script}" "$PREV"
     338         LUSER_wrt_unpack "$pkg_tarball"
     339         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     340         LUSER_wrt_RunAsUser "${file}"
     341         LUSER_RemoveBuildDirs "${name}"
     342         wrt_touch
     343         temptools="$temptools $this_script"
     344         continue ;;
     345     esac
     346
     347
     348    #--------------------------------------------------------------------#
     349    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     350    #--------------------------------------------------------------------#
     351    #
     352    # Drop in the name of the target on a new line, and the previous target
     353    # as a dependency. Also call the echo_message function.
     354    CHROOT_wrt_target "${this_script}" "$PREV"
     355    #
     356    # If $pkg_tarball isn't empty, we've got a package...
     357    # Insert instructions for unpacking the package and changing directories
     358    #
     359    if [ "$pkg_tarball" != "" ] ; then
     360      case $this_script in
     361        *util-linux)      ROOT_Unpack  "$pkg_tarball"  ;;
     362        *)              CHROOT_Unpack "$pkg_tarball"  ;;
     363      esac
     364      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     365    fi
     366    #
     367    # Select a script execution method
     368    case $this_script in
     369      *kernfs)      wrt_RunAsRoot         "${this_script}" "${file}"  ;;
     370      *util-linux)  ROOT_RunAsRoot        "${file}"  ;;
     371      *)            CHROOT_wrt_RunAsRoot  "${file}"  ;;
     372    esac
     373    #
     374    # Housekeeping...remove the build directory(ies), except if the package build fails.
     375    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     376    #
     377    # Include a touch of the target name so make can check if it's already been made.
     378    wrt_touch
     379    #
     380    #--------------------------------------------------------------------#
     381    #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
     382    #--------------------------------------------------------------------#
     383    #
     384    # Keep the script file name for Makefile dependencies.
     385    PREV=$this_script
     386
     387  done # for file in...
     388}
     389
     390
     391#--------------------------------------#
     392boot_Makefiles() {                     #
     393#--------------------------------------#
     394
     395  echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools BOOT  ( LUSER ) ${R_arrow}"
     396  #
     397  # Create a target bootable partition containing a compile environment. Later
     398  #  on we boot into this environment and contine the build.
     399  #
    217400  for file in boot/* ; do
    218401    # Keep the script file name
     
    223406      *grub | *aboot | *colo | *silo | *arcload | *lilo )     continue     ;;
    224407      *whatnext*) continue     ;;
    225       *kernel)    # if there is no kernel config file do not build the kernel
     408      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
     409      *kernel)  # if there is no kernel config file do not build the kernel
    226410                [[ -z $CONFIG ]] && continue
    227411                  # Copy the config file to /sources with a standardized name
     
    232416    # First append each name of the script files to a list (this will become
    233417    # the names of the targets in the Makefile
    234     boottools="$boottools $this_script"
     418    case "${this_script}" in
     419      *changingowner)  orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     420      *devices)        orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     421      *)               boottools="$boottools $this_script" ;;
     422    esac
    235423    #
    236424    # Grab the name of the target, strip id number and misc words.
     
    257445    # Drop in the name of the target on a new line, and the previous target
    258446    # as a dependency. Also call the echo_message function.
    259     wrt_target "${this_script}" "$PREV"
     447    LUSER_wrt_target "${this_script}" "$PREV"
    260448    #
    261449    # If $pkg_tarball isn't empty, we've got a package...
    262450    # Insert instructions for unpacking the package and changing directories
    263451    #
    264     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     452    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
    265453    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    266454    #
    267455    # Select a script execution method
    268456    case $this_script in
     457       # The following 2 scripts are defined in the /boot directory but need
     458       # to be run as a root user. Set them up here but run them in another phase
    269459      *changingowner*)  wrt_RunAsRoot "${this_script}" "${file}"    ;;
    270460      *devices*)        wrt_RunAsRoot "${this_script}" "${file}"    ;;
    271461      *fstab*)   if [[ -n "$FSTAB" ]]; then
    272                    wrt_copy_fstab "${this_script}"
     462                   LUSER_wrt_CopyFstab
    273463                 else
    274                    wrt_RunAsUser  "${this_script}" "${file}"
     464                   LUSER_wrt_RunAsUser "${file}"
    275465                 fi
    276466         ;;
    277       *)         wrt_RunAsUser  "${this_script}" "${file}"       ;;
     467      *)         LUSER_wrt_RunAsUser "${file}"       ;;
    278468    esac
    279469    #
    280470    # Housekeeping...remove any build directory(ies) except if the package build fails.
    281     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     471    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    282472    #
    283473    # Include a touch of the target name so make can check if it's already been made.
     
    295485
    296486
    297 #-----------------------------#
    298 chroot_Makefiles() {          #
    299 #-----------------------------#
    300   echo "${tab_}${GREEN}Processing... ${L_arrow}chroot${R_arrow}"
    301 
    302   for file in chroot/* ; do
    303     # Keep the script file name
    304     this_script=`basename $file`
    305     #
    306     # Skipping scripts is done now and not included in the build tree.
    307     case $this_script in
    308       *chroot*) continue ;;
    309     esac
    310 
    311     #
    312     # First append each name of the script files to a list (this will become
    313     # the names of the targets in the Makefile
    314     chroottools="$chroottools $this_script"
    315 
    316     # Grab the name of the target, strip id number, XXX-script
    317     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    318 
    319     pkg_tarball=$(get_package_tarball_name $name)
    320 
    321     #--------------------------------------------------------------------#
    322     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
    323     #--------------------------------------------------------------------#
    324     #
    325     # Drop in the name of the target on a new line, and the previous target
    326     # as a dependency. Also call the echo_message function.
    327     wrt_target "${this_script}" "$PREV"
    328     #
    329     # If $pkg_tarball isn't empty, we've got a package...
    330     # Insert instructions for unpacking the package and changing directories
    331     #
    332     if [ "$pkg_tarball" != "" ] ; then
    333       case $this_script in
    334         *util-linux)    wrt_unpack  "$pkg_tarball"  ;;
    335         *)              wrt_unpack2 "$pkg_tarball"  ;;
    336       esac
    337       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    338     fi
    339     #
    340     # Select a script execution method
    341     case $this_script in
    342       *kernfs)      wrt_RunAsRoot "${this_script}" "${file}"  ;;
    343       *util-linux)  wrt_RunAsUser "${this_script}" "${file}"  ;;
    344       *)            wrt_run_as_chroot1  "${this_script}" "${file}"  ;;
    345     esac
    346     #
    347     # Housekeeping...remove the build directory(ies), except if the package build fails.
    348     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    349     #
    350     # Include a touch of the target name so make can check if it's already been made.
    351     wrt_touch
    352     #
    353     #--------------------------------------------------------------------#
    354     #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
    355     #--------------------------------------------------------------------#
    356     #
    357     # Keep the script file name for Makefile dependencies.
    358     PREV=$this_script
    359 
    360   done # for file in...
    361 }
    362 
    363 
    364 #-----------------------------#
    365 testsuite_tools_Makefiles() { #
    366 #-----------------------------#
    367   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools${R_arrow}"
     487#--------------------------------------#
     488chroot_testsuite_tools_Makefiles() {   #
     489#--------------------------------------#
     490  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools  ( CHROOT ) ${R_arrow}"
    368491
    369492  for file in testsuite-tools/* ; do
     
    390513    # Drop in the name of the target on a new line, and the previous target
    391514    # as a dependency. Also call the echo_message function.
    392     wrt_target "${this_script}" "$PREV"
    393     #
    394     wrt_unpack2 "$pkg_tarball"
     515    CHROOT_wrt_target "${this_script}" "$PREV"
     516    #
     517    CHROOT_Unpack "$pkg_tarball"
    395518    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    396519    #
    397     wrt_run_as_chroot1 "${this_script}" "${file}"
    398     #
    399     wrt_remove_build_dirs "${name}"
     520    CHROOT_wrt_RunAsRoot "${file}"
     521    #
     522    CHROOT_wrt_RemoveBuildDirs "${name}"
    400523    #
    401524    # Include a touch of the target name so make can check if it's already been made.
     
    412535}
    413536
    414 
    415 #--------------------------------#
    416 bm_testsuite_tools_Makefiles() { #
    417 #--------------------------------#
    418   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools${R_arrow}"
    419 
     537#--------------------------------------#
     538boot_testsuite_tools_Makefiles() {     #
     539#--------------------------------------#
     540  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools ( ROOT ) ${R_arrow}"
    420541  for file in testsuite-tools/* ; do
    421542    # Keep the script file name
     
    442563    # Drop in the name of the target on a new line, and the previous target
    443564    # as a dependency. Also call the echo_message function.
    444     wrt_target_boot "${this_script}" "$PREV"
    445     #
    446     wrt_unpack3 "$pkg_tarball"
     565    BOOT_wrt_target "${this_script}" "$PREV"
     566    #
     567    BOOT_wrt_Unpack "$pkg_tarball"
    447568    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    448569    #
    449     wrt_run_as_root2 "${this_script}" "${file}"
    450     #
    451     wrt_remove_build_dirs2 "${name}"
     570    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     571    #
     572    BOOT_wrt_RemoveBuildDirs "${name}"
    452573    #
    453574    # Include a touch of the target name so make can check if it's already been made.
     
    462583
    463584  done
    464 }
    465 
    466 
    467 #-----------------------------#
    468 final_system_Makefiles() {    #
    469 #-----------------------------#
     585
     586}
     587
     588
     589#--------------------------------------#
     590chroot_final_system_Makefiles() {      #
     591#--------------------------------------#
    470592  # Set envars and scripts for iteration targets
    471593  LOGS="" # Start with an empty global LOGS envar
     
    489611  fi
    490612
    491   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N${R_arrow}"
     613  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N ( CHROOT ) ${R_arrow}"
    492614
    493615  for file in final-system$N/* ; do
     
    536658    # Drop in the name of the target on a new line, and the previous target
    537659    # as a dependency. Also call the echo_message function.
    538     wrt_target "${this_script}${N}" "$PREV"
     660    CHROOT_wrt_target "${this_script}${N}" "$PREV"
    539661
    540662    # If $pkg_tarball isn't empty, we've got a package...
    541663    if [ "$pkg_tarball" != "" ] ; then
    542       wrt_unpack2 "$pkg_tarball"
     664      CHROOT_Unpack "$pkg_tarball"
    543665      # If the testsuites must be run, initialize the log file
    544666      case $name in
    545667        binutils | gcc | glibc )
    546           [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     668          [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
    547669          ;;
    548670        * )
    549           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
     671          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
    550672          ;;
    551673      esac
     
    554676    fi
    555677    #
    556     wrt_run_as_chroot1 "${this_script}" "${file}"
    557     #
    558     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     678    CHROOT_wrt_RunAsRoot "${file}"
     679    #
     680    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    559681    #
    560682    # Include a touch of the target name so make can check if it's already been made.
     
    572694}
    573695
    574 
    575 #-----------------------------#
    576 bm_final_system_Makefiles() { #
    577 #-----------------------------#
     696#--------------------------------------#
     697boot_final_system_Makefiles() {        #
     698#--------------------------------------#
    578699  # Set envars and scripts for iteration targets
    579700  LOGS="" # Start with an empty global LOGS envar
     
    599720  fi
    600721
    601   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N${R_arrow}"
     722  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N  ( ROOT ) ${R_arrow}"
    602723
    603724  for file in final-system$N/* ; do
     
    647768    # Drop in the name of the target on a new line, and the previous target
    648769    # as a dependency. Also call the echo_message function.
    649     wrt_target_boot "${this_script}${N}" "$PREV"
     770    BOOT_wrt_target "${this_script}${N}" "$PREV"
    650771
    651772    # If $pkg_tarball isn't empty, we've got a package...
    652773    if [ "$pkg_tarball" != "" ] ; then
    653774      FILE="$pkg_tarball"
    654       wrt_unpack3 "$FILE"
     775      BOOT_wrt_Unpack "$FILE"
    655776      # If the testsuites must be run, initialize the log file
    656777      case $name in
    657778        binutils | gcc | glibc )
    658           [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     779          [[ "$TEST" != "0" ]] && BOOT_wrt_test_log "${this_script}"
    659780          ;;
    660781        * )
    661           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
     782          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && BOOT_wrt_test_log "${this_script}"
    662783          ;;
    663784      esac
     
    666787    fi
    667788    #
    668     wrt_run_as_root2 "${this_script}" "${file}"
    669     #
    670     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     789    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     790    #
     791    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    671792    #
    672793    # Include a touch of the target name so make can check if it's already been made.
     
    682803    system_build=$basicsystem
    683804  done  # for file in final-system/* ...
    684 }
    685 
    686 
    687 #-----------------------------#
    688 bootscripts_Makefiles() {     #
    689 #-----------------------------#
    690     echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts${R_arrow}"
     805
     806}
     807
     808#--------------------------------------#
     809chroot_bootscripts_Makefiles() {       #
     810#--------------------------------------#
     811  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts   ( CHROOT ) ${R_arrow}"
    691812
    692813  for file in bootscripts/* ; do
     
    723844    # Drop in the name of the target on a new line, and the previous target
    724845    # as a dependency. Also call the echo_message function.
    725     wrt_target "${this_script}" "$PREV"
     846    CHROOT_wrt_target "${this_script}" "$PREV"
    726847    #
    727848    # If $pkg_tarball isn't empty, we've got a package...
    728849    #
    729     [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
    730     #
    731     wrt_run_as_chroot1 "${this_script}" "${file}"
    732     #
    733     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     850    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     851    #
     852    CHROOT_wrt_RunAsRoot "${file}"
     853    #
     854    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    734855    #
    735856    # Include a touch of the target name so make can check if it's already been made.
     
    744865
    745866  done  # for file in bootscripts/* ...
    746 
    747 }
    748 
    749 #-----------------------------#
    750 bm_bootscripts_Makefiles() {  #
    751 #-----------------------------#
    752     echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts${R_arrow}"
     867}
     868
     869#--------------------------------------#
     870boot_bootscripts_Makefiles() {         #
     871#--------------------------------------#
     872  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts     ( ROOT ) ${R_arrow}"
    753873
    754874  for file in bootscripts/* ; do
     
    785905    # Drop in the name of the target on a new line, and the previous target
    786906    # as a dependency. Also call the echo_message function.
    787     wrt_target_boot "${this_script}" "$PREV"
     907    BOOT_wrt_target "${this_script}" "$PREV"
    788908    #
    789909    # If $pkg_tarball isn't empty, we've got a package...
    790910    #
    791     [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
    792     #
    793     wrt_run_as_root2 "${this_script}" "${file}"
    794     #
    795     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     911    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
     912    #
     913    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     914    #
     915    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    796916    #
    797917    # Include a touch of the target name so make can check if it's already been made.
     
    806926
    807927  done  # for file in bootscripts/* ...
    808 
    809 }
    810 
    811 
    812 
    813 #-----------------------------#
    814 bootable_Makefiles() {        #
    815 #-----------------------------#
    816   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable${R_arrow}"
     928}
     929
     930#--------------------------------------#
     931chroot_bootable_Makefiles() {          #
     932#--------------------------------------#
     933  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable ( CHROOT ) ${R_arrow}"
    817934
    818935  for file in {bootable,the-end}/* ; do
     
    823940    case $this_script in
    824941      *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue ;;
     942      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
    825943      *kernel) # if there is no kernel config file do not build the kernel
    826944               [[ -z $CONFIG ]] && continue
     
    849967    # Drop in the name of the target on a new line, and the previous target
    850968    # as a dependency. Also call the echo_message function.
    851     wrt_target "${this_script}" "$PREV"
     969    CHROOT_wrt_target "${this_script}" "$PREV"
    852970    #
    853971    # If $pkg_tarball isn't empty, we've got a package...
    854972    # Insert instructions for unpacking the package and changing directories
    855973    #
    856     [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
     974    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
    857975    #
    858976    # Select a script execution method
    859977    case $this_script in
    860       *fstab*)  if [[ -n "$FSTAB" ]]; then
    861                   wrt_copy_fstab "${this_script}"
    862                 else
    863                   wrt_run_as_chroot1  "${this_script}" "${file}"
    864                 fi
    865           ;;
    866       *)  wrt_run_as_chroot1  "${this_script}" "${file}"   ;;
     978      *fstab*)   if [[ -n "$FSTAB" ]]; then
     979                   CHROOT_wrt_CopyFstab
     980                 else
     981                   CHROOT_wrt_RunAsRoot  "${file}"
     982                 fi
     983        ;;
     984      *)  CHROOT_wrt_RunAsRoot  "${file}"
     985        ;;
    867986    esac
    868987    #
    869988    # Housekeeping...remove any build directory(ies) except if the package build fails.
    870     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     989    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    871990    #
    872991    # Include a touch of the target name so make can check if it's already been made.
     
    8821001  done
    8831002
    884   # Add SBU-disk_usage report target if required
    885   if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
    886 
    887 }
    888 
    889 
    890 
    891 #-----------------------------#
    892 bm_bootable_Makefiles() {     #
    893 #-----------------------------#
    894   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable${R_arrow}"
     1003}
     1004
     1005#--------------------------------------#
     1006boot_bootable_Makefiles() {            #
     1007#--------------------------------------#
     1008  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable   ( ROOT ) ${R_arrow}"
    8951009
    8961010  for file in {bootable,the-end}/* ; do
     
    9261040    # Drop in the name of the target on a new line, and the previous target
    9271041    # as a dependency. Also call the echo_message function.
    928     wrt_target_boot "${this_script}" "$PREV"
     1042    BOOT_wrt_target "${this_script}" "$PREV"
    9291043    #
    9301044    # If $pkg_tarball isn't empty, we've got a package...
    9311045    # Insert instructions for unpacking the package and changing directories
    9321046    #
    933     [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
     1047    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
    9341048    #
    9351049    # Select a script execution method
     
    9381052                  # Minimal boot mode has no access to original file, store in /sources
    9391053                  cp $FSTAB $BUILDDIR/sources/fstab
    940                   wrt_copy_fstab2 "${this_script}"
     1054                  BOOT_wrt_CopyFstab "${this_script}"
    9411055                else
    942                   wrt_run_as_root2  "${this_script}" "${file}"
     1056                  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"
    9431057                fi
    9441058          ;;
    945       *)  wrt_run_as_root2  "${this_script}" "${file}"   ;;
     1059      *)  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"   ;;
    9461060    esac
    9471061    #
    9481062    # Housekeeping...remove any build directory(ies) except if the package build fails.
    949     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     1063    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    9501064    #
    9511065    # Include a touch of the target name so make can check if it's already been made.
     
    9581072    # Keep the script file name for Makefile dependencies.
    9591073    PREV=$this_script
    960 
    9611074  done
    9621075
    963   # Add SBU-disk_usage report target if required
    964   if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
    965 
    966 }
    967 
    968 
    969 #-----------------------------#
    970 build_Makefile() {            # Construct a Makefile from the book scripts
    971 #-----------------------------#
    972   echo "Creating Makefile... ${BOLD}START${OFF}"
     1076}
     1077
     1078
     1079#--------------------------------------#
     1080build_Makefile() {                     # Construct a Makefile from the book scripts
     1081#--------------------------------------#
     1082  #
     1083  # Script crashes if error trapping is on
     1084  #
     1085set +e
     1086  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
     1091set -e
     1092
     1093  echo "...Creating Makefile... ${BOLD}START${OFF}"
    9731094
    9741095  cd $JHALFSDIR/${PROGNAME}-commands
    975   # Start with a clean Makefile.tmp file
     1096  # Start with a clean files
     1097  >$MKFILE
    9761098  >$MKFILE.tmp
    9771099
    978   host_prep_Makefiles
    979   cross_tools_Makefiles            # $cross_tools
    980   temptools_Makefiles              # $temptools
    981   if [[ $METHOD = "chroot" ]]; then
    982     chroot_Makefiles               # $chroottools
    983     if [[ ! $TEST = "0" ]]; then
    984       testsuite_tools_Makefiles    # $testsuitetools
    985     fi
    986     final_system_Makefiles         # $basicsystem
     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
     1105
     1106  host_prep_Makefiles        # mk_SETUP      (SETUP)  $host_prep
     1107  cross_tools_Makefiles      # mk_CROSS      (LUSER)  $cross_tools
     1108  temptools_Makefiles        # mk_TEMP       (LUSER)  $temptools
     1109  $method_cmds               # mk_SYSTOOLS   (CHROOT) $chroottools/$boottools
     1110  if [[ ! $TEST = "0" ]]; then
     1111    $testsuite_cmds          # mk_SYSTOOLS   (CHROOT) $testsuitetools
     1112  fi
     1113  $final_sys_cmds            # mk_FINAL      (CHROOT) $basicsystem
    9871114    # Add the iterations targets, if needed
    988     [[ "$COMPARE" = "y" ]] && wrt_compare_targets
    989     bootscripts_Makefiles          # $bootscripttools
    990     bootable_Makefiles             # $bootabletools
    991   else
    992     boot_Makefiles                 # $boottools
    993     if [[ ! $TEST = "0" ]]; then
    994       bm_testsuite_tools_Makefiles # $testsuitetools
    995     fi
    996     bm_final_system_Makefiles      # $basicsystem
    997     # Add the iterations targets, if needed
    998     [[ "$COMPARE" = "y" ]] && wrt_compare_targets
    999     bm_bootscripts_Makefiles       # $bootscipttools
    1000     bm_bootable_Makefiles          # $bootabletoosl
    1001   fi
    1002 #  the_end_Makefiles
    1003 
     1115  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
     1116  $bootscripts_cmds          # mk_BOOTSCRIPT (CHROOT) $bootscripttools
     1117  $bootable_cmds             # mk_BOOTABLE   (CHROOT) $bootabletools
    10041118
    10051119  # Add a header, some variables and include the function file
     
    10301144LUSER_HOME   = /home/\$(LUSER)
    10311145PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
    1032 PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
    1033 
     1146PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
     1147
     1148export PATH := \${PATH}:/usr/sbin
    10341149
    10351150include makefile-functions
     
    10571172  fi
    10581173
    1059   # Drop in the main target 'all:' and the chapter targets with each sub-target
    1060   # as a dependency.
     1174################## CHROOT ####################
     1175
    10611176if [[ "${METHOD}" = "chroot" ]]; then
    10621177(
    1063         cat << EOF
    1064 all:  chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 do-housekeeping
     1178cat << EOF
     1179
     1180all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report
     1181        @sudo make do-housekeeping
    10651182        @\$(call echo_finished,$VERSION)
    10661183
    1067 chapter2:  023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment
    1068 
    1069 chapter3:  chapter2 $cross_tools
    1070 
    1071 chapter4:  chapter3 $temptools
    1072 
    1073 chapter5:  chapter4 $chroottools restore-luser-env $testsuitetools
    1074 
    1075 chapter6:  chapter5 $basicsystem
    1076 
    1077 chapter7:  chapter6 $bootscripttools
    1078 
    1079 chapter8:  chapter7 $bootabletools
    1080 
    1081 clean-all:  clean
    1082         rm -rf ./{clfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
    1083 
    1084 clean:  clean-chapter4 clean-chapter3 clean-chapter2
    1085 
    1086 restart:
    1087         @echo "This feature does not exist for the CLFS makefile. (yet)"
    1088 
    1089 clean-chapter2:
    1090         -if [ ! -f luser-exist ]; then \\
     1184ck_UID:
     1185        @if [ \`id -u\` = "0" ]; then \\
     1186          echo "+--------------------------------------------------+"; \\
     1187          echo "|You cannot run this makefile from the root account|"; \\
     1188          echo "+--------------------------------------------------+"; \\
     1189          exit 1; \\
     1190        fi
     1191
     1192#---------------AS ROOT
     1193mk_SETUP:
     1194        @\$(call echo_SU_request)
     1195        @sudo make SETUP
     1196        @touch \$@
     1197
     1198#---------------AS LUSER
     1199mk_CROSS: mk_SETUP
     1200        @\$(call echo_PHASE,Cross and Temporary Tools)
     1201        @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" )
     1202        @sudo make restore-luser-env
     1203        @touch \$@
     1204
     1205mk_SUDO: mk_CROSS
     1206        @sudo make SUDO
     1207        @touch \$@
     1208#
     1209# The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
     1210# chroot environment. (Unless someone knows a different way)
     1211# Manually create the /bin directory and provide link to the /tools dir.
     1212# Also change the original symlink creation to include (f)orce to prevent failure due to
     1213#  pre-existing links.
     1214
     1215#---------------CHROOT JAIL
     1216mk_SYSTOOLS: mk_SUDO
     1217        @if [ ! -e \$(MOUNT_PT)/bin ]; then \\
     1218          mkdir \$(MOUNT_PT)/bin; \\
     1219          cd \$(MOUNT_PT)/bin && \\
     1220          ln -svf /tools/bin/bash bash; ln -sf bash sh; \\
     1221          sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
     1222        fi;
     1223        @sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chroot/082-createfiles
     1224        @\$(call echo_CHROOT_request)
     1225        @\$(call echo_PHASE, CHROOT JAIL )
     1226        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL")
     1227        @touch \$@
     1228
     1229
     1230
     1231SETUP:       $host_prep
     1232AS_LUSER:    $cross_tools $temptools
     1233SUDO:        $orphan_scripts
     1234CHROOT_JAIL: ${chroottools}${boottools} $testsuitetools $basicsystem  $bootscripttools  $bootabletools
     1235
     1236do-housekeeping:
     1237        @-umount \$(MOUNT_PT)/dev/pts
     1238        @-umount \$(MOUNT_PT)/dev/shm
     1239        @-umount \$(MOUNT_PT)/dev
     1240        @-umount \$(MOUNT_PT)/sys
     1241        @-umount \$(MOUNT_PT)/proc
     1242        @-rm /tools /cross-tools
     1243        @-if [ ! -f luser-exist ]; then \\
    10911244                userdel \$(LUSER); \\
    10921245                rm -rf /home/\$(LUSER); \\
    10931246        fi;
    1094         rm -rf \$(MOUNT_PT)/tools
    1095         rm -f /tools
    1096         rm -rf \$(MOUNT_PT)/cross-tools
    1097         rm -f /cross-tools
    1098         rm -f envars luser-exist
    1099         rm -f 02* logs/02*.log
    1100 
    1101 clean-chapter3:
    1102         rm -rf \$(MOUNT_PT)/tools/*
    1103         rm -f $cross_tools sources-dir
    1104         cd logs && rm -f $cross_tools && cd ..
    1105 
    1106 clean-chapter4:
    1107         -umount \$(MOUNT_PT)/sys
    1108         -umount \$(MOUNT_PT)/proc
    1109         -umount \$(MOUNT_PT)/dev/shm
    1110         -umount \$(MOUNT_PT)/dev/pts
    1111         -umount \$(MOUNT_PT)/dev
    1112         rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,lib64,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
    1113         rm -f $temptools
    1114         cd logs && rm -f $temptools && cd ..
    1115 
     1247
     1248EOF
     1249) >> $MKFILE
     1250
     1251  # Add SBU-disk_usage report target
     1252  echo "create-sbu_du-report:" >> $MKFILE
     1253  if [[ "$REPORT" = "y" ]] ; then
     1254(
     1255    cat << EOF
     1256        @\$(call echo_message, Building)
     1257        @./create-sbu_du-report.sh logs $VERSION
     1258        @\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
     1259        @touch  \$@
     1260
     1261EOF
     1262) >> $MKFILE
     1263  else echo -e "\t@true\n" >> $MKFILE; fi
     1264
     1265fi
     1266
     1267################### BOOT #####################
     1268
     1269if [[ "${METHOD}" = "boot" ]]; then
     1270(
     1271cat << EOF
     1272
     1273all:    ck_UID mk_SETUP mk_CROSS mk_SUDO
     1274        @sudo make restore-luser-env
     1275        @sudo make do-housekeeping
     1276        @\$(call echo_boot_finished,$VERSION)
     1277
     1278makesys: mk_FINAL
     1279        @\$(call echo_finished,$VERSION)
     1280
     1281
     1282ck_UID:
     1283        @if [ \`id -u\` = "0" ]; then \\
     1284          echo "+--------------------------------------------------+"; \\
     1285          echo "|You cannot run this makefile from the root account|"; \\
     1286          echo "|However, if this is the boot environment          |"; \\
     1287          echo "| the command you are looking for is               |"; \\
     1288          echo "|   make makesys                                   |"; \\
     1289          echo "| to finish off the build                          |"; \\
     1290          echo "+--------------------------------------------------+"; \\
     1291          exit 1; \\
     1292        fi
     1293
     1294#---------------AS ROOT
     1295
     1296mk_SETUP:
     1297        @\$(call echo_SU_request)
     1298        @sudo make SETUP
     1299        @touch \$@
     1300
     1301#---------------AS LUSER
     1302
     1303mk_CROSS: mk_SETUP
     1304        @\$(call echo_PHASE,Cross Tool)
     1305        @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" )
     1306        @touch \$@
     1307
     1308mk_SUDO: mk_SYSTOOLS
     1309        @sudo make SUDO
     1310        @touch \$@
     1311
     1312#---------------AS ROOT
     1313
     1314mk_FINAL:
     1315        @\$(call echo_PHASE,Final System)
     1316        @( make AS_ROOT )
     1317        @touch \$@
     1318
     1319SETUP:      $host_prep
     1320AS_LUSER:   $cross_tools $temptools ${chroottools}${boottools}
     1321SUDO:       $orphan_scripts
     1322AS_ROOT:    $testsuitetools $basicsystem $bootscripttools $bootabletools
     1323
     1324do-housekeeping:
     1325        @-rm /tools /cross-tools
     1326        @-if [ ! -f luser-exist ]; then \\
     1327                userdel \$(LUSER); \\
     1328                rm -rf /home/\$(LUSER); \\
     1329        fi;
     1330
     1331EOF
     1332) >> $MKFILE
     1333fi
     1334
     1335(
     1336 cat << EOF
     1337
     1338
     1339restart:
     1340        @echo "This feature does not exist for the CLFS makefile. (yet)"
    11161341
    11171342restore-luser-env:
     
    11281353        echo --------------------------------------------------------------------------------\$(WHITE)
    11291354
    1130 do-housekeeping:
    1131         @-umount \$(MOUNT_PT)/dev/pts
    1132         @-umount \$(MOUNT_PT)/dev/shm
    1133         @-umount \$(MOUNT_PT)/dev
    1134         @-umount \$(MOUNT_PT)/sys
    1135         @-umount \$(MOUNT_PT)/proc
    1136         @-if [ ! -f luser-exist ]; then \\
    1137                 userdel \$(LUSER); \\
    1138                 rm -rf /home/\$(LUSER); \\
    1139         fi;
     1355########################################################
     1356
    11401357
    11411358EOF
    11421359) >> $MKFILE
    1143 fi
    1144 
    1145 
    1146 if [[ "${METHOD}" = "boot" ]]; then
    1147 (
    1148         cat << EOF
    1149 
    1150 all:    makeboot
    1151 
    1152 makeboot: 023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment \
    1153         $cross_tools\
    1154         $temptools \
    1155         $chroottools \
    1156         $boottools restore-luser-env
    1157         @\$(call echo_boot_finished,$VERSION)
    1158 
    1159 makesys:  $testsuitetools $basicsystem $bootscripttools $bootabletools
    1160         @\$(call echo_finished,$VERSION)
    1161 
    1162 
    1163 clean-all:  clean
    1164         rm -rf ./{clfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
    1165 
    1166 clean:  clean-makesys clean-makeboot clean-jhalfs
    1167 
    1168 restart:
    1169         @echo "This feature does not exist for the CLFS makefile. (yet)"
    1170 
    1171 clean-jhalfs:
    1172         -if [ ! -f luser-exist ]; then \\
    1173                 userdel \$(LUSER); \\
    1174                 rm -rf /home/\$(LUSER); \\
    1175         fi;
    1176         rm -rf \$(MOUNT_PT)/tools
    1177         rm -f /tools
    1178         rm -rf \$(MOUNT_PT)/cross-tools
    1179         rm -f /cross-tools
    1180         rm -f envars luser-exist
    1181         rm -f 02* logs/02*.log
    1182 
    1183 clean-makeboot:
    1184         rm -rf /tools/*
    1185         rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools
    1186         rm -f restore-luser-env sources-dir
    1187         cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd ..
    1188 
    1189 clean-makesys:
    1190         -umount \$(MOUNT_PT)/sys
    1191         -umount \$(MOUNT_PT)/proc
    1192         -umount \$(MOUNT_PT)/dev/shm
    1193         -umount \$(MOUNT_PT)/dev/pts
    1194         -umount \$(MOUNT_PT)/dev
    1195         rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,lib64,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
    1196         rm -f $basicsystem
    1197         rm -f $bootscripttools
    1198         rm -f $bootabletools
    1199         cd logs && rm -f $basicsystem && rm -f $bootscripttools && rm -f $bootabletools && cd ..
    1200 
    1201 
    1202 restore-luser-env:
    1203         @\$(call echo_message, Building)
    1204         @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
    1205                 mv -fv /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
    1206         fi;
    1207         @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
    1208                 mv -v /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
    1209         fi;
    1210         @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
    1211         touch \$@ && \\
    1212         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    1213         echo --------------------------------------------------------------------------------\$(WHITE)
    1214 
    1215 
    1216 EOF
    1217 ) >> $MKFILE
    1218 fi
    12191360
    12201361  # Bring over the items from the Makefile.tmp
    12211362  cat $MKFILE.tmp >> $MKFILE
    12221363  rm $MKFILE.tmp
     1364
    12231365  echo "Creating Makefile... ${BOLD}DONE${OFF}"
    1224 
    1225 }
    1226 
     1366}
Note: See TracChangeset for help on using the changeset viewer.