source: contrib/jhalfs-paco.patch@ 05ccaa9

1.0
Last change on this file since 05ccaa9 was d82b935, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Fixed the paco patch update.

  • Property mode set to 100644
File size: 24.1 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
     
    232249    # and not to use chroot.
    233250    case "${this_script}" in
    234251      *kernfs)  wrt_run_as_root    "${this_script}" "$file" ;;
    235       *)        wrt_run_as_chroot1 "${this_script}" "$file" ;;
     252      *)        wrt_paco_prep
     253                wrt_run_as_chroot1 "${this_script}" "$file"
     254                wrt_paco_log "$pkg_tarball" ;;
    236255    esac
    237256
    238257    # Remove the build directory(ies) except if the package build fails.
     
    252271    PREV=${this_script}${N}
    253272    # Set system_build envar for iteration targets
    254273    system_build=$chapter6
     274
     275    # Reinstalling paco after readsjusting the toolchain.
     276    case "${this_script}" in
     277      *readjusting)
     278        TMP_SCRIPT="$this_script"
     279        this_script=`echo ${this_script} | sed -e 's/readjusting/x-paco/'`
     280        wrt_paco_inst "$this_script"
     281        this_script="$TMP_SCRIPT" ;;
     282    esac
     283
    255284  done # end for file in chapter06/*
    256285}
    257286
     
    312341              else
    313342                wrt_run_as_chroot2 "$this_script" "$file"
    314343              fi
     344              wrt_paco_log "lfs-sysconf"
    315345        ;;
     346      *kernel)       wrt_paco_prep
     347                     wrt_run_as_chroot2 "$this_script" "$file"
     348                     wrt_paco_log "$pkg_tarball"
     349        ;;
     350      *bootscripts)  wrt_paco_prep
     351                     wrt_run_as_chroot2 "$this_script" "$file"
     352                     wrt_paco_log "$pkg_tarball"
     353        ;;
    316354      *)        wrt_run_as_chroot2 "$this_script" "$file"
     355                wrt_paco_log "lfs-sysconf"
    317356        ;;
    318357    esac
    319358
  • LFS/lfs.xsl

     
    3232  <!-- Locale settings -->
    3333  <xsl:param name="lang" select="C"/>
    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>
     
    206209        <xsl:apply-templates/>
    207210        <xsl:text> || true&#xA;</xsl:text>
    208211      </xsl:when>
     212      <!-- paco begin -->
     213      <!-- General rule -->
     214      <xsl:when test="$use_paco != '0' and
     215                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     216                contains(string(),'make') and
     217                contains(string(),'install')">
     218        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     219        <xsl:apply-templates/>
     220        <xsl:text>&#xA;</xsl:text>
     221      </xsl:when>
     222      <!-- Linux-libc-headers -->
     223      <xsl:when test="$use_paco != '0' and
     224                ancestor::sect1[@id='ch-system-linux-libc-headers'] and
     225                contains(string(),'install ')">
     226        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     227        <xsl:apply-templates/>
     228        <xsl:text>&#xA;</xsl:text>
     229      </xsl:when>
     230      <!-- Unset LD_PRELOAD before second make in Zlib -->
     231      <xsl:when test="$use_paco != '0' and
     232                ancestor::sect1[@id='ch-system-zlib'] and
     233                contains(string(),'make clean')">
     234        <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
     235        <xsl:apply-templates/>
     236        <xsl:text>&#xA;</xsl:text>
     237      </xsl:when>
     238      <!-- paco end -->
    209239      <!-- The rest of commands -->
    210240      <xsl:otherwise>
    211241        <xsl:apply-templates/>
  • common/paco-build-hlfs.sh

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

     
    8686#--- Run farce testing 0(no)/1(yes)
    8787RUN_FARCE=0
    8888
     89#==== PACO VARIABLES ====
     90#--- Use paco? 0(no)/1(yes)
     91USE_PACO=1
     92PACO_VERSION=1.10.10
     93
     94#--- Name of the Paco source package
     95PACO_FILE=paco-$PACO_VERSION.tar.bz2   # (use .tar.gz if preferred)
     96
     97#--- Sourceforge mirror to use for Paco source download
     98# Europe: heanet, belnet, puzzle, surfnet, switch, kent
     99# North America: superb-east, superb-west, umn, easynews
     100# South America: ufpr
     101# Asia: nchc, jaist
     102# Australia: optusnet
     103PACO_MIRROR1=heanet
     104PACO_MIRROR2=kent
     105
    89106#==== INTERNAL VARIABLES ====
    90107# Don't edit it unless you know what you are doing
    91108
     
    103120
    104121#--- farce report log directory
    105122FARCELOGDIR=$LOGDIR/farce
     123
     124#--- Variables needed by paco
     125PACO_INCLUDE=/
     126PACO_EXCLUDE=/${SCRIPT_ROOT}
     127PACO_TMPFILE=/tmp/paco.tmp
     128LD_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 GETKERNEL 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 GETKERNEL 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 GETKERNEL        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 GETKERNEL 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 GETKERNEL 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 GETKERNEL        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}'
     
    176176                    [[ "$GETPKG" = "1" ]] && validate_against_str "x0x x1x"
    177177                  fi ;;
    178178      RUNMAKE)    validate_against_str "x0x x1x" ;;
     179      USE_PACO)   validate_against_str "x0x x1x" ;;
    179180      REPORT)     validate_against_str "x0x x1x"
    180181                  if [[ "${!config_param}" = "1" ]]; then
    181182                    if [[ `type -p bc` ]]; then
  • common/paco-functions

     
     1#!/bin/bash
     2
     3#----------------------------#
     4wrt_paco_inst() {            #
     5#----------------------------#
     6
     7# Not using Paco with uClibc, even if requested
     8if [ $PROGNAME = "hlfs" ]; then
     9  if [ $MODEL = "uclibc" ]; then
     10    USE_PACO=0
     11  fi
     12fi
     13
     14if [ $USE_PACO != 0 ]; then
     15  paco_script="$1"
     16  paco_file="chapter06/$paco_script"
     17  chapter6="$chapter6 $paco_script"
     18
     19  # Copy the paco build script to the correct directory and make it executable
     20  cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
     21  chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
     22
     23  # Write target, dependency and unpack
     24  wrt_target "$paco_script" "$PREV"
     25  wrt_unpack2 "$PACO_FILE"
     26
     27  # Run the script
     28  wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
     29
     30  # Clean up
     31  wrt_remove_build_dirs "paco"
     32  wrt_touch
     33
     34  # Override the PREV variable
     35  PREV="$paco_script"
     36fi
     37}
     38
     39
     40#----------------------------------#
     41wrt_paco_prep() {                  # Export Paco variables
     42#----------------------------------# and remove tmpfile
     43
     44# Not using Paco with uClibc, even if requested
     45if [ $PROGNAME = "hlfs" ]; then
     46  if [ $MODEL = "uclibc" ]; then
     47    USE_PACO=0
     48  fi
     49fi
     50
     51check_log_package
     52
     53if [ $USE_PACO != 0 ] && [ $LOG_PACKAGE != 0 ]; then
     54(
     55cat  << EOF
     56        @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
     57        echo "export PACO_EXCLUDE=\$(SRC):$PACO_EXCLUDE" >> envars && \\
     58        echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
     59        rm -f \$(MOUNT_PT)$PACO_TMPFILE
     60EOF
     61) >> $MKFILE.tmp
     62fi
     63}
     64
     65
     66#----------------------------------#
     67wrt_paco_log() {                   # If the tmpfile exist, then log the current package
     68#----------------------------------# and remove tempfile
     69local PACKAGE
     70
     71PACKAGE=`echo $1 | sed -e 's/.tar.*//'`
     72
     73# Not using Paco with uClibc, even if requested
     74if [ $PROGNAME = "hlfs" ]; then
     75  if [ $MODEL = "uclibc" ]; then
     76    USE_PACO=0
     77  fi
     78fi
     79
     80check_log_package
     81
     82if [ $USE_PACO != 0 ]; then
     83  if [ $LOG_PACKAGE != 0 ]; then
     84(
     85cat << EOF
     86        @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
     87                \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\
     88                rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
     89        fi;
     90EOF
     91) >> $MKFILE.tmp
     92  fi
     93  wrt_paco_add_log
     94fi
     95}
     96
     97
     98#----------------------------------#
     99wrt_paco_add_log() {               #
     100#----------------------------------#
     101# Some packages create files using bash redirection, which the LD_PRELOAD lib don't notice
     102# These rules will add the missing files to the proper logs.
     103# Most of these is not needed for HLFS, but they do no harm.
     104if [ $USE_PACO != 0 ]; then
     105  case $this_script in
     106    *glibc)
     107      echo -e "\t@\$(CHROOT1) 'find /lib -type l | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     108      echo -e "\t@\$(CHROOT1) 'find /etc/{nsswitch.conf,ld.so.conf} | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     109    ;;
     110    *ncurses)
     111      LIBS="/usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
     112      echo -e "\t@\$(CHROOT1) 'find $LIBS | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     113    ;;
     114    *bash)
     115      echo -e "\t@\$(CHROOT1) 'echo /bin/sh | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     116    ;;
     117    *flex)
     118      echo -e "\t@\$(CHROOT1) 'echo /usr/bin/lex | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     119    ;;
     120    *shadow)
     121      echo -e "\t@\$(CHROOT1) 'echo /etc/login.defs | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     122    ;;
     123    *hotplug)
     124      echo -e "\t@\$(CHROOT1) 'echo /var/log/hotplug | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     125      echo -e "\t@\$(CHROOT1) 'echo /var/run/usb | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     126    ;;
     127    *sysklogd)
     128      echo -e "\t@\$(CHROOT1) 'echo /etc/syslog.conf | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     129    ;;
     130    *sysvinit)
     131      echo -e "\t@\$(CHROOT1) 'echo /etc/inittab | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     132    ;;
     133    *udev)
     134      echo -e "\t@\$(CHROOT1) 'find /lib/udev/devices | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     135      echo -e "\t@\$(CHROOT1) 'echo /lib/firmware | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     136      echo -e "\t@\$(CHROOT1) 'find /etc/udev/rules.d -type f | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     137    ;;
     138    *util-linux)
     139      echo -e "\t@\$(CHROOT1) 'echo /var/lib/hwclock | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     140      echo -e "\t@\$(CHROOT1) 'echo /etc/nologin.txt | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     141    ;;
     142    *vim)
     143      echo -e "\t@\$(CHROOT1) 'echo /etc/vimrc | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     144    ;;
     145    # Rules below here will log configuration files created in LFS and HLFS
     146    # They will end up in a log named {h}lfs-sysconf
     147    *setclock)
     148      echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/clock | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     149    ;;
     150    *inputrc)
     151      echo -e "\t@\$(CHROOT2) 'echo /etc/inputrc | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     152    ;;
     153    *profile)
     154      echo -e "\t@\$(CHROOT2) 'echo /etc/profile | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     155    ;;
     156    *hostname)
     157      echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     158    ;;
     159    *localnet)
     160      echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     161    ;;
     162    *hosts)
     163      echo -e "\t@\$(CHROOT2) 'echo /etc/hosts | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     164    ;;
     165    *network)
     166      echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4 | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     167      echo -e "\t@\$(CHROOT2) 'echo /etc/resolv.conf | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     168    ;;
     169    *fstab)
     170      echo -e "\t@\$(CHROOT2) 'echo /etc/fstab | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     171    ;;
     172    *theend) # LFS
     173      echo -e "\t@\$(CHROOT2) 'echo /etc/$PROGNAME-release | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     174    ;;
     175    *finished) # HLFS
     176      echo -e "\t@\$(CHROOT2) 'echo /etc/$PROGNAME-release | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     177    ;;
     178  esac
     179fi
     180}
     181
     182
     183#----------------------------------#
     184check_log_package() {              #
     185#----------------------------------#
     186# Maybe don't need this function, but it will avoid writing some
     187# unnecessary paco commands in the Makefile.
     188
     189case $this_script in
     190  *changingowner)   LOG_PACKAGE=0 ;;
     191  *creatingdirs)    LOG_PACKAGE=0 ;;
     192  *createfiles)     LOG_PACKAGE=0 ;;
     193  *pwdgroup)        LOG_PACKAGE=0 ;;
     194  *devices)         LOG_PACKAGE=0 ;;
     195  *strippingagain)  LOG_PACKAGE=0 ;;
     196  *readjusting)     LOG_PACKAGE=0 ;;
     197  *setclock)        LOG_PACKAGE=0 ;;
     198  *inputrc)         LOG_PACKAGE=0 ;;
     199  *profile)         LOG_PACKAGE=0 ;;
     200  *hostname)        LOG_PACKAGE=0 ;;
     201  *localnet)        LOG_PACKAGE=0 ;;
     202  *hosts)           LOG_PACKAGE=0 ;;
     203  *network)         LOG_PACKAGE=0 ;;
     204  *fstab)           LOG_PACKAGE=0 ;;
     205  *theend)          LOG_PACKAGE=0 ;;
     206  *finished)        LOG_PACKAGE=0 ;;
     207  *)                LOG_PACKAGE=1 ;;
     208esac
     209}
     210
     211#----------------------------------#
     212get_paco_src() {                   #
     213#----------------------------------#
     214# Download the paco sources
     215# We don't do any MD5SUM checking as of yet
     216# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
     217
     218local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
     219local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
     220
     221# Test if paco is to be used
     222[ ! "$USE_PACO" = "1" ] && return
     223
     224# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
     225if [ ! -z ${SRC_ARCHIVE} ] &&
     226   [   -d ${SRC_ARCHIVE} ] &&
     227   [   -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
     228  cp ${SRC_ARCHIVE}/$PACO_FILE .
     229  echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
     230  fromARCHIVE=1
     231else
     232  echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
     233  fromARCHIVE=0
     234  # If the file does not exist yet in /sources download a fresh one
     235  if [ ! -f $PACO_FILE ] ; then
     236    if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
     237      gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
     238      continue
     239    fi
     240  fi
     241fi
     242
     243# Copy the freshly downloaded file to the source archive.
     244if [ ! -z ${SRC_ARCHIVE}  ] &&
     245   [   -d ${SRC_ARCHIVE}  ] &&
     246   [   -w ${SRC_ARCHIVE}  ] &&
     247   [ "$fromARCHIVE" = "0" ] ; then
     248     echo "Storing file:<$PACO_FILE> in the package archive"
     249     cp -f $PACO_FILE ${SRC_ARCHIVE}
     250fi
     251}
  • common/paco-build-lfs.sh

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

     
    6969        in the configuration file has the proper packages and patches for the
    7070        book version being processed.
    7171
     72${BOLD}  --no-paco${OFF}
     73        dissables paco logging feature.
     74
    7275${BOLD}  -O, --optimize${OFF}
    7376        Optimize [0-2]
    7477          0 = no optimization
     
    733736                 --stringparam lc_all $LC_ALL \
    734737                 --stringparam keymap $KEYMAP \
    735738                 --stringparam grsecurity_host $GRSECURITY_HOST \
     739                 --stringparam use_paco $USE_PACO \
    736740                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    737741      ;;
    738742    lfs)
     
    744748                 --stringparam timezone $TIMEZONE \
    745749                 --stringparam page $PAGE \
    746750                 --stringparam lang $LANG \
     751                 --stringparam use_paco $USE_PACO \
    747752                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    748753      ;;
    749754    *) exit 1 ;;
     
    810815    # Generate URLs file
    811816  create_urls
    812817
     818    # If Paco is to be used, then download the sources
     819  get_paco_src
     820
    813821  IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
    814822  for line in `cat urls.lst`; do
    815823    IFS=$saveIFS  # Restore the system defaults
  • HLFS/hlfs.xsl

     
    3939  <xsl:param name="lang" select="C"/>
    4040  <xsl:param name="lc_all" select="C"/>
    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>
     
    177180      <!-- Fixing bootscripts installation -->
    178181      <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
    179182                string() = 'make install'">
     183        <!-- inserting LD_PRELOAD before installing bootscripts -->
     184        <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
     185          <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     186        </xsl:if>
    180187        <xsl:text>make install&#xA;</xsl:text>
    181188        <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
    182189      </xsl:when>
     
    237244        <xsl:apply-templates/>
    238245        <xsl:text> || true&#xA;</xsl:text>
    239246      </xsl:when>
     247
     248      <!-- paco begin -->
     249      <!-- General rule -->
     250      <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
     251                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     252                contains(string(),'make') and
     253                contains(string(),'install')">
     254        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     255        <xsl:apply-templates/>
     256        <xsl:text>&#xA;</xsl:text>
     257      </xsl:when>
     258      <!-- Linux-libc-headers -->
     259      <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
     260                ancestor::sect1[@id='ch-system-linux-headers'] and
     261                contains(string(),'install ')">
     262        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     263        <xsl:apply-templates/>
     264        <xsl:text>&#xA;</xsl:text>
     265      </xsl:when>
     266      <!-- paco end -->
     267
    240268      <!-- The rest of commands -->
    241269      <xsl:otherwise>
    242270        <xsl:apply-templates/>
  • HLFS/master.sh

     
    7676        @echo "export PKGDIR=\$(SRC)" > envars
    7777EOF
    7878) >> $MKFILE.tmp
     79      wrt_paco_prep
    7980      wrt_run_as_chroot1 "$toolchain" "$this_script"
     81      wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
    8082      ;;
    8183
    8284    *)
     
    310312    # Keep the script file name
    311313    this_script=`basename $file`
    312314
     315    # If this script is *-paco, then skip it
     316    case $this_script in
     317      *paco )     continue ;;
     318    esac
     319
    313320    # Skip this script depending on jhalfs.conf flags set.
    314321    case $this_script in
    315322        # We'll run the chroot commands differently than the others, so skip them in the
     
    319326      *-stripping* )  [[ "$STRIP" = "0" ]] && continue ;;
    320327    esac
    321328
     329    # Install paco as the first package in ch6, before installing
     330    # linux-libc-headers, except in iterartive builds
     331    if [[ -z "$N" ]]; then
     332      case $this_script in
     333        *linux-headers)
     334          TMP_SCRIPT="$this_script"
     335          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     336          wrt_paco_inst "$this_script"
     337          this_script="$TMP_SCRIPT" ;;
     338      esac
     339    fi
     340
    322341    # Grab the name of the target
    323342    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    324343
     
    385404        wrt_RunAsRoot "hlfs" "${this_script}" "${file}"
    386405        ;;
    387406      *)   # The rest of Chapter06
     407        wrt_paco_prep
    388408        wrt_run_as_chroot1 "${this_script}" "${file}"
     409        wrt_paco_log "$pkg_tarball"
    389410       ;;
    390411    esac
    391412    #
     
    405426    PREV=${this_script}${N}
    406427    # Set system_build envar for iteration targets
    407428    system_build=$chapter6
     429
     430    # Reinstall paco after the toolchain has been readjusted.
     431    case "${this_script}" in
     432      *readjusting)
     433        TMP_SCRIPT="$this_script"
     434        this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
     435        wrt_paco_inst "$this_script"
     436        this_script="$TMP_SCRIPT" ;;
     437    esac
     438
    408439  done # end for file in chapter06/*
    409440
    410441}
     
    463494        else  # Initialize the log and run the script
    464495          wrt_run_as_chroot2 "${this_script}" "${file}"
    465496        fi
     497        wrt_paco_log "hlfs-sysconf"
    466498        ;;
     499      *kernel)       wrt_paco_prep
     500                     wrt_run_as_chroot2 "$this_script" "$file"
     501                     wrt_paco_log "$(get_package_tarball_name "linux")"
     502        ;;
     503      *bootscripts)  wrt_paco_prep
     504                     wrt_run_as_chroot2 "$this_script" "$file"
     505                     wrt_paco_log "$(get_package_tarball_name "lfs-bootscripts")"
     506        ;;
    467507      *)  # All other scripts
    468508        wrt_run_as_chroot2 "${this_script}" "${file}"
     509        wrt_paco_log "hlfs-sysconf"
    469510        ;;
    470511    esac
    471512
  • master.sh

     
    149149
    150150    --help | -h )  usage | more && exit  ;;
    151151
     152    --no-paco )            USE_PACO=0    ;;
     153
    152154    --optimize | -O )
    153155      test $# = 1 && eval "$exit_missing_arg"
    154156      shift
     
    440442  [[ $VERBOSITY > 0 ]] && echo "OK"
    441443fi
    442444#
     445# paco module
     446if [[ "$USE_PACO" = "1" ]]; then
     447  [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
     448  source $COMMON_DIR/paco-functions
     449  [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
     450  [[ $VERBOSITY > 0 ]] && echo "OK"
     451fi
     452#
    443453# optimize module
    444454if [[ "$OPTIMIZE" != "0" ]]; then
    445455  [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
     
    486496if [[ "$PWD" != "$JHALFSDIR" ]]; then
    487497  cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
    488498  #
     499  [[ $USE_PACO != "0" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
     500  #
    489501  [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
    490502  #
    491503  if [[ "$COMPARE" != "0" ]] ; then
Note: See TracBrowser for help on using the repository browser.