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

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

Fixed the paco patch update.

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