Changeset d81c640


Ignore:
Timestamp:
07/30/2006 10:17:29 AM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
ccc7c2b
Parents:
cb39f79
Message:

Ported the new HLFS code from experimental branch.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • HLFS/hlfs.xsl

    rcb39f79 rd81c640  
    2727       1 = only chapter06 Glibc, GCC and Binutils testsuites
    2828       2 = all chapter06 testsuites
    29        3 = all chapter05 and chapter06 testsuites-->
     29       3 = alias to 2 -->
    3030  <xsl:param name="testsuite" select="1"/>
    3131
     
    9595        </xsl:choose>
    9696        <xsl:if test="(sect2[@role='installation'] and
    97                      not(@id='bootable-kernel')) or
    98                      @id='ch-tools-adjusting' or
    99                      @id='ch-system-readjusting'">
     97                           not(@id='bootable-kernel'))">
    10098          <xsl:text>cd $PKGDIR&#xA;</xsl:text>
    10199          <xsl:if test="@id='ch-tools-uclibc' or @id='ch-system-uclibc'">
    102100             <xsl:text>pushd ../; tar -xvf gettext-&gettext-version;.*; popd; &#xA;</xsl:text>
    103101          </xsl:if>
    104           <xsl:if test="@id='ch-tools-glibc' or @id='ch-system-glibc'">
    105              <xsl:text>tar -xvf ../glibc-libidn-&glibc-version;.*&#xA;</xsl:text>
    106           </xsl:if>
    107           <xsl:if test="@id='ch-tools-gcc' or @id='ch-system-gcc'">
    108              <xsl:text>pushd ../; tar -xvf gcc-g++-&gcc-version;.*; popd; &#xA;</xsl:text>
    109           </xsl:if>
    110           <xsl:if test="@id='ch-tools-gcc' and $testsuite = '3'">
    111             <xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; &#xA;</xsl:text>
    112           </xsl:if>
    113           <xsl:if test="@id='ch-system-gcc' and $testsuite != '0'">
    114             <xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; &#xA;</xsl:text>
    115           </xsl:if>
     102
     103          <!-- NEW toolchain format, from inside ./sources dir unpack binutils and gcc -->
     104          <xsl:if test="@id='ch-tools-embryo-toolchain' or
     105                        @id='ch-tools-cocoon-toolchain' or
     106                        @id='ch-system-butterfly-toolchain'">
     107             <xsl:text>tar -xvf gcc-core-&gcc-version;.*; &#xA;</xsl:text>
     108             <xsl:text>tar -xvf gcc-g++-&gcc-version;.*; &#xA;</xsl:text>
     109             <xsl:text>tar -xvf binutils-&binutils-version;.*; &#xA;</xsl:text>
     110          </xsl:if>
     111          <!-- ONLY butterfly has a testsuite -->
     112          <xsl:if test="@id='ch-tools-butterfly-toolchain' and $testsuite != '0'">
     113            <xsl:text>tar -xvf gcc-testsuite-&gcc-version;.*; &#xA;</xsl:text>
     114          </xsl:if>
     115          <!-- END new toolchain format -->
     116
    116117          <xsl:if test="@id='bootable-bootscripts'">
    117118             <xsl:text>pushd ../; tar -xvf blfs-bootscripts-&blfs-bootscripts-version;.* ; popd; &#xA;</xsl:text>
    118119          </xsl:if>
    119         </xsl:if>
    120         <xsl:if test="@id='ch-system-kernfs'">
    121           <xsl:text>export HLFS=$LFS&#xA;</xsl:text>
    122120        </xsl:if>
    123121        <xsl:apply-templates select=".//para/userinput | .//screen"/>
     
    136134  <xsl:template match="para/userinput">
    137135    <xsl:if test="(contains(string(),'test') or
    138             contains(string(),'check')) and
    139             (($testsuite = '1' and
    140             (ancestor::sect1[@id='ch-system-gcc'] or
    141             ancestor::sect1[@id='ch-system-glibc'])) or
    142             ($testsuite = '2' and
    143             ancestor::chapter[@id='chapter-building-system']) or
    144             $testsuite = '3')">
    145       <xsl:choose>
    146         <xsl:when test="ancestor::sect1[@id='ch-system-gcc']">
    147           <xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
    148         </xsl:when>
    149         <xsl:otherwise>
    150           <xsl:value-of select="substring-before(string(),'make')"/>
    151           <xsl:text>make -k</xsl:text>
    152           <xsl:value-of select="substring-after(string(),'make')"/>
    153           <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
    154         </xsl:otherwise>
    155       </xsl:choose>
     136                  contains(string(),'check')) and
     137                  ($testsuite = '2' or $testsuite = '3')">
     138      <xsl:value-of select="substring-before(string(),'make')"/>
     139      <xsl:text>make -k</xsl:text>
     140      <xsl:value-of select="substring-after(string(),'make')"/>
     141      <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
    156142    </xsl:if>
    157143  </xsl:template>
     
    228214        </xsl:choose>
    229215      </xsl:when>
    230       <!-- Fixing toolchain test suites run -->
    231       <xsl:when test="string() = 'make check' or
    232                 string() = 'make -k check'">
    233         <xsl:choose>
    234           <xsl:when test="(($testsuite = '1' or $testsuite = '2') and
    235                     ancestor::chapter[@id='chapter-building-system']) or
    236                     $testsuite = '3'">
     216      <!-- Fixing butterfly toolchain test suites run -->
     217      <xsl:when test="string() = 'make -k check'">
     218        <xsl:choose>
     219          <xsl:when test="$testsuite != '0'">
    237220            <xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
    238221          </xsl:when>
    239222        </xsl:choose>
    240223      </xsl:when>
    241       <xsl:when test="contains(string(),'make check') and
    242                 ancestor::sect1[@id='ch-system-binutils']">
     224      <!-- Fixing Glbc test suite  -->
     225      <xsl:when test="contains(string(),'glibc-check-log')">
    243226        <xsl:choose>
    244227          <xsl:when test="$testsuite != '0'">
    245             <xsl:value-of select="substring-before(string(),'make check')"/>
    246             <xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
    247           </xsl:when>
    248         </xsl:choose>
    249       </xsl:when>
    250       <xsl:when test="contains(string(),'hardened-specs') and
    251                 ancestor::sect1[@id='ch-system-binutils']
    252                 and $testsuite = '0'"/>
     228            <xsl:value-of select="substring-before(string(),'&gt; glibc-')"/>
     229            <xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
     230          </xsl:when>
     231        </xsl:choose>
     232      </xsl:when>
    253233      <!-- Don't stop on strip run and chapter05 GCC installation test-->
    254234      <xsl:when test="contains(string(),'strip ') or
     
    266246  </xsl:template>
    267247
     248  <xsl:template match="literal">
     249    <xsl:if test="@condition=$model or not(@condition)">
     250      <xsl:apply-templates/>
     251    </xsl:if>
     252  </xsl:template>
     253
    268254  <xsl:template match="replaceable">
    269255    <xsl:choose>
  • HLFS/master.sh

    rcb39f79 rd81c640  
    88###################################
    99
     10#----------------------------------#
     11wrt_ExecuteAsUser() {              # Execute the file ($3) under the users account ($1), log in $2
     12#----------------------------------#
     13  local this_user=$1
     14  local this_script=$2
     15  local file=$3
     16
     17(
     18cat << EOF
     19        @( time { su - ${this_user} -c "source /home/${this_user}/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
     20        echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
     21EOF
     22) >> $MKFILE.tmp
     23}
     24
     25
     26#----------------------------------#
     27wrt_Unpack_SetOwner() {            # Unpack and set owner. Assign 'ROOT' var
     28#----------------------------------#
     29  local USER_ACCT=$1
     30  local FILE=$2
     31  local optSAVE_PREVIOUS=$3
     32
     33  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
     34    wrt_remove_existing_dirs "$FILE"
     35  fi
     36(
     37cat << EOF
     38        @\$(call unpack,$FILE)
     39        @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
     40        echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\
     41        chown -R ${USER_ACCT} \$(MOUNT_PT)\$(SRC)/\$\$ROOT
     42EOF
     43) >> $MKFILE.tmp
     44}
     45
     46#----------------------------------#
     47wrt_RunAsRoot() {                  # Some scripts must be run as root..
     48#----------------------------------#
     49  local user_ACCT=$(echo $1 | tr [a-z] [A-Z])
     50  local this_script=$2
     51  local file=$3
     52
     53(
     54cat << EOF
     55        @( time { export ${user_ACCT}=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
     56        echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
     57EOF
     58) >> $MKFILE.tmp
     59}
     60
     61
     62#----------------------------#
     63process_toolchain() {        # embryo,cocoon and butterfly need special handling
     64#----------------------------#
     65  local toolchain=$1
     66  local this_script=$2
     67  local  tc_phase
     68
     69  echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
     70
     71  case ${toolchain} in
     72    *butterfly*)
     73      [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     74(
     75cat << EOF
     76        @echo "export PKGDIR=\$(SRC)" > envars
     77EOF
     78) >> $MKFILE.tmp
     79      wrt_run_as_chroot1 "$toolchain" "$this_script"
     80      ;;
     81
     82    *)
     83(
     84cat << EOF
     85        @echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
     86EOF
     87) >> $MKFILE.tmp
     88      wrt_ExecuteAsUser "hlfs" "$toolchain" "$this_script"
     89      ;;
     90  esac
     91  #
     92  # Safe method to remove packages unpacked outside the toolchain
     93  pkg_tarball=$(get_package_tarball_name "binutils")
     94  wrt_remove_existing_dirs  "$pkg_tarball"
     95  pkg_tarball=$(get_package_tarball_name "gcc-core")
     96  wrt_remove_existing_dirs  "$pkg_tarball"
     97  #
     98  # Manually remove the toolchain directories..
     99  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@'`
     100(
     101cat << EOF
     102        @rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
     103        rm  -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
     104EOF
     105) >> $MKFILE.tmp
     106
     107}
     108
    10109
    11110#----------------------------#
    12111chapter3_Makefiles() {       # Initialization of the system
    13112#----------------------------#
    14   local TARGET LOADER
    15113
    16114  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}"
     
    18116  # Define a few model dependant variables
    19117  if [[ ${MODEL} = "uclibc" ]]; then
    20     TARGET="tools-linux-uclibc"; LOADER="ld-uClibc.so.0"
     118    TARGET="pc-linux-gnu"; LOADER="ld-uClibc.so.0"
    21119  else
    22     TARGET="tools-linux-gnu";    LOADER="ld-linux.so.2"
     120    TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
    23121  fi
    24122
    25   # NOTE: We use the lfs username and groupname also in HLFS
    26   # If /home/lfs is already present in the host, we asume that the
    27   # lfs user and group are also presents in the host, and a backup
     123  # If /home/hlfs is already present in the host, we asume that the
     124  # hlfs user and group are also presents in the host, and a backup
    28125  # of their bash init files is made.
    29126(
     
    44141021-addinguser:  020-creatingtoolsdir
    45142        @\$(call echo_message, Building)
    46         @if [ ! -d /home/lfs ]; then \\
    47                 groupadd lfs; \\
    48                 useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
     143        @if [ ! -d /home/hlfs ]; then \\
     144                groupadd hlfs; \\
     145                useradd -s /bin/bash -g hlfs -m -k /dev/null hlfs; \\
    49146        else \\
    50                 touch user-lfs-exist; \\
    51         fi;
    52         @chown lfs \$(MOUNT_PT)/tools && \\
    53         chown lfs \$(MOUNT_PT)/sources && \\
     147                touch user-hlfs-exist; \\
     148        fi;
     149        @chown hlfs \$(MOUNT_PT)/tools && \\
     150        chown hlfs \$(MOUNT_PT)/sources && \\
    54151        touch \$@ && \\
    55152        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    58155022-settingenvironment:  021-addinguser
    59156        @\$(call echo_message, Building)
    60         @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
    61                 mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
    62         fi;
    63         @if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
    64                 mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
    65         fi;
    66         @echo "set +h" > /home/lfs/.bashrc && \\
    67         echo "umask 022" >> /home/lfs/.bashrc && \\
    68         echo "HLFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
    69         echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
    70         echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
    71         echo "export HLFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
    72         echo "" >> /home/lfs/.bashrc && \\
     157        @if [ -f /home/hlfs/.bashrc -a ! -f /home/hlfs/.bashrc.XXX ]; then \\
     158                mv /home/hlfs/.bashrc /home/hlfs/.bashrc.XXX; \\
     159        fi;
     160        @if [ -f /home/hlfs/.bash_profile  -a ! -f /home/hlfs/.bash_profile.XXX ]; then \\
     161                mv /home/hlfs/.bash_profile /home/hlfs/.bash_profile.XXX; \\
     162        fi;
     163        @echo "set +h" > /home/hlfs/.bashrc && \\
     164        echo "umask 022" >> /home/hlfs/.bashrc && \\
     165        echo "HLFS=\$(MOUNT_PT)" >> /home/hlfs/.bashrc && \\
     166        echo "LC_ALL=POSIX" >> /home/hlfs/.bashrc && \\
     167        echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/hlfs/.bashrc && \\
     168        echo "export HLFS LC_ALL PATH" >> /home/hlfs/.bashrc && \\
     169        echo "" >> /home/hlfs/.bashrc && \\
    73170        echo "target=$(uname -m)-${TARGET}" >> /home/lfs/.bashrc && \\
    74171        echo "ldso=/tools/lib/${LOADER}" >> /home/lfs/.bashrc && \\
    75172        echo "export target ldso" >> /home/lfs/.bashrc && \\
    76         echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
    77         chown lfs:lfs /home/lfs/.bashrc && \\
     173        echo "source $JHALFSDIR/envars" >> /home/hlfs/.bashrc && \\
     174        chown hlfs:hlfs /home/hlfs/.bashrc && \\
    78175        touch envars && \\
    79176        touch \$@ && \\
     
    114211    chapter5="$chapter5 $this_script"
    115212
    116     # Grab the name of the target (minus the -headers or -cross in the case of gcc
    117     # and binutils in chapter 5)
    118     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-cross@@' -e 's@-headers@@'`
     213    # Grab the name of the target
     214    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    119215
    120216    # Adjust 'name'
    121217    case $name in
    122       linux-libc) name="linux-libc-headers" ;;
    123       gcc)        name="gcc-core"  ;;
    124218      uclibc)     name="uClibc"  ;;
    125219    esac
     
    134228    # Drop in the name of the target on a new line, and the previous target
    135229    # as a dependency. Also call the echo_message function.
     230
     231    # This is a very special script and requires manual processing
     232    # NO Optimization allowed
     233    if [[ ${name} = "embryo-toolchain" ]] || \
     234       [[ ${name} = "cocoon-toolchain" ]]; then
     235       wrt_target "$this_script" "$PREV"
     236         process_toolchain "${this_script}" "${file}"
     237       wrt_touch
     238       PREV=$this_script
     239       continue
     240    fi
     241    #
    136242    wrt_target "$this_script" "$PREV"
    137 
    138243    # Find the version of the command files, if it corresponds with the building of
    139244    # a specific package
     
    142247    if [ "$pkg_tarball" != "" ] ; then
    143248      # Insert instructions for unpacking the package and to set the PKGDIR variable.
    144       case $this_script in
    145         *binutils* )  wrt_unpack "$pkg_tarball" 1 ;; # Do not delete an existing package directories
    146         *)            wrt_unpack "$pkg_tarball" ;;
    147       esac
     249      wrt_Unpack_SetOwner "hlfs" "$pkg_tarball"
    148250      # If the testsuites must be run, initialize the log file
    149251      [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
     
    151253      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    152254    fi
    153 
    154     case $this_script in
    155       *binutils* )  # Dump the path to sources directory for later removal
    156 (
    157 cat << EOF
    158         @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
    159         echo "\$(MOUNT_PT)\$(SRC)/\$\$ROOT" >> sources-dir
    160 EOF
    161 ) >> $MKFILE.tmp
    162         ;;
    163       *adjusting* )  # For the Adjusting phase we must to cd to the binutils-build directory.
    164         echo -e '\t@echo "export PKGDIR=$(MOUNT_PT)$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
    165         ;;
    166     esac
    167 
    168255    # Insert date and disk usage at the top of the log file, the script run
    169256    # and date and disk usage again at the bottom of the log file.
    170     wrt_run_as_su "${this_script}" "${file}"
     257    wrt_ExecuteAsUser "hlfs" "$this_script" "${file}"
    171258
    172259    # Remove the build directory(ies) except if the package build fails
    173260    # (so we can review config.cache, config.log, etc.)
    174     # For Binutils the sources must be retained for some time.
    175261    if [ "$pkg_tarball" != "" ] ; then
    176       case "${this_script}" in
    177         *binutils*) : ;;   # do NOTHING
    178         *gcc*) wrt_remove_build_dirs "gcc"    ;;
    179         *)     wrt_remove_build_dirs "$name"    ;;
    180       esac
     262       wrt_remove_build_dirs "$name"
    181263    fi
    182 
    183     # Remove the Binutils pass 1 sources after a successful Adjusting phase.
    184     case "${this_script}" in
    185      *adjusting*)
    186 (
    187 cat << EOF
    188         @rm -r \`cat sources-dir\` && \\
    189         rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\
    190         rm sources-dir
    191 EOF
    192 ) >> $MKFILE.tmp
    193       ;;
    194     esac
    195264
    196265    # Include a touch of the target name so make can check if it's already been made.
     
    210279chapter6_Makefiles() {       # sysroot or chroot build phase
    211280#----------------------------#
    212   local TARGET LOADER
    213281  local file
    214282  local this_script
     
    238306
    239307  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
    240   #
    241   # Set these definitions early and only once
    242   #
    243   if [[ ${MODEL} = "uclibc" ]]; then
    244     TARGET="pc-linux-uclibc"; LOADER="ld-uClibc.so.0"
    245   else
    246     TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
    247   fi
    248308
    249309  for file in chapter06$N/* ; do
     
    263323    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    264324
    265     #
    266     # Sed replacement to fix some rm command that could fail.
    267     # That should be fixed in the book sources.
    268     #
    269325    case $name in
    270       glibc)  sed 's/rm /rm -f /' -i chapter06$N/$this_script        ;;
    271       gcc)    sed 's/rm /rm -f /' -i chapter06$N/$this_script        ;;
    272     esac
    273 
    274     case $name in
    275       gcc)     name="gcc-core" ;;
    276326      uclibc)  name="uClibc"   ;;
    277327    esac
     
    302352    #
    303353    # Drop in the name of the target on a new line, and the previous target
    304     # as a dependency. Also call the echo_message function.             
     354    # as a dependency. Also call the echo_message function.
     355    if [[ ${name} = "butterfly-toolchain" ]]; then
     356       wrt_target "$this_script" "$PREV"
     357         process_toolchain "${this_script}" "${file}"
     358       wrt_touch
     359       PREV=$this_script
     360       continue
     361    fi
     362
    305363    wrt_target "${this_script}${N}" "$PREV"
    306364
     
    309367    if [ "$pkg_tarball" != "" ] ; then
    310368      wrt_unpack2 "$pkg_tarball"
    311       wrt_target_vars
    312369      # If the testsuites must be run, initialize the log file
    313370      case $name in
    314         binutils | gcc-core | glibc )
     371        glibc )
    315372          [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
    316373          ;;
     
    323380    fi
    324381
    325     case $this_script in
    326       *readjusting*) # For the Re-Adjusting phase we must to cd to the binutils-build directory.
    327         echo -e '\t@echo "export PKGDIR=$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
    328         ;;
    329     esac
    330 
    331     # In the mount of kernel filesystems we need to set LFS and not to use chroot.
     382    # In the mount of kernel filesystems we need to set HLFS and not to use chroot.
    332383    case "${this_script}" in
    333384      *kernfs*)
    334         wrt_run_as_root "${this_script}" "${file}"
     385        wrt_RunAsRoot "hlfs" "${this_script}" "${file}"
    335386        ;;
    336387      *)   # The rest of Chapter06
     
    344395    fi
    345396    #
    346     # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.
    347     case "${this_script}" in
    348       *readjusting*)
    349 (
    350 cat << EOF
    351         @rm -r \`cat sources-dir\` && \\
    352         rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\
    353         rm sources-dir
    354 EOF
    355 ) >> $MKFILE.tmp
    356       ;;
    357     esac
    358 
    359397    # Include a touch of the target name so make can check if it's already been made.
    360398    wrt_touch
     
    390428      *usage)   continue  ;; # Contains example commands
    391429      *grub)    continue  ;;
    392       *reboot)  continue  ;;
    393430      *console) continue  ;; # Use the file generated by lfs-bootscripts
    394431
     
    520557chapter3:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
    521558
    522 chapter5:  chapter3 $chapter5 restore-lfs-env
     559chapter5:  chapter3 $chapter5 restore-hlfs-env
    523560
    524561chapter6:  chapter5 $chapter6
     
    534571
    535572clean-chapter3:
    536         -if [ ! -f user-lfs-exist ]; then \\
    537                 userdel lfs; \\
    538                 rm -rf /home/lfs; \\
     573        -if [ ! -f user-hlfs-exist ]; then \\
     574                userdel hlfs; \\
     575                rm -rf /home/hlfs; \\
    539576        fi;
    540577        rm -rf \$(MOUNT_PT)/tools
    541578        rm -f /tools
    542         rm -f envars user-lfs-exist
     579        rm -f envars user-hlfs-exist
    543580        rm -f 02* logs/02*.log
    544581
    545582clean-chapter5:
    546583        rm -rf \$(MOUNT_PT)/tools/*
    547         rm -f $chapter5 restore-lfs-env sources-dir
     584        rm -f $chapter5 restore-hlfs-env sources-dir
    548585        cd logs && rm -f $chapter5 && cd ..
    549586
     
    562599        cd logs && rm -f $chapter7 && cd ..
    563600
    564 restore-lfs-env:
     601restore-hlfs-env:
    565602        @\$(call echo_message, Building)
    566         @if [ -f /home/lfs/.bashrc.XXX ]; then \\
    567                 mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
    568         fi;
    569         @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
    570                 mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
    571         fi;
    572         @chown lfs:lfs /home/lfs/.bash* && \\
     603        @if [ -f /home/hlfs/.bashrc.XXX ]; then \\
     604                mv -f /home/hlfs/.bashrc.XXX /home/hlfs/.bashrc; \\
     605        fi;
     606        @if [ -f /home/hlfs/.bash_profile.XXX ]; then \\
     607                mv /home/hlfs/.bash_profile.XXX /home/hlfs/.bash_profile; \\
     608        fi;
     609        @chown hlfs:hlfs /home/hlfs/.bash* && \\
    573610        touch \$@ && \\
    574611        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    581618        @-umount \$(MOUNT_PT)/sys
    582619        @-umount \$(MOUNT_PT)/proc
    583         @-if [ ! -f user-lfs-exist ]; then \\
    584                 userdel lfs; \\
    585                 rm -rf /home/lfs; \\
     620        @-if [ ! -f user-hlfs-exist ]; then \\
     621                userdel hlfs; \\
     622                rm -rf /home/hlfs; \\
    586623        fi;
    587624
    588625restart_code:
    589         @echo ">>> This feature is experimental, BUGS may exist"       
    590        
     626        @echo ">>> This feature is experimental, BUGS may exist"
     627
    591628        @if [ ! -L /tools ]; then \\
    592629          echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\
    593630        fi;
    594        
     631
    595632        @if [ ! -e /tools ]; then \\
    596633          echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\
    597634        fi;
    598        
     635
    599636        @if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\
    600637          echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\
    601         fi;     
     638        fi;
    602639
    603640        @if [ -f ???-kernfs ]; then \\
  • common/common-functions

    rcb39f79 rd81c640  
    8383          2 = all final system testsuites
    8484          3 = all temporary tools and final system testsuites
    85         In CLFS, 3 is an alias to 2
     85        In CLFS and HLFS, 3 is an alias to 2
    8686
    8787${BOLD}  -W, --working-copy DIR${OFF}
  • common/config

    rcb39f79 rd81c640  
    1717
    1818#=== Getting packages ===
    19 #    Files will be retrieved from the local archive SRC_ARCHIVE 
     19#    Files will be retrieved from the local archive SRC_ARCHIVE
    2020#    (if defined) or the 'net and will be stored in $BUILDDIR/sources
    2121#--- Download the source packages 0(no)/1(yes)
     
    4949#  2 = all chapter06 testsuites
    5050#  3 = all chapter05 and chapter06 testsuites
    51 #      (in CLFS, alias to 2)
     51#      (in CLFS and HLFS, alias to 2)
    5252TEST=1
    5353
Note: See TracChangeset for help on using the changeset viewer.