Changeset 3da8c49 for LFS


Ignore:
Timestamp:
06/14/2020 07:08:19 AM (4 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
cce9c16
Parents:
b33c6ee
Message:

Update ICA for new LFS/master.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LFS/master.sh

    rb33c6ee r3da8c49  
    1818  printf -v dir chapter%02d $1
    1919
    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
    2347    # Keep the script file name
    2448    this_script=`basename $file`
    2549
    2650    # Some scripts need peculiar actions:
    27     # - glibc chap 5: ix locales creation when running chapter05 testsuites
     51    # - glibc chap 5: fix locales creation when running chapter05 testsuites
    2852    # - Stripping at the end of system build: lfs.xsl does not generate
    2953    #   correct commands if the user does not want to strip, so skip it
    3054    #   in this case
     55    # - do not reinstall linux-headers when rebuilding
    3156    # - grub config: must be done manually; skip it
    3257    # - handle fstab and .config. Skip kernel if .config not supplied
     
    3560                       sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
    3661      *strippingagain) [[ "${STRIP}" = "n" ]] && continue ;;
     62      *linux-headers*) [[ -n "$N" ]] && continue ;;
    3763      8*grub)          (( nb_chaps == 5 )) && continue ;;
    3864      10*grub)         continue ;;
     
    4470                       cp ${CONFIG} $BUILDDIR/sources/kernel-config  ;;
    4571    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
    4690
    4791    # Append the name of the script to a list. The name of the
     
    58102    eval $Makefile_target=\"\$$Makefile_target ${this_script}\"
    59103
    60     # Grab the name of the target
    61     name=`echo ${this_script} | sed -e 's@[0-9]\{3,4\}-@@' \
    62                                     -e 's@-pass[0-9]\{1\}@@' \
    63                                     -e 's@-libstdc++@@'`
    64 
    65104    #--------------------------------------------------------------------#
    66105    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
    67106    #--------------------------------------------------------------------#
    68     #
    69     # Find the name of the tarball and the version of the package
    70     pkg_tarball=$(sed -n 's/tar -xf \(.*\)/\1/p' $file)
    71     pkg_version=$(sed -n 's/VERSION=\(.*\)/\1/p' $file)
    72107
    73108    # Drop in the name of the target on a new line, and the previous target
     
    81116    if [ "$pkg_tarball" != "" ] ; then
    82117      # 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
    85122        CHROOT_wrt_TouchTimestamp
    86123      fi
     
    153190    # except if the package build fails.
    154191    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
    156195        CHROOT_wrt_LogNewFiles "$name"
    157196      fi
     
    168207    # Keep the script file name for Makefile dependencies.
    169208    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
    170214  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
    171220}
    172221
     
    535584      [[ "$SAVE_CH5" = "y" ]] && wrt_save_target $Makefile_target
    536585    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
    539590  done
    540591  # Add the CUSTOM_TOOLS targets, if needed
Note: See TracChangeset for help on using the changeset viewer.