Changeset 65a2be6
- Timestamp:
- 07/27/2006 09:37:57 PM (18 years ago)
- Branches:
- experimental
- Children:
- 21dab83
- Parents:
- f2382aa
- Files:
-
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Config.in
rf2382aa r65a2be6 42 42 43 43 config BRANCH_ID 44 string "Branch (mand itory)"44 string "Branch (mandatory)" 45 45 default "**EDIT ME**" 46 46 depends BRANCH … … 50 50 51 51 config BOOK 52 string "Loc of working copy (mand itory)"52 string "Loc of working copy (mandatory)" 53 53 default "**EDIT ME**" 54 54 depends WORKING_COPY … … 198 198 199 199 config BOOT_CONFIG 200 string "BOOT kernel config file (mand itory)"200 string "BOOT kernel config file (mandatory)" 201 201 default "" 202 202 depends on BUILD_BOOT -
HLFS/hlfs.xsl
rf2382aa r65a2be6 95 95 </xsl:choose> 96 96 <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'))"> 100 98 <xsl:text>cd $PKGDIR
</xsl:text> 101 99 <xsl:if test="@id='ch-tools-uclibc' or @id='ch-system-uclibc'"> … … 117 115 <xsl:text>pushd ../; tar -xvf blfs-bootscripts-&blfs-bootscripts-version;.* ; popd; 
</xsl:text> 118 116 </xsl:if> 119 </xsl:if>120 <xsl:if test="@id='ch-system-kernfs'">121 <xsl:text>export HLFS=$LFS
</xsl:text>122 117 </xsl:if> 123 118 <xsl:apply-templates select=".//para/userinput | .//screen"/> … … 127 122 </xsl:template> 128 123 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 129 130 <xsl:template match="screen"> 130 131 <xsl:if test="(@condition=$model or not(@condition)) and -
HLFS/master.sh
rf2382aa r65a2be6 8 8 ################################### 9 9 10 #----------------------------------# 11 wrt_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 ( 18 cat << 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 21 EOF 22 ) >> $MKFILE.tmp 23 } 24 25 26 #----------------------------------# 27 wrt_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 ( 37 cat << 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 42 EOF 43 ) >> $MKFILE.tmp 44 } 45 46 #----------------------------# 47 process_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 ( 62 cat << EOF 63 @echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars 64 EOF 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 ( 83 cat << EOF 84 @rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\ 85 rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build 86 EOF 87 ) >> $MKFILE.tmp 88 ;; 89 butterfly ) # system phase 90 ( 91 cat << EOF 92 @rm -r \$(SRC)/butterfly-toolchain && \\ 93 rm -r \$(SRC)/butterfly-build 94 EOF 95 ) >> $MKFILE.tmp 96 ;; 97 esac 98 99 } 100 10 101 11 102 #----------------------------# 12 103 chapter3_Makefiles() { # Initialization of the system 13 104 #----------------------------# 14 local TARGET LOADER15 105 16 106 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}" 17 107 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 28 112 # of their bash init files is made. 29 113 ( … … 44 128 021-addinguser: 020-creatingtoolsdir 45 129 @\$(call echo_message, Building) 46 @if [ ! -d /home/ lfs ]; then \\47 groupadd lfs; \\48 useradd -s /bin/bash -g lfs -m -k /dev/nulllfs; \\130 @if [ ! -d /home/hlfs ]; then \\ 131 groupadd hlfs; \\ 132 useradd -s /bin/bash -g hlfs -m -k /dev/null hlfs; \\ 49 133 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 && \\ 54 138 touch \$@ && \\ 55 139 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ … … 58 142 022-settingenvironment: 021-addinguser 59 143 @\$(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 && \\ 78 159 touch envars && \\ 79 160 touch \$@ && \\ … … 116 197 # Grab the name of the target (minus the -headers or -cross in the case of gcc 117 198 # 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\}-@@' ` 119 200 120 201 # Adjust 'name' 121 202 case $name in 122 linux-libc) name="linux-libc-headers" ;;123 gcc) name="gcc-core" ;;124 203 uclibc) name="uClibc" ;; 125 204 esac … … 134 213 # Drop in the name of the target on a new line, and the previous target 135 214 # 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 # 136 227 wrt_target "$this_script" "$PREV" 137 138 228 # Find the version of the command files, if it corresponds with the building of 139 229 # a specific package … … 142 232 if [ "$pkg_tarball" != "" ] ; then 143 233 # 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" 148 235 # If the testsuites must be run, initialize the log file 149 236 [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}" … … 151 238 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" 152 239 fi 153 154 case $this_script in155 *binutils* ) # Dump the path to sources directory for later removal156 (157 cat << EOF158 @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\159 echo "\$(MOUNT_PT)\$(SRC)/\$\$ROOT" >> sources-dir160 EOF161 ) >> $MKFILE.tmp162 ;;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.tmp165 ;;166 esac167 168 240 # Insert date and disk usage at the top of the log file, the script run 169 241 # 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}" 171 243 172 244 # Remove the build directory(ies) except if the package build fails … … 174 246 # For Binutils the sources must be retained for some time. 175 247 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" 181 249 fi 182 183 # Remove the Binutils pass 1 sources after a successful Adjusting phase.184 case "${this_script}" in185 *adjusting*)186 (187 cat << EOF188 @rm -r \`cat sources-dir\` && \\189 rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\190 rm sources-dir191 EOF192 ) >> $MKFILE.tmp193 ;;194 esac195 250 196 251 # Include a touch of the target name so make can check if it's already been made. … … 210 265 chapter6_Makefiles() { # sysroot or chroot build phase 211 266 #----------------------------# 212 local TARGET LOADER213 267 local file 214 268 local this_script … … 238 292 239 293 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}" 240 #241 # Set these definitions early and only once242 #243 if [[ ${MODEL} = "uclibc" ]]; then244 TARGET="pc-linux-uclibc"; LOADER="ld-uClibc.so.0"245 else246 TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"247 fi248 294 249 295 for file in chapter06$N/* ; do … … 269 315 case $name in 270 316 glibc) sed 's/rm /rm -f /' -i chapter06$N/$this_script ;; 271 gcc) sed 's/rm /rm -f /' -i chapter06$N/$this_script ;;272 317 esac 273 318 274 319 case $name in 275 gcc) name="gcc-core" ;;276 320 uclibc) name="uClibc" ;; 277 321 esac … … 302 346 # 303 347 # 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 305 357 wrt_target "${this_script}${N}" "$PREV" 306 358 … … 309 361 if [ "$pkg_tarball" != "" ] ; then 310 362 wrt_unpack2 "$pkg_tarball" 311 wrt_target_vars312 363 # If the testsuites must be run, initialize the log file 313 364 case $name in 314 binutils | gcc-core |glibc )365 glibc ) 315 366 [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}" 316 367 ;; … … 323 374 fi 324 375 325 case $this_script in326 *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.tmp328 ;;329 esac330 331 376 # In the mount of kernel filesystems we need to set LFS and not to use chroot. 332 377 case "${this_script}" in … … 344 389 fi 345 390 # 346 # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.347 case "${this_script}" in348 *readjusting*)349 (350 cat << EOF351 @rm -r \`cat sources-dir\` && \\352 rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\353 rm sources-dir354 EOF355 ) >> $MKFILE.tmp356 ;;357 esac358 359 391 # Include a touch of the target name so make can check if it's already been made. 360 392 wrt_touch … … 520 552 chapter3: 020-creatingtoolsdir 021-addinguser 022-settingenvironment 521 553 522 chapter5: chapter3 $chapter5 restore- lfs-env554 chapter5: chapter3 $chapter5 restore-hlfs-env 523 555 524 556 chapter6: chapter5 $chapter6 … … 534 566 535 567 clean-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; \\ 539 571 fi; 540 572 rm -rf \$(MOUNT_PT)/tools 541 573 rm -f /tools 542 rm -f envars user- lfs-exist574 rm -f envars user-hlfs-exist 543 575 rm -f 02* logs/02*.log 544 576 545 577 clean-chapter5: 546 578 rm -rf \$(MOUNT_PT)/tools/* 547 rm -f $chapter5 restore- lfs-env sources-dir579 rm -f $chapter5 restore-hlfs-env sources-dir 548 580 cd logs && rm -f $chapter5 && cd .. 549 581 … … 562 594 cd logs && rm -f $chapter7 && cd .. 563 595 564 restore- lfs-env:596 restore-hlfs-env: 565 597 @\$(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* && \\ 573 605 touch \$@ && \\ 574 606 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ … … 581 613 @-umount \$(MOUNT_PT)/sys 582 614 @-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; \\ 586 618 fi; 587 619 -
Makefile
rf2382aa r65a2be6 1 1 # 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> 3 4 4 5 TOPDIR=$(shell pwd)
Note:
See TracChangeset
for help on using the changeset viewer.