source: contrib/jhalfs-paco.patch@ 31e78bd

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

Rediffied paco patch.

  • Property mode set to 100644
File size: 32.8 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_RunAsRoot    "${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 | *bootscripts )
     347              wrt_paco_prep
     348              wrt_run_as_chroot2 "$this_script" "$file"
     349              wrt_paco_log "$pkg_tarball"
     350        ;;
    316351      *)        wrt_run_as_chroot2 "$this_script" "$file"
     352                wrt_paco_log "lfs-sysconf"
    317353        ;;
    318354    esac
    319355
  • LFS/lfs.xsl

     
    3939  <!-- Locale settings -->
    4040  <xsl:param name="lang" 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>
     
    239242        <xsl:apply-templates/>
    240243        <xsl:text> || true&#xA;</xsl:text>
    241244      </xsl:when>
     245      <!-- paco begin -->
     246      <!-- General rule -->
     247      <xsl:when test="$use_paco != '0' and
     248                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     249                contains(string(),'make') and
     250                contains(string(),'install')">
     251        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     252        <xsl:apply-templates/>
     253        <xsl:text>&#xA;</xsl:text>
     254      </xsl:when>
     255      <!-- Linux-libc-headers -->
     256      <xsl:when test="$use_paco != '0' and
     257                ancestor::sect1[@id='ch-system-linux-libc-headers'] and
     258                contains(string(),'install ')">
     259        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     260        <xsl:apply-templates/>
     261        <xsl:text>&#xA;</xsl:text>
     262      </xsl:when>
     263      <!-- Unset LD_PRELOAD before second make in Zlib -->
     264      <xsl:when test="$use_paco != '0' and
     265                ancestor::sect1[@id='ch-system-zlib'] and
     266                contains(string(),'make clean')">
     267        <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
     268        <xsl:apply-templates/>
     269        <xsl:text>&#xA;</xsl:text>
     270      </xsl:when>
     271      <!-- paco end -->
    242272      <!-- The rest of commands -->
    243273      <xsl:otherwise>
    244274        <xsl:apply-templates/>
  • CLFS/master.sh

     
    495495    # Keep the script file name
    496496    this_script=`basename $file`
    497497
     498    # If $this_script corresponds to a paco script, then skip it
     499    case "${this_script}" in
     500      *paco)       continue ;;
     501    esac
     502
    498503    # Test if the stripping phase must be skipped.
    499504    # Skip alsp temp-perl for iterative runs
    500505    case $this_script in
     
    502507      *temp-perl*) [[ -n "$N" ]] && continue ;;
    503508    esac
    504509
     510    # Install paco as the first package in ch6, before installing
     511    # linux-libc-headers, except in iterartive builds
     512    if [[ -z "$N" ]]; then
     513      case $this_script in
     514        *linux-headers)
     515          TMP_SCRIPT="$this_script"
     516          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     517          wrt_paco_inst "$this_script"
     518          this_script="$TMP_SCRIPT" ;;
     519      esac
     520    fi
     521
    505522    # Grab the name of the target, strip id number, XXX-script
    506523    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
    507524                                  -e 's@temp-@@' \
     
    554571      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    555572    fi
    556573    #
     574    wrt_paco_prep
    557575    wrt_run_as_chroot1 "${this_script}" "${file}"
     576    wrt_paco_log "$pkg_tarball"
    558577    #
    559578    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    560579    #
     
    569588    PREV=${this_script}${N}
    570589    # Set system_build envar for iteration targets
    571590    system_build=$basicsystem
     591
     592    # Reinstalling paco after readsjusting the toolchain.
     593    case "${this_script}" in
     594      *adjusting)
     595        TMP_SCRIPT="$this_script"
     596        this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
     597        wrt_paco_inst "$this_script"
     598        this_script="$TMP_SCRIPT" ;;
     599    esac
     600
    572601  done  # for file in final-system/* ...
    573602}
    574603
     
    605634    # Keep the script file name
    606635    this_script=`basename $file`
    607636
     637    # If $this_script corresponds to a paco script, then skip it
     638    case "${this_script}" in
     639      *paco)       continue ;;
     640    esac
     641
    608642    # Test if the stripping phase must be skipped
    609643    # Skip alsp temp-perl for iterative runs
    610644    case $this_script in
     
    612646      *temp-perl*) [[ -n "$N" ]] && continue ;;
    613647    esac
    614648
     649    # Install paco as the first package in ch6, before installing
     650    # linux-libc-headers, except in iterartive builds
     651    if [[ -z "$N" ]]; then
     652      case $this_script in
     653        *linux-headers)
     654          TMP_SCRIPT="$this_script"
     655          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     656          wrt_paco_inst "$this_script"
     657          this_script="$TMP_SCRIPT" ;;
     658      esac
     659    fi
     660
    615661    # Grab the name of the target, strip id number, XXX-script
    616662    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
    617663                                  -e 's@temp-@@' \
     
    666712      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    667713    fi
    668714    #
     715    wrt_paco_prep
    669716    wrt_run_as_root2 "${this_script}" "${file}"
     717    wrt_paco_log "$pkg_tarball"
    670718    #
    671719    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    672720    #
     
    681729    PREV=${this_script}${N}
    682730    # Set system_build envar for iteration targets
    683731    system_build=$basicsystem
     732
     733    # Reinstalling paco after readsjusting the toolchain.
     734    case "${this_script}" in
     735      *adjusting)
     736        TMP_SCRIPT="$this_script"
     737        this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
     738        wrt_paco_inst "$this_script"
     739        this_script="$TMP_SCRIPT" ;;
     740    esac
     741
    684742  done  # for file in final-system/* ...
    685743}
    686744
     
    729787    #
    730788    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
    731789    #
     790    case $this_script in
     791      *bootscripts* | *udev-rules )
     792        wrt_paco_prep ;;
     793    esac
    732794    wrt_run_as_chroot1 "${this_script}" "${file}"
     795    case $this_script in
     796      *bootscripts* | *udev-rules )
     797        wrt_paco_log "$pkg_tarball" ;;
     798      *)
     799        wrt_paco_log "clfs-sysconf" ;;
     800    esac
    733801    #
    734802    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    735803    #
     
    791859    #
    792860    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
    793861    #
     862    case $this_script in
     863      *bootscripts* | *udev-rules )
     864        wrt_paco_prep ;;
     865    esac
    794866    wrt_run_as_root2 "${this_script}" "${file}"
     867    case $this_script in
     868      *bootscripts* | *udev-rules )
     869        wrt_paco_log "$pkg_tarball" ;;
     870      *)
     871        wrt_paco_log "clfs-sysconf" ;;
     872    esac
    795873    #
    796874    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    797875    #
     
    863941                else
    864942                  wrt_run_as_chroot1  "${this_script}" "${file}"
    865943                fi
     944                wrt_paco_log "clfs-sysconf"
    866945          ;;
    867       *)  wrt_run_as_chroot1  "${this_script}" "${file}"   ;;
     946      *kernel)  wrt_paco_prep
     947                wrt_run_as_chroot1  "${this_script}" "${file}"
     948                wrt_paco_log "$pkg_tarball" ;;
     949      *)  wrt_run_as_chroot1  "${this_script}" "${file}"
     950          wrt_paco_log "clfs-sysconf" ;;
    868951    esac
    869952    #
    870953    # Housekeeping...remove any build directory(ies) except if the package build fails.
     
    9421025                else
    9431026                  wrt_run_as_root2  "${this_script}" "${file}"
    9441027                fi
     1028                wrt_paco_log "clfs-sysconf"
    9451029          ;;
    946       *)  wrt_run_as_root2  "${this_script}" "${file}"   ;;
     1030      *kernel)  wrt_paco_prep
     1031                wrt_run_as_root2  "${this_script}" "${file}"
     1032                wrt_paco_log "$pkg_tarball"   ;;
     1033      *)  wrt_run_as_root2  "${this_script}" "${file}"
     1034          wrt_paco_log "clfs-sysconf"   ;;
    9471035    esac
    9481036    #
    9491037    # Housekeeping...remove any build directory(ies) except if the package build fails.
  • CLFS/clfs.xsl

     
    4545  <!-- Locale settings -->
    4646  <xsl:param name="lang" select="C"/>
    4747
     48  <!-- Use paco? -->
     49  <xsl:param name="use_paco" select="1"/>
     50
    4851  <xsl:template match="/">
    4952    <xsl:apply-templates select="//sect1"/>
    5053  </xsl:template>
     
    106109                <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
    107110              </xsl:if>
    108111            </xsl:if>
     112            <!-- paco begin -->
     113            <!-- General rule -->
     114            <xsl:if test="$use_paco != '0' and
     115                    @id='ch-scripts-bootscripts' or
     116                    @id='ch-scripts-udev-rules' or
     117                    @id='ch-bootable-kernel' or
     118                    (../@id='chapter-building-system' and
     119                    @id!='ch-system-temp-perl' and
     120                    contains(string(),'make') and
     121                    contains(string(),'install'))">
     122              <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     123            </xsl:if>
     124            <!-- Linux headers -->
     125            <xsl:if test="$use_paco != '0' and
     126                    @id='ch-system-linux-headers' and
     127                    contains(string(),'install')">
     128              <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     129            </xsl:if>
     130            <!-- paco end -->
    109131            <xsl:apply-templates select=".//para/userinput | .//screen"/>
    110132            <xsl:text>exit</xsl:text>
    111133          </exsl:document>
  • 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

     
    9191#--- Run farce testing 0(no)/1(yes)
    9292RUN_FARCE=0
    9393
     94#==== PACO VARIABLES ====
     95#--- Use paco? 0(no)/1(yes)
     96USE_PACO=1
     97PACO_VERSION=1.10.10
     98
     99#--- Name of the Paco source package
     100PACO_FILE=paco-$PACO_VERSION.tar.bz2   # (use .tar.gz if preferred)
     101
     102#--- Sourceforge mirror to use for Paco source download
     103# Europe: heanet, belnet, puzzle, surfnet, switch, kent
     104# North America: superb-east, superb-west, umn, easynews
     105# South America: ufpr
     106# Asia: nchc, jaist
     107# Australia: optusnet
     108PACO_MIRROR1=heanet
     109PACO_MIRROR2=kent
     110
    94111#==== INTERNAL VARIABLES ====
    95112# Don't edit it unless you know what you are doing
    96113
     
    108125
    109126#--- farce report log directory
    110127FARCELOGDIR=$LOGDIR/farce
     128
     129#--- Variables needed by paco
     130PACO_INCLUDE=/
     131PACO_EXCLUDE=/${SCRIPT_ROOT}
     132PACO_TMPFILE=/tmp/paco.tmp
     133LD_PRELOAD=/usr/lib/libpaco-log.so
  • common/func_validate_configs.sh

     
    8686inline_doc
    8787
    8888  # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
    89   local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL KEYMAP         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
    90   local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD  ARCH  TARGET  TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
    91   local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE         ARCH  TARGET                 OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
    92   local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                       TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL        VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
     89  local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL KEYMAP         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
     90  local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE METHOD  ARCH  TARGET  TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
     91  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE          GETPKG RUNMAKE         ARCH  TARGET                 OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
     92  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE                       TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL        VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
    9393
    9494  local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
    9595  local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
     
    179179                    [[ "$GETPKG" = "1" ]] && validate_against_str "x0x x1x"
    180180                  fi ;;
    181181      RUNMAKE)    validate_against_str "x0x x1x" ;;
     182      USE_PACO)   validate_against_str "x0x x1x" ;;
    182183      REPORT)     validate_against_str "x0x x1x"
    183184                  if [[ "${!config_param}" = "1" ]]; then
    184185                    if [[ `type -p bc` ]]; then
  • common/paco-functions

     
     1#!/bin/bash
     2
     3#----------------------------#
     4wrt_paco_inst() {            #
     5#----------------------------#
     6
     7local paco_script="$1"
     8
     9check_build_model
     10
     11if [ $USE_PACO != 0 ]; then
     12  case $PROGNAME in
     13    clfs )
     14      paco_file="final-system/$paco_script"
     15      basicsystem="$basicsystem $paco_script" ;;
     16    * )
     17      paco_file="chapter06/$paco_script"
     18      chapter6="$chapter6 $paco_script" ;;
     19  esac
     20
     21  # Copy the paco build script to the correct directory and make it executable
     22  cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
     23  chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
     24
     25  # Write target, dependency and unpack
     26  if [ $CLFS_BOOT = 1 ]; then
     27    wrt_target_boot "$paco_script" "$PREV"
     28    wrt_unpack3 "$PACO_FILE"
     29    wrt_run_as_root2 "${paco_script}" "${paco_file}"
     30    wrt_remove_build_dirs2 "paco"
     31  else
     32    wrt_target "$paco_script" "$PREV"
     33    wrt_unpack2 "$PACO_FILE"
     34    wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
     35    wrt_remove_build_dirs "paco"
     36  fi
     37
     38  wrt_touch
     39
     40  # Override the PREV variable
     41  PREV="$paco_script"
     42fi
     43}
     44
     45
     46#----------------------------------#
     47wrt_paco_prep() {                  # Export Paco variables
     48#----------------------------------# and remove tmpfile
     49
     50local TMPFILEPATH
     51
     52check_build_model
     53
     54check_log_package
     55
     56if [ $USE_PACO != 0 ] && [ $LOG_PACKAGE != 0 ]; then
     57  if [ $CLFS_BOOT = 1 ]; then
     58    TMPFILEPATH="$PACO_TMPFILE"
     59  else
     60    TMPFILEPATH="\$(MOUNT_PT)$PACO_TMPFILE"
     61  fi
     62(
     63cat  << EOF
     64        @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
     65        echo "export PACO_EXCLUDE=\$(SRC):$PACO_EXCLUDE" >> envars && \\
     66        echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
     67        rm -f $TMPFILEPATH
     68EOF
     69) >> $MKFILE.tmp
     70fi
     71}
     72
     73
     74#----------------------------------#
     75wrt_paco_log() {                   # If the tmpfile exist, then log the current package
     76#----------------------------------# and remove tempfile
     77local PACKAGE
     78
     79# Extract package name and version from the tarball name
     80PACKAGE=`echo $1 | sed -e 's/.tar.*//'`
     81
     82check_build_model
     83
     84# Check if the package should be logged
     85check_log_package
     86
     87
     88if [ $USE_PACO != 0 ]; then
     89  if [ $LOG_PACKAGE != 0 ]; then
     90    # Only use this if doing CLFS boot build
     91    if [ $CLFS_BOOT = 1 ]; then
     92(
     93cat << EOF
     94        @if [ -e $PACO_TMPFILE ]; then \\
     95                paco -lp+ $PACKAGE < $PACO_TMPFILE && \\
     96                rm -f $PACO_TMPFILE; \\
     97        fi;
     98EOF
     99) >> $MKFILE.tmp
     100    # All else should use these commands
     101    else
     102(
     103cat << EOF
     104        @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
     105                \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\
     106                rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
     107        fi;
     108EOF
     109) >> $MKFILE.tmp
     110    fi
     111  fi
     112  # Add missing files to the logs if needed
     113  wrt_paco_add_log
     114fi
     115}
     116
     117
     118#----------------------------------#
     119fnc_add_log() {                    #
     120#----------------------------------#
     121
     122MISSING_FILE=$1
     123
     124if [ $CLFS_BOOT = 1 ]; then
     125  echo -e "\t@$MISSING_FILE | paco -lp+ $PACKAGE" >> $MKFILE.tmp
     126else
     127  echo -e "\t@\$(CHROOT1) '$MISSING_FILE | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
     128fi
     129}
     130
     131
     132#----------------------------------#
     133wrt_paco_add_log() {               #
     134#----------------------------------#
     135# Some packages create files using bash redirection, which the LD_PRELOAD lib don't notice
     136# These rules will add the missing files to the proper logs.
     137# Most of these is not needed for HLFS, but they do no harm.
     138if [ $USE_PACO != 0 ]; then
     139 case $this_script in
     140    *glibc)
     141      fnc_add_log "find /lib -type l"
     142      fnc_add_log "find /etc/{nsswitch.conf,ld.so.conf}"
     143    ;;
     144    *ncurses)
     145      fnc_add_log "find /usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
     146    ;;
     147    *bash)
     148      fnc_add_log "echo /bin/sh"
     149    ;;
     150    *flex)
     151      fnc_add_log "echo /usr/bin/lex"
     152    ;;
     153    *shadow)
     154      fnc_add_log "echo /etc/login.defs"
     155    ;;
     156    *hotplug)
     157      fnc_add_log "echo /var/log/hotplug"
     158      fnc_add_log "echo /var/run/usb"
     159    ;;
     160    *sysklogd)
     161      fnc_add_log "echo /etc/syslog.conf"
     162    ;;
     163    *sysvinit)
     164      fnc_add_log "echo /etc/inittab"
     165    ;;
     166    *udev)
     167      fnc_add_log "find /lib/udev/devices"
     168      fnc_add_log "echo /lib/firmware"
     169      fnc_add_log "find /etc/udev/rules.d -type f"
     170    ;;
     171    *util-linux)
     172      fnc_add_log "echo /var/lib/hwclock"
     173      fnc_add_log "echo /etc/nologin.txt"
     174    ;;
     175    *vim)
     176      fnc_add_log "echo /etc/vimrc"
     177    ;;
     178    # Rules below here will log configuration files created in {C,H}LFS
     179    # They will end up in a log named {c,h}lfs-sysconf
     180    *setclock)
     181      fnc_add_log "echo /etc/sysconfig/clock"
     182    ;;
     183    *inputrc)
     184      fnc_add_log "echo /etc/inputrc"
     185    ;;
     186    *profile)
     187      fnc_add_log "echo /etc/profile"
     188    ;;
     189    *hostname)
     190      fnc_add_log "echo /etc/sysconfig/network"
     191    ;;
     192    *localnet)
     193      fnc_add_log "echo /etc/sysconfig/network"
     194    ;;
     195    *hosts)
     196      fnc_add_log "echo /etc/hosts"
     197    ;;
     198    *network)
     199      fnc_add_log "echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4"
     200      fnc_add_log "echo /etc/resolv.conf"
     201    ;;
     202    *fstab)
     203      fnc_add_log "echo /etc/fstab"
     204    ;;
     205    *theend) # LFS and CLFS
     206      fnc_add_log "echo /etc/$PROGNAME-release"
     207    ;;
     208    *finished) # HLFS
     209      fnc_add_log "echo /etc/$PROGNAME-release"
     210    ;;
     211  esac
     212fi
     213}
     214
     215
     216#----------------------------------#
     217check_log_package() {              #
     218#----------------------------------#
     219# Maybe don't need this function, but it will avoid writing some
     220# unnecessary paco commands in the Makefile.
     221
     222case $this_script in
     223  *changingowner)   LOG_PACKAGE=0 ;;
     224  *creatingdirs)    LOG_PACKAGE=0 ;;
     225  *createfiles)     LOG_PACKAGE=0 ;;
     226  *pwdgroup)        LOG_PACKAGE=0 ;;
     227  *devices)         LOG_PACKAGE=0 ;;
     228  *stripping)       LOG_PACKAGE=0 ;;
     229  *strippingagain)  LOG_PACKAGE=0 ;;
     230  *adjusting)       LOG_PACKAGE=0 ;;
     231  *temp-perl)       LOG_PACKAGE=0 ;;
     232  *readjusting)     LOG_PACKAGE=0 ;;
     233  *setclock)        LOG_PACKAGE=0 ;;
     234  *inputrc)         LOG_PACKAGE=0 ;;
     235  *profile)         LOG_PACKAGE=0 ;;
     236  *hostname)        LOG_PACKAGE=0 ;;
     237  *localnet)        LOG_PACKAGE=0 ;;
     238  *hosts)           LOG_PACKAGE=0 ;;
     239  *network)         LOG_PACKAGE=0 ;;
     240  *fstab)           LOG_PACKAGE=0 ;;
     241  *theend)          LOG_PACKAGE=0 ;;
     242  *finished)        LOG_PACKAGE=0 ;;
     243  *)                LOG_PACKAGE=1 ;;
     244esac
     245}
     246
     247#----------------------------------#
     248get_paco_src() {                   #
     249#----------------------------------#
     250# Download the paco sources
     251# We don't do any MD5SUM checking as of yet
     252# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
     253
     254local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
     255local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
     256
     257# Test if paco is to be used
     258[[ ! "$USE_PACO" = "1" ]] && return
     259
     260# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
     261if [ ! -z ${SRC_ARCHIVE} ] &&
     262   [   -d ${SRC_ARCHIVE} ] &&
     263   [   -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
     264  cp ${SRC_ARCHIVE}/$PACO_FILE .
     265  echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
     266  fromARCHIVE=1
     267else
     268  echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
     269  fromARCHIVE=0
     270  # If the file does not exist yet in /sources download a fresh one
     271  if [ ! -f $PACO_FILE ] ; then
     272    if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
     273      gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
     274      continue
     275    fi
     276  fi
     277fi
     278
     279# Copy the freshly downloaded file to the source archive.
     280if [ ! -z ${SRC_ARCHIVE}  ] &&
     281   [   -d ${SRC_ARCHIVE}  ] &&
     282   [   -w ${SRC_ARCHIVE}  ] &&
     283   [ "$fromARCHIVE" = "0" ] ; then
     284     echo "Storing file:<$PACO_FILE> in the package archive"
     285     cp -f $PACO_FILE ${SRC_ARCHIVE}
     286fi
     287}
     288
     289
     290#----------------------------------#
     291check_build_model() {              #
     292#----------------------------------#
     293# Check what script we're running, and set some switches accordingly
     294
     295CLFS_BOOT=0
     296
     297case $PROGNAME in
     298  hlfs)
     299    # Not using Paco with uClibc, even if requested
     300    if [ "$MODEL" = "uclibc" ]; then
     301      USE_PACO=0
     302    fi
     303  ;;
     304  clfs)
     305    # CLFS boot method require it's own commands
     306    if [ "$METHOD" = "boot" ]; then
     307      CLFS_BOOT=1
     308    fi
     309  ;;
     310esac
     311}
  • 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/paco-build-clfs.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
     
    696699                 --stringparam page $PAGE \
    697700                 --stringparam lang $LANG \
    698701                 --stringparam keymap ${KEYMAP:-"none"} \
     702                 --stringparam use_paco $USE_PACO \
    699703                 -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
    700704      ;;
    701705
     
    723727                 --stringparam lc_all $LC_ALL \
    724728                 --stringparam keymap ${KEYMAP:-"none"} \
    725729                 --stringparam grsecurity_host $GRSECURITY_HOST \
     730                 --stringparam use_paco $USE_PACO \
    726731                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    727732      ;;
    728733    lfs)
     
    735740                 --stringparam timezone $TIMEZONE \
    736741                 --stringparam page $PAGE \
    737742                 --stringparam lang $LANG \
     743                 --stringparam use_paco $USE_PACO \
    738744                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    739745      ;;
    740746    *) exit 1 ;;
     
    801807    # Generate URLs file
    802808  create_urls
    803809
     810    # If Paco is to be used, then download the sources
     811  get_paco_src
     812
    804813  IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
    805814  for line in `cat urls.lst`; do
    806815    IFS=$saveIFS  # Restore the system defaults
  • HLFS/hlfs.xsl

     
    4646  <xsl:param name="lang" select="C"/>
    4747  <xsl:param name="lc_all" select="C"/>
    4848
     49  <!-- Use paco? -->
     50  <xsl:param name="use_paco" select="1"/>
     51
    4952  <xsl:template match="/">
    5053    <xsl:apply-templates select="//sect1"/>
    5154  </xsl:template>
     
    192195      <!-- Fixing bootscripts installation -->
    193196      <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
    194197                string() = 'make install'">
     198        <!-- inserting LD_PRELOAD before installing bootscripts -->
     199        <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
     200          <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     201        </xsl:if>
    195202        <xsl:text>make install&#xA;</xsl:text>
    196203        <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
    197204      </xsl:when>
     
    280287        <xsl:apply-templates/>
    281288        <xsl:text> || true&#xA;</xsl:text>
    282289      </xsl:when>
     290      <!-- paco begin -->
     291      <!-- General rule -->
     292      <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
     293                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     294                contains(string(),'make') and
     295                contains(string(),'install')">
     296        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     297        <xsl:apply-templates/>
     298        <xsl:text>&#xA;</xsl:text>
     299      </xsl:when>
     300      <!-- Linux-libc-headers -->
     301      <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
     302                ancestor::sect1[@id='ch-system-linux-headers'] and
     303                contains(string(),'install ')">
     304        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     305        <xsl:apply-templates/>
     306        <xsl:text>&#xA;</xsl:text>
     307      </xsl:when>
     308      <!-- paco end -->
    283309      <!-- The rest of commands -->
    284310      <xsl:otherwise>
    285311        <xsl:apply-templates/>
  • HLFS/master.sh

     
    4040EOF
    4141) >> $MKFILE.tmp
    4242      [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     43      wrt_paco_prep
    4344      wrt_run_as_chroot1 "$toolchain" "$this_script"
     45      wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
    4446      ;;
    4547
    4648    *)
     
    272274    # Keep the script file name
    273275    this_script=`basename $file`
    274276
     277    # If this script is *-paco, then skip it
     278    case $this_script in
     279      *paco )     continue ;;
     280    esac
     281
    275282    # Skip this script depending on jhalfs.conf flags set.
    276283    case $this_script in
    277284        # We'll run the chroot commands differently than the others, so skip them in the
     
    281288      *-stripping* )  [[ "$STRIP" = "0" ]] && continue ;;
    282289    esac
    283290
     291    # Install paco as the first package in ch6, before installing
     292    # linux-libc-headers, except in iterartive builds
     293    if [[ -z "$N" ]]; then
     294      case $this_script in
     295        *linux-headers)
     296          TMP_SCRIPT="$this_script"
     297          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     298          wrt_paco_inst "$this_script"
     299          this_script="$TMP_SCRIPT" ;;
     300      esac
     301    fi
     302
    284303    # Grab the name of the target
    285304    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    286305
     
    346365        wrt_RunAsRoot "${this_script}" "${file}"
    347366        ;;
    348367      *)   # The rest of Chapter06
     368        wrt_paco_prep
    349369        wrt_run_as_chroot1 "${this_script}" "${file}"
     370        wrt_paco_log "$pkg_tarball"
    350371       ;;
    351372    esac
    352373    #
     
    366387    PREV=${this_script}${N}
    367388    # Set system_build envar for iteration targets
    368389    system_build=$chapter6
     390
     391    # Reinstall paco after the toolchain has been readjusted.
     392    case "${this_script}" in
     393      *readjusting)
     394        TMP_SCRIPT="$this_script"
     395        this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
     396        wrt_paco_inst "$this_script"
     397        this_script="$TMP_SCRIPT" ;;
     398    esac
     399
    369400  done # end for file in chapter06/*
    370401
    371402}
     
    424455        else  # Initialize the log and run the script
    425456          wrt_run_as_chroot2 "${this_script}" "${file}"
    426457        fi
     458        wrt_paco_log "hlfs-sysconf"
    427459        ;;
     460      *kernel)       wrt_paco_prep
     461                     wrt_run_as_chroot2 "$this_script" "$file"
     462                     wrt_paco_log "$(get_package_tarball_name "linux")"
     463        ;;
     464      *bootscripts)  wrt_paco_prep
     465                     wrt_run_as_chroot2 "$this_script" "$file"
     466                     wrt_paco_log "$(get_package_tarball_name "lfs-bootscripts")"
     467        ;;
    428468      *)  # All other scripts
    429469        wrt_run_as_chroot2 "${this_script}" "${file}"
     470        wrt_paco_log "hlfs-sysconf"
    430471        ;;
    431472    esac
    432473
  • master.sh

     
    194194
    195195    --help | -h )  usage | more && exit  ;;
    196196
     197    --no-paco )            USE_PACO=0    ;;
     198
    197199    --optimize | -O )
    198200      test $# = 1 && eval "$exit_missing_arg"
    199201      shift
     
    489491  [[ $VERBOSITY > 0 ]] && echo "OK"
    490492fi
    491493#
     494# paco module
     495if [[ "$USE_PACO" = "1" ]]; then
     496  [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
     497  source $COMMON_DIR/paco-functions
     498  [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
     499  [[ $VERBOSITY > 0 ]] && echo "OK"
     500fi
     501#
    492502# optimize module
    493503if [[ "$OPTIMIZE" != "0" ]]; then
    494504  [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
     
    535545if [[ "$PWD" != "$JHALFSDIR" ]]; then
    536546  cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
    537547  #
     548  [[ $USE_PACO != "0" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
     549  #
    538550  [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
    539551  #
    540552  if [[ "$COMPARE" != "0" ]] ; then
Note: See TracBrowser for help on using the repository browser.