source: contrib/jhalfs-paco.patch@ 8b57785

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

Rediffied paco patch.

  • Property mode set to 100644
File size: 32.8 KB
RevLine 
[059822c]1Index: LFS/master.sh
2===================================================================
[d9daa95]3--- LFS/master.sh (revision 2916)
[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
[daa9b6c]39 *kernfs) wrt_RunAsRoot "${this_script}" "$file" ;;
[059822c]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
[8b7357b]64@@ -312,8 +341,15 @@
[b9ec725]65 else
[059822c]66 wrt_run_as_chroot2 "$this_script" "$file"
67 fi
[b9ec725]68+ wrt_paco_log "lfs-sysconf"
[059822c]69 ;;
[8b7357b]70+ *kernel | *bootscripts )
71+ wrt_paco_prep
72+ wrt_run_as_chroot2 "$this_script" "$file"
73+ wrt_paco_log "$pkg_tarball"
[059822c]74+ ;;
75 *) wrt_run_as_chroot2 "$this_script" "$file"
[b9ec725]76+ wrt_paco_log "lfs-sysconf"
[059822c]77 ;;
78 esac
[b9ec725]79
[059822c]80Index: LFS/lfs.xsl
81===================================================================
[d9daa95]82--- LFS/lfs.xsl (revision 2916)
[059822c]83+++ LFS/lfs.xsl (working copy)
[963fdae]84@@ -39,6 +39,9 @@
[059822c]85 <!-- Locale settings -->
[c665386]86 <xsl:param name="lang" select="C"/>
[059822c]87
88+ <!-- Use paco? -->
89+ <xsl:param name="use_paco" select="1"/>
90+
91 <xsl:template match="/">
92 <xsl:apply-templates select="//sect1"/>
93 </xsl:template>
[963fdae]94@@ -239,6 +242,33 @@
[059822c]95 <xsl:apply-templates/>
96 <xsl:text> || true&#xA;</xsl:text>
97 </xsl:when>
98+ <!-- paco begin -->
99+ <!-- General rule -->
100+ <xsl:when test="$use_paco != '0' and
101+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
102+ contains(string(),'make') and
103+ contains(string(),'install')">
104+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
105+ <xsl:apply-templates/>
106+ <xsl:text>&#xA;</xsl:text>
107+ </xsl:when>
108+ <!-- Linux-libc-headers -->
109+ <xsl:when test="$use_paco != '0' and
110+ ancestor::sect1[@id='ch-system-linux-libc-headers'] and
111+ contains(string(),'install ')">
112+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
113+ <xsl:apply-templates/>
114+ <xsl:text>&#xA;</xsl:text>
115+ </xsl:when>
116+ <!-- Unset LD_PRELOAD before second make in Zlib -->
117+ <xsl:when test="$use_paco != '0' and
118+ ancestor::sect1[@id='ch-system-zlib'] and
119+ contains(string(),'make clean')">
120+ <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
121+ <xsl:apply-templates/>
122+ <xsl:text>&#xA;</xsl:text>
123+ </xsl:when>
124+ <!-- paco end -->
125 <!-- The rest of commands -->
126 <xsl:otherwise>
127 <xsl:apply-templates/>
[8b7357b]128Index: CLFS/master.sh
129===================================================================
[d9daa95]130--- CLFS/master.sh (revision 2916)
[8b7357b]131+++ CLFS/master.sh (working copy)
132@@ -495,6 +495,11 @@
133 # Keep the script file name
134 this_script=`basename $file`
135
136+ # If $this_script corresponds to a paco script, then skip it
137+ case "${this_script}" in
138+ *paco) continue ;;
139+ esac
140+
141 # Test if the stripping phase must be skipped.
142 # Skip alsp temp-perl for iterative runs
143 case $this_script in
144@@ -502,6 +507,18 @@
145 *temp-perl*) [[ -n "$N" ]] && continue ;;
146 esac
147
148+ # Install paco as the first package in ch6, before installing
149+ # linux-libc-headers, except in iterartive builds
150+ if [[ -z "$N" ]]; then
151+ case $this_script in
152+ *linux-headers)
153+ TMP_SCRIPT="$this_script"
154+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
155+ wrt_paco_inst "$this_script"
156+ this_script="$TMP_SCRIPT" ;;
157+ esac
158+ fi
159+
160 # Grab the name of the target, strip id number, XXX-script
161 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
162 -e 's@temp-@@' \
163@@ -554,7 +571,9 @@
164 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
165 fi
166 #
167+ wrt_paco_prep
168 wrt_run_as_chroot1 "${this_script}" "${file}"
169+ wrt_paco_log "$pkg_tarball"
170 #
171 [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
172 #
173@@ -569,6 +588,16 @@
174 PREV=${this_script}${N}
175 # Set system_build envar for iteration targets
176 system_build=$basicsystem
177+
178+ # Reinstalling paco after readsjusting the toolchain.
179+ case "${this_script}" in
180+ *adjusting)
181+ TMP_SCRIPT="$this_script"
182+ this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
183+ wrt_paco_inst "$this_script"
184+ this_script="$TMP_SCRIPT" ;;
185+ esac
186+
187 done # for file in final-system/* ...
188 }
189
190@@ -605,6 +634,11 @@
191 # Keep the script file name
192 this_script=`basename $file`
193
194+ # If $this_script corresponds to a paco script, then skip it
195+ case "${this_script}" in
196+ *paco) continue ;;
197+ esac
198+
199 # Test if the stripping phase must be skipped
200 # Skip alsp temp-perl for iterative runs
201 case $this_script in
202@@ -612,6 +646,18 @@
203 *temp-perl*) [[ -n "$N" ]] && continue ;;
204 esac
205
206+ # Install paco as the first package in ch6, before installing
207+ # linux-libc-headers, except in iterartive builds
208+ if [[ -z "$N" ]]; then
209+ case $this_script in
210+ *linux-headers)
211+ TMP_SCRIPT="$this_script"
212+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
213+ wrt_paco_inst "$this_script"
214+ this_script="$TMP_SCRIPT" ;;
215+ esac
216+ fi
217+
218 # Grab the name of the target, strip id number, XXX-script
219 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
220 -e 's@temp-@@' \
221@@ -666,7 +712,9 @@
222 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
223 fi
224 #
225+ wrt_paco_prep
226 wrt_run_as_root2 "${this_script}" "${file}"
227+ wrt_paco_log "$pkg_tarball"
228 #
229 [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
230 #
231@@ -681,6 +729,16 @@
232 PREV=${this_script}${N}
233 # Set system_build envar for iteration targets
234 system_build=$basicsystem
235+
236+ # Reinstalling paco after readsjusting the toolchain.
237+ case "${this_script}" in
238+ *adjusting)
239+ TMP_SCRIPT="$this_script"
240+ this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
241+ wrt_paco_inst "$this_script"
242+ this_script="$TMP_SCRIPT" ;;
243+ esac
244+
245 done # for file in final-system/* ...
246 }
247
248@@ -729,7 +787,17 @@
249 #
250 [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
251 #
252+ case $this_script in
253+ *bootscripts* | *udev-rules )
254+ wrt_paco_prep ;;
255+ esac
256 wrt_run_as_chroot1 "${this_script}" "${file}"
257+ case $this_script in
258+ *bootscripts* | *udev-rules )
259+ wrt_paco_log "$pkg_tarball" ;;
260+ *)
261+ wrt_paco_log "clfs-sysconf" ;;
262+ esac
263 #
264 [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
265 #
266@@ -791,7 +859,17 @@
267 #
268 [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
269 #
270+ case $this_script in
271+ *bootscripts* | *udev-rules )
272+ wrt_paco_prep ;;
273+ esac
274 wrt_run_as_root2 "${this_script}" "${file}"
275+ case $this_script in
276+ *bootscripts* | *udev-rules )
277+ wrt_paco_log "$pkg_tarball" ;;
278+ *)
279+ wrt_paco_log "clfs-sysconf" ;;
280+ esac
281 #
282 [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
283 #
284@@ -863,8 +941,13 @@
285 else
286 wrt_run_as_chroot1 "${this_script}" "${file}"
287 fi
288+ wrt_paco_log "clfs-sysconf"
289 ;;
290- *) wrt_run_as_chroot1 "${this_script}" "${file}" ;;
291+ *kernel) wrt_paco_prep
292+ wrt_run_as_chroot1 "${this_script}" "${file}"
293+ wrt_paco_log "$pkg_tarball" ;;
294+ *) wrt_run_as_chroot1 "${this_script}" "${file}"
295+ wrt_paco_log "clfs-sysconf" ;;
296 esac
297 #
298 # Housekeeping...remove any build directory(ies) except if the package build fails.
299@@ -942,8 +1025,13 @@
300 else
301 wrt_run_as_root2 "${this_script}" "${file}"
302 fi
303+ wrt_paco_log "clfs-sysconf"
304 ;;
305- *) wrt_run_as_root2 "${this_script}" "${file}" ;;
306+ *kernel) wrt_paco_prep
307+ wrt_run_as_root2 "${this_script}" "${file}"
308+ wrt_paco_log "$pkg_tarball" ;;
309+ *) wrt_run_as_root2 "${this_script}" "${file}"
310+ wrt_paco_log "clfs-sysconf" ;;
311 esac
312 #
313 # Housekeeping...remove any build directory(ies) except if the package build fails.
314Index: CLFS/clfs.xsl
315===================================================================
[d9daa95]316--- CLFS/clfs.xsl (revision 2916)
[8b7357b]317+++ CLFS/clfs.xsl (working copy)
[963fdae]318@@ -45,6 +45,9 @@
[8b7357b]319 <!-- Locale settings -->
320 <xsl:param name="lang" select="C"/>
321
322+ <!-- Use paco? -->
323+ <xsl:param name="use_paco" select="1"/>
324+
325 <xsl:template match="/">
326 <xsl:apply-templates select="//sect1"/>
327 </xsl:template>
[963fdae]328@@ -106,6 +109,25 @@
[8b7357b]329 <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
330 </xsl:if>
331 </xsl:if>
332+ <!-- paco begin -->
333+ <!-- General rule -->
334+ <xsl:if test="$use_paco != '0' and
335+ @id='ch-scripts-bootscripts' or
336+ @id='ch-scripts-udev-rules' or
337+ @id='ch-bootable-kernel' or
338+ (../@id='chapter-building-system' and
339+ @id!='ch-system-temp-perl' and
340+ contains(string(),'make') and
341+ contains(string(),'install'))">
342+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
343+ </xsl:if>
344+ <!-- Linux headers -->
345+ <xsl:if test="$use_paco != '0' and
346+ @id='ch-system-linux-headers' and
347+ contains(string(),'install')">
348+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
349+ </xsl:if>
350+ <!-- paco end -->
351 <xsl:apply-templates select=".//para/userinput | .//screen"/>
352 <xsl:text>exit</xsl:text>
353 </exsl:document>
[799b0d1]354Index: common/paco-build-hlfs.sh
355===================================================================
356--- common/paco-build-hlfs.sh (revision 0)
357+++ common/paco-build-hlfs.sh (revision 0)
[b9ec725]358@@ -0,0 +1,12 @@
[799b0d1]359+#!/bin/sh
360+set -e
361+
362+cd $PKGDIR
[b9ec725]363+./configure --sysconfdir=/etc \
364+ --enable-scripts \
[799b0d1]365+ --disable-gpaco \
[b9ec725]366+ --disable-static \
367+ --with-pic &&
[799b0d1]368+make &&
369+make install &&
370+make logme
[059822c]371Index: common/config
372===================================================================
[d9daa95]373--- common/config (revision 2916)
[059822c]374+++ common/config (working copy)
[963fdae]375@@ -91,6 +91,23 @@
[4795dfb]376 #--- Run farce testing 0(no)/1(yes)
377 RUN_FARCE=0
[d748b31]378
[059822c]379+#==== PACO VARIABLES ====
[4795dfb]380+#--- Use paco? 0(no)/1(yes)
[059822c]381+USE_PACO=1
[9b09518]382+PACO_VERSION=1.10.10
[059822c]383+
384+#--- Name of the Paco source package
[8715be1]385+PACO_FILE=paco-$PACO_VERSION.tar.bz2 # (use .tar.gz if preferred)
386+
387+#--- Sourceforge mirror to use for Paco source download
388+# Europe: heanet, belnet, puzzle, surfnet, switch, kent
389+# North America: superb-east, superb-west, umn, easynews
390+# South America: ufpr
391+# Asia: nchc, jaist
392+# Australia: optusnet
393+PACO_MIRROR1=heanet
394+PACO_MIRROR2=kent
[059822c]395+
[4795dfb]396 #==== INTERNAL VARIABLES ====
397 # Don't edit it unless you know what you are doing
398
[963fdae]399@@ -108,3 +125,9 @@
[4795dfb]400
401 #--- farce report log directory
402 FARCELOGDIR=$LOGDIR/farce
403+
404+#--- Variables needed by paco
[059822c]405+PACO_INCLUDE=/
[41dfd7c]406+PACO_EXCLUDE=/${SCRIPT_ROOT}
[059822c]407+PACO_TMPFILE=/tmp/paco.tmp
408+LD_PRELOAD=/usr/lib/libpaco-log.so
409Index: common/func_validate_configs.sh
410===================================================================
[d9daa95]411--- common/func_validate_configs.sh (revision 2916)
[059822c]412+++ common/func_validate_configs.sh (working copy)
[9b09518]413@@ -86,10 +86,10 @@
[059822c]414 inline_doc
415
416 # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
[daa9b6c]417- local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
418- local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
419- local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
420- 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"
421+ local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
422+ local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
423+ local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
424+ 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"
[059822c]425
426 local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
427 local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
[9b09518]428@@ -179,6 +179,7 @@
[f358747]429 [[ "$GETPKG" = "1" ]] && validate_against_str "x0x x1x"
430 fi ;;
[4795dfb]431 RUNMAKE) validate_against_str "x0x x1x" ;;
432+ USE_PACO) validate_against_str "x0x x1x" ;;
433 REPORT) validate_against_str "x0x x1x"
434 if [[ "${!config_param}" = "1" ]]; then
435 if [[ `type -p bc` ]]; then
[059822c]436Index: common/paco-functions
437===================================================================
438--- common/paco-functions (revision 0)
439+++ common/paco-functions (revision 0)
[8b7357b]440@@ -0,0 +1,311 @@
[059822c]441+#!/bin/bash
442+
443+#----------------------------#
444+wrt_paco_inst() { #
445+#----------------------------#
[d748b31]446+
[8b7357b]447+local paco_script="$1"
448+
449+check_build_model
[d748b31]450+
451+if [ $USE_PACO != 0 ]; then
[8b7357b]452+ case $PROGNAME in
453+ clfs )
454+ paco_file="final-system/$paco_script"
455+ basicsystem="$basicsystem $paco_script" ;;
456+ * )
457+ paco_file="chapter06/$paco_script"
458+ chapter6="$chapter6 $paco_script" ;;
459+ esac
[6821737]460+
461+ # Copy the paco build script to the correct directory and make it executable
[799b0d1]462+ cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
[6821737]463+ chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
[059822c]464+
465+ # Write target, dependency and unpack
[8b7357b]466+ if [ $CLFS_BOOT = 1 ]; then
467+ wrt_target_boot "$paco_script" "$PREV"
468+ wrt_unpack3 "$PACO_FILE"
469+ wrt_run_as_root2 "${paco_script}" "${paco_file}"
470+ wrt_remove_build_dirs2 "paco"
471+ else
472+ wrt_target "$paco_script" "$PREV"
473+ wrt_unpack2 "$PACO_FILE"
474+ wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
475+ wrt_remove_build_dirs "paco"
476+ fi
[059822c]477+
[2b88404]478+ wrt_touch
[059822c]479+
480+ # Override the PREV variable
[6821737]481+ PREV="$paco_script"
[059822c]482+fi
483+}
484+
485+
486+#----------------------------------#
487+wrt_paco_prep() { # Export Paco variables
488+#----------------------------------# and remove tmpfile
[d748b31]489+
[8b7357b]490+local TMPFILEPATH
491+
492+check_build_model
[d748b31]493+
[b9ec725]494+check_log_package
495+
496+if [ $USE_PACO != 0 ] && [ $LOG_PACKAGE != 0 ]; then
[8b7357b]497+ if [ $CLFS_BOOT = 1 ]; then
498+ TMPFILEPATH="$PACO_TMPFILE"
499+ else
500+ TMPFILEPATH="\$(MOUNT_PT)$PACO_TMPFILE"
501+ fi
[059822c]502+(
503+cat << EOF
504+ @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
[b9ec725]505+ echo "export PACO_EXCLUDE=\$(SRC):$PACO_EXCLUDE" >> envars && \\
[059822c]506+ echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
[8b7357b]507+ rm -f $TMPFILEPATH
[059822c]508+EOF
509+) >> $MKFILE.tmp
510+fi
511+}
512+
513+
514+#----------------------------------#
515+wrt_paco_log() { # If the tmpfile exist, then log the current package
516+#----------------------------------# and remove tempfile
[d748b31]517+local PACKAGE
518+
[8b7357b]519+# Extract package name and version from the tarball name
[2b88404]520+PACKAGE=`echo $1 | sed -e 's/.tar.*//'`
[059822c]521+
[8b7357b]522+check_build_model
[059822c]523+
[8b7357b]524+# Check if the package should be logged
[b9ec725]525+check_log_package
526+
[8b7357b]527+
[b9ec725]528+if [ $USE_PACO != 0 ]; then
529+ if [ $LOG_PACKAGE != 0 ]; then
[8b7357b]530+ # Only use this if doing CLFS boot build
531+ if [ $CLFS_BOOT = 1 ]; then
532+(
533+cat << EOF
534+ @if [ -e $PACO_TMPFILE ]; then \\
535+ paco -lp+ $PACKAGE < $PACO_TMPFILE && \\
536+ rm -f $PACO_TMPFILE; \\
537+ fi;
538+EOF
539+) >> $MKFILE.tmp
540+ # All else should use these commands
541+ else
[059822c]542+(
543+cat << EOF
544+ @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
[4795dfb]545+ \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\
[059822c]546+ rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
547+ fi;
548+EOF
549+) >> $MKFILE.tmp
[8b7357b]550+ fi
[b9ec725]551+ fi
[8b7357b]552+ # Add missing files to the logs if needed
[b9ec725]553+ wrt_paco_add_log
[059822c]554+fi
[b9ec725]555+}
[059822c]556+
[b9ec725]557+
558+#----------------------------------#
[8b7357b]559+fnc_add_log() { #
560+#----------------------------------#
561+
562+MISSING_FILE=$1
563+
564+if [ $CLFS_BOOT = 1 ]; then
565+ echo -e "\t@$MISSING_FILE | paco -lp+ $PACKAGE" >> $MKFILE.tmp
566+else
567+ echo -e "\t@\$(CHROOT1) '$MISSING_FILE | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
568+fi
569+}
570+
571+
572+#----------------------------------#
[b9ec725]573+wrt_paco_add_log() { #
574+#----------------------------------#
575+# Some packages create files using bash redirection, which the LD_PRELOAD lib don't notice
576+# These rules will add the missing files to the proper logs.
577+# Most of these is not needed for HLFS, but they do no harm.
578+if [ $USE_PACO != 0 ]; then
[8b7357b]579+ case $this_script in
[b9ec725]580+ *glibc)
[8b7357b]581+ fnc_add_log "find /lib -type l"
582+ fnc_add_log "find /etc/{nsswitch.conf,ld.so.conf}"
[b9ec725]583+ ;;
584+ *ncurses)
[8b7357b]585+ fnc_add_log "find /usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
[b9ec725]586+ ;;
587+ *bash)
[8b7357b]588+ fnc_add_log "echo /bin/sh"
[b9ec725]589+ ;;
590+ *flex)
[8b7357b]591+ fnc_add_log "echo /usr/bin/lex"
[b9ec725]592+ ;;
593+ *shadow)
[8b7357b]594+ fnc_add_log "echo /etc/login.defs"
[b9ec725]595+ ;;
596+ *hotplug)
[8b7357b]597+ fnc_add_log "echo /var/log/hotplug"
598+ fnc_add_log "echo /var/run/usb"
[b9ec725]599+ ;;
600+ *sysklogd)
[8b7357b]601+ fnc_add_log "echo /etc/syslog.conf"
[b9ec725]602+ ;;
603+ *sysvinit)
[8b7357b]604+ fnc_add_log "echo /etc/inittab"
[b9ec725]605+ ;;
606+ *udev)
[8b7357b]607+ fnc_add_log "find /lib/udev/devices"
608+ fnc_add_log "echo /lib/firmware"
609+ fnc_add_log "find /etc/udev/rules.d -type f"
[b9ec725]610+ ;;
611+ *util-linux)
[8b7357b]612+ fnc_add_log "echo /var/lib/hwclock"
613+ fnc_add_log "echo /etc/nologin.txt"
[b9ec725]614+ ;;
615+ *vim)
[8b7357b]616+ fnc_add_log "echo /etc/vimrc"
[b9ec725]617+ ;;
[8b7357b]618+ # Rules below here will log configuration files created in {C,H}LFS
619+ # They will end up in a log named {c,h}lfs-sysconf
[b9ec725]620+ *setclock)
[8b7357b]621+ fnc_add_log "echo /etc/sysconfig/clock"
[b9ec725]622+ ;;
623+ *inputrc)
[8b7357b]624+ fnc_add_log "echo /etc/inputrc"
[b9ec725]625+ ;;
626+ *profile)
[8b7357b]627+ fnc_add_log "echo /etc/profile"
[b9ec725]628+ ;;
629+ *hostname)
[8b7357b]630+ fnc_add_log "echo /etc/sysconfig/network"
[b9ec725]631+ ;;
632+ *localnet)
[8b7357b]633+ fnc_add_log "echo /etc/sysconfig/network"
[b9ec725]634+ ;;
635+ *hosts)
[8b7357b]636+ fnc_add_log "echo /etc/hosts"
[b9ec725]637+ ;;
638+ *network)
[8b7357b]639+ fnc_add_log "echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4"
640+ fnc_add_log "echo /etc/resolv.conf"
[b9ec725]641+ ;;
642+ *fstab)
[8b7357b]643+ fnc_add_log "echo /etc/fstab"
[b9ec725]644+ ;;
[8b7357b]645+ *theend) # LFS and CLFS
646+ fnc_add_log "echo /etc/$PROGNAME-release"
[b9ec725]647+ ;;
648+ *finished) # HLFS
[8b7357b]649+ fnc_add_log "echo /etc/$PROGNAME-release"
[b9ec725]650+ ;;
651+ esac
[059822c]652+fi
653+}
[b9ec725]654+
655+
656+#----------------------------------#
657+check_log_package() { #
658+#----------------------------------#
659+# Maybe don't need this function, but it will avoid writing some
660+# unnecessary paco commands in the Makefile.
661+
662+case $this_script in
[2b88404]663+ *changingowner) LOG_PACKAGE=0 ;;
[b9ec725]664+ *creatingdirs) LOG_PACKAGE=0 ;;
665+ *createfiles) LOG_PACKAGE=0 ;;
[2b88404]666+ *pwdgroup) LOG_PACKAGE=0 ;;
667+ *devices) LOG_PACKAGE=0 ;;
[8b7357b]668+ *stripping) LOG_PACKAGE=0 ;;
[b9ec725]669+ *strippingagain) LOG_PACKAGE=0 ;;
[8b7357b]670+ *adjusting) LOG_PACKAGE=0 ;;
671+ *temp-perl) LOG_PACKAGE=0 ;;
[b9ec725]672+ *readjusting) LOG_PACKAGE=0 ;;
673+ *setclock) LOG_PACKAGE=0 ;;
674+ *inputrc) LOG_PACKAGE=0 ;;
675+ *profile) LOG_PACKAGE=0 ;;
676+ *hostname) LOG_PACKAGE=0 ;;
677+ *localnet) LOG_PACKAGE=0 ;;
678+ *hosts) LOG_PACKAGE=0 ;;
679+ *network) LOG_PACKAGE=0 ;;
680+ *fstab) LOG_PACKAGE=0 ;;
681+ *theend) LOG_PACKAGE=0 ;;
682+ *finished) LOG_PACKAGE=0 ;;
683+ *) LOG_PACKAGE=1 ;;
684+esac
685+}
[8715be1]686+
687+#----------------------------------#
688+get_paco_src() { #
689+#----------------------------------#
690+# Download the paco sources
691+# We don't do any MD5SUM checking as of yet
692+# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
693+
694+local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
695+local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
696+
697+# Test if paco is to be used
[8b7357b]698+[[ ! "$USE_PACO" = "1" ]] && return
[8715be1]699+
700+# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
701+if [ ! -z ${SRC_ARCHIVE} ] &&
702+ [ -d ${SRC_ARCHIVE} ] &&
703+ [ -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
704+ cp ${SRC_ARCHIVE}/$PACO_FILE .
705+ echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
706+ fromARCHIVE=1
707+else
708+ echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
709+ fromARCHIVE=0
710+ # If the file does not exist yet in /sources download a fresh one
711+ if [ ! -f $PACO_FILE ] ; then
712+ if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
713+ gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
714+ continue
715+ fi
716+ fi
717+fi
718+
719+# Copy the freshly downloaded file to the source archive.
720+if [ ! -z ${SRC_ARCHIVE} ] &&
721+ [ -d ${SRC_ARCHIVE} ] &&
722+ [ -w ${SRC_ARCHIVE} ] &&
723+ [ "$fromARCHIVE" = "0" ] ; then
724+ echo "Storing file:<$PACO_FILE> in the package archive"
725+ cp -f $PACO_FILE ${SRC_ARCHIVE}
726+fi
727+}
[8b7357b]728+
729+
730+#----------------------------------#
731+check_build_model() { #
732+#----------------------------------#
733+# Check what script we're running, and set some switches accordingly
734+
735+CLFS_BOOT=0
736+
737+case $PROGNAME in
738+ hlfs)
739+ # Not using Paco with uClibc, even if requested
740+ if [ "$MODEL" = "uclibc" ]; then
741+ USE_PACO=0
742+ fi
743+ ;;
744+ clfs)
745+ # CLFS boot method require it's own commands
746+ if [ "$METHOD" = "boot" ]; then
747+ CLFS_BOOT=1
748+ fi
749+ ;;
750+esac
751+}
[799b0d1]752Index: common/paco-build-lfs.sh
[6821737]753===================================================================
[799b0d1]754--- common/paco-build-lfs.sh (revision 0)
755+++ common/paco-build-lfs.sh (revision 0)
[b9ec725]756@@ -0,0 +1,10 @@
[6821737]757+#!/bin/sh
758+set -e
759+
760+cd $PKGDIR
[b9ec725]761+./configure --sysconfdir=/etc \
762+ --enable-scripts \
763+ --disable-gpaco &&
[6821737]764+make &&
765+make install &&
766+make logme
[8b7357b]767Index: common/paco-build-clfs.sh
768===================================================================
769--- common/paco-build-clfs.sh (revision 0)
770+++ common/paco-build-clfs.sh (revision 0)
771@@ -0,0 +1,10 @@
772+#!/bin/sh
773+set -e
774+
775+cd $PKGDIR
776+./configure --sysconfdir=/etc \
777+ --enable-scripts \
778+ --disable-gpaco &&
779+make &&
780+make install &&
781+make logme
[059822c]782Index: common/common-functions
783===================================================================
[d9daa95]784--- common/common-functions (revision 2916)
[059822c]785+++ common/common-functions (working copy)
[a708b15]786@@ -69,6 +69,9 @@
[059822c]787 in the configuration file has the proper packages and patches for the
788 book version being processed.
789
790+${BOLD} --no-paco${OFF}
791+ dissables paco logging feature.
792+
[f3ae556]793 ${BOLD} -O, --optimize${OFF}
794 Optimize [0-2]
795 0 = no optimization
[daa9b6c]796@@ -696,6 +699,7 @@
[8b7357b]797 --stringparam page $PAGE \
798 --stringparam lang $LANG \
[d9daa95]799 --stringparam keymap ${KEYMAP:-"none"} \
[8b7357b]800+ --stringparam use_paco $USE_PACO \
801 -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
802 ;;
803
[daa9b6c]804@@ -723,6 +727,7 @@
[059822c]805 --stringparam lc_all $LC_ALL \
[d9daa95]806 --stringparam keymap ${KEYMAP:-"none"} \
[059822c]807 --stringparam grsecurity_host $GRSECURITY_HOST \
808+ --stringparam use_paco $USE_PACO \
809 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
810 ;;
811 lfs)
[daa9b6c]812@@ -735,6 +740,7 @@
[059822c]813 --stringparam timezone $TIMEZONE \
814 --stringparam page $PAGE \
815 --stringparam lang $LANG \
816+ --stringparam use_paco $USE_PACO \
817 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
818 ;;
[8230977]819 *) exit 1 ;;
[daa9b6c]820@@ -801,6 +807,9 @@
[8715be1]821 # Generate URLs file
822 create_urls
823
824+ # If Paco is to be used, then download the sources
825+ get_paco_src
826+
827 IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
828 for line in `cat urls.lst`; do
829 IFS=$saveIFS # Restore the system defaults
[059822c]830Index: HLFS/hlfs.xsl
831===================================================================
[d9daa95]832--- HLFS/hlfs.xsl (revision 2916)
[059822c]833+++ HLFS/hlfs.xsl (working copy)
[963fdae]834@@ -46,6 +46,9 @@
[c665386]835 <xsl:param name="lang" select="C"/>
836 <xsl:param name="lc_all" select="C"/>
[059822c]837
838+ <!-- Use paco? -->
839+ <xsl:param name="use_paco" select="1"/>
840+
841 <xsl:template match="/">
842 <xsl:apply-templates select="//sect1"/>
843 </xsl:template>
[963fdae]844@@ -192,6 +195,10 @@
[059822c]845 <!-- Fixing bootscripts installation -->
846 <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
847 string() = 'make install'">
848+ <!-- inserting LD_PRELOAD before installing bootscripts -->
849+ <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
850+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
851+ </xsl:if>
852 <xsl:text>make install&#xA;</xsl:text>
853 <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
854 </xsl:when>
[963fdae]855@@ -280,6 +287,25 @@
[059822c]856 <xsl:apply-templates/>
857 <xsl:text> || true&#xA;</xsl:text>
858 </xsl:when>
859+ <!-- paco begin -->
860+ <!-- General rule -->
861+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
862+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
863+ contains(string(),'make') and
864+ contains(string(),'install')">
865+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
[9b09518]866+ <xsl:apply-templates/>
[059822c]867+ <xsl:text>&#xA;</xsl:text>
868+ </xsl:when>
869+ <!-- Linux-libc-headers -->
870+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
[9b09518]871+ ancestor::sect1[@id='ch-system-linux-headers'] and
[059822c]872+ contains(string(),'install ')">
873+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
[9b09518]874+ <xsl:apply-templates/>
[059822c]875+ <xsl:text>&#xA;</xsl:text>
876+ </xsl:when>
877+ <!-- paco end -->
878 <!-- The rest of commands -->
879 <xsl:otherwise>
880 <xsl:apply-templates/>
881Index: HLFS/master.sh
882===================================================================
[d9daa95]883--- HLFS/master.sh (revision 2916)
[059822c]884+++ HLFS/master.sh (working copy)
[daa9b6c]885@@ -40,7 +40,9 @@
[9b09518]886 EOF
887 ) >> $MKFILE.tmp
[963fdae]888 [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
[9b09518]889+ wrt_paco_prep
890 wrt_run_as_chroot1 "$toolchain" "$this_script"
891+ wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
892 ;;
893
894 *)
[daa9b6c]895@@ -272,6 +274,11 @@
[8230977]896 # Keep the script file name
897 this_script=`basename $file`
898
899+ # If this script is *-paco, then skip it
900+ case $this_script in
901+ *paco ) continue ;;
902+ esac
903+
904 # Skip this script depending on jhalfs.conf flags set.
905 case $this_script in
906 # We'll run the chroot commands differently than the others, so skip them in the
[daa9b6c]907@@ -281,6 +288,18 @@
[4795dfb]908 *-stripping* ) [[ "$STRIP" = "0" ]] && continue ;;
[6821737]909 esac
910
[4795dfb]911+ # Install paco as the first package in ch6, before installing
912+ # linux-libc-headers, except in iterartive builds
913+ if [[ -z "$N" ]]; then
914+ case $this_script in
[9b09518]915+ *linux-headers)
[799b0d1]916+ TMP_SCRIPT="$this_script"
[9b09518]917+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
[799b0d1]918+ wrt_paco_inst "$this_script"
919+ this_script="$TMP_SCRIPT" ;;
[4795dfb]920+ esac
921+ fi
[6821737]922+
[4795dfb]923 # Grab the name of the target
924 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
925
[daa9b6c]926@@ -346,7 +365,9 @@
927 wrt_RunAsRoot "${this_script}" "${file}"
[059822c]928 ;;
929 *) # The rest of Chapter06
930+ wrt_paco_prep
931 wrt_run_as_chroot1 "${this_script}" "${file}"
[2b88404]932+ wrt_paco_log "$pkg_tarball"
[059822c]933 ;;
934 esac
935 #
[daa9b6c]936@@ -366,6 +387,16 @@
[4795dfb]937 PREV=${this_script}${N}
938 # Set system_build envar for iteration targets
939 system_build=$chapter6
[059822c]940+
[6821737]941+ # Reinstall paco after the toolchain has been readjusted.
[059822c]942+ case "${this_script}" in
[6821737]943+ *readjusting)
[799b0d1]944+ TMP_SCRIPT="$this_script"
945+ this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
946+ wrt_paco_inst "$this_script"
947+ this_script="$TMP_SCRIPT" ;;
[059822c]948+ esac
949+
950 done # end for file in chapter06/*
951
952 }
[daa9b6c]953@@ -424,9 +455,19 @@
[b9ec725]954 else # Initialize the log and run the script
[059822c]955 wrt_run_as_chroot2 "${this_script}" "${file}"
956 fi
[b9ec725]957+ wrt_paco_log "hlfs-sysconf"
[059822c]958 ;;
959+ *kernel) wrt_paco_prep
960+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]961+ wrt_paco_log "$(get_package_tarball_name "linux")"
[059822c]962+ ;;
963+ *bootscripts) wrt_paco_prep
964+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]965+ wrt_paco_log "$(get_package_tarball_name "lfs-bootscripts")"
[059822c]966+ ;;
967 *) # All other scripts
968 wrt_run_as_chroot2 "${this_script}" "${file}"
[b9ec725]969+ wrt_paco_log "hlfs-sysconf"
[059822c]970 ;;
[b9ec725]971 esac
972
[d748b31]973Index: master.sh
974===================================================================
[d9daa95]975--- master.sh (revision 2916)
[d748b31]976+++ master.sh (working copy)
[d9daa95]977@@ -194,6 +194,8 @@
[d748b31]978
979 --help | -h ) usage | more && exit ;;
980
981+ --no-paco ) USE_PACO=0 ;;
982+
[f3ae556]983 --optimize | -O )
[d748b31]984 test $# = 1 && eval "$exit_missing_arg"
985 shift
[d9daa95]986@@ -489,6 +491,14 @@
[d29584b]987 [[ $VERBOSITY > 0 ]] && echo "OK"
988 fi
[f3ae556]989 #
[d29584b]990+# paco module
991+if [[ "$USE_PACO" = "1" ]]; then
992+ [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
993+ source $COMMON_DIR/paco-functions
994+ [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
995+ [[ $VERBOSITY > 0 ]] && echo "OK"
996+fi
997+#
[f3ae556]998 # optimize module
999 if [[ "$OPTIMIZE" != "0" ]]; then
1000 [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
[d9daa95]1001@@ -535,6 +545,8 @@
[d748b31]1002 if [[ "$PWD" != "$JHALFSDIR" ]]; then
[b9ec725]1003 cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
[c665386]1004 #
[8230977]1005+ [[ $USE_PACO != "0" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
1006+ #
[f3ae556]1007 [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
[c665386]1008 #
[4795dfb]1009 if [[ "$COMPARE" != "0" ]] ; then
Note: See TracBrowser for help on using the repository browser.