source: contrib/jhalfs-paco.patch@ 0c2d20a

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

Rediffied paco patch.

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

     
    172172    # Keep the script file name
    173173    this_script=`basename $file`
    174174
     175    # If $this_script corresponds to a paco script, then skip it
     176    case "${this_script}" in
     177      *paco)       continue ;;
     178    esac
     179
    175180    # We'll run the chroot commands differently than the others, so skip them in the
    176181    # dependencies and target creation.
    177182    case "${this_script}" in
     
    179184      *stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
    180185    esac
    181186
     187    # Install paco as the first package in ch6, before installing
     188    # linux-libc-headers, except in iterartive builds
     189    if [[ -z "$N" ]]; then
     190      case $this_script in
     191        *linux-libc-headers)
     192          TMP_SCRIPT="$this_script"
     193          this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'`
     194          wrt_paco_inst "$this_script"
     195          this_script="$TMP_SCRIPT" ;;
     196      esac
     197    fi
     198
    182199    # Grab the name of the target
    183200    name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
    184201
     
    231248    # and not to use chroot.
    232249    case "${this_script}" in
    233250      *kernfs)  wrt_RunAsRoot    "${this_script}" "$file" ;;
    234       *)        wrt_run_as_chroot1 "${this_script}" "$file" ;;
     251      *)        wrt_paco_prep
     252                wrt_run_as_chroot1 "${this_script}" "$file"
     253                wrt_paco_log "$pkg_tarball" ;;
    235254    esac
    236255
    237256    # Remove the build directory(ies) except if the package build fails.
     
    251270    PREV=${this_script}${N}
    252271    # Set system_build envar for iteration targets
    253272    system_build=$chapter6
     273
     274    # Reinstalling paco after readsjusting the toolchain.
     275    case "${this_script}" in
     276      *readjusting)
     277        TMP_SCRIPT="$this_script"
     278        this_script=`echo ${this_script} | sed -e 's/readjusting/x-paco/'`
     279        wrt_paco_inst "$this_script"
     280        this_script="$TMP_SCRIPT" ;;
     281    esac
     282
    254283  done # end for file in chapter06/*
    255284}
    256285
     
    311340              else
    312341                wrt_run_as_chroot2 "$this_script" "$file"
    313342              fi
     343              wrt_paco_log "lfs-sysconf"
    314344        ;;
     345      *kernel | *bootscripts )
     346              wrt_paco_prep
     347              wrt_run_as_chroot2 "$this_script" "$file"
     348              wrt_paco_log "$pkg_tarball"
     349        ;;
    315350      *)        wrt_run_as_chroot2 "$this_script" "$file"
     351                wrt_paco_log "lfs-sysconf"
    316352        ;;
    317353    esac
    318354
  • LFS/lfs.xsl

     
    3939  <!-- Locale settings -->
    4040  <xsl:param name="lang" select="C"/>
    4141
     42  <!-- Use paco? -->
     43  <xsl:param name="use_paco" select="y"/>
     44
    4245  <xsl:template match="/">
    4346    <xsl:apply-templates select="//sect1"/>
    4447  </xsl:template>
     
    251254        <xsl:apply-templates/>
    252255        <xsl:text> || true&#xA;</xsl:text>
    253256      </xsl:when>
     257      <!-- paco begin -->
     258      <!-- General rule -->
     259      <xsl:when test="$use_paco != 'n' and
     260                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     261                contains(string(),'make') and
     262                contains(string(),'install')">
     263        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     264        <xsl:apply-templates/>
     265        <xsl:text>&#xA;</xsl:text>
     266      </xsl:when>
     267      <!-- Linux-libc-headers -->
     268      <xsl:when test="$use_paco != 'n' and
     269                ancestor::sect1[@id='ch-system-linux-libc-headers'] and
     270                contains(string(),'install ')">
     271        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     272        <xsl:apply-templates/>
     273        <xsl:text>&#xA;</xsl:text>
     274      </xsl:when>
     275      <!-- Unset LD_PRELOAD before second make in Zlib -->
     276      <xsl:when test="$use_paco != 'n' and
     277                ancestor::sect1[@id='ch-system-zlib'] and
     278                contains(string(),'make clean')">
     279        <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
     280        <xsl:apply-templates/>
     281        <xsl:text>&#xA;</xsl:text>
     282      </xsl:when>
     283      <!-- paco end -->
    254284      <!-- The rest of commands -->
    255285      <xsl:otherwise>
    256286        <xsl:apply-templates/>
  • CLFS/master.sh

     
    494494    # Keep the script file name
    495495    this_script=`basename $file`
    496496
     497    # If $this_script corresponds to a paco script, then skip it
     498    case "${this_script}" in
     499      *paco)       continue ;;
     500    esac
     501
    497502    # Test if the stripping phase must be skipped.
    498503    # Skip alsp temp-perl for iterative runs
    499504    case $this_script in
     
    501506      *temp-perl*) [[ -n "$N" ]] && continue ;;
    502507    esac
    503508
     509    # Install paco as the first package in ch6, before installing
     510    # linux-libc-headers, except in iterartive builds
     511    if [[ -z "$N" ]]; then
     512      case $this_script in
     513        *linux-headers)
     514          TMP_SCRIPT="$this_script"
     515          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     516          wrt_paco_inst "$this_script"
     517          this_script="$TMP_SCRIPT" ;;
     518      esac
     519    fi
     520
    504521    # Grab the name of the target, strip id number, XXX-script
    505522    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
    506523                                  -e 's@temp-@@' \
     
    553570      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    554571    fi
    555572    #
     573    wrt_paco_prep
    556574    wrt_run_as_chroot1 "${this_script}" "${file}"
     575    wrt_paco_log "$pkg_tarball"
    557576    #
    558577    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    559578    #
     
    568587    PREV=${this_script}${N}
    569588    # Set system_build envar for iteration targets
    570589    system_build=$basicsystem
     590
     591    # Reinstalling paco after readsjusting the toolchain.
     592    case "${this_script}" in
     593      *adjusting)
     594        TMP_SCRIPT="$this_script"
     595        this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
     596        wrt_paco_inst "$this_script"
     597        this_script="$TMP_SCRIPT" ;;
     598    esac
     599
    571600  done  # for file in final-system/* ...
    572601}
    573602
     
    604633    # Keep the script file name
    605634    this_script=`basename $file`
    606635
     636    # If $this_script corresponds to a paco script, then skip it
     637    case "${this_script}" in
     638      *paco)       continue ;;
     639    esac
     640
    607641    # Test if the stripping phase must be skipped
    608642    # Skip alsp temp-perl for iterative runs
    609643    case $this_script in
     
    611645      *temp-perl*) [[ -n "$N" ]] && continue ;;
    612646    esac
    613647
     648    # Install paco as the first package in ch6, before installing
     649    # linux-libc-headers, except in iterartive builds
     650    if [[ -z "$N" ]]; then
     651      case $this_script in
     652        *linux-headers)
     653          TMP_SCRIPT="$this_script"
     654          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     655          wrt_paco_inst "$this_script"
     656          this_script="$TMP_SCRIPT" ;;
     657      esac
     658    fi
     659
    614660    # Grab the name of the target, strip id number, XXX-script
    615661    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
    616662                                  -e 's@temp-@@' \
     
    665711      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    666712    fi
    667713    #
     714    wrt_paco_prep
    668715    wrt_run_as_root2 "${this_script}" "${file}"
     716    wrt_paco_log "$pkg_tarball"
    669717    #
    670718    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    671719    #
     
    680728    PREV=${this_script}${N}
    681729    # Set system_build envar for iteration targets
    682730    system_build=$basicsystem
     731
     732    # Reinstalling paco after readsjusting the toolchain.
     733    case "${this_script}" in
     734      *adjusting)
     735        TMP_SCRIPT="$this_script"
     736        this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
     737        wrt_paco_inst "$this_script"
     738        this_script="$TMP_SCRIPT" ;;
     739    esac
     740
    683741  done  # for file in final-system/* ...
    684742}
    685743
     
    728786    #
    729787    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
    730788    #
     789    case $this_script in
     790      *bootscripts* | *udev-rules )
     791        wrt_paco_prep ;;
     792    esac
    731793    wrt_run_as_chroot1 "${this_script}" "${file}"
     794    case $this_script in
     795      *bootscripts* | *udev-rules )
     796        wrt_paco_log "$pkg_tarball" ;;
     797      *)
     798        wrt_paco_log "clfs-sysconf" ;;
     799    esac
    732800    #
    733801    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    734802    #
     
    790858    #
    791859    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
    792860    #
     861    case $this_script in
     862      *bootscripts* | *udev-rules )
     863        wrt_paco_prep ;;
     864    esac
    793865    wrt_run_as_root2 "${this_script}" "${file}"
     866    case $this_script in
     867      *bootscripts* | *udev-rules )
     868        wrt_paco_log "$pkg_tarball" ;;
     869      *)
     870        wrt_paco_log "clfs-sysconf" ;;
     871    esac
    794872    #
    795873    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    796874    #
     
    862940                else
    863941                  wrt_run_as_chroot1  "${this_script}" "${file}"
    864942                fi
     943                wrt_paco_log "clfs-sysconf"
    865944          ;;
    866       *)  wrt_run_as_chroot1  "${this_script}" "${file}"   ;;
     945      *kernel)  wrt_paco_prep
     946                wrt_run_as_chroot1  "${this_script}" "${file}"
     947                wrt_paco_log "$pkg_tarball" ;;
     948      *)  wrt_run_as_chroot1  "${this_script}" "${file}"
     949          wrt_paco_log "clfs-sysconf" ;;
    867950    esac
    868951    #
    869952    # Housekeeping...remove any build directory(ies) except if the package build fails.
     
    9411024                else
    9421025                  wrt_run_as_root2  "${this_script}" "${file}"
    9431026                fi
     1027                wrt_paco_log "clfs-sysconf"
    9441028          ;;
    945       *)  wrt_run_as_root2  "${this_script}" "${file}"   ;;
     1029      *kernel)  wrt_paco_prep
     1030                wrt_run_as_root2  "${this_script}" "${file}"
     1031                wrt_paco_log "$pkg_tarball"   ;;
     1032      *)  wrt_run_as_root2  "${this_script}" "${file}"
     1033          wrt_paco_log "clfs-sysconf"   ;;
    9461034    esac
    9471035    #
    9481036    # Housekeeping...remove any build directory(ies) except if the package build fails.
  • CLFS/clfs.xsl

     
    4242  <!-- Locale settings -->
    4343  <xsl:param name="lang" select="C"/>
    4444
     45  <!-- Use paco? -->
     46  <xsl:param name="use_paco" select="y"/>
     47
    4548  <xsl:template match="/">
    4649    <xsl:apply-templates select="//sect1"/>
    4750  </xsl:template>
     
    103106                <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
    104107              </xsl:if>
    105108            </xsl:if>
     109            <!-- paco begin -->
     110            <!-- General rule -->
     111            <xsl:if test="$use_paco != 'n' and
     112                    @id='ch-scripts-bootscripts' or
     113                    @id='ch-scripts-udev-rules' or
     114                    @id='ch-bootable-kernel' or
     115                    (../@id='chapter-building-system' and
     116                    @id!='ch-system-temp-perl' and
     117                    contains(string(),'make') and
     118                    contains(string(),'install'))">
     119              <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     120            </xsl:if>
     121            <!-- Linux headers -->
     122            <xsl:if test="$use_paco != 'n' and
     123                    @id='ch-system-linux-headers' and
     124                    contains(string(),'install')">
     125              <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     126            </xsl:if>
     127            <!-- paco end -->
    106128            <xsl:apply-templates select=".//para/userinput | .//screen"/>
    107129            <xsl:text>exit</xsl:text>
    108130          </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/func_validate_configs.sh

     
    2020inline_doc
    2121
    2222  # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
    23   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         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL"
    24   local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
    25   local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH TARGET                         OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
    26   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 BLFS_TOOL"
     23  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         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL"
     24  local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
     25  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE          GETPKG RUNMAKE        ARCH TARGET                         OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
     26  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 BLFS_TOOL"
    2727  local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
    2828
    2929  local -r  blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
     
    9999    case $config_param in
    100100      # Allways display this, if found in ${PROGNAME}_PARAM_LIST
    101101      GETPKG          | \
     102      USE_PACO        | \
    102103      RUNMAKE         | \
    103104      TEST            | \
    104105      OPTIMIZE        | \
  • 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 = "y" ]; 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 = "y" ] && [ $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 = "y" ]; 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 = "y" ]; then
     139 case $this_script in
     140    *e2fsprogs)
     141      fnc_add_log "echo /etc/mke2fs.conf"
     142    ;;
     143    *bootscripts)
     144      fnc_add_log "echo /etc/sysconfig/rc"
     145      fnc_add_log "echo /etc/sysconfig/createfiles"
     146    ;;
     147    *glibc)
     148      fnc_add_log "find /lib -type l"
     149      fnc_add_log "echo /etc/{nsswitch.conf,ld.so.conf}"
     150    ;;
     151    *ncurses)
     152      fnc_add_log "echo /usr/lib/{libcurses.so,libncurses.so{,.5},libform.so,libpanel.so,libmenu.so}"
     153    ;;
     154    *bash)
     155      fnc_add_log "echo /bin/sh"
     156    ;;
     157    *flex)
     158      fnc_add_log "echo /usr/bin/lex"
     159    ;;
     160    *shadow)
     161      fnc_add_log "echo /etc/login.defs"
     162      fnc_add_log "echo /etc/group"
     163    ;;
     164    *hotplug)
     165      fnc_add_log "echo /var/log/hotplug"
     166      fnc_add_log "echo /var/run/usb"
     167    ;;
     168    *sysklogd)
     169      fnc_add_log "echo /etc/syslog.conf"
     170    ;;
     171    *sysvinit)
     172      fnc_add_log "echo /etc/inittab"
     173      fnc_add_log "echo /usr/bin/lastb"
     174    ;;
     175    *texinfo)
     176      fnc_add_log "echo /usr/share/info/dir"
     177    ;;
     178    *udev)
     179      fnc_add_log "find /lib/udev/devices"
     180      fnc_add_log "echo /lib/firmware"
     181      fnc_add_log "find /etc/udev/rules.d -type f"
     182      fnc_add_log "echo /etc/udev/udev.conf"
     183    ;;
     184    *udev-rules)
     185      fnc_add_log "echo /lib/udev/devices/{null,console}"
     186    ;;
     187    *util-linux)
     188      fnc_add_log "echo /var/lib/hwclock"
     189      fnc_add_log "echo /etc/nologin.txt"
     190    ;;
     191    *vim)
     192      fnc_add_log "echo /etc/vimrc"
     193    ;;
     194    # Rules below here will log configuration files created in {C,H}LFS
     195    # They will end up in a log named {c,h}lfs-sysconf
     196    *setclock)
     197      fnc_add_log "echo /etc/sysconfig/clock"
     198    ;;
     199    *inputrc)
     200      fnc_add_log "echo /etc/inputrc"
     201    ;;
     202    *profile)
     203      fnc_add_log "echo /etc/profile"
     204    ;;
     205    *hostname)
     206      fnc_add_log "echo /etc/sysconfig/network"
     207    ;;
     208    *localnet)
     209      fnc_add_log "echo /etc/sysconfig/network"
     210    ;;
     211    *hosts)
     212      fnc_add_log "echo /etc/hosts"
     213    ;;
     214    *network)
     215      fnc_add_log "echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4"
     216      fnc_add_log "echo /etc/resolv.conf"
     217    ;;
     218    *fstab)
     219      fnc_add_log "echo /etc/fstab"
     220    ;;
     221    *theend | *finished)
     222      fnc_add_log "echo /etc/$PROGNAME-release"
     223      fnc_add_log "echo /var/run/utmp"
     224      fnc_add_log "echo /var/log/btmp"
     225      fnc_add_log "echo /var/log/wtmp"
     226      fnc_add_log "echo /var/log/lastlog"
     227    ;;
     228  esac
     229fi
     230}
     231
     232
     233#----------------------------------#
     234check_log_package() {              #
     235#----------------------------------#
     236# Maybe don't need this function, but it will avoid writing some
     237# unnecessary paco commands in the Makefile.
     238
     239case $this_script in
     240  *changingowner)   LOG_PACKAGE=0 ;;
     241  *creatingdirs)    LOG_PACKAGE=0 ;;
     242  *createfiles)     LOG_PACKAGE=0 ;;
     243  *pwdgroup)        LOG_PACKAGE=0 ;;
     244  *devices)         LOG_PACKAGE=0 ;;
     245  *stripping)       LOG_PACKAGE=0 ;;
     246  *strippingagain)  LOG_PACKAGE=0 ;;
     247  *adjusting)       LOG_PACKAGE=0 ;;
     248  *temp-perl)       LOG_PACKAGE=0 ;;
     249  *readjusting)     LOG_PACKAGE=0 ;;
     250  *setclock)        LOG_PACKAGE=0 ;;
     251  *inputrc)         LOG_PACKAGE=0 ;;
     252  *profile)         LOG_PACKAGE=0 ;;
     253  *hostname)        LOG_PACKAGE=0 ;;
     254  *localnet)        LOG_PACKAGE=0 ;;
     255  *hosts)           LOG_PACKAGE=0 ;;
     256  *network)         LOG_PACKAGE=0 ;;
     257  *fstab)           LOG_PACKAGE=0 ;;
     258  *theend)          LOG_PACKAGE=0 ;;
     259  *finished)        LOG_PACKAGE=0 ;;
     260  *)                LOG_PACKAGE=1 ;;
     261esac
     262}
     263
     264#----------------------------------#
     265get_paco_src() {                   #
     266#----------------------------------#
     267# Download the paco sources
     268# We don't do any MD5SUM checking as of yet
     269# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
     270
     271local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
     272local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
     273
     274# Test if paco is to be used
     275[[ ! "$USE_PACO" = "y" ]] && return
     276
     277# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
     278if [ ! -z ${SRC_ARCHIVE} ] &&
     279   [   -d ${SRC_ARCHIVE} ] &&
     280   [   -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
     281  cp ${SRC_ARCHIVE}/$PACO_FILE .
     282  echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
     283  fromARCHIVE=1
     284else
     285  echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
     286  fromARCHIVE=0
     287  # If the file does not exist yet in /sources download a fresh one
     288  if [ ! -f $PACO_FILE ] ; then
     289    if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
     290      gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
     291      continue
     292    fi
     293  fi
     294fi
     295
     296# Copy the freshly downloaded file to the source archive.
     297if [ ! -z ${SRC_ARCHIVE}  ] &&
     298   [   -d ${SRC_ARCHIVE}  ] &&
     299   [   -w ${SRC_ARCHIVE}  ] &&
     300   [ "$fromARCHIVE" = "0" ] ; then
     301     echo "Storing file:<$PACO_FILE> in the package archive"
     302     cp -f $PACO_FILE ${SRC_ARCHIVE}
     303fi
     304}
     305
     306
     307#----------------------------------#
     308check_build_model() {              #
     309#----------------------------------#
     310# Check what script we're running, and set some switches accordingly
     311
     312CLFS_BOOT=0
     313
     314case $PROGNAME in
     315  hlfs)
     316    # Not using Paco with uClibc, even if requested
     317    if [ "$MODEL" = "uclibc" ]; then
     318      USE_PACO=n
     319    fi
     320  ;;
     321  clfs)
     322    # CLFS boot method require it's own commands
     323    if [ "$METHOD" = "boot" ]; then
     324      CLFS_BOOT=1
     325    fi
     326  ;;
     327esac
     328}
  • 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

     
    532532                 --stringparam timezone $TIMEZONE \
    533533                 --stringparam page $PAGE \
    534534                 --stringparam lang $LANG \
     535                 --stringparam use_paco $USE_PACO \
    535536                 -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
    536537      ;;
    537538
     
    557558                 --stringparam lang $LANG \
    558559                 --stringparam lc_all $LC_ALL \
    559560                 --stringparam grsecurity_host $GRSECURITY_HOST \
     561                 --stringparam use_paco $USE_PACO \
    560562                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    561563      ;;
    562564    lfs)
     
    569571                 --stringparam timezone $TIMEZONE \
    570572                 --stringparam page $PAGE \
    571573                 --stringparam lang $LANG \
     574                 --stringparam use_paco $USE_PACO \
    572575                 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    573576      ;;
    574577    *) exit 1 ;;
     
    653656    # Generate URLs file
    654657  create_urls
    655658
     659    # If Paco is to be used, then download the sources
     660  get_paco_src
     661
    656662  IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
    657663  for line in `cat urls.lst`; do
    658664    IFS=$saveIFS  # Restore the system defaults
  • HLFS/hlfs.xsl

     
    4343  <xsl:param name="lang" select="C"/>
    4444  <xsl:param name="lc_all" select="C"/>
    4545
     46  <!-- Use paco? -->
     47  <xsl:param name="use_paco" select="y"/>
     48
    4649  <xsl:template match="/">
    4750    <xsl:apply-templates select="//sect1"/>
    4851  </xsl:template>
     
    193196      <!-- Fixing bootscripts installation -->
    194197      <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
    195198                string() = 'make install'">
     199        <!-- inserting LD_PRELOAD before installing bootscripts -->
     200        <xsl:if test="$use_paco != 'n' and $model != 'uclibc'">
     201          <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     202        </xsl:if>
    196203        <xsl:text>make install&#xA;</xsl:text>
    197204        <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
    198205      </xsl:when>
     
    292299        <xsl:apply-templates/>
    293300        <xsl:text> || true&#xA;</xsl:text>
    294301      </xsl:when>
     302      <!-- paco begin -->
     303      <!-- General rule -->
     304      <xsl:when test="$use_paco != 'n' and $model != 'uclibc' and
     305                ancestor::chapter[@id != 'chapter-temporary-tools'] and
     306                contains(string(),'make') and
     307                contains(string(),'install')">
     308        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     309        <xsl:apply-templates/>
     310        <xsl:text>&#xA;</xsl:text>
     311      </xsl:when>
     312      <!-- Linux-libc-headers -->
     313      <xsl:when test="$use_paco != 'n' and $model != 'uclibc' and
     314                ancestor::sect1[@id='ch-system-linux-headers'] and
     315                contains(string(),'install ')">
     316        <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
     317        <xsl:apply-templates/>
     318        <xsl:text>&#xA;</xsl:text>
     319      </xsl:when>
     320      <!-- paco end -->
    295321      <!-- The rest of commands -->
    296322      <xsl:otherwise>
    297323        <xsl:apply-templates/>
  • HLFS/master.sh

     
    4747EOF
    4848) >> $MKFILE.tmp
    4949      [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
     50      wrt_paco_prep
    5051      wrt_run_as_chroot1 "$toolchain" "$this_script"
     52      wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
    5153      ;;
    5254
    5355    *)
     
    281283    # Keep the script file name
    282284    this_script=`basename $file`
    283285
     286    # If this script is *-paco, then skip it
     287    case $this_script in
     288      *paco )     continue ;;
     289    esac
     290
    284291    # Skip this script depending on jhalfs.conf flags set.
    285292    case $this_script in
    286293        # We'll run the chroot commands differently than the others, so skip them in the
     
    290297      *-stripping* )  [[ "$STRIP" = "n" ]] && continue ;;
    291298    esac
    292299
     300    # Install paco as the first package in ch6, before installing
     301    # linux-libc-headers, except in iterartive builds
     302    if [[ -z "$N" ]]; then
     303      case $this_script in
     304        *linux-headers)
     305          TMP_SCRIPT="$this_script"
     306          this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
     307          wrt_paco_inst "$this_script"
     308          this_script="$TMP_SCRIPT" ;;
     309      esac
     310    fi
     311
    293312    # Grab the name of the target
    294313    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    295314
     
    355374        wrt_RunAsRoot "${this_script}" "${file}"
    356375        ;;
    357376      *)   # The rest of Chapter06
     377        wrt_paco_prep
    358378        wrt_run_as_chroot1 "${this_script}" "${file}"
     379        wrt_paco_log "$pkg_tarball"
    359380       ;;
    360381    esac
    361382    #
     
    375396    PREV=${this_script}${N}
    376397    # Set system_build envar for iteration targets
    377398    system_build=$chapter6
     399
     400    # Reinstall paco after the toolchain has been readjusted.
     401    case "${this_script}" in
     402      *readjusting)
     403        TMP_SCRIPT="$this_script"
     404        this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
     405        wrt_paco_inst "$this_script"
     406        this_script="$TMP_SCRIPT" ;;
     407    esac
     408
    378409  done # end for file in chapter06/*
    379410
    380411}
     
    433464        else  # Initialize the log and run the script
    434465          wrt_run_as_chroot2 "${this_script}" "${file}"
    435466        fi
     467        wrt_paco_log "hlfs-sysconf"
    436468        ;;
     469      *kernel)       wrt_paco_prep
     470                     wrt_run_as_chroot2 "$this_script" "$file"
     471                     wrt_paco_log "$(get_package_tarball_name "linux")"
     472        ;;
     473      *bootscripts)  wrt_paco_prep
     474                     wrt_run_as_chroot2 "$this_script" "$file"
     475                     wrt_paco_log "$(get_package_tarball_name "lfs-bootscripts")"
     476        ;;
    437477      *)  # All other scripts
    438478        wrt_run_as_chroot2 "${this_script}" "${file}"
     479        wrt_paco_log "hlfs-sysconf"
    439480        ;;
    440481    esac
    441482
  • jhalfs

     
    111111REPORT=${REPORT:=n}
    112112VIMLANG=${VIMLANG:-n}
    113113GRSECURITY_HOST=${GRSECURITY_HOST:-n}
     114USE_PACO=${USE_PACO:-n}
    114115
    115116# Book surces envars
    116117BRANCH_ID=${BRANCH_ID:=development}
     
    269270  [[ $VERBOSITY > 0 ]] && echo "OK"
    270271fi
    271272#
     273# paco module
     274if [[ "$USE_PACO" = "y" ]]; then
     275  [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
     276  source $COMMON_DIR/paco-functions
     277  [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
     278  [[ $VERBOSITY > 0 ]] && echo "OK"
     279fi
     280#
    272281# optimize module
    273282if [[ "$OPTIMIZE" != "0" ]]; then
    274283  [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
     
    314323#
    315324cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
    316325#
     326[[ $USE_PACO != "n" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
     327#
    317328[[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
    318329#
    319330if [[ "$COMPARE" = "y" ]]; then
  • Config.in

     
    786786
    787787#--- End Advanced Features
    788788endmenu
     789
     790#--- PACO
     791config  USE_PACO
     792        bool    "Use PACO"
     793        default n
     794        depends on !BOOK_BLFS && !BOOK_CLFS2 && !LIB_UCLIBC
     795
     796        config  PACO_VERSION
     797                string  "PACO package version"
     798                default "1.10.10"
     799                depends USE_PACO
     800
     801        config  PACO_FILE
     802                string  "PACO package full name"
     803                default "paco-$PACO_VERSION.tar.bz2"
     804                depends USE_PACO
     805                help
     806                        #-- You can use .tar.gz if preferred
     807
     808        config  PACO_MIRROR1
     809                string  "Sourceforge mirror 1"
     810                default "heanet"
     811                depends USE_PACO
     812                help
     813                        #-- Sourceforge mirror to use for Paco source download
     814                        #
     815                        # Europe: heanet, belnet, puzzle, surfnet, switch, kent
     816                        # North America: superb-east, superb-west, umn, easynews
     817                        # South America: ufpr
     818                        # Asia: nchc, jaist
     819                        # Australia: optusnet
     820
     821        config  PACO_MIRROR2
     822                string  "Sourceforge mirror 2"
     823                default "kent"
     824                depends USE_PACO
     825                help
     826                        #-- Sourceforge mirror to use for Paco source download
     827                        #
     828                        # Europe: heanet, belnet, puzzle, surfnet, switch, kent
     829                        # North America: superb-east, superb-west, umn, easynews
     830                        # South America: ufpr
     831                        # Asia: nchc, jaist
     832                        # Australia: optusnet
     833
     834        #-- Internal Settings
     835        menu "--- Internal Settings (WARNING: for paco developers only)"
     836                depends USE_PACO
     837
     838                config  PACO_INCLUDE
     839                        string  "Include dirs"
     840                        default "/"
     841
     842                config  PACO_EXCLUDE
     843                        string  "Exclude dirs"
     844                        default "/${SCRIPT_ROOT}"
     845
     846                config  PACO_TMPFILE
     847                        string  "Temp file"
     848                        default "/tmp/paco.tmp"
     849
     850                config  LD_PRELOAD
     851                        string  "LD_PRELOAD"
     852                        default "/usr/lib/libpaco-log.so"
     853
     854        #--- End Internal Settings
     855        endmenu
     856#--- End PACO
     857
Note: See TracBrowser for help on using the repository browser.