source: contrib/jhalfs-paco.patch@ bb19ced

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

Rediffied paco patch.

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