Changeset 65a2be6


Ignore:
Timestamp:
07/27/2006 09:37:57 PM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
experimental
Children:
21dab83
Parents:
f2382aa
Message:

Changes to Config.in. Adapt ./HLFS/master.sh to the latest svn (major changes in book

Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • Config.in

    rf2382aa r65a2be6  
    4242
    4343        config  BRANCH_ID
    44                 string  "Branch (manditory)"
     44                string  "Branch (mandatory)"
    4545                default "**EDIT ME**"
    4646                depends BRANCH
     
    5050
    5151        config  BOOK
    52                 string  "Loc of working copy (manditory)"
     52                string  "Loc of working copy (mandatory)"
    5353                default "**EDIT ME**"
    5454                depends WORKING_COPY
     
    198198               
    199199        config  BOOT_CONFIG
    200                 string  "BOOT kernel config file (manditory)"
     200                string  "BOOT kernel config file (mandatory)"
    201201                default ""
    202202                depends on BUILD_BOOT
  • HLFS/hlfs.xsl

    rf2382aa r65a2be6  
    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'">
     
    117115             <xsl:text>pushd ../; tar -xvf blfs-bootscripts-&blfs-bootscripts-version;.* ; popd; &#xA;</xsl:text>
    118116          </xsl:if>
    119         </xsl:if>
    120         <xsl:if test="@id='ch-system-kernfs'">
    121           <xsl:text>export HLFS=$LFS&#xA;</xsl:text>
    122117        </xsl:if>
    123118        <xsl:apply-templates select=".//para/userinput | .//screen"/>
     
    127122  </xsl:template>
    128123
     124  <xsl:template match="literal">
     125    <xsl:if test="@condition=$model or not(@condition)">
     126      <xsl:apply-templates/>
     127    </xsl:if>
     128  </xsl:template>
     129 
    129130  <xsl:template match="screen">
    130131    <xsl:if test="(@condition=$model or not(@condition)) and
  • HLFS/master.sh

    rf2382aa r65a2be6  
    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#----------------------------#
     47process_toolchain() {        # embryo,cocoon and butterfly need special handling
     48#----------------------------#
     49  local toolchain=$1
     50  local this_script=$2
     51  local  tc_phase
     52
     53  echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
     54
     55  pkg_tarball=$(get_package_tarball_name "binutils")
     56  wrt_Unpack_SetOwner "hlfs" "$pkg_tarball" 1
     57  pkg_tarball=$(get_package_tarball_name "gcc-core")
     58  wrt_Unpack_SetOwner "hlfs" "$pkg_tarball" 1
     59  pkg_tarball=$(get_package_tarball_name "gcc-g++")
     60  wrt_Unpack_SetOwner "hlfs" "$pkg_tarball" 1
     61(
     62cat << EOF
     63        @echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
     64EOF
     65) >> $MKFILE.tmp
     66  if [[ ${toolchain} = "butterfly-toolchain" ]]; then
     67    [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     68    wrt_run_as_chroot1 "$toolchain" "$this_script"
     69  else
     70    wrt_ExecuteAsUser "hlfs" "$toolchain" "$this_script"
     71  fi
     72
     73  pkg_tarball=$(get_package_tarball_name "binutils")
     74  wrt_remove_existing_dirs  "$pkg_tarball"
     75  pkg_tarball=$(get_package_tarball_name "gcc-core")
     76  wrt_remove_existing_dirs  "$pkg_tarball"
     77
     78  # Manually remove the toolchain directories..
     79  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@'`
     80  case $tc_phase in
     81    embryo | cocoon)  # toolchain phase
     82(
     83cat << EOF
     84        @rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
     85        rm  -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
     86EOF
     87) >> $MKFILE.tmp
     88    ;;   
     89    butterfly ) # system phase
     90(
     91cat << EOF
     92        @rm -r \$(SRC)/butterfly-toolchain && \\
     93        rm -r \$(SRC)/butterfly-build
     94EOF
     95) >> $MKFILE.tmp
     96    ;;
     97  esac
     98
     99}
     100
    10101
    11102#----------------------------#
    12103chapter3_Makefiles() {       # Initialization of the system
    13104#----------------------------#
    14   local TARGET LOADER
    15105
    16106  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}"
    17107
    18   # Define a few model dependant variables
    19   if [[ ${MODEL} = "uclibc" ]]; then
    20     TARGET="tools-linux-uclibc"; LOADER="ld-uClibc.so.0"
    21   else
    22     TARGET="tools-linux-gnu";    LOADER="ld-linux.so.2"
    23   fi
    24 
    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
     108
     109  # NOTE: We use the hlfs username and groupname also in HLFS
     110  # If /home/hlfs is already present in the host, we asume that the
     111  # hlfs user and group are also presents in the host, and a backup
    28112  # of their bash init files is made.
    29113(
     
    44128021-addinguser:  020-creatingtoolsdir
    45129        @\$(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; \\
     130        @if [ ! -d /home/hlfs ]; then \\
     131                groupadd hlfs; \\
     132                useradd -s /bin/bash -g hlfs -m -k /dev/null hlfs; \\
    49133        else \\
    50                 touch user-lfs-exist; \\
    51         fi;
    52         @chown lfs \$(MOUNT_PT)/tools && \\
    53         chown lfs \$(MOUNT_PT)/sources && \\
     134                touch user-hlfs-exist; \\
     135        fi;
     136        @chown hlfs \$(MOUNT_PT)/tools && \\
     137        chown hlfs \$(MOUNT_PT)/sources && \\
    54138        touch \$@ && \\
    55139        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    58142022-settingenvironment:  021-addinguser
    59143        @\$(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 && \\
    73         echo "target=$(uname -m)-${TARGET}" >> /home/lfs/.bashrc && \\
    74         echo "ldso=/tools/lib/${LOADER}" >> /home/lfs/.bashrc && \\
    75         echo "export target ldso" >> /home/lfs/.bashrc && \\
    76         echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
    77         chown lfs:lfs /home/lfs/.bashrc && \\
     144        @if [ -f /home/hlfs/.bashrc -a ! -f /home/hlfs/.bashrc.XXX ]; then \\
     145                mv /home/hlfs/.bashrc /home/hlfs/.bashrc.XXX; \\
     146        fi;
     147        @if [ -f /home/hlfs/.bash_profile  -a ! -f /home/hlfs/.bash_profile.XXX ]; then \\
     148                mv /home/hlfs/.bash_profile /home/hlfs/.bash_profile.XXX; \\
     149        fi;
     150        @echo "set +h" > /home/hlfs/.bashrc && \\
     151        echo "umask 022" >> /home/hlfs/.bashrc && \\
     152        echo "HLFS=\$(MOUNT_PT)" >> /home/hlfs/.bashrc && \\
     153        echo "LC_ALL=POSIX" >> /home/hlfs/.bashrc && \\
     154        echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/hlfs/.bashrc && \\
     155        echo "export HLFS LC_ALL PATH" >> /home/hlfs/.bashrc && \\
     156        echo "" >> /home/hlfs/.bashrc && \\
     157        echo "source $JHALFSDIR/envars" >> /home/hlfs/.bashrc && \\
     158        chown hlfs:hlfs /home/hlfs/.bashrc && \\
    78159        touch envars && \\
    79160        touch \$@ && \\
     
    116197    # Grab the name of the target (minus the -headers or -cross in the case of gcc
    117198    # and binutils in chapter 5)
    118     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-cross@@' -e 's@-headers@@'`
     199    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' `
    119200
    120201    # Adjust 'name'
    121202    case $name in
    122       linux-libc) name="linux-libc-headers" ;;
    123       gcc)        name="gcc-core"  ;;
    124203      uclibc)     name="uClibc"  ;;
    125204    esac
     
    134213    # Drop in the name of the target on a new line, and the previous target
    135214    # as a dependency. Also call the echo_message function.
     215   
     216    # This is a very special script and requires manual processing
     217    # NO Optimization allowed
     218    if [[ ${name} = "embryo-toolchain" ]] || \
     219       [[ ${name} = "cocoon-toolchain" ]]; then
     220       wrt_target "$this_script" "$PREV"
     221         process_toolchain "${this_script}" "${file}"
     222       wrt_touch
     223       PREV=$this_script
     224       continue
     225    fi
     226    #
    136227    wrt_target "$this_script" "$PREV"
    137 
    138228    # Find the version of the command files, if it corresponds with the building of
    139229    # a specific package
     
    142232    if [ "$pkg_tarball" != "" ] ; then
    143233      # 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
     234      wrt_Unpack_SetOwner "hlfs" "$pkg_tarball"
    148235      # If the testsuites must be run, initialize the log file
    149236      [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
     
    151238      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    152239    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 
    168240    # Insert date and disk usage at the top of the log file, the script run
    169241    # and date and disk usage again at the bottom of the log file.
    170     wrt_run_as_su "${this_script}" "${file}"
     242    wrt_ExecuteAsUser "hlfs" "$this_script" "${file}"
    171243
    172244    # Remove the build directory(ies) except if the package build fails
     
    174246    # For Binutils the sources must be retained for some time.
    175247    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
     248       wrt_remove_build_dirs "$name"
    181249    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
    195250
    196251    # Include a touch of the target name so make can check if it's already been made.
     
    210265chapter6_Makefiles() {       # sysroot or chroot build phase
    211266#----------------------------#
    212   local TARGET LOADER
    213267  local file
    214268  local this_script
     
    238292
    239293  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
    248294
    249295  for file in chapter06$N/* ; do
     
    269315    case $name in
    270316      glibc)  sed 's/rm /rm -f /' -i chapter06$N/$this_script        ;;
    271       gcc)    sed 's/rm /rm -f /' -i chapter06$N/$this_script        ;;
    272317    esac
    273318
    274319    case $name in
    275       gcc)     name="gcc-core" ;;
    276320      uclibc)  name="uClibc"   ;;
    277321    esac
     
    302346    #
    303347    # 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.             
     348    # as a dependency. Also call the echo_message function.
     349    if [[ ${name} = "butterfly-toolchain" ]]; then
     350       wrt_target "$this_script" "$PREV"
     351         process_toolchain "${this_script}" "${file}"
     352       wrt_touch
     353       PREV=$this_script
     354       continue
     355    fi
     356
    305357    wrt_target "${this_script}${N}" "$PREV"
    306358
     
    309361    if [ "$pkg_tarball" != "" ] ; then
    310362      wrt_unpack2 "$pkg_tarball"
    311       wrt_target_vars
    312363      # If the testsuites must be run, initialize the log file
    313364      case $name in
    314         binutils | gcc-core | glibc )
     365        glibc )
    315366          [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
    316367          ;;
     
    323374    fi
    324375
    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 
    331376    # In the mount of kernel filesystems we need to set LFS and not to use chroot.
    332377    case "${this_script}" in
     
    344389    fi
    345390    #
    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 
    359391    # Include a touch of the target name so make can check if it's already been made.
    360392    wrt_touch
     
    520552chapter3:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
    521553
    522 chapter5:  chapter3 $chapter5 restore-lfs-env
     554chapter5:  chapter3 $chapter5 restore-hlfs-env
    523555
    524556chapter6:  chapter5 $chapter6
     
    534566
    535567clean-chapter3:
    536         -if [ ! -f user-lfs-exist ]; then \\
    537                 userdel lfs; \\
    538                 rm -rf /home/lfs; \\
     568        -if [ ! -f user-hlfs-exist ]; then \\
     569                userdel hlfs; \\
     570                rm -rf /home/hlfs; \\
    539571        fi;
    540572        rm -rf \$(MOUNT_PT)/tools
    541573        rm -f /tools
    542         rm -f envars user-lfs-exist
     574        rm -f envars user-hlfs-exist
    543575        rm -f 02* logs/02*.log
    544576
    545577clean-chapter5:
    546578        rm -rf \$(MOUNT_PT)/tools/*
    547         rm -f $chapter5 restore-lfs-env sources-dir
     579        rm -f $chapter5 restore-hlfs-env sources-dir
    548580        cd logs && rm -f $chapter5 && cd ..
    549581
     
    562594        cd logs && rm -f $chapter7 && cd ..
    563595
    564 restore-lfs-env:
     596restore-hlfs-env:
    565597        @\$(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* && \\
     598        @if [ -f /home/hlfs/.bashrc.XXX ]; then \\
     599                mv -f /home/hlfs/.bashrc.XXX /home/hlfs/.bashrc; \\
     600        fi;
     601        @if [ -f /home/hlfs/.bash_profile.XXX ]; then \\
     602                mv /home/hlfs/.bash_profile.XXX /home/hlfs/.bash_profile; \\
     603        fi;
     604        @chown hlfs:hlfs /home/hlfs/.bash* && \\
    573605        touch \$@ && \\
    574606        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    581613        @-umount \$(MOUNT_PT)/sys
    582614        @-umount \$(MOUNT_PT)/proc
    583         @-if [ ! -f user-lfs-exist ]; then \\
    584                 userdel lfs; \\
    585                 rm -rf /home/lfs; \\
     615        @-if [ ! -f user-hlfs-exist ]; then \\
     616                userdel hlfs; \\
     617                rm -rf /home/hlfs; \\
    586618        fi;
    587619
  • Makefile

    rf2382aa r65a2be6  
    11# From the Build Scripts Written By: Jim Gifford <lfs@jg555.com>
    2 # Modified By: Joe Ciccone <jciccone@linuxfromscratch.org>
     2# Modified By: Joe Ciccone <jciccone@linuxfromscratch.org
     3# Additional changes: George Boudreau <georgeb@linuxfromscratch.org>
    34
    45TOPDIR=$(shell pwd)
Note: See TracChangeset for help on using the changeset viewer.