source: contrib/jhalfs-paco.patch@ 8715be1

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

Fixed the paco patch update.

  • Property mode set to 100644
File size: 24.5 KB
RevLine 
[059822c]1Index: LFS/master.sh
2===================================================================
[8715be1]3--- LFS/master.sh (revision 2864)
[059822c]4+++ LFS/master.sh (working copy)
[9b09518]5@@ -173,6 +173,11 @@
[8230977]6 # Keep the script file name
7 this_script=`basename $file`
8
9+ # If $this_script corresponds to a paco script, then skip it
10+ case "${this_script}" in
11+ *paco) continue ;;
12+ esac
13+
14 # We'll run the chroot commands differently than the others, so skip them in the
15 # dependencies and target creation.
16 case "${this_script}" in
[9b09518]17@@ -180,6 +185,18 @@
[6821737]18 *stripping*) [[ "${STRIP}" = "0" ]] && continue ;;
19 esac
20
[4795dfb]21+ # Install paco as the first package in ch6, before installing
22+ # linux-libc-headers, except in iterartive builds
23+ if [[ -z "$N" ]]; then
24+ case $this_script in
25+ *linux-libc-headers)
[799b0d1]26+ TMP_SCRIPT="$this_script"
27+ this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'`
28+ wrt_paco_inst "$this_script"
29+ this_script="$TMP_SCRIPT" ;;
[4795dfb]30+ esac
31+ fi
[6821737]32+
[4795dfb]33 # Grab the name of the target
34 name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
35
[9b09518]36@@ -232,7 +249,9 @@
[059822c]37 # and not to use chroot.
38 case "${this_script}" in
39 *kernfs) wrt_run_as_root "${this_script}" "$file" ;;
40- *) wrt_run_as_chroot1 "${this_script}" "$file" ;;
41+ *) wrt_paco_prep
42+ wrt_run_as_chroot1 "${this_script}" "$file"
[2b88404]43+ wrt_paco_log "$pkg_tarball" ;;
[059822c]44 esac
45
46 # Remove the build directory(ies) except if the package build fails.
[9b09518]47@@ -252,6 +271,16 @@
[4795dfb]48 PREV=${this_script}${N}
49 # Set system_build envar for iteration targets
50 system_build=$chapter6
[059822c]51+
[6821737]52+ # Reinstalling paco after readsjusting the toolchain.
[059822c]53+ case "${this_script}" in
[6821737]54+ *readjusting)
[799b0d1]55+ TMP_SCRIPT="$this_script"
56+ this_script=`echo ${this_script} | sed -e 's/readjusting/x-paco/'`
57+ wrt_paco_inst "$this_script"
58+ this_script="$TMP_SCRIPT" ;;
[059822c]59+ esac
60+
61 done # end for file in chapter06/*
62 }
63
[9b09518]64@@ -312,8 +341,18 @@
[b9ec725]65 else
[059822c]66 wrt_run_as_chroot2 "$this_script" "$file"
67 fi
[b9ec725]68+ wrt_paco_log "lfs-sysconf"
[059822c]69 ;;
70+ *kernel) wrt_paco_prep
71+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]72+ wrt_paco_log "$pkg_tarball"
[059822c]73+ ;;
74+ *bootscripts) wrt_paco_prep
75+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]76+ wrt_paco_log "$pkg_tarball"
[059822c]77+ ;;
78 *) wrt_run_as_chroot2 "$this_script" "$file"
[b9ec725]79+ wrt_paco_log "lfs-sysconf"
[059822c]80 ;;
81 esac
[b9ec725]82
[059822c]83Index: LFS/lfs.xsl
84===================================================================
[8715be1]85--- LFS/lfs.xsl (revision 2864)
[059822c]86+++ LFS/lfs.xsl (working copy)
87@@ -32,6 +32,9 @@
88 <!-- Locale settings -->
[c665386]89 <xsl:param name="lang" select="C"/>
[059822c]90
91+ <!-- Use paco? -->
92+ <xsl:param name="use_paco" select="1"/>
93+
94 <xsl:template match="/">
95 <xsl:apply-templates select="//sect1"/>
96 </xsl:template>
[9b09518]97@@ -206,6 +209,33 @@
[059822c]98 <xsl:apply-templates/>
99 <xsl:text> || true&#xA;</xsl:text>
100 </xsl:when>
101+ <!-- paco begin -->
102+ <!-- General rule -->
103+ <xsl:when test="$use_paco != '0' and
104+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
105+ contains(string(),'make') and
106+ contains(string(),'install')">
107+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
108+ <xsl:apply-templates/>
109+ <xsl:text>&#xA;</xsl:text>
110+ </xsl:when>
111+ <!-- Linux-libc-headers -->
112+ <xsl:when test="$use_paco != '0' and
113+ ancestor::sect1[@id='ch-system-linux-libc-headers'] and
114+ contains(string(),'install ')">
115+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
116+ <xsl:apply-templates/>
117+ <xsl:text>&#xA;</xsl:text>
118+ </xsl:when>
119+ <!-- Unset LD_PRELOAD before second make in Zlib -->
120+ <xsl:when test="$use_paco != '0' and
121+ ancestor::sect1[@id='ch-system-zlib'] and
122+ contains(string(),'make clean')">
123+ <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
124+ <xsl:apply-templates/>
125+ <xsl:text>&#xA;</xsl:text>
126+ </xsl:when>
127+ <!-- paco end -->
128 <!-- The rest of commands -->
129 <xsl:otherwise>
130 <xsl:apply-templates/>
[799b0d1]131Index: common/paco-build-hlfs.sh
132===================================================================
133--- common/paco-build-hlfs.sh (revision 0)
134+++ common/paco-build-hlfs.sh (revision 0)
[b9ec725]135@@ -0,0 +1,12 @@
[799b0d1]136+#!/bin/sh
137+set -e
138+
139+cd $PKGDIR
[b9ec725]140+./configure --sysconfdir=/etc \
141+ --enable-scripts \
[799b0d1]142+ --disable-gpaco \
[b9ec725]143+ --disable-static \
144+ --with-pic &&
[799b0d1]145+make &&
146+make install &&
147+make logme
[059822c]148Index: common/config
149===================================================================
[8715be1]150--- common/config (revision 2864)
[059822c]151+++ common/config (working copy)
[8715be1]152@@ -86,6 +86,23 @@
[4795dfb]153 #--- Run farce testing 0(no)/1(yes)
154 RUN_FARCE=0
[d748b31]155
[059822c]156+#==== PACO VARIABLES ====
[4795dfb]157+#--- Use paco? 0(no)/1(yes)
[059822c]158+USE_PACO=1
[9b09518]159+PACO_VERSION=1.10.10
[059822c]160+
161+#--- Name of the Paco source package
[8715be1]162+PACO_FILE=paco-$PACO_VERSION.tar.bz2 # (use .tar.gz if preferred)
163+
164+#--- Sourceforge mirror to use for Paco source download
165+# Europe: heanet, belnet, puzzle, surfnet, switch, kent
166+# North America: superb-east, superb-west, umn, easynews
167+# South America: ufpr
168+# Asia: nchc, jaist
169+# Australia: optusnet
170+PACO_MIRROR1=heanet
171+PACO_MIRROR2=kent
[059822c]172+
[4795dfb]173 #==== INTERNAL VARIABLES ====
174 # Don't edit it unless you know what you are doing
175
[8715be1]176@@ -103,3 +120,9 @@
[4795dfb]177
178 #--- farce report log directory
179 FARCELOGDIR=$LOGDIR/farce
180+
181+#--- Variables needed by paco
[059822c]182+PACO_INCLUDE=/
[41dfd7c]183+PACO_EXCLUDE=/${SCRIPT_ROOT}
[059822c]184+PACO_TMPFILE=/tmp/paco.tmp
185+LD_PRELOAD=/usr/lib/libpaco-log.so
186Index: common/func_validate_configs.sh
187===================================================================
[8715be1]188--- common/func_validate_configs.sh (revision 2864)
[059822c]189+++ common/func_validate_configs.sh (working copy)
[9b09518]190@@ -86,10 +86,10 @@
[059822c]191 inline_doc
192
193 # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
[9b09518]194- 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"
195- 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"
196- local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
197- 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"
198+ 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"
199+ 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"
200+ local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
201+ 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"
[059822c]202
203 local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
204 local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
[9b09518]205@@ -179,6 +179,7 @@
[f358747]206 [[ "$GETPKG" = "1" ]] && validate_against_str "x0x x1x"
207 fi ;;
[4795dfb]208 RUNMAKE) validate_against_str "x0x x1x" ;;
209+ USE_PACO) validate_against_str "x0x x1x" ;;
210 REPORT) validate_against_str "x0x x1x"
211 if [[ "${!config_param}" = "1" ]]; then
212 if [[ `type -p bc` ]]; then
[059822c]213Index: common/paco-functions
214===================================================================
215--- common/paco-functions (revision 0)
216+++ common/paco-functions (revision 0)
[8715be1]217@@ -0,0 +1,251 @@
[059822c]218+#!/bin/bash
219+
220+#----------------------------#
221+wrt_paco_inst() { #
222+#----------------------------#
[d748b31]223+
224+# Not using Paco with uClibc, even if requested
225+if [ $PROGNAME = "hlfs" ]; then
226+ if [ $MODEL = "uclibc" ]; then
[6821737]227+ USE_PACO=0
[d748b31]228+ fi
229+fi
230+
231+if [ $USE_PACO != 0 ]; then
[6821737]232+ paco_script="$1"
233+ paco_file="chapter06/$paco_script"
234+ chapter6="$chapter6 $paco_script"
235+
236+ # Copy the paco build script to the correct directory and make it executable
[799b0d1]237+ cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
[6821737]238+ chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
[059822c]239+
240+ # Write target, dependency and unpack
[6821737]241+ wrt_target "$paco_script" "$PREV"
[059822c]242+ wrt_unpack2 "$PACO_FILE"
243+
244+ # Run the script
[6821737]245+ wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
[059822c]246+
247+ # Clean up
[6821737]248+ wrt_remove_build_dirs "paco"
[2b88404]249+ wrt_touch
[059822c]250+
251+ # Override the PREV variable
[6821737]252+ PREV="$paco_script"
[059822c]253+fi
254+}
255+
256+
257+#----------------------------------#
258+wrt_paco_prep() { # Export Paco variables
259+#----------------------------------# and remove tmpfile
[d748b31]260+
261+# Not using Paco with uClibc, even if requested
262+if [ $PROGNAME = "hlfs" ]; then
263+ if [ $MODEL = "uclibc" ]; then
[6821737]264+ USE_PACO=0
[d748b31]265+ fi
266+fi
267+
[b9ec725]268+check_log_package
269+
270+if [ $USE_PACO != 0 ] && [ $LOG_PACKAGE != 0 ]; then
[059822c]271+(
272+cat << EOF
273+ @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
[b9ec725]274+ echo "export PACO_EXCLUDE=\$(SRC):$PACO_EXCLUDE" >> envars && \\
[059822c]275+ echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
276+ rm -f \$(MOUNT_PT)$PACO_TMPFILE
277+EOF
278+) >> $MKFILE.tmp
279+fi
280+}
281+
282+
283+#----------------------------------#
284+wrt_paco_log() { # If the tmpfile exist, then log the current package
285+#----------------------------------# and remove tempfile
[d748b31]286+local PACKAGE
287+
[2b88404]288+PACKAGE=`echo $1 | sed -e 's/.tar.*//'`
[059822c]289+
[d748b31]290+# Not using Paco with uClibc, even if requested
291+if [ $PROGNAME = "hlfs" ]; then
292+ if [ $MODEL = "uclibc" ]; then
[6821737]293+ USE_PACO=0
[059822c]294+ fi
[d748b31]295+fi
[059822c]296+
[b9ec725]297+check_log_package
298+
299+if [ $USE_PACO != 0 ]; then
300+ if [ $LOG_PACKAGE != 0 ]; then
[059822c]301+(
302+cat << EOF
303+ @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
[4795dfb]304+ \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\
[059822c]305+ rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
306+ fi;
307+EOF
308+) >> $MKFILE.tmp
[b9ec725]309+ fi
310+ wrt_paco_add_log
[059822c]311+fi
[b9ec725]312+}
[059822c]313+
[b9ec725]314+
315+#----------------------------------#
316+wrt_paco_add_log() { #
317+#----------------------------------#
318+# Some packages create files using bash redirection, which the LD_PRELOAD lib don't notice
319+# These rules will add the missing files to the proper logs.
320+# Most of these is not needed for HLFS, but they do no harm.
321+if [ $USE_PACO != 0 ]; then
322+ case $this_script in
323+ *glibc)
324+ echo -e "\t@\$(CHROOT1) 'find /lib -type l | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
325+ echo -e "\t@\$(CHROOT1) 'find /etc/{nsswitch.conf,ld.so.conf} | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
326+ ;;
327+ *ncurses)
328+ LIBS="/usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
329+ echo -e "\t@\$(CHROOT1) 'find $LIBS | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
330+ ;;
331+ *bash)
332+ echo -e "\t@\$(CHROOT1) 'echo /bin/sh | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
333+ ;;
334+ *flex)
335+ echo -e "\t@\$(CHROOT1) 'echo /usr/bin/lex | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
336+ ;;
337+ *shadow)
338+ echo -e "\t@\$(CHROOT1) 'echo /etc/login.defs | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
339+ ;;
340+ *hotplug)
341+ echo -e "\t@\$(CHROOT1) 'echo /var/log/hotplug | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
342+ echo -e "\t@\$(CHROOT1) 'echo /var/run/usb | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
343+ ;;
344+ *sysklogd)
345+ echo -e "\t@\$(CHROOT1) 'echo /etc/syslog.conf | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
346+ ;;
347+ *sysvinit)
348+ echo -e "\t@\$(CHROOT1) 'echo /etc/inittab | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
349+ ;;
350+ *udev)
351+ echo -e "\t@\$(CHROOT1) 'find /lib/udev/devices | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
352+ echo -e "\t@\$(CHROOT1) 'echo /lib/firmware | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
353+ echo -e "\t@\$(CHROOT1) 'find /etc/udev/rules.d -type f | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
354+ ;;
355+ *util-linux)
356+ echo -e "\t@\$(CHROOT1) 'echo /var/lib/hwclock | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
357+ echo -e "\t@\$(CHROOT1) 'echo /etc/nologin.txt | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
358+ ;;
359+ *vim)
360+ echo -e "\t@\$(CHROOT1) 'echo /etc/vimrc | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
361+ ;;
362+ # Rules below here will log configuration files created in LFS and HLFS
363+ # They will end up in a log named {h}lfs-sysconf
364+ *setclock)
365+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/clock | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
366+ ;;
367+ *inputrc)
368+ echo -e "\t@\$(CHROOT2) 'echo /etc/inputrc | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
369+ ;;
370+ *profile)
371+ echo -e "\t@\$(CHROOT2) 'echo /etc/profile | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
372+ ;;
373+ *hostname)
374+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
375+ ;;
376+ *localnet)
377+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
378+ ;;
379+ *hosts)
380+ echo -e "\t@\$(CHROOT2) 'echo /etc/hosts | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
381+ ;;
382+ *network)
383+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4 | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
384+ echo -e "\t@\$(CHROOT2) 'echo /etc/resolv.conf | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
385+ ;;
386+ *fstab)
387+ echo -e "\t@\$(CHROOT2) 'echo /etc/fstab | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
388+ ;;
389+ *theend) # LFS
390+ echo -e "\t@\$(CHROOT2) 'echo /etc/$PROGNAME-release | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
391+ ;;
392+ *finished) # HLFS
393+ echo -e "\t@\$(CHROOT2) 'echo /etc/$PROGNAME-release | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
394+ ;;
395+ esac
[059822c]396+fi
397+}
[b9ec725]398+
399+
400+#----------------------------------#
401+check_log_package() { #
402+#----------------------------------#
403+# Maybe don't need this function, but it will avoid writing some
404+# unnecessary paco commands in the Makefile.
405+
406+case $this_script in
[2b88404]407+ *changingowner) LOG_PACKAGE=0 ;;
[b9ec725]408+ *creatingdirs) LOG_PACKAGE=0 ;;
409+ *createfiles) LOG_PACKAGE=0 ;;
[2b88404]410+ *pwdgroup) LOG_PACKAGE=0 ;;
411+ *devices) LOG_PACKAGE=0 ;;
[b9ec725]412+ *strippingagain) LOG_PACKAGE=0 ;;
413+ *readjusting) LOG_PACKAGE=0 ;;
414+ *setclock) LOG_PACKAGE=0 ;;
415+ *inputrc) LOG_PACKAGE=0 ;;
416+ *profile) LOG_PACKAGE=0 ;;
417+ *hostname) LOG_PACKAGE=0 ;;
418+ *localnet) LOG_PACKAGE=0 ;;
419+ *hosts) LOG_PACKAGE=0 ;;
420+ *network) LOG_PACKAGE=0 ;;
421+ *fstab) LOG_PACKAGE=0 ;;
422+ *theend) LOG_PACKAGE=0 ;;
423+ *finished) LOG_PACKAGE=0 ;;
424+ *) LOG_PACKAGE=1 ;;
425+esac
426+}
[8715be1]427+
428+#----------------------------------#
429+get_paco_src() { #
430+#----------------------------------#
431+# Download the paco sources
432+# We don't do any MD5SUM checking as of yet
433+# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
434+
435+local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
436+local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
437+
438+# Test if paco is to be used
439+[ ! "$USE_PACO" = "1" ] && return
440+
441+# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
442+if [ ! -z ${SRC_ARCHIVE} ] &&
443+ [ -d ${SRC_ARCHIVE} ] &&
444+ [ -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
445+ cp ${SRC_ARCHIVE}/$PACO_FILE .
446+ echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
447+ fromARCHIVE=1
448+else
449+ echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
450+ fromARCHIVE=0
451+ # If the file does not exist yet in /sources download a fresh one
452+ if [ ! -f $PACO_FILE ] ; then
453+ if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
454+ gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
455+ continue
456+ fi
457+ fi
458+fi
459+
460+# Copy the freshly downloaded file to the source archive.
461+if [ ! -z ${SRC_ARCHIVE} ] &&
462+ [ -d ${SRC_ARCHIVE} ] &&
463+ [ -w ${SRC_ARCHIVE} ] &&
464+ [ "$fromARCHIVE" = "0" ] ; then
465+ echo "Storing file:<$PACO_FILE> in the package archive"
466+ cp -f $PACO_FILE ${SRC_ARCHIVE}
467+fi
468+}
[799b0d1]469Index: common/paco-build-lfs.sh
[6821737]470===================================================================
[799b0d1]471--- common/paco-build-lfs.sh (revision 0)
472+++ common/paco-build-lfs.sh (revision 0)
[b9ec725]473@@ -0,0 +1,10 @@
[6821737]474+#!/bin/sh
475+set -e
476+
477+cd $PKGDIR
[b9ec725]478+./configure --sysconfdir=/etc \
479+ --enable-scripts \
480+ --disable-gpaco &&
[6821737]481+make &&
482+make install &&
483+make logme
[059822c]484Index: common/common-functions
485===================================================================
[8715be1]486--- common/common-functions (revision 2864)
[059822c]487+++ common/common-functions (working copy)
[a708b15]488@@ -69,6 +69,9 @@
[059822c]489 in the configuration file has the proper packages and patches for the
490 book version being processed.
491
492+${BOLD} --no-paco${OFF}
493+ dissables paco logging feature.
494+
[f3ae556]495 ${BOLD} -O, --optimize${OFF}
496 Optimize [0-2]
497 0 = no optimization
[9b09518]498@@ -759,6 +762,7 @@
[059822c]499 --stringparam lc_all $LC_ALL \
500 --stringparam keymap $KEYMAP \
501 --stringparam grsecurity_host $GRSECURITY_HOST \
502+ --stringparam use_paco $USE_PACO \
503 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
504 ;;
505 lfs)
[9b09518]506@@ -770,6 +774,7 @@
[059822c]507 --stringparam timezone $TIMEZONE \
508 --stringparam page $PAGE \
509 --stringparam lang $LANG \
510+ --stringparam use_paco $USE_PACO \
511 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
512 ;;
[8230977]513 *) exit 1 ;;
[8715be1]514@@ -836,6 +841,9 @@
515 # Generate URLs file
516 create_urls
517
518+ # If Paco is to be used, then download the sources
519+ get_paco_src
520+
521 IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
522 for line in `cat urls.lst`; do
523 IFS=$saveIFS # Restore the system defaults
[059822c]524Index: HLFS/hlfs.xsl
525===================================================================
[8715be1]526--- HLFS/hlfs.xsl (revision 2864)
[059822c]527+++ HLFS/hlfs.xsl (working copy)
528@@ -39,6 +39,9 @@
[c665386]529 <xsl:param name="lang" select="C"/>
530 <xsl:param name="lc_all" select="C"/>
[059822c]531
532+ <!-- Use paco? -->
533+ <xsl:param name="use_paco" select="1"/>
534+
535 <xsl:template match="/">
536 <xsl:apply-templates select="//sect1"/>
537 </xsl:template>
[9b09518]538@@ -177,6 +180,10 @@
[059822c]539 <!-- Fixing bootscripts installation -->
540 <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
541 string() = 'make install'">
542+ <!-- inserting LD_PRELOAD before installing bootscripts -->
543+ <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
544+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
545+ </xsl:if>
546 <xsl:text>make install&#xA;</xsl:text>
547 <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
548 </xsl:when>
[9b09518]549@@ -237,6 +244,27 @@
[059822c]550 <xsl:apply-templates/>
551 <xsl:text> || true&#xA;</xsl:text>
552 </xsl:when>
[9b09518]553+
[059822c]554+ <!-- paco begin -->
555+ <!-- General rule -->
556+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
557+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
558+ contains(string(),'make') and
559+ contains(string(),'install')">
560+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
[9b09518]561+ <xsl:apply-templates/>
[059822c]562+ <xsl:text>&#xA;</xsl:text>
563+ </xsl:when>
564+ <!-- Linux-libc-headers -->
565+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
[9b09518]566+ ancestor::sect1[@id='ch-system-linux-headers'] and
[059822c]567+ contains(string(),'install ')">
568+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
[9b09518]569+ <xsl:apply-templates/>
[059822c]570+ <xsl:text>&#xA;</xsl:text>
571+ </xsl:when>
572+ <!-- paco end -->
[9b09518]573+
[059822c]574 <!-- The rest of commands -->
575 <xsl:otherwise>
576 <xsl:apply-templates/>
577Index: HLFS/master.sh
578===================================================================
[8715be1]579--- HLFS/master.sh (revision 2864)
[059822c]580+++ HLFS/master.sh (working copy)
[9b09518]581@@ -76,7 +76,9 @@
582 @echo "export PKGDIR=\$(SRC)" > envars
583 EOF
584 ) >> $MKFILE.tmp
585+ wrt_paco_prep
586 wrt_run_as_chroot1 "$toolchain" "$this_script"
587+ wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
588 ;;
589
590 *)
591@@ -310,6 +312,11 @@
[8230977]592 # Keep the script file name
593 this_script=`basename $file`
594
595+ # If this script is *-paco, then skip it
596+ case $this_script in
597+ *paco ) continue ;;
598+ esac
599+
600 # Skip this script depending on jhalfs.conf flags set.
601 case $this_script in
602 # We'll run the chroot commands differently than the others, so skip them in the
[9b09518]603@@ -319,6 +326,18 @@
[4795dfb]604 *-stripping* ) [[ "$STRIP" = "0" ]] && continue ;;
[6821737]605 esac
606
[4795dfb]607+ # Install paco as the first package in ch6, before installing
608+ # linux-libc-headers, except in iterartive builds
609+ if [[ -z "$N" ]]; then
610+ case $this_script in
[9b09518]611+ *linux-headers)
[799b0d1]612+ TMP_SCRIPT="$this_script"
[9b09518]613+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
[799b0d1]614+ wrt_paco_inst "$this_script"
615+ this_script="$TMP_SCRIPT" ;;
[4795dfb]616+ esac
617+ fi
[6821737]618+
[4795dfb]619 # Grab the name of the target
620 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
621
[9b09518]622@@ -385,7 +404,9 @@
623 wrt_RunAsRoot "hlfs" "${this_script}" "${file}"
[059822c]624 ;;
625 *) # The rest of Chapter06
626+ wrt_paco_prep
627 wrt_run_as_chroot1 "${this_script}" "${file}"
[2b88404]628+ wrt_paco_log "$pkg_tarball"
[059822c]629 ;;
630 esac
631 #
[9b09518]632@@ -405,6 +426,16 @@
[4795dfb]633 PREV=${this_script}${N}
634 # Set system_build envar for iteration targets
635 system_build=$chapter6
[059822c]636+
[6821737]637+ # Reinstall paco after the toolchain has been readjusted.
[059822c]638+ case "${this_script}" in
[6821737]639+ *readjusting)
[799b0d1]640+ TMP_SCRIPT="$this_script"
641+ this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
642+ wrt_paco_inst "$this_script"
643+ this_script="$TMP_SCRIPT" ;;
[059822c]644+ esac
645+
646 done # end for file in chapter06/*
647
648 }
[9b09518]649@@ -463,9 +494,19 @@
[b9ec725]650 else # Initialize the log and run the script
[059822c]651 wrt_run_as_chroot2 "${this_script}" "${file}"
652 fi
[b9ec725]653+ wrt_paco_log "hlfs-sysconf"
[059822c]654 ;;
655+ *kernel) wrt_paco_prep
656+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]657+ wrt_paco_log "$(get_package_tarball_name "linux")"
[059822c]658+ ;;
659+ *bootscripts) wrt_paco_prep
660+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]661+ wrt_paco_log "$(get_package_tarball_name "lfs-bootscripts")"
[059822c]662+ ;;
663 *) # All other scripts
664 wrt_run_as_chroot2 "${this_script}" "${file}"
[b9ec725]665+ wrt_paco_log "hlfs-sysconf"
[059822c]666 ;;
[b9ec725]667 esac
668
[d748b31]669Index: master.sh
670===================================================================
[8715be1]671--- master.sh (revision 2864)
[d748b31]672+++ master.sh (working copy)
[a708b15]673@@ -149,6 +149,8 @@
[d748b31]674
675 --help | -h ) usage | more && exit ;;
676
677+ --no-paco ) USE_PACO=0 ;;
678+
[f3ae556]679 --optimize | -O )
[d748b31]680 test $# = 1 && eval "$exit_missing_arg"
681 shift
[9b09518]682@@ -444,6 +446,14 @@
[d29584b]683 [[ $VERBOSITY > 0 ]] && echo "OK"
684 fi
[f3ae556]685 #
[d29584b]686+# paco module
687+if [[ "$USE_PACO" = "1" ]]; then
688+ [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
689+ source $COMMON_DIR/paco-functions
690+ [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
691+ [[ $VERBOSITY > 0 ]] && echo "OK"
692+fi
693+#
[f3ae556]694 # optimize module
695 if [[ "$OPTIMIZE" != "0" ]]; then
696 [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
[9b09518]697@@ -490,6 +500,8 @@
[d748b31]698 if [[ "$PWD" != "$JHALFSDIR" ]]; then
[b9ec725]699 cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
[c665386]700 #
[8230977]701+ [[ $USE_PACO != "0" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
702+ #
[f3ae556]703 [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
[c665386]704 #
[4795dfb]705 if [[ "$COMPARE" != "0" ]] ; then
Note: See TracBrowser for help on using the repository browser.