source: contrib/jhalfs-paco.patch@ d3b8635

1.0 2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since d3b8635 was 8230977, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Updated paco patch.
Upstream fixes plus removal of BLFS support.

  • Property mode set to 100644
File size: 17.6 KB
  • LFS/master.sh

     
    173173    # Keep the script file name
    174174    this_script=`basename $file`
    175175
     176    # If $this_script corresponds to a paco script, then skip it
     177    case "${this_script}" in
     178      *paco)       continue ;;
     179    esac
     180
    176181    # We'll run the chroot commands differently than the others, so skip them in the
    177182    # dependencies and target creation.
    178183    case "${this_script}" in
     
    180185      *stripping*) [[ "${STRIP}" = "0" ]] && continue ;;
    181186    esac
    182187
     188    # Install paco as the first package in ch6, before installing
     189    # linux-libc-headers, except in iterartive builds
     190    if [[ -z "$N" ]]; then
     191      case $this_script in
     192        *linux-libc-headers)
     193          TMP_SCRIPT="$this_script"
     194          this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'`
     195          wrt_paco_inst "$this_script"
     196          this_script="$TMP_SCRIPT" ;;
     197      esac
     198    fi
     199
    183200    # Grab the name of the target
    184201    name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
    185202
     
    223240    # and not to use chroot.
    224241    case "${this_script}" in
    225242      *kernfs)  wrt_run_as_root    "${this_script}" "$file" ;;
    226       *)        wrt_run_as_chroot1 "${this_script}" "$file" ;;
     243      *)        wrt_paco_prep
     244                wrt_run_as_chroot1 "${this_script}" "$file"
     245                wrt_paco_log "$name" "$vrs" ;;
    227246    esac
    228247
    229248    # Remove the build directory(ies) except if the package build fails.
     
    243262    PREV=${this_script}${N}
    244263    # Set system_build envar for iteration targets
    245264    system_build=$chapter6
     265
     266    # Reinstalling paco after readsjusting the toolchain.
     267    case "${this_script}" in
     268      *readjusting)
     269        TMP_SCRIPT="$this_script"
     270        this_script=`echo ${this_script} | sed -e 's/readjusting/x-paco/'`
     271        wrt_paco_inst "$this_script"
     272        this_script="$TMP_SCRIPT" ;;
     273    esac
     274
    246275  done # end for file in chapter06/*
    247276}
    248277
     
    304333                wrt_run_as_chroot2 "$this_script" "$file"
    305334              fi
    306335        ;;
     336      *kernel)       wrt_paco_prep
     337                     wrt_run_as_chroot2 "$this_script" "$file"
     338                     wrt_paco_log "linux-kernel" "$vrs"
     339        ;;
     340      *bootscripts)  wrt_paco_prep
     341                     wrt_run_as_chroot2 "$this_script" "$file"
     342                     wrt_paco_log "lfs-bootscripts" "$vrs"
     343        ;;
    307344      *)        wrt_run_as_chroot2 "$this_script" "$file"
    308345        ;;
    309346    esac
  • LFS/lfs.xsl

     
    3232  <!-- Locale settings -->
    3333  <xsl:param name="lang" select="en_CA"/>
    3434
     35  <!-- Use paco? -->
     36  <xsl:param name="use_paco" select="1"/>
     37
    3538  <xsl:template match="/">
    3639    <xsl:apply-templates select="//sect1"/>
    3740  </xsl:template>
     
    190193        <xsl:apply-templates/>
    191194        <xsl:text> || true&#xA;</xsl:text>
    192195      </xsl:when>
     196      <!-- paco begin -->
     197      <!-- General rule -->
     198      <xsl:when test="$use_paco != '0' and
     199                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     200                contains(string(),'make') and
     201                contains(string(),'install')">
     202        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     203        <xsl:apply-templates/>
     204        <xsl:text>&#xA;</xsl:text>
     205      </xsl:when>
     206      <!-- Linux-libc-headers -->
     207      <xsl:when test="$use_paco != '0' and
     208                ancestor::sect1[@id='ch-system-linux-libc-headers'] and
     209                contains(string(),'install ')">
     210        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     211        <xsl:apply-templates/>
     212        <xsl:text>&#xA;</xsl:text>
     213      </xsl:when>
     214      <!-- Unset LD_PRELOAD before second make in Zlib -->
     215      <xsl:when test="$use_paco != '0' and
     216                ancestor::sect1[@id='ch-system-zlib'] and
     217                contains(string(),'make clean')">
     218        <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
     219        <xsl:apply-templates/>
     220        <xsl:text>&#xA;</xsl:text>
     221      </xsl:when>
     222      <!-- paco end -->
    193223      <!-- The rest of commands -->
    194224      <xsl:otherwise>
    195225        <xsl:apply-templates/>
  • common/paco-build-hlfs.sh

     
     1#!/bin/sh
     2set -e
     3
     4cd $PKGDIR
     5./configure --with-pic \
     6        --disable-static \
     7        --disable-gpaco \
     8        --sysconfdir=/etc &&
     9make &&
     10make install &&
     11make logme
  • common/config

     
    8484#--- Run farce testing 0(no)/1(yes)
    8585RUN_FARCE=0
    8686
     87#==== PACO VARIABLES ====
     88#--- Use paco? 0(no)/1(yes)
     89USE_PACO=1
     90PACO_VERSION=1.10.7
     91
     92#--- Name of the Paco source package
     93PACO_FILE=paco-$PACO_VERSION.tar.*
     94
    8795#==== INTERNAL VARIABLES ====
    8896# Don't edit it unless you know what you are doing
    8997
     
    96104
    97105#--- farce report log directory
    98106FARCELOGDIR=$LOGDIR/farce
     107
     108#--- Variables needed by paco
     109PACO_INCLUDE=/
     110PACO_EXCLUDE=/sys:/dev:/proc:/tmp:/usr/src:/usr/share/info/dir:/jhalfs
     111PACO_TMPFILE=/tmp/paco.tmp
     112LD_PRELOAD=/usr/lib/libpaco-log.so
  • common/func_validate_configs.sh

     
    8484inline_doc
    8585
    8686  # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
    87   local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG KEYMAP         PAGE TIMEZONE LANG LC_ALL"
    88   local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD  ARCH  TARGET  TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
    89   local -r  lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                       TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG        VIMLANG PAGE TIMEZONE LANG"
     87  local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG KEYMAP         PAGE TIMEZONE LANG LC_ALL"
     88  local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE METHOD  ARCH  TARGET  TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
     89  local -r  lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE                       TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG        VIMLANG PAGE TIMEZONE LANG"
    9090
    9191  local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
    9292  local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
     
    173173      # Validate general parameters..
    174174      GETPKG)     validate_against_str "x0x x1x" ;;
    175175      RUNMAKE)    validate_against_str "x0x x1x" ;;
     176      USE_PACO)   validate_against_str "x0x x1x" ;;
    176177      REPORT)     validate_against_str "x0x x1x"
    177178                  if [[ "${!config_param}" = "1" ]]; then
    178179                    if [[ `type -p bc` ]]; then
  • common/paco-functions

     
     1#!/bin/bash
     2
     3
     4#----------------------------#
     5wrt_paco_inst() {            #
     6#----------------------------#
     7
     8# Not using Paco with uClibc, even if requested
     9if [ $PROGNAME = "hlfs" ]; then
     10  if [ $MODEL = "uclibc" ]; then
     11    USE_PACO=0
     12  fi
     13fi
     14
     15if [ $USE_PACO != 0 ]; then
     16  paco_script="$1"
     17  paco_file="chapter06/$paco_script"
     18  chapter6="$chapter6 $paco_script"
     19
     20  # Copy the paco build script to the correct directory and make it executable
     21  cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
     22  chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
     23
     24  # Write target, dependency and unpack
     25  wrt_target "$paco_script" "$PREV"
     26  wrt_unpack2 "$PACO_FILE"
     27
     28  # Run the script
     29  wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
     30
     31  # Clean up
     32  wrt_remove_build_dirs "paco"
     33  echo -e '\t@touch $@' >> $MKFILE.tmp
     34
     35  # Override the PREV variable
     36  PREV="$paco_script"
     37fi
     38}
     39
     40
     41#----------------------------------#
     42wrt_paco_prep() {                  # Export Paco variables
     43#----------------------------------# and remove tmpfile
     44
     45# Not using Paco with uClibc, even if requested
     46if [ $PROGNAME = "hlfs" ]; then
     47  if [ $MODEL = "uclibc" ]; then
     48    USE_PACO=0
     49  fi
     50fi
     51
     52if [ $USE_PACO != 0 ] && [ "$vrs" != "" ]; then
     53(
     54cat  << EOF
     55        @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
     56        echo "export PACO_EXCLUDE=\$(SRC):$JHALFSDIR:$PACO_EXCLUDE" >> envars && \\
     57        echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
     58        rm -f \$(MOUNT_PT)$PACO_TMPFILE
     59EOF
     60) >> $MKFILE.tmp
     61fi
     62}
     63
     64
     65#----------------------------------#
     66wrt_paco_log() {                   # If the tmpfile exist, then log the current package
     67#----------------------------------# and remove tempfile
     68local PACKAGE
     69
     70# Allow packages to be logged without version
     71if [[ $2 != "" ]] ; then
     72  PACKAGE="$1-$2";
     73else
     74  PACKAGE="$1"
     75fi
     76
     77# Not using Paco with uClibc, even if requested
     78if [ $PROGNAME = "hlfs" ]; then
     79  if [ $MODEL = "uclibc" ]; then
     80    USE_PACO=0
     81  fi
     82fi
     83
     84if [ $USE_PACO != 0 ] && [ "$vrs" != "" ]; then
     85(
     86cat << EOF
     87        @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
     88                \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\
     89                rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
     90        fi;
     91EOF
     92) >> $MKFILE.tmp
     93fi
     94
     95# Glibc uses 'sln' to install symlinks in /lib
     96# add these to the log since paco can't track statically linked executables
     97# Glibc is the first package to install into /lib, so a simple 'find' will suffice
     98if [ $USE_PACO != 0 ] && [ "$name" = "glibc" ]; then
     99(
     100cat << EOF
     101        @\$(CHROOT1) 'find /lib -type l | paco -lp+ $PACKAGE'
     102EOF
     103) >> $MKFILE.tmp
     104fi
     105}
  • common/paco-build-lfs.sh

     
     1#!/bin/sh
     2set -e
     3
     4cd $PKGDIR
     5./configure --disable-gpaco \
     6        --sysconfdir=/etc &&
     7make &&
     8make install &&
     9make logme
  • common/common-functions

     
    6565        in the configuration file has the proper packages and patches for the
    6666        book version being processed.
    6767
     68${BOLD}  --no-paco${OFF}
     69        dissables paco logging feature.
     70
    6871${BOLD}  -O, --optimize${OFF}
    6972        Optimize [0-2]
    7073          0 = no optimization
     
    556559                 --stringparam lc_all $LC_ALL \
    557560                 --stringparam keymap $KEYMAP \
    558561                 --stringparam grsecurity_host $GRSECURITY_HOST \
     562                 --stringparam use_paco $USE_PACO \
    559563                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    560564      ;;
    561565    lfs)
     
    567571                 --stringparam timezone $TIMEZONE \
    568572                 --stringparam page $PAGE \
    569573                 --stringparam lang $LANG \
     574                 --stringparam use_paco $USE_PACO \
    570575                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    571576      ;;
    572577    *) exit 1 ;;
  • HLFS/hlfs.xsl

     
    3939  <xsl:param name="lang" select="en_CA"/>
    4040  <xsl:param name="lc_all" select="en_CA"/>
    4141
     42  <!-- Use paco? -->
     43  <xsl:param name="use_paco" select="1"/>
     44
    4245  <xsl:template match="/">
    4346    <xsl:apply-templates select="//sect1"/>
    4447  </xsl:template>
     
    191194      <!-- Fixing bootscripts installation -->
    192195      <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
    193196                string() = 'make install'">
     197        <!-- inserting LD_PRELOAD before installing bootscripts -->
     198        <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
     199          <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     200        </xsl:if>
    194201        <xsl:text>make install&#xA;</xsl:text>
    195202        <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
    196203      </xsl:when>
     
    248255        <xsl:apply-templates/>
    249256        <xsl:text> || true&#xA;</xsl:text>
    250257      </xsl:when>
     258      <!-- paco begin -->
     259      <!-- General rule -->
     260      <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
     261                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     262                contains(string(),'make') and
     263                contains(string(),'install')">
     264        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     265        <xsl:apply-templates/>
     266        <xsl:text>&#xA;</xsl:text>
     267      </xsl:when>
     268      <!-- Linux-libc-headers -->
     269      <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
     270                ancestor::sect1[@id='ch-system-linux-libc-headers'] and
     271                contains(string(),'install ')">
     272        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     273        <xsl:apply-templates/>
     274        <xsl:text>&#xA;</xsl:text>
     275      </xsl:when>
     276      <!-- paco end -->
    251277      <!-- The rest of commands -->
    252278      <xsl:otherwise>
    253279        <xsl:apply-templates/>
  • HLFS/master.sh

     
    245245    # Keep the script file name
    246246    this_script=`basename $file`
    247247
     248    # If this script is *-paco, then skip it
     249    case $this_script in
     250      *paco )     continue ;;
     251    esac
     252
    248253    # Skip this script depending on jhalfs.conf flags set.
    249254    case $this_script in
    250255        # We'll run the chroot commands differently than the others, so skip them in the
     
    254259      *-stripping* )  [[ "$STRIP" = "0" ]] && continue ;;
    255260    esac
    256261
     262    # Install paco as the first package in ch6, before installing
     263    # linux-libc-headers, except in iterartive builds
     264    if [[ -z "$N" ]]; then
     265      case $this_script in
     266        *linux-libc-headers)
     267          TMP_SCRIPT="$this_script"
     268          this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'`
     269          wrt_paco_inst "$this_script"
     270          this_script="$TMP_SCRIPT" ;;
     271      esac
     272    fi
     273
    257274    # Grab the name of the target
    258275    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    259276
     
    324341        wrt_run_as_root "${this_script}" "${file}"
    325342        ;;
    326343      *)   # The rest of Chapter06
     344        wrt_paco_prep
    327345        wrt_run_as_chroot1 "${this_script}" "${file}"
     346        wrt_paco_log "$name" "$vrs"
    328347       ;;
    329348    esac
    330349    #
     
    357376    PREV=${this_script}${N}
    358377    # Set system_build envar for iteration targets
    359378    system_build=$chapter6
     379
     380    # Reinstall paco after the toolchain has been readjusted.
     381    case "${this_script}" in
     382      *readjusting)
     383        TMP_SCRIPT="$this_script"
     384        this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
     385        wrt_paco_inst "$this_script"
     386        this_script="$TMP_SCRIPT" ;;
     387    esac
     388
    360389  done # end for file in chapter06/*
    361390
    362391}
     
    419448          wrt_run_as_chroot2 "${this_script}" "${file}"
    420449        fi
    421450        ;;
     451      *kernel)       wrt_paco_prep
     452                     wrt_run_as_chroot2 "$this_script" "$file"
     453                     version=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     454                     wrt_paco_log "linux-kernel" "$version"
     455        ;;
     456      *bootscripts)  wrt_paco_prep
     457                     wrt_run_as_chroot2 "$this_script" "$file"
     458                     wrt_paco_log "hlfs-bootscripts"
     459        ;;
    422460      *)  # All other scripts
    423461        wrt_run_as_chroot2 "${this_script}" "${file}"
    424462        ;;
  • master.sh

     
    147147
    148148    --help | -h )  usage | more && exit  ;;
    149149
     150    --no-paco )            USE_PACO=0    ;;
     151
    150152    --optimize | -O )
    151153      test $# = 1 && eval "$exit_missing_arg"
    152154      shift
     
    438440  [[ $VERBOSITY > 0 ]] && echo "OK"
    439441fi
    440442#
     443# paco module
     444if [[ "$USE_PACO" = "1" ]]; then
     445  [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
     446  source $COMMON_DIR/paco-functions
     447  [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
     448  [[ $VERBOSITY > 0 ]] && echo "OK"
     449fi
     450#
    441451# optimize module
    442452if [[ "$OPTIMIZE" != "0" ]]; then
    443453  [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
     
    482492#
    483493if [[ "$PWD" != "$JHALFSDIR" ]]; then
    484494  cp $COMMON_DIR/makefile-functions $JHALFSDIR/
     495  #
     496  [[ $USE_PACO != "0" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
     497  #
    485498  [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
     499  #
    486500  if [[ "$COMPARE" != "0" ]] ; then
    487501    mkdir -p $JHALFSDIR/extras
    488502    cp extras/* $JHALFSDIR/extras
Note: See TracBrowser for help on using the repository browser.