- Timestamp:
- 06/14/2020 07:08:19 AM (4 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- cce9c16
- Parents:
- b33c6ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/master.sh
rb33c6ee r3da8c49 18 18 printf -v dir chapter%02d $1 19 19 20 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter $1${R_arrow}" 21 22 for file in $dir/* ; do 20 # $2 contains the build number if rebuilding for ICA 21 if [[ -z "$2" ]] ; then 22 local N="" 23 else 24 local N=-build_$2 25 local CHROOT_TGT="" 26 mkdir ${dir}$N 27 cp ${dir}/* ${dir}$N 28 for script in ${dir}$N/* ; do 29 # Overwrite existing symlinks, files, and dirs 30 sed -e 's/ln *-sv/&f/g' \ 31 -e 's/mv *-v/&f/g' \ 32 -e 's/mkdir *-v/&p/g' -i ${script} 33 # Rename the scripts 34 mv ${script} ${script}$N 35 done 36 # Remove Bzip2 binaries before make install (LFS-6.2 compatibility) 37 sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i ${dir}$N/*-bzip2$N 38 # Remove openssl-<version> from /usr/share/doc (LFS-9.x), because 39 # otherwise the mv command creates an openssl directory. 40 sed -e 's@mv -v@rm -rfv /usr/share/doc/openssl-*\n&@' \ 41 -i ${dir}$N/*-openssl$N 42 fi 43 44 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter $1$N${R_arrow}" 45 46 for file in ${dir}$N/* ; do 23 47 # Keep the script file name 24 48 this_script=`basename $file` 25 49 26 50 # Some scripts need peculiar actions: 27 # - glibc chap 5: ix locales creation when running chapter05 testsuites51 # - glibc chap 5: fix locales creation when running chapter05 testsuites 28 52 # - Stripping at the end of system build: lfs.xsl does not generate 29 53 # correct commands if the user does not want to strip, so skip it 30 54 # in this case 55 # - do not reinstall linux-headers when rebuilding 31 56 # - grub config: must be done manually; skip it 32 57 # - handle fstab and .config. Skip kernel if .config not supplied … … 35 60 sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;; 36 61 *strippingagain) [[ "${STRIP}" = "n" ]] && continue ;; 62 *linux-headers*) [[ -n "$N" ]] && continue ;; 37 63 8*grub) (( nb_chaps == 5 )) && continue ;; 38 64 10*grub) continue ;; … … 44 70 cp ${CONFIG} $BUILDDIR/sources/kernel-config ;; 45 71 esac 72 # Grab the name of the target 73 name=`echo ${this_script} | sed -e 's@[0-9]\{3,4\}-@@' \ 74 -e 's@-pass[0-9]\{1\}@@' \ 75 -e 's@-libstdc++@@' \ 76 -e 's,'$N',,'` 77 78 # Find the name of the tarball and the version of the package 79 # If it doesn't exist, we skip it in iterations rebuilds (except stripping 80 # and revisedchroot, where .a and .la files are removed). 81 pkg_tarball=$(sed -n 's/tar -xf \(.*\)/\1/p' $file) 82 pkg_version=$(sed -n 's/VERSION=\(.*\)/\1/p' $file) 83 84 if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then 85 case "${this_script}" in 86 *stripping*|*revised*) ;; 87 *) continue ;; 88 esac 89 fi 46 90 47 91 # Append the name of the script to a list. The name of the … … 58 102 eval $Makefile_target=\"\$$Makefile_target ${this_script}\" 59 103 60 # Grab the name of the target61 name=`echo ${this_script} | sed -e 's@[0-9]\{3,4\}-@@' \62 -e 's@-pass[0-9]\{1\}@@' \63 -e 's@-libstdc++@@'`64 65 104 #--------------------------------------------------------------------# 66 105 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< # 67 106 #--------------------------------------------------------------------# 68 #69 # Find the name of the tarball and the version of the package70 pkg_tarball=$(sed -n 's/tar -xf \(.*\)/\1/p' $file)71 pkg_version=$(sed -n 's/VERSION=\(.*\)/\1/p' $file)72 107 73 108 # Drop in the name of the target on a new line, and the previous target … … 81 116 if [ "$pkg_tarball" != "" ] ; then 82 117 # Touch timestamp file if installed files logs shall be created. 83 # But only for the final install chapter 84 if [ "${INSTALL_LOG}" = "y" ] && (( 1+nb_chaps <= $1 )) ; then 118 # But only for the final install chapter and not when rebuilding it 119 if [ "${INSTALL_LOG}" = "y" ] && 120 (( 1+nb_chaps <= $1 )) && 121 [ "x$N" = x ] ; then 85 122 CHROOT_wrt_TouchTimestamp 86 123 fi … … 153 190 # except if the package build fails. 154 191 if [ "$pkg_tarball" != "" ] ; then 155 if [ "${INSTALL_LOG}" = "y" ] && (( 1+nb_chaps <= $1 )) ; then 192 if [ "${INSTALL_LOG}" = "y" ] && 193 (( 1+nb_chaps <= $1 )) && 194 [ "x${N}" = "x" ] ; then 156 195 CHROOT_wrt_LogNewFiles "$name" 157 196 fi … … 168 207 # Keep the script file name for Makefile dependencies. 169 208 PREV=${this_script} 209 # Set "system_build" var for iteration targets 210 if [ -z "$N" ] && (( 1+nb_chaps == $1 )); then 211 system_build="$system_build $this_script" 212 fi 213 170 214 done # end for file in $dir/* 215 # Set "system_build" when rebuilding: note the CHROOT_TGT is local 216 # in that case. 217 if [ -n "$N" ]; then 218 system_build="$CHROOT_TGT" 219 fi 171 220 } 172 221 … … 535 584 [[ "$SAVE_CH5" = "y" ]] && wrt_save_target $Makefile_target 536 585 fi 537 # TODO Add the iterations targets, if needed 538 # [[ "$COMPARE" = "y" ]] && wrt_compare_targets 586 if (( i == 1+nb_chaps )); then : # we have finished final system 587 # Add the iterations targets, if needed 588 [[ "$COMPARE" = "y" ]] && wrt_compare_targets $i 589 fi 539 590 done 540 591 # Add the CUSTOM_TOOLS targets, if needed
Note:
See TracChangeset
for help on using the changeset viewer.