source: contrib/jhalfs-paco.patch@ 71dd5a5

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

Updated paco patch.

  • Property mode set to 100644
File size: 16.7 KB
RevLine 
[059822c]1Index: LFS/master.sh
2===================================================================
[d748b31]3--- LFS/master.sh (revision 2520)
[059822c]4+++ LFS/master.sh (working copy)
5@@ -188,7 +188,9 @@
6 # and not to use chroot.
7 case "${this_script}" in
8 *kernfs) wrt_run_as_root "${this_script}" "$file" ;;
9- *) wrt_run_as_chroot1 "${this_script}" "$file" ;;
10+ *) wrt_paco_prep
11+ wrt_run_as_chroot1 "${this_script}" "$file"
12+ wrt_paco_log "$name" "$vrs" ;;
13 esac
14
15 # Remove the build directory(ies) except if the package build fails.
16@@ -206,6 +208,13 @@
17
18 # Keep the script file name for Makefile dependencies.
19 PREV=${this_script}
20+
21+ # Inserting paco build commands
22+ case "${this_script}" in
23+ *devices) wrt_paco_inst "065.5" ;;
24+ *readjusting) wrt_paco_inst "069.5" ;;
25+ esac
26+
27 done # end for file in chapter06/*
28 }
29
30@@ -267,6 +276,14 @@
31 wrt_run_as_chroot2 "$this_script" "$file"
32 fi
33 ;;
34+ *kernel) wrt_paco_prep
35+ wrt_run_as_chroot2 "$this_script" "$file"
36+ wrt_paco_log "linux-kernel" "$vrs"
37+ ;;
38+ *bootscripts) wrt_paco_prep
39+ wrt_run_as_chroot2 "$this_script" "$file"
40+ wrt_paco_log "lfs-bootscripts" "$vrs"
41+ ;;
42 *) wrt_run_as_chroot2 "$this_script" "$file"
43 ;;
44 esac
45Index: LFS/lfs.xsl
46===================================================================
[d748b31]47--- LFS/lfs.xsl (revision 2520)
[059822c]48+++ LFS/lfs.xsl (working copy)
49@@ -32,6 +32,9 @@
50 <!-- Locale settings -->
51 <xsl:param name="lang" select="en_CA"/>
52
53+ <!-- Use paco? -->
54+ <xsl:param name="use_paco" select="1"/>
55+
56 <xsl:template match="/">
57 <xsl:apply-templates select="//sect1"/>
58 </xsl:template>
59@@ -190,6 +193,33 @@
60 <xsl:apply-templates/>
61 <xsl:text> || true&#xA;</xsl:text>
62 </xsl:when>
63+ <!-- paco begin -->
64+ <!-- General rule -->
65+ <xsl:when test="$use_paco != '0' and
66+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
67+ contains(string(),'make') and
68+ contains(string(),'install')">
69+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
70+ <xsl:apply-templates/>
71+ <xsl:text>&#xA;</xsl:text>
72+ </xsl:when>
73+ <!-- Linux-libc-headers -->
74+ <xsl:when test="$use_paco != '0' and
75+ ancestor::sect1[@id='ch-system-linux-libc-headers'] and
76+ contains(string(),'install ')">
77+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
78+ <xsl:apply-templates/>
79+ <xsl:text>&#xA;</xsl:text>
80+ </xsl:when>
81+ <!-- Unset LD_PRELOAD before second make in Zlib -->
82+ <xsl:when test="$use_paco != '0' and
83+ ancestor::sect1[@id='ch-system-zlib'] and
84+ contains(string(),'make clean')">
85+ <xsl:text>unset LD_PRELOAD&#xA;</xsl:text>
86+ <xsl:apply-templates/>
87+ <xsl:text>&#xA;</xsl:text>
88+ </xsl:when>
89+ <!-- paco end -->
90 <!-- The rest of commands -->
91 <xsl:otherwise>
92 <xsl:apply-templates/>
93Index: BLFS/master.sh
94===================================================================
[d748b31]95--- BLFS/master.sh (revision 2520)
[059822c]96+++ BLFS/master.sh (working copy)
97@@ -79,6 +79,19 @@
98 EOF
99 ) >> $MKFILE
100
101+ if [[ $USE_PACO != 0 ]]; then
102+(
103+ cat << EOF
104+ @echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >logs/$this_script && \\
105+ source $JHALFSDIR/pacovars && \\
106+ rm -f $PACO_TMPFILE && \\
107+ $JHALFSDIR/${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\
108+ echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >>logs/$this_script
109+EOF
110+) >> $MKFILE
111+ wrt_paco_log_blfs
112+
113+ else
114 # Insert date and disk usage at the top of the log file, the script run
115 # and date and disk usage again at the bottom of the log file.
116 (
117Index: BLFS/blfs.xsl
118===================================================================
[d748b31]119--- BLFS/blfs.xsl (revision 2520)
[059822c]120+++ BLFS/blfs.xsl (working copy)
121@@ -159,7 +159,7 @@
122 <xsl:when test="@role = 'nodump'"/>
123 <xsl:otherwise>
124 <xsl:if test="@role = 'root'">
125- <xsl:text>sudo </xsl:text>
126+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
127 </xsl:if>
128 <xsl:apply-templates select="userinput" mode="screen"/>
129 </xsl:otherwise>
130Index: common/config
131===================================================================
[d748b31]132--- common/config (revision 2520)
[059822c]133+++ common/config (working copy)
[d748b31]134@@ -58,6 +58,23 @@
135 # Not used in LFS
136 KEYMAP=none
137
[059822c]138+
139+#==== PACO VARIABLES ====
140+#--- Use paco? 0/1 0(no)/1(yes)
141+USE_PACO=1
142+PACO_VERSION=1.10.4
143+
144+#--- Name of the Paco source package
145+PACO_FILE=paco-$PACO_VERSION.tar.*
146+
147+#--- Variables needed
148+# Don't change unless you know what you're doing
149+PACO_INCLUDE=/
150+PACO_EXCLUDE=/sys:/dev:/proc:/tmp:/usr/src:/usr/share/info/dir
151+PACO_TMPFILE=/tmp/paco.tmp
152+LD_PRELOAD=/usr/lib/libpaco-log.so
[d748b31]153+
154+
155 #=== Variables needed by ICA (Not implemented yet :-/)===
156 #--- Run ICA testing 0/1 0(no)/1(yes)
157 RUN_ICA=0
[059822c]158Index: common/func_validate_configs.sh
159===================================================================
[d748b31]160--- common/func_validate_configs.sh (revision 2520)
[059822c]161+++ common/func_validate_configs.sh (working copy)
162@@ -85,10 +85,10 @@
163 inline_doc
164
165 # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
166- local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG DEPEND TEST"
167- local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE MODEL GRSECURITY_HOST TEST STRIP FSTAB CONFIG KEYMAP PAGE TIMEZONE LANG LC_ALL"
168- local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE METHOD ARCH TARGET TEST STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
169- local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE TEST STRIP FSTAB CONFIG VIMLANG PAGE TIMEZONE LANG"
[d748b31]170+ local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO HPKG DEPEND TEST"
[059822c]171+ local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO HPKG RUNMAKE MODEL GRSECURITY_HOST TEST STRIP FSTAB CONFIG KEYMAP PAGE TIMEZONE LANG LC_ALL"
172+ local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO HPKG RUNMAKE METHOD ARCH TARGET TEST STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
173+ local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO HPKG RUNMAKE TEST STRIP FSTAB CONFIG VIMLANG PAGE TIMEZONE LANG"
174
175 local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
176 local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
177@@ -130,6 +130,7 @@
178 continue ;;
179 TIMEZONE) continue;;
180 MKFILE) continue;;
181+ USE_PACO) validation_str="x0x x1x"; validate_str; continue ;;
182 HPKG) validation_str="x0x x1x"; validate_str; continue ;;
183 RUNMAKE) validation_str="x0x x1x"; validate_str; continue ;;
184 TEST) validation_str="x0x x1x x2x x3x"; validate_str; continue ;;
185Index: common/paco-build.sh
186===================================================================
187--- common/paco-build.sh (revision 0)
188+++ common/paco-build.sh (revision 0)
189@@ -0,0 +1,9 @@
190+#!/bin/sh
191+set -e
192+
193+cd $PKGDIR
194+./configure --disable-gpaco \
195+ --sysconfdir=/etc &&
196+make &&
197+make install &&
198+make logme
199
200Property changes on: common/paco-build.sh
201___________________________________________________________________
202Name: svn:keywords
203 + Author Date Revision Id
204
205Index: common/paco-functions
206===================================================================
207--- common/paco-functions (revision 0)
208+++ common/paco-functions (revision 0)
[d748b31]209@@ -0,0 +1,113 @@
[059822c]210+#!/bin/bash
211+
212+
213+#----------------------------#
214+wrt_paco_inst() { #
215+#----------------------------#
[d748b31]216+
217+# Not using Paco with uClibc, even if requested
218+if [ $PROGNAME = "hlfs" ]; then
219+ if [ $MODEL = "uclibc" ]; then
220+ $USE_PACO = 0
221+ fi
222+fi
223+
224+if [ $USE_PACO != 0 ]; then
[059822c]225+ name="paco"
226+ this_script="$1-$name"
227+ file="chapter06/$this_script"
228+ chapter6="$chapter6 $this_script"
229+
230+ # Write target, dependency and unpack
231+ wrt_target "$this_script" "$PREV"
232+ wrt_unpack2 "$PACO_FILE"
233+
234+ # Copy the paco build script to the correct directory and make it executable
235+ echo -e "\t@cp $JHALFSDIR/paco-build.sh $JHALFSDIR/${PROGNAME}-commands/$file && \\" >> $MKFILE.tmp
236+ echo -e "\tchmod +x $JHALFSDIR/${PROGNAME}-commands/$file" >> $MKFILE.tmp
237+
238+ # Run the script
239+ wrt_run_as_chroot1 "${this_script}" "${file}"
240+
241+ # Clean up
242+ wrt_remove_build_dirs "$name"
243+ echo -e '\t@touch $@' >> $MKFILE.tmp
244+
245+ # Override the PREV variable
246+ PREV="$this_script"
247+fi
248+}
249+
250+
251+#----------------------------------#
252+wrt_paco_prep() { # Export Paco variables
253+#----------------------------------# and remove tmpfile
[d748b31]254+
255+# Not using Paco with uClibc, even if requested
256+if [ $PROGNAME = "hlfs" ]; then
257+ if [ $MODEL = "uclibc" ]; then
258+ $USE_PACO = 0
259+ fi
260+fi
261+
262+if [ $USE_PACO != 0 ] && [ "$vrs" != "" ]; then
[059822c]263+(
264+cat << EOF
265+ @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
266+ echo "export PACO_EXCLUDE=\$(SRC):$JHALFSDIR:$PACO_EXCLUDE" >> envars && \\
267+ echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
268+ rm -f \$(MOUNT_PT)$PACO_TMPFILE
269+EOF
270+) >> $MKFILE.tmp
271+fi
272+}
273+
274+
275+#----------------------------------#
276+wrt_paco_log() { # If the tmpfile exist, then log the current package
277+#----------------------------------# and remove tempfile
[d748b31]278+local PACKAGE
279+
280+# Allow packages to be logged without version
281+if [[ $2 != "" ]] ; then
282+ PACKAGE="$1-$2";
283+else
284+ PACKAGE="$1"
285+fi
[059822c]286+
[d748b31]287+# Not using Paco with uClibc, even if requested
288+if [ $PROGNAME = "hlfs" ]; then
289+ if [ $MODEL = "uclibc" ]; then
290+ $USE_PACO = 0
[059822c]291+ fi
[d748b31]292+fi
[059822c]293+
[d748b31]294+if [ $USE_PACO != 0 ] && [ "$vrs" != "" ]; then
[059822c]295+(
296+cat << EOF
297+ @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
298+ \$(CHROOT1) 'paco -lp $PACKAGE < $PACO_TMPFILE' && \\
299+ rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
300+ fi;
301+EOF
302+) >> $MKFILE.tmp
303+fi
304+}
305+
306+
307+#----------------------------------#
308+wrt_paco_log_blfs() { # If the tmpfile exist, then log the current package
309+#----------------------------------# and remove tempfile
310+if [ $USE_PACO != 0 ] ; then
311+(
312+cat << EOF
313+ @PACKAGE=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
314+ if [ -e $PACO_TMPFILE ]; then \\
[d748b31]315+ paco -lp \$\$PACKAGE < $PACO_TMPFILE && \\
[059822c]316+ rm -f $PACO_TMPFILE; \\
317+ fi;
318+EOF
319+) >> $MKFILE
320+fi
321+}
322+
323
324Property changes on: common/paco-functions
325___________________________________________________________________
326Name: svn:keywords
327 + Author Date Revision Id
328
329Index: common/common-functions
330===================================================================
[d748b31]331--- common/common-functions (revision 2520)
[059822c]332+++ common/common-functions (working copy)
333@@ -60,6 +60,9 @@
334 in the configuration file has the proper packages and patches for the
335 book version being processed.
336
337+${BOLD} --no-paco${OFF}
338+ dissables paco logging feature.
339+
340 ${BOLD} -T, --testsuites N ${OFF}
341 Run test suites [0-3]
342 0 = none
343@@ -623,6 +626,7 @@
344 --stringparam lc_all $LC_ALL \
345 --stringparam keymap $KEYMAP \
346 --stringparam grsecurity_host $GRSECURITY_HOST \
347+ --stringparam use_paco $USE_PACO \
348 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
349 ;;
350 lfs)
351@@ -634,6 +638,7 @@
352 --stringparam timezone $TIMEZONE \
353 --stringparam page $PAGE \
354 --stringparam lang $LANG \
355+ --stringparam use_paco $USE_PACO \
356 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
357 ;;
358 blfs)
359Index: HLFS/hlfs.xsl
360===================================================================
[d748b31]361--- HLFS/hlfs.xsl (revision 2520)
[059822c]362+++ HLFS/hlfs.xsl (working copy)
363@@ -39,6 +39,9 @@
364 <xsl:param name="lang" select="en_CA"/>
365 <xsl:param name="lc_all" select="en_CA"/>
366
367+ <!-- Use paco? -->
368+ <xsl:param name="use_paco" select="1"/>
369+
370 <xsl:template match="/">
371 <xsl:apply-templates select="//sect1"/>
372 </xsl:template>
373@@ -191,6 +194,10 @@
374 <!-- Fixing bootscripts installation -->
375 <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
376 string() = 'make install'">
377+ <!-- inserting LD_PRELOAD before installing bootscripts -->
378+ <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
379+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
380+ </xsl:if>
381 <xsl:text>make install&#xA;</xsl:text>
382 <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
383 </xsl:when>
384@@ -248,6 +255,25 @@
385 <xsl:apply-templates/>
386 <xsl:text> || true&#xA;</xsl:text>
387 </xsl:when>
388+ <!-- paco begin -->
389+ <!-- General rule -->
390+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
391+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
392+ contains(string(),'make') and
393+ contains(string(),'install')">
394+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
395+ <xsl:apply-templates/>
396+ <xsl:text>&#xA;</xsl:text>
397+ </xsl:when>
398+ <!-- Linux-libc-headers -->
399+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
400+ ancestor::sect1[@id='ch-system-linux-libc-headers'] and
401+ contains(string(),'install ')">
402+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
403+ <xsl:apply-templates/>
404+ <xsl:text>&#xA;</xsl:text>
405+ </xsl:when>
406+ <!-- paco end -->
407 <!-- The rest of commands -->
408 <xsl:otherwise>
409 <xsl:apply-templates/>
410Index: HLFS/master.sh
411===================================================================
[d748b31]412--- HLFS/master.sh (revision 2520)
[059822c]413+++ HLFS/master.sh (working copy)
414@@ -376,7 +376,9 @@
415 wrt_run_as_root "${this_script}" "${file}"
416 ;;
417 *) # The rest of Chapter06
418+ wrt_paco_prep
419 wrt_run_as_chroot1 "${this_script}" "${file}"
420+ wrt_paco_log "$name" "$vrs"
421 ;;
422 esac
423 #
424@@ -407,6 +409,13 @@
425
426 # Keep the script file name for Makefile dependencies.
427 PREV=$this_script
428+
429+ # Inserting paco build commands
430+ case "${this_script}" in
431+ *devices) wrt_paco_inst "068.5" ;;
432+ *readjusting) wrt_paco_inst "073.5" ;;
433+ esac
434+
435 done # end for file in chapter06/*
436
437 }
438@@ -469,6 +478,15 @@
439 wrt_run_as_chroot2 "${this_script}" "${file}"
440 fi
441 ;;
442+ *kernel) wrt_paco_prep
443+ wrt_run_as_chroot2 "$this_script" "$file"
444+ version=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
445+ wrt_paco_log "linux-kernel" "$version"
446+ ;;
447+ *bootscripts) wrt_paco_prep
448+ wrt_run_as_chroot2 "$this_script" "$file"
449+ wrt_paco_log "hlfs-bootscripts"
450+ ;;
451 *) # All other scripts
452 wrt_run_as_chroot2 "${this_script}" "${file}"
453 ;;
[d748b31]454Index: master.sh
455===================================================================
456--- master.sh (revision 2520)
457+++ master.sh (working copy)
458@@ -66,6 +66,11 @@
459 source $MODULE
460 [[ $? > 0 ]] && echo "$MODULE did not load.." && exit 2
461 [[ $VERBOSITY > 0 ]] && echo "OK"
462+# Load paco-functions
463+[[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
464+source $COMMON_DIR/paco-functions
465+[[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
466+[[ $VERBOSITY > 0 ]] && echo "OK"
467 #
468 [[ $VERBOSITY > 0 ]] && echo "---------------${nl_}"
469
470@@ -146,6 +151,8 @@
471
472 --help | -h ) usage | more && exit ;;
473
474+ --no-paco ) USE_PACO=0 ;;
475+
476 --testsuites | -T )
477 test $# = 1 && eval "$exit_missing_arg"
478 shift
479@@ -455,6 +462,15 @@
480
481 if [[ "$PWD" != "$JHALFSDIR" ]]; then
482 cp $COMMON_DIR/makefile-functions $JHALFSDIR/
483+ if [[ $USE_PACO != "0" ]] ; then
484+ if [[ $PROGNAME != "blfs" ]]; then
485+ cp $COMMON_DIR/paco-build.sh $JHALFSDIR/
486+ else
487+ echo -e "export PACO_INCLUDE=$PACO_INCLUDE" > $JHALFSDIR/pacovars
488+ echo -e "export PACO_EXCLUDE=~/sources:$JHALFSDIR:$PACO_EXCLUDE" >> $JHALFSDIR/pacovars
489+ echo -e "export PACO_TMPFILE=$PACO_TMPFILE" >> $JHALFSDIR/pacovars
490+ fi
491+ fi
492 if [[ -n "$FILES" ]]; then
493 # pushd/popd necessary to deal with mulitiple files
494 pushd $PACKAGE_DIR 1> /dev/null
Note: See TracBrowser for help on using the repository browser.