Changeset 9c9775f for HLFS/master.sh


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

Updated experimental branch to current trunk code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • HLFS/master.sh

    • Property mode changed from 100755 to 100644
    r0510381 r9c9775f  
    1 #!/bin/sh
     1#!/bin/bash
    22set -e  # Enable error trapping
    33
     
    2020  local remove_existing
    2121
    22   tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@'`
     22  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@' -e 's,'$N',,'`
    2323  case $tc_phase in
    2424    embryo | \
     
    9494  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3     ( SETUP ) ${R_arrow}"
    9595
    96   # Define a few model dependant variables
    97   if [[ ${MODEL} = "uclibc" ]]; then
    98     TARGET="pc-linux-gnu"; LOADER="ld-uClibc.so.0"
    99   else
    100     TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"
    101   fi
    102 
    103   # If /home/$LUSER is already present in the host, we asume that the
     96  # If $LUSER_HOME is already present in the host, we asume that the
    10497  # hlfs user and group are also presents in the host, and a backup
    10598  # of their bash init files is made.
     
    111104        rm -f /tools && \\
    112105        ln -s \$(MOUNT_PT)/tools /
    113         @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
    114                 mkdir \$(MOUNT_PT)/sources; \\
    115         fi;
    116         @chmod a+wt \$(MOUNT_PT)/sources && \\
    117         touch \$@ && \\
    118         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    119         echo --------------------------------------------------------------------------------\$(WHITE)
     106        @\$(call housekeeping)
    120107
    121108021-addinguser:  020-creatingtoolsdir
    122109        @\$(call echo_message, Building)
    123         @if [ ! -d /home/\$(LUSER) ]; then \\
     110        @if [ ! -d \$(LUSER_HOME) ]; then \\
    124111                groupadd \$(LGROUP); \\
    125112                useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
     
    128115        fi;
    129116        @chown \$(LUSER) \$(MOUNT_PT)/tools && \\
    130         chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
    131         chown \$(LUSER) \$(MOUNT_PT)/sources && \\
    132         touch \$@ && \\
    133         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    134         echo --------------------------------------------------------------------------------\$(WHITE)
     117        chmod -R a+wt \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
     118        chmod a+wt \$(SRCSDIR)
     119        @\$(call housekeeping)
    135120
    136121022-settingenvironment:  021-addinguser
    137122        @\$(call echo_message, Building)
    138         @if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
    139                 mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
    140         fi;
    141         @if [ -f /home/\$(LUSER)/.bash_profile  -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
    142                 mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
    143         fi;
    144         @echo "set +h" > /home/\$(LUSER)/.bashrc && \\
    145         echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
    146         echo "HLFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
    147         echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
    148         echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
    149         echo "export HLFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
    150         echo "" >> /home/\$(LUSER)/.bashrc && \\
    151         echo "target=$(uname -m)-${TARGET}" >> /home/\$(LUSER)/.bashrc && \\
    152         echo "ldso=/tools/lib/${LOADER}" >> /home/\$(LUSER)/.bashrc && \\
    153         echo "export target ldso" >> /home/\$(LUSER)/.bashrc && \\
    154         echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
    155         chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
     123        @if [ -f \$(LUSER_HOME)/.bashrc -a ! -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
     124                mv \$(LUSER_HOME)/.bashrc \$(LUSER_HOME)/.bashrc.XXX; \\
     125        fi;
     126        @if [ -f \$(LUSER_HOME)/.bash_profile  -a ! -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
     127                mv \$(LUSER_HOME)/.bash_profile \$(LUSER_HOME)/.bash_profile.XXX; \\
     128        fi;
     129        @echo "set +h" > \$(LUSER_HOME)/.bashrc && \\
     130        echo "umask 022" >> \$(LUSER_HOME)/.bashrc && \\
     131        echo "HLFS=\$(MOUNT_PT)" >> \$(LUSER_HOME)/.bashrc && \\
     132        echo "LC_ALL=POSIX" >> \$(LUSER_HOME)/.bashrc && \\
     133        echo "PATH=/tools/bin:/bin:/usr/bin" >> \$(LUSER_HOME)/.bashrc && \\
     134        echo "export HLFS LC_ALL PATH" >> \$(LUSER_HOME)/.bashrc && \\
     135        echo "" >> \$(LUSER_HOME)/.bashrc && \\
     136        echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc && \\
     137        chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
    156138        chmod -R a+wt \$(MOUNT_PT) && \\
    157139        touch envars && \\
    158         chown \$(LUSER) envars && \\
    159         touch \$@ && \\
    160         echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
    161         echo --------------------------------------------------------------------------------\$(WHITE)
     140        chown \$(LUSER) envars
     141        @\$(call housekeeping)
    162142EOF
    163143) >> $MKFILE.tmp
     
    183163      *expect* )  [[ "$TEST" = "0" ]] && continue; ;;
    184164      *dejagnu* ) [[ "$TEST" = "0" ]] && continue; ;;
    185         # Nothing interestin in this script
    186       *introduction* ) continue ;;
    187165        # Test if the stripping phase must be skipped
    188166      *stripping* ) [[ "$STRIP" = "n" ]] && continue ;;
     
    195173
    196174    # Grab the name of the target
    197     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
     175    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
    198176
    199177    # Adjust 'name'
     
    225203    LUSER_wrt_target "$this_script" "$PREV"
    226204    # Find the version of the command files, if it corresponds with the building of
    227     # a specific package
    228     pkg_tarball=$(get_package_tarball_name $name)
     205    # a specific package. Fix GCC tarball name for 2.4-branch.
     206    case $name in
     207      gcc ) pkg_tarball=$(get_package_tarball_name gcc-core) ;;
     208        * ) pkg_tarball=$(get_package_tarball_name $name) ;;
     209    esac
    229210    # If $pkg_tarball isn't empty, we've got a package...
    230211    if [ "$pkg_tarball" != "" ] ; then
     
    263244  local this_script
    264245  # Set envars and scripts for iteration targets
    265   LOGS="" # Start with an empty global LOGS envar
    266246  if [[ -z "$1" ]] ; then
    267247    local N=""
     
    274254      # Overwrite existing symlinks, files, and dirs
    275255      sed -e 's/ln -s /ln -sf /g' \
    276           -e 's/^mv /&-f/g' -i ${script}
     256          -e 's/^mv /&-f /g' \
     257          -e 's/mkdir -v/&p/g' -i ${script}
     258      # Rename the scripts
     259      mv ${script} ${script}$N
    277260    done
    278261    # Remove Bzip2 binaries before make install
    279     sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
     262    sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2$N
    280263    # Fix how Module-Init-Tools do the install target
    281     sed -e 's@make install@make INSTALL=install install@' -i chapter06$N/*-module-init-tools
    282     # Delete *old Readline libraries just after make install
    283     sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i chapter06$N/*-readline
     264    sed -e 's@make install@make INSTALL=install install@' -i chapter06$N/*-module-init-tools$N
    284265    # Don't readd already existing groups
    285     sed -e '/groupadd/d' -i chapter06$N/*-udev
     266    sed -e '/groupadd/d' -i chapter06$N/*-udev$N
    286267  fi
    287268
     
    299280        # Test if the stripping phase must be skipped
    300281      *-stripping* )  [[ "$STRIP" = "n" ]] && continue ;;
     282        # Skip linux-headers in iterative builds
     283      *linux-headers*) [[ -n "$N" ]] && continue ;;
    301284    esac
    302285
    303286    # Grab the name of the target
    304     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
     287    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's,'$N',,'`
    305288
    306289    case $name in
     
    309292
    310293    # Find the version of the command files, if it corresponds with the building of
    311     # a specific package
    312     pkg_tarball=$(get_package_tarball_name $name)
     294    # a specific package. Fix GCC tarball name for 2.4-branch.
     295    case $name in
     296      gcc ) pkg_tarball=$(get_package_tarball_name gcc-core) ;;
     297        * ) pkg_tarball=$(get_package_tarball_name $name) ;;
     298    esac
    313299
    314300    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
     
    321307    # Append each name of the script files to a list (this will become
    322308    # the names of the targets in the Makefile
    323     chapter6="$chapter6 ${this_script}${N}"
    324 
    325     # Append each name of the script files to a list (this will become
    326     # the names of the logs to be moved for each iteration)
    327     LOGS="$LOGS ${this_script}"
     309    case "${this_script}" in
     310      *kernfs* ) runasroot=" ${this_script}" ;;
     311             * ) chapter6="$chapter6 ${this_script}" ;;
     312    esac
    328313
    329314
     
    335320    # as a dependency. Also call the echo_message function.
    336321    if [[ ${name} = "butterfly-toolchain" ]]; then
    337        CHROOT_wrt_target "${this_script}${N}" "$PREV"
    338          process_toolchain "${this_script}" "${file}"
    339        wrt_touch
    340        PREV=$this_script
    341        continue
     322      CHROOT_wrt_target "${this_script}" "$PREV"
     323      # Touch timestamp file if installed files logs will be created.
     324      # But only for the firt build when running iterative builds.
     325      if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
     326        CHROOT_wrt_TouchTimestamp
     327      fi
     328      process_toolchain "${this_script}" "${file}"
     329      if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
     330        CHROOT_wrt_LogNewFiles "$name"
     331      fi
     332      wrt_touch
     333      PREV=$this_script
     334      continue
    342335    fi
    343 
    344     CHROOT_wrt_target "${this_script}${N}" "$PREV"
     336    # kernfs is run in SUDO target
     337    case "${this_script}" in
     338      *kernfs* )  LUSER_wrt_target  "${this_script}" "$PREV" ;;
     339             * )  CHROOT_wrt_target "${this_script}" "$PREV" ;;
     340    esac
    345341
    346342    # If $pkg_tarball isn't empty, we've got a package...
    347343    # Insert instructions for unpacking the package and changing directories
    348344    if [ "$pkg_tarball" != "" ] ; then
     345      # Touch timestamp file if installed files logs will be created.
     346      # But only for the firt build when running iterative builds.
     347      if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
     348        CHROOT_wrt_TouchTimestamp
     349      fi
    349350      CHROOT_Unpack "$pkg_tarball"
    350351      # If the testsuites must be run, initialize the log file
    351352      # butterfly-toolchain tests are enabled in 'process_tookchain' function
     353      # 2.4-branch toolchain is ernabled here.
    352354      case $name in
    353         glibc ) [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
    354           ;;
    355             * ) [[ "$TEST" > "1" ]]  && CHROOT_wrt_test_log "${this_script}"
    356           ;;
     355        glibc | gcc | binutils)
     356            [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" ;;
     357        * ) [[ "$TEST" > "1" ]]  && CHROOT_wrt_test_log "${this_script}" ;;
    357358      esac
    358359      # If using optimizations, write the instructions
     
    360361    fi
    361362
    362     # In the mount of kernel filesystems we need to set HLFS and not to use chroot.
     363    # In kernfs we need to set HLFS and not to use chroot.
    363364    case "${this_script}" in
    364       *kernfs* | *changingowner*)
    365         wrt_RunAsRoot "${this_script}" "${file}"
    366         ;;
    367       *)   # The rest of Chapter06
    368         CHROOT_wrt_RunAsRoot "${file}"
    369        ;;
    370     esac
    371     #
    372     # Remove the build directory(ies) except if the package build fails.
     365      *kernfs* ) wrt_RunAsRoot "${file}" ;;
     366             * ) CHROOT_wrt_RunAsRoot "${file}" ;;
     367    esac
     368    #
     369    # Write installed files log and remove the build directory(ies)
     370    # except if the package build fails.
    373371    if [ "$pkg_tarball" != "" ] ; then
    374372      CHROOT_wrt_RemoveBuildDirs "$name"
     373      if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
     374        CHROOT_wrt_LogNewFiles "$name"
     375      fi
    375376    fi
    376377    #
     
    383384
    384385    # Keep the script file name for Makefile dependencies.
    385     PREV=${this_script}${N}
     386    PREV=${this_script}
    386387    # Set system_build envar for iteration targets
    387388    system_build=$chapter6
     
    401402    this_script=`basename $file`
    402403
    403     # Grub must be configured manually.
    404     # The filesystems can't be unmounted via Makefile and the user
    405     # should enter the chroot environment to create the root
    406     # password, edit several files and setup Grub.
    407404    case $this_script in
    408       *usage)   continue  ;; # Contains example commands
    409       *grub)    continue  ;;
    410       *console) continue  ;; # Use the file generated by lfs-bootscripts
    411       *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab
     405      *grub)     continue  ;; # Grub must be configured manually.
     406      *console)  continue  ;; # Use the file generated by lfs-bootscripts
     407      *fstab)    [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab
    412408        ;;
    413       *kernel)  # If no .config file is supplied, the kernel build is skipped
    414                 [[ -z $CONFIG ]] && continue
    415                 cp $CONFIG $BUILDDIR/sources/kernel-config
     409      *kernel)   # If no .config file is supplied, the kernel build is skipped
     410                 [[ -z $CONFIG ]] && continue
     411                 cp $CONFIG $BUILDDIR/sources/kernel-config
    416412        ;;
    417413    esac
     
    431427    case "${this_script}" in
    432428      *bootscripts*)
     429        if [ "${INSTALL_LOG}" = "y" ] ; then
     430          CHROOT_wrt_TouchTimestamp
     431        fi
    433432        CHROOT_Unpack $(get_package_tarball_name "lfs-bootscripts")
    434433        blfs_bootscripts=$(get_package_tarball_name "blfs-bootscripts" | sed -e 's/.tar.*//' )
    435434        echo -e "\t@echo \"\$(MOUNT_PT)\$(SRC)/$blfs_bootscripts\" >> sources-dir" >> $MKFILE.tmp
     435        ;;
     436      *kernel)
     437        name="linux"
     438        pkg_tarball=$(get_package_tarball_name $name)
     439        if [ "${INSTALL_LOG}" = "y" ] ; then
     440          CHROOT_wrt_TouchTimestamp
     441        fi
     442        CHROOT_Unpack "$pkg_tarball"
    436443        ;;
    437444    esac
     
    457464        @ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
    458465        rm -r \$(SRC)/\$\$ROOT
    459         @rm -r \`cat sources-dir\` && \\
     466        @rm -rf \`cat sources-dir\` && \\
    460467        rm sources-dir
    461468EOF
    462469) >> $MKFILE.tmp
     470          if [ "${INSTALL_LOG}" = "y" ] ; then
     471            CHROOT_wrt_LogNewFiles "$name"
     472          fi
    463473       ;;
     474      *kernel)       CHROOT_wrt_RemoveBuildDirs "dummy"
     475                     if [ "${INSTALL_LOG}" = "y" ] ; then
     476                       CHROOT_wrt_LogNewFiles "$name"
     477                     fi ;;
    464478    esac
    465479
     
    492506  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
    493507  chapter7_Makefiles
     508  # Add the CUSTOM_TOOLS targets, if needed
     509  [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
     510  # Add the BLFS_TOOL targets, if needed
     511  [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
    494512
    495513  # Add a header, some variables and include the function file
    496514  # to the top of the real Makefile.
    497 (
    498     cat << EOF
    499 $HEADER
    500 
    501 SRC          = /sources
    502 MOUNT_PT     = $BUILDDIR
    503 PKG_LST      = $PKG_LST
    504 LUSER        = $LUSER
    505 LGROUP       = $LGROUP
    506 SCRIPT_ROOT  = $SCRIPT_ROOT
    507 
    508 BASEDIR      = \$(MOUNT_PT)
    509 SRCSDIR      = \$(BASEDIR)/sources
    510 CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
    511 LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
    512 TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
    513 
    514 crSRCSDIR    = /sources
    515 crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
    516 crLOGDIR     = /\$(SCRIPT_ROOT)/logs
    517 crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
    518 
    519 SU_LUSER     = su - \$(LUSER) -c
    520 LUSER_HOME   = /home/\$(LUSER)
    521 PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
    522 PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
    523 
    524 export PATH := \${PATH}:/usr/sbin
    525 
    526 include makefile-functions
    527 
    528 EOF
    529 ) > $MKFILE
    530 
     515  wrt_Makefile_header
    531516
    532517  # Add chroot commands
     
    536521    chroot=`cat $file | \
    537522            sed -e "s@chroot@$CHROOT_LOC@" \
    538                 -e '/#!\/bin\/sh/d' \
     523                -e '/#!\/bin\/bash/d' \
    539524                -e '/^export/d' \
    540525                -e '/^logout/d' \
     
    546531                -e 's|$| -c|' \
    547532                -e 's|"$$HLFS"|$(MOUNT_PT)|'\
    548                 -e 's|set -e||'`
     533                -e 's|set -e||' \
     534                -e 's|set +h||'`
    549535    echo -e "CHROOT$i= $chroot\n" >> $MKFILE
    550536    i=`expr $i + 1`
     
    556542  cat << EOF
    557543
    558 all:    ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report
     544all:    ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
    559545        @sudo make do-housekeeping
     546        @echo "$VERSION - jhalfs build" > hlfs-release && \\
     547        sudo install -m444 hlfs-release \$(MOUNT_PT)/etc/hlfs-release
    560548        @\$(call echo_finished,$VERSION)
    561549
     
    570558mk_SETUP:
    571559        @\$(call echo_SU_request)
    572         @sudo make SETUP
     560        @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
    573561        @touch \$@
    574562
    575563mk_LUSER: mk_SETUP
    576564        @\$(call echo_SULUSER_request)
    577         @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
     565        @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) LUSER" )
    578566        @sudo make restore-luser-env
    579567        @touch \$@
     
    584572
    585573mk_CHROOT: mk_SUDO
    586         @if [ ! -e \$(MOUNT_PT)/bin ]; then \\
    587           mkdir \$(MOUNT_PT)/bin; \\
    588           cd \$(MOUNT_PT)/bin && \\
    589           ln -sf /tools/bin/bash bash; ln -sf bash sh; \\
    590           sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
    591         fi;
    592         @sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chapter06/064-createfiles
     574        @if [ ! -e \$(MOUNT_PT)/dev ]; then \\
     575          mkdir \$(MOUNT_PT)/dev && \\
     576          sudo mknod -m 666 \$(MOUNT_PT)/dev/null c 1 3 && \\
     577          sudo mknod -m 600 \$(MOUNT_PT)/dev/console c 5 1 && \\
     578          sudo chown -R 0:0 \$(MOUNT_PT)/dev; \\
     579        fi;
    593580        @\$(call echo_CHROOT_request)
    594         @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT")
     581        @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT")
    595582        @touch \$@
    596583
    597584mk_BOOT: mk_CHROOT
    598585        @\$(call echo_CHROOT_request)
    599         @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
     586        @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
    600587        @touch \$@
    601588
    602 
    603 SETUP:  $chapter3
    604 
    605 LUSER:  $chapter5
    606 
    607 SUDO:   060-kernfs 062-changingowner
    608 
    609 CHROOT: $chapter6
    610 
    611 BOOT:   $chapter7
    612 
     589mk_CUSTOM_TOOLS: create-sbu_du-report
     590        @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
     591          \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
     592          sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
     593          (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
     594        fi;
     595        @touch \$@
     596
     597mk_BLFS_TOOL: mk_CUSTOM_TOOLS
     598        @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
     599          \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
     600          sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
     601          (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"); \\
     602        fi;
     603        @touch \$@
     604
     605
     606SETUP:        $chapter3
     607LUSER:        $chapter5
     608SUDO:         $runasroot
     609CHROOT:       SHELL=/tools/bin/bash
     610CHROOT:       $chapter6
     611BOOT:         $chapter7
     612CUSTOM_TOOLS: $custom_list
     613BLFS_TOOL:    $blfs_tool
     614
     615
     616create-sbu_du-report:  mk_BOOT
     617        @\$(call echo_message, Building)
     618        @if [ "\$(ADD_REPORT)" = "y" ]; then \\
     619          ./create-sbu_du-report.sh logs $VERSION; \\
     620          \$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
     621        fi;
     622        @touch  \$@
    613623
    614624restore-luser-env:
    615625        @\$(call echo_message, Building)
    616         @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
    617                 mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
    618         fi;
    619         @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
    620                 mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
    621         fi;
    622         @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
     626        @if [ -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
     627                mv -f \$(LUSER_HOME)/.bashrc.XXX \$(LUSER_HOME)/.bashrc; \\
     628        fi;
     629        @if [ -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
     630                mv \$(LUSER_HOME)/.bash_profile.XXX \$(LUSER_HOME)/.bash_profile; \\
     631        fi;
     632        @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bash* && \\
    623633        touch \$@ && \\
    624634        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    634644        @-if [ ! -f luser-exist ]; then \\
    635645                userdel \$(LUSER); \\
    636                 rm -rf /home/\$(LUSER); \\
     646                rm -rf \$(LUSER_HOME); \\
    637647        fi;
    638648
     
    641651EOF
    642652) >> $MKFILE
    643 
    644   # Add SBU-disk_usage report target
    645   echo "create-sbu_du-report:" >> $MKFILE
    646   if [[ "$REPORT" = "y" ]] ; then
    647 (
    648     cat << EOF
    649         @\$(call echo_message, Building)
    650         @./create-sbu_du-report.sh logs $VERSION
    651         @\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
    652         @touch  \$@
    653 
    654 
    655 EOF
    656 ) >> $MKFILE
    657   else echo -e "\t@true\n\n" >> $MKFILE; fi
    658653
    659654  # Bring over the items from the Makefile.tmp
Note: See TracChangeset for help on using the changeset viewer.