Changeset d14903f for CLFS/master.sh


Ignore:
Timestamp:
09/02/2006 03:04:03 AM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
experimental
Children:
1ba5024
Parents:
b179a81
Message:

First commit of CLFS changes to new Makefile scheme.. work still to be done on optimize function and ICA/farce tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    rb179a81 rd14903f  
    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        chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
    81175        touch \$@ && \\
    82176        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    84178EOF
    85179) >> $MKFILE.tmp
    86 
    87 }
    88 
    89 
    90 
    91 #-----------------------------#
    92 cross_tools_Makefiles() {     #
    93 #-----------------------------#
    94   echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
     180  host_prep=" 023-creatingtoolsdir 024-creatingcrossdir 026-settingenvironment"
     181
     182}
     183
     184#--------------------------------------#
     185cross_tools_Makefiles() {              #
     186#--------------------------------------#
     187  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools  ( LUSER ) ${R_arrow}"
    95188
    96189  for file in cross-tools/* ; do
     
    127220    # Drop in the name of the target on a new line, and the previous target
    128221    # as a dependency. Also call the echo_message function.
    129     wrt_target "${this_script}" "$PREV"
     222    LUSER_wrt_target "${this_script}" "$PREV"
    130223    #
    131224    # If $pkg_tarball isn't empty, we've got a package...
    132225    #
    133     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
    134     #
    135     wrt_RunAsUser "${this_script}" "${file}"
    136     #
    137     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     226    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     227    #
     228    LUSER_wrt_RunAsUser "${file}"
     229    #
     230    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    138231    #
    139232    # Include a touch of the target name so make can check if it's already been made.
     
    150243}
    151244
    152 
    153 #-----------------------------#
    154 temptools_Makefiles() {       #
    155 #-----------------------------#
    156   echo "${tab_}${GREEN}Processing... ${L_arrow}temp system${R_arrow}"
     245#--------------------------------------#
     246temptools_Makefiles() {                #
     247#--------------------------------------#
     248  echo "${tab_}${GREEN}Processing... ${L_arrow}temp system  ( LUSER ) ${R_arrow}"
    157249
    158250  for file in temp-system/* ; do
     
    185277    # Drop in the name of the target on a new line, and the previous target
    186278    # as a dependency. Also call the echo_message function.
    187     wrt_target "${this_script}" "$PREV"
     279    LUSER_wrt_target "${this_script}" "$PREV"
    188280    #
    189281    # If $pkg_tarball isn't empty, we've got a package...
    190282    # Insert instructions for unpacking the package and to set the PKGDIR variable.
    191283    #
    192     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     284    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
    193285    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    194286    #
    195     wrt_RunAsUser "${this_script}" "${file}"
    196     #
    197     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     287    LUSER_wrt_RunAsUser "${file}"
     288    #
     289    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    198290    #
    199291    # Include a touch of the target name so make can check if it's already been made.
     
    210302
    211303
    212 #-----------------------------#
    213 boot_Makefiles() {            #
    214 #-----------------------------#
    215   echo "${tab_}${GREEN}Processing... ${L_arrow}boot${R_arrow}"
    216 
     304#--------------------------------------#
     305chroot_Makefiles() {                   #
     306#--------------------------------------#
     307  echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools CHROOT        ( CHROOT ) ${R_arrow}"
     308
     309  for file in chroot/* ; do
     310    # Keep the script file name
     311    this_script=`basename $file`
     312    #
     313    # Skipping scripts is done now and not included in the build tree.
     314    case $this_script in
     315      *chroot*) continue ;;
     316    esac
     317
     318    #
     319    # First append each name of the script files to a list (this will become
     320    # the names of the targets in the Makefile
     321    case "${this_script}" in
     322      *util-linux) : ;;
     323      *kernfs) orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     324      *)          chroottools="$chroottools $this_script"         ;;
     325    esac   
     326
     327    # Grab the name of the target, strip id number, XXX-script
     328    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
     329
     330    pkg_tarball=$(get_package_tarball_name $name)
     331   
     332    # This is very ugly:: util-linux is in /chroot but should be run under LUSER
     333    # A custom collection of routines.
     334    case "${this_script}" in
     335      *util-linux)
     336         LUSER_wrt_target "${this_script}" "$PREV"
     337         [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     338         [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     339         LUSER_wrt_RunAsUser "${file}"
     340         LUSER_RemoveBuildDirs "${name}"
     341         wrt_touch
     342         temptools="$temptools $this_script"
     343         continue ;;
     344     esac
     345
     346
     347    #--------------------------------------------------------------------#
     348    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     349    #--------------------------------------------------------------------#
     350    #
     351    # Drop in the name of the target on a new line, and the previous target
     352    # as a dependency. Also call the echo_message function.
     353    CHROOT_wrt_target "${this_script}" "$PREV"
     354    #
     355    # If $pkg_tarball isn't empty, we've got a package...
     356    # Insert instructions for unpacking the package and changing directories
     357    #
     358    if [ "$pkg_tarball" != "" ] ; then
     359      case $this_script in
     360        *util-linux)      ROOT_Unpack  "$pkg_tarball"  ;;
     361        *)              CHROOT_Unpack "$pkg_tarball"  ;;
     362      esac
     363      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     364    fi
     365    #
     366    # Select a script execution method
     367    case $this_script in
     368      *kernfs)      wrt_RunAsRoot         "${this_script}" "${file}"  ;;
     369      *util-linux)  ROOT_RunAsRoot        "${file}"  ;;
     370      *)            CHROOT_wrt_RunAsRoot  "${file}"  ;;
     371    esac
     372    #
     373    # Housekeeping...remove the build directory(ies), except if the package build fails.
     374    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     375    #
     376    # Include a touch of the target name so make can check if it's already been made.
     377    wrt_touch
     378    #
     379    #--------------------------------------------------------------------#
     380    #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
     381    #--------------------------------------------------------------------#
     382    #
     383    # Keep the script file name for Makefile dependencies.
     384    PREV=$this_script
     385
     386  done # for file in...
     387}
     388
     389
     390#--------------------------------------#
     391boot_Makefiles() {                     #
     392#--------------------------------------#
     393 
     394  echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools BOOT  ( LUSER ) ${R_arrow}"
     395  #
     396  # Create a target bootable partition containing a compile environment. Later
     397  #  on we boot into this environment and contine the build.
     398  #
    217399  for file in boot/* ; do
    218400    # Keep the script file name
     
    223405      *grub | *aboot | *colo | *silo | *arcload | *lilo )     continue     ;;
    224406      *whatnext*) continue     ;;
    225       *kernel)    # if there is no kernel config file do not build the kernel
     407      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
     408      *kernel)  # if there is no kernel config file do not build the kernel
    226409                [[ -z $CONFIG ]] && continue
    227410                  # Copy the config file to /sources with a standardized name
     
    232415    # First append each name of the script files to a list (this will become
    233416    # the names of the targets in the Makefile
    234     boottools="$boottools $this_script"
     417    case "${this_script}" in
     418      *changingowner)  orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     419      *devices)        orphan_scripts="${orphan_scripts} ${this_script}"  ;;
     420      *)               boottools="$boottools $this_script" ;;
     421    esac
    235422    #
    236423    # Grab the name of the target, strip id number and misc words.
     
    257444    # Drop in the name of the target on a new line, and the previous target
    258445    # as a dependency. Also call the echo_message function.
    259     wrt_target "${this_script}" "$PREV"
     446    LUSER_wrt_target "${this_script}" "$PREV"
    260447    #
    261448    # If $pkg_tarball isn't empty, we've got a package...
    262449    # Insert instructions for unpacking the package and changing directories
    263450    #
    264     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     451    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
    265452    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    266453    #
    267454    # Select a script execution method
    268455    case $this_script in
     456       # The following 2 scripts are defined in the /boot directory but need
     457       # to be run as a root user. Set them up here but run them in another phase
    269458      *changingowner*)  wrt_RunAsRoot "${this_script}" "${file}"    ;;
    270459      *devices*)        wrt_RunAsRoot "${this_script}" "${file}"    ;;
    271460      *fstab*)   if [[ -n "$FSTAB" ]]; then
    272                    wrt_copy_fstab "${this_script}"
     461                   LUSER_wrt_CopyFstab
    273462                 else
    274                    wrt_RunAsUser  "${this_script}" "${file}"
     463                   LUSER_wrt_RunAsUser "${file}"
    275464                 fi
    276465         ;;
    277       *)         wrt_RunAsUser  "${this_script}" "${file}"       ;;
     466      *)         LUSER_wrt_RunAsUser "${file}"       ;;
    278467    esac
    279468    #
    280469    # Housekeeping...remove any build directory(ies) except if the package build fails.
    281     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     470    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    282471    #
    283472    # Include a touch of the target name so make can check if it's already been made.
     
    295484
    296485
    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}"
     486#--------------------------------------#
     487chroot_testsuite_tools_Makefiles() {   #
     488#--------------------------------------#
     489  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools  ( CHROOT ) ${R_arrow}"
    368490
    369491  for file in testsuite-tools/* ; do
     
    390512    # Drop in the name of the target on a new line, and the previous target
    391513    # as a dependency. Also call the echo_message function.
    392     wrt_target "${this_script}" "$PREV"
    393     #
    394     wrt_unpack2 "$pkg_tarball"
     514    CHROOT_wrt_target "${this_script}" "$PREV"
     515    #
     516    CHROOT_Unpack "$pkg_tarball"
    395517    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    396518    #
    397     wrt_run_as_chroot1 "${this_script}" "${file}"
    398     #
    399     wrt_remove_build_dirs "${name}"
     519    CHROOT_wrt_RunAsRoot "${file}"
     520    #
     521    CHROOT_wrt_RemoveBuildDirs "${name}"
    400522    #
    401523    # Include a touch of the target name so make can check if it's already been made.
     
    412534}
    413535
    414 
    415 #--------------------------------#
    416 bm_testsuite_tools_Makefiles() { #
    417 #--------------------------------#
    418   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools${R_arrow}"
    419 
     536#--------------------------------------#
     537boot_testsuite_tools_Makefiles() {     #
     538#--------------------------------------#
     539  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools ( ROOT ) ${R_arrow}"
    420540  for file in testsuite-tools/* ; do
    421541    # Keep the script file name
     
    442562    # Drop in the name of the target on a new line, and the previous target
    443563    # as a dependency. Also call the echo_message function.
    444     wrt_target_boot "${this_script}" "$PREV"
    445     #
    446     wrt_unpack3 "$pkg_tarball"
     564    BOOT_wrt_target "${this_script}" "$PREV"
     565    #
     566    BOOT_wrt_Unpack "$pkg_tarball"
    447567    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    448568    #
    449     wrt_run_as_root2 "${this_script}" "${file}"
    450     #
    451     wrt_remove_build_dirs2 "${name}"
     569    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     570    #
     571    BOOT_wrt_RemoveBuildDirs "${name}"
    452572    #
    453573    # Include a touch of the target name so make can check if it's already been made.
     
    462582
    463583  done
    464 }
    465 
    466 
    467 #-----------------------------#
    468 final_system_Makefiles() {    #
    469 #-----------------------------#
     584
     585}
     586
     587
     588#--------------------------------------#
     589chroot_final_system_Makefiles() {      #
     590#--------------------------------------#
    470591  # Set envars and scripts for iteration targets
    471592  LOGS="" # Start with an empty global LOGS envar
     
    489610  fi
    490611
    491   echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N${R_arrow}"
     612  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N ( CHROOT ) ${R_arrow}"
    492613
    493614  for file in final-system$N/* ; do
     
    536657    # Drop in the name of the target on a new line, and the previous target
    537658    # as a dependency. Also call the echo_message function.
    538     wrt_target "${this_script}${N}" "$PREV"
     659    CHROOT_wrt_target "${this_script}${N}" "$PREV"
    539660
    540661    # If $pkg_tarball isn't empty, we've got a package...
    541662    if [ "$pkg_tarball" != "" ] ; then
    542       wrt_unpack2 "$pkg_tarball"
     663      CHROOT_Unpack "$pkg_tarball"
    543664      # If the testsuites must be run, initialize the log file
    544665      case $name in
    545666        binutils | gcc | glibc )
    546           [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     667          [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
    547668          ;;
    548669        * )
    549           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
     670          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
    550671          ;;
    551672      esac
     
    554675    fi
    555676    #
    556     wrt_run_as_chroot1 "${this_script}" "${file}"
    557     #
    558     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     677    CHROOT_wrt_RunAsRoot "${file}"
     678    #
     679    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    559680    #
    560681    # Include a touch of the target name so make can check if it's already been made.
     
    572693}
    573694
    574 
    575 #-----------------------------#
    576 bm_final_system_Makefiles() { #
    577 #-----------------------------#
     695#--------------------------------------#
     696boot_final_system_Makefiles() {        #
     697#--------------------------------------#
    578698  # Set envars and scripts for iteration targets
    579699  LOGS="" # Start with an empty global LOGS envar
     
    599719  fi
    600720
    601   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N${R_arrow}"
     721  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N  ( ROOT ) ${R_arrow}"
    602722
    603723  for file in final-system$N/* ; do
     
    647767    # Drop in the name of the target on a new line, and the previous target
    648768    # as a dependency. Also call the echo_message function.
    649     wrt_target_boot "${this_script}${N}" "$PREV"
     769    BOOT_wrt_target "${this_script}${N}" "$PREV"
    650770
    651771    # If $pkg_tarball isn't empty, we've got a package...
    652772    if [ "$pkg_tarball" != "" ] ; then
    653773      FILE="$pkg_tarball"
    654       wrt_unpack3 "$FILE"
     774      BOOT_wrt_Unpack "$FILE"
    655775      # If the testsuites must be run, initialize the log file
    656776      case $name in
    657777        binutils | gcc | glibc )
    658           [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     778          [[ "$TEST" != "0" ]] && BOOT_wrt_test_log "${this_script}"
    659779          ;;
    660780        * )
    661           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
     781          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && BOOT_wrt_test_log "${this_script}"
    662782          ;;
    663783      esac
     
    666786    fi
    667787    #
    668     wrt_run_as_root2 "${this_script}" "${file}"
    669     #
    670     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     788    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     789    #
     790    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    671791    #
    672792    # Include a touch of the target name so make can check if it's already been made.
     
    682802    system_build=$basicsystem
    683803  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}"
     804
     805}
     806
     807#--------------------------------------#
     808chroot_bootscripts_Makefiles() {       #
     809#--------------------------------------#
     810  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts   ( CHROOT ) ${R_arrow}"
    691811
    692812  for file in bootscripts/* ; do
     
    723843    # Drop in the name of the target on a new line, and the previous target
    724844    # as a dependency. Also call the echo_message function.
    725     wrt_target "${this_script}" "$PREV"
     845    CHROOT_wrt_target "${this_script}" "$PREV"
    726846    #
    727847    # If $pkg_tarball isn't empty, we've got a package...
    728848    #
    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}"
     849    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     850    #
     851    CHROOT_wrt_RunAsRoot "${file}"
     852    #
     853    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    734854    #
    735855    # Include a touch of the target name so make can check if it's already been made.
     
    744864
    745865  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}"
     866}
     867
     868#--------------------------------------#
     869boot_bootscripts_Makefiles() {         #
     870#--------------------------------------#
     871  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts     ( ROOT ) ${R_arrow}"
    753872
    754873  for file in bootscripts/* ; do
     
    785904    # Drop in the name of the target on a new line, and the previous target
    786905    # as a dependency. Also call the echo_message function.
    787     wrt_target_boot "${this_script}" "$PREV"
     906    BOOT_wrt_target "${this_script}" "$PREV"
    788907    #
    789908    # If $pkg_tarball isn't empty, we've got a package...
    790909    #
    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}"
     910    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
     911    #
     912    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     913    #
     914    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    796915    #
    797916    # Include a touch of the target name so make can check if it's already been made.
     
    806925
    807926  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}"
     927}
     928
     929#--------------------------------------#
     930chroot_bootable_Makefiles() {          #
     931#--------------------------------------#
     932  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable ( CHROOT ) ${R_arrow}"
    817933
    818934  for file in {bootable,the-end}/* ; do
     
    823939    case $this_script in
    824940      *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue ;;
     941      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
    825942      *kernel) # if there is no kernel config file do not build the kernel
    826943               [[ -z $CONFIG ]] && continue
     
    849966    # Drop in the name of the target on a new line, and the previous target
    850967    # as a dependency. Also call the echo_message function.
    851     wrt_target "${this_script}" "$PREV"
     968    CHROOT_wrt_target "${this_script}" "$PREV"
    852969    #
    853970    # If $pkg_tarball isn't empty, we've got a package...
    854971    # Insert instructions for unpacking the package and changing directories
    855972    #
    856     [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
     973    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
    857974    #
    858975    # Select a script execution method
    859976    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}"   ;;
     977      *fstab*)   if [[ -n "$FSTAB" ]]; then
     978                   CHROOT_wrt_CopyFstab
     979                 else
     980                   CHROOT_wrt_RunAsRoot  "${file}"
     981                 fi
     982        ;;
     983      *)  CHROOT_wrt_RunAsRoot  "${file}"
     984        ;;
    867985    esac
    868986    #
    869987    # Housekeeping...remove any build directory(ies) except if the package build fails.
    870     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     988    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
    871989    #
    872990    # Include a touch of the target name so make can check if it's already been made.
     
    8871005}
    8881006
    889 
    890 
    891 #-----------------------------#
    892 bm_bootable_Makefiles() {     #
    893 #-----------------------------#
    894   echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable${R_arrow}"
     1007#--------------------------------------#
     1008boot_bootable_Makefiles() {            #
     1009#--------------------------------------#
     1010  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable   ( ROOT ) ${R_arrow}"
    8951011
    8961012  for file in {bootable,the-end}/* ; do
     
    9261042    # Drop in the name of the target on a new line, and the previous target
    9271043    # as a dependency. Also call the echo_message function.
    928     wrt_target_boot "${this_script}" "$PREV"
     1044    BOOT_wrt_target "${this_script}" "$PREV"
    9291045    #
    9301046    # If $pkg_tarball isn't empty, we've got a package...
    9311047    # Insert instructions for unpacking the package and changing directories
    9321048    #
    933     [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
     1049    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
    9341050    #
    9351051    # Select a script execution method
     
    9381054                  # Minimal boot mode has no access to original file, store in /sources
    9391055                  cp $FSTAB $BUILDDIR/sources/fstab
    940                   wrt_copy_fstab2 "${this_script}"
     1056                  BOOT_wrt_CopyFstab "${this_script}"
    9411057                else
    942                   wrt_run_as_root2  "${this_script}" "${file}"
     1058                  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"
    9431059                fi
    9441060          ;;
    945       *)  wrt_run_as_root2  "${this_script}" "${file}"   ;;
     1061      *)  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"   ;;
    9461062    esac
    9471063    #
    9481064    # Housekeeping...remove any build directory(ies) except if the package build fails.
    949     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     1065    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
    9501066    #
    9511067    # Include a touch of the target name so make can check if it's already been made.
     
    9581074    # Keep the script file name for Makefile dependencies.
    9591075    PREV=$this_script
    960 
    9611076  done
    9621077
     
    9641079  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
    9651080
    966 }
    967 
    968 
    969 #-----------------------------#
    970 build_Makefile() {            # Construct a Makefile from the book scripts
    971 #-----------------------------#
    972   echo "Creating Makefile... ${BOLD}START${OFF}"
     1081
     1082}
     1083
     1084
     1085#--------------------------------------#
     1086build_Makefile() {                     # Construct a Makefile from the book scripts
     1087#--------------------------------------#
     1088  #
     1089  # Script crashes if error trapping is on
     1090  #
     1091set +e
     1092  declare -f  method_cmds
     1093  declare -f  testsuite_cmds
     1094  declare -f  final_sys_cmds
     1095  declare -f  bootscripts_cmds
     1096  declare -f  bootable_cmds
     1097set -e
     1098
     1099  echo "...Creating Makefile... ${BOLD}START${OFF}"
    9731100
    9741101  cd $JHALFSDIR/${PROGNAME}-commands
    975   # Start with a clean Makefile.tmp file
     1102  # Start with a clean files
     1103  >$MKFILE
    9761104  >$MKFILE.tmp
    9771105
    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
     1106       method_cmds=${METHOD}_Makefiles
     1107    testsuite_cmds=${METHOD}_testsuite_tools_Makefiles
     1108    final_sys_cmds=${METHOD}_final_system_Makefiles
     1109  bootscripts_cmds=${METHOD}_bootscripts_Makefiles
     1110     bootable_cmds=${METHOD}_bootable_Makefiles
     1111 
     1112  host_prep_Makefiles        # mk_SETUP      (SETUP)  $host_prep
     1113  cross_tools_Makefiles      # mk_CROSS      (LUSER)  $cross_tools
     1114  temptools_Makefiles        # mk_TEMP       (LUSER)  $temptools
     1115  $method_cmds               # mk_SYSTOOLS   (CHROOT) $chroottools/$boottools
     1116  if [[ ! $TEST = "0" ]]; then
     1117    $testsuite_cmds          # mk_SYSTOOLS   (CHROOT) $testsuitetools
     1118  fi
     1119  $final_sys_cmds            # mk_FINAL      (CHROOT) $basicsystem
    9871120    # 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 
     1121  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
     1122  $bootscripts_cmds          # mk_BOOTSCRIPT (CHROOT) $bootscripttools
     1123  $bootable_cmds             # mk_BOOTABLE   (CHROOT) $bootabletools
    10041124
    10051125  # Add a header, some variables and include the function file
     
    10301150LUSER_HOME   = /home/\$(LUSER)
    10311151PRT_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 
     1152PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
    10341153
    10351154include makefile-functions
     
    10571176  fi
    10581177
    1059   # Drop in the main target 'all:' and the chapter targets with each sub-target
    1060   # as a dependency.
     1178################## CHROOT ####################
     1179
    10611180if [[ "${METHOD}" = "chroot" ]]; then
    10621181(
    1063         cat << EOF
    1064 all:  chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 do-housekeeping
     1182cat << EOF
     1183
     1184all: mk_SETUP mk_CROSS mk_TEMP mk_SYSTOOLS mk_FINAL mk_BOOTSCRIPT mk_BOOTABLE do-housekeeping
    10651185        @\$(call echo_finished,$VERSION)
    10661186
    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
     1187#---------------AS ROOT
     1188mk_SETUP:
     1189        @\$(call echo_SU_request)
     1190        @sudo make SETUP
     1191        @touch \$@
     1192       
     1193#---------------AS LUSER
     1194mk_CROSS: mk_SETUP
     1195        @\$(call echo_PHASE,Cross Tool)
     1196        @( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make CROSS" )
     1197        @touch \$@
     1198
     1199mk_TEMP: mk_CROSS
     1200        @\$(call echo_PHASE,Temporary Tools)
     1201        @( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make TEMP" )
     1202        @touch \$@
     1203
     1204#
     1205# The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
     1206# chroot environment. (Unless someone knows a different way)
     1207# Manually create the /bin directory and provide link to the /tools dir.
     1208# Also change the original symlink creation to include (f)orce to prevent failure due to
     1209#  pre-existing links.
     1210
     1211#---------------CHROOT JAIL
     1212mk_SYSTOOLS: mk_TEMP $orphan_scripts
     1213        @mkdir \$(MOUNT_PT)/bin && \\
     1214        cd \$(MOUNT_PT)/bin && \\
     1215        ln -sf /tools/bin/bash bash; ln -sf bash sh
     1216        @sed -e 's|^ln -sv|ln -svf|' -i \$(CMDSDIR)/chroot/082-createfiles
     1217        @\$(call echo_CHROOT_request)
     1218        @\$(call echo_PHASE, Chroot systools)
     1219        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make SYSTOOLS")
     1220        @touch \$@
     1221
     1222mk_FINAL: mk_SYSTOOLS
     1223        @\$(call echo_PHASE,Final System)
     1224        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make FINAL")
     1225        @touch \$@
     1226
     1227mk_BOOTSCRIPT: mk_FINAL
     1228        @\$(call echo_PHASE,Bootscript)
     1229        @\$(call echo_CHROOT_request)
     1230        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BOOTSCRIPT")
     1231        @touch \$@
     1232
     1233mk_BOOTABLE: mk_BOOTSCRIPT
     1234        @\$(call echo_PHASE, Make bootable )
     1235        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BOOTABLE")
     1236        @touch \$@
     1237
     1238EOF
     1239) >> $MKFILE
     1240fi
     1241
     1242################### BOOT #####################
     1243
     1244if [[ "${METHOD}" = "boot" ]]; then
     1245(
     1246cat << EOF
     1247
     1248all:    mk_SETUP mk_CROSS mk_TEMP mk_SYSTOOLS $orphan_scripts restore-luser-env
     1249        @\$(call echo_boot_finished,$VERSION)
     1250
     1251makesys: mk_FINAL mk_BOOTSCRIPT mk_BOOTABLE
     1252        @\$(call echo_finished,$VERSION)
     1253
     1254#---------------AS ROOT
     1255
     1256mk_SETUP:
     1257        @\$(call echo_SU_request)
     1258        @sudo make SETUP
     1259        @touch \$@
     1260
     1261#---------------AS LUSER
     1262       
     1263mk_CROSS: mk_SETUP
     1264        @\$(call echo_PHASE,Cross Tool)
     1265        @( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make CROSS" )
     1266        @touch \$@
     1267
     1268mk_TEMP: mk_CROSS
     1269        @\$(call echo_PHASE,Temporary Tools)
     1270        @( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make TEMP" )
     1271        @touch \$@
     1272
     1273mk_SYSTOOLS: mk_TEMP
     1274        @\$(call echo_PHASE,Minimal Boot system)
     1275        @( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SYSTOOLS" )
     1276        @touch \$@
     1277
     1278#---------------AS ROOT
     1279
     1280mk_FINAL:
     1281        @\$(call echo_PHASE,Final System)
     1282        @( make FINAL )
     1283        @touch \$@
     1284
     1285mk_BOOTSCRIPT: mk_FINAL
     1286        @\$(call echo_PHASE,Bootscript)
     1287        @( make BOOTSCRIPT )
     1288        @touch \$@
     1289
     1290mk_BOOTABLE: mk_BOOTSCRIPT
     1291        @\$(call echo_PHASE,Making Bootable)
     1292        @( make BOOTABLE )
     1293        @touch \$@
     1294
     1295EOF
     1296) >> $MKFILE
     1297fi
     1298
     1299(
     1300 cat << EOF
     1301
     1302SETUP:      $host_prep
     1303CROSS:      $cross_tools
     1304TEMP:       $temptools
     1305SYSTOOLS:   ${chroottools}${boottools}
     1306FINAL:      $testsuitetools $basicsystem
     1307BOOTSCRIPT: $bootscripttools
     1308BOOTABLE:   $bootabletools
    10851309
    10861310restart:
    10871311        @echo "This feature does not exist for the CLFS makefile. (yet)"
    1088 
    1089 clean-chapter2:
    1090         -if [ ! -f luser-exist ]; then \\
    1091                 userdel \$(LUSER); \\
    1092                 rm -rf /home/\$(LUSER); \\
    1093         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 
    11161312
    11171313restore-luser-env:
     
    11391335        fi;
    11401336
     1337########################################################
     1338
     1339
    11411340EOF
    11421341) >> $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
    12191342
    12201343  # Bring over the items from the Makefile.tmp
    12211344  cat $MKFILE.tmp >> $MKFILE
    12221345  rm $MKFILE.tmp
     1346
    12231347  echo "Creating Makefile... ${BOLD}DONE${OFF}"
    1224 
    1225 }
    1226 
     1348}
Note: See TracChangeset for help on using the changeset viewer.