source: contrib/jhalfs-paco.patch@ ae0172b

1.0
Last change on this file since ae0172b was 7d2638a, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Rediffied 1.0 branch paco patch.

  • Property mode set to 100644
File size: 32.3 KB
RevLine 
[059822c]1Index: LFS/master.sh
2===================================================================
[7d2638a]3--- LFS/master.sh (revision 2906)
[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
[7d2638a]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.
[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
[50c8292]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 ;;
[50c8292]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===================================================================
[7d2638a]82--- LFS/lfs.xsl (revision 2906)
[059822c]83+++ LFS/lfs.xsl (working copy)
[50c8292]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>
[50c8292]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/>
[50c8292]128Index: CLFS/master.sh
129===================================================================
[7d2638a]130--- CLFS/master.sh (revision 2906)
[50c8292]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===================================================================
[7d2638a]316--- CLFS/clfs.xsl (revision 2906)
[50c8292]317+++ CLFS/clfs.xsl (working copy)
318@@ -45,6 +45,9 @@
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>
328@@ -106,6 +109,25 @@
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===================================================================
[7d2638a]373--- common/config (revision 2906)
[059822c]374+++ common/config (working copy)
[50c8292]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
[6921b21]382+PACO_VERSION=1.10.10
[059822c]383+
384+#--- Name of the Paco source package
[d82b935]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
[50c8292]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===================================================================
[7d2638a]411--- common/func_validate_configs.sh (revision 2906)
[059822c]412+++ common/func_validate_configs.sh (working copy)
[8230977]413@@ -84,9 +84,9 @@
[059822c]414 inline_doc
415
416 # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
[7d2638a]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 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"
420+ 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"
421+ 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"
422+ 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]423
424 local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
425 local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
[f358747]426@@ -176,6 +176,7 @@
427 [[ "$GETPKG" = "1" ]] && validate_against_str "x0x x1x"
428 fi ;;
[4795dfb]429 RUNMAKE) validate_against_str "x0x x1x" ;;
430+ USE_PACO) validate_against_str "x0x x1x" ;;
431 REPORT) validate_against_str "x0x x1x"
432 if [[ "${!config_param}" = "1" ]]; then
433 if [[ `type -p bc` ]]; then
[059822c]434Index: common/paco-functions
435===================================================================
436--- common/paco-functions (revision 0)
437+++ common/paco-functions (revision 0)
[50c8292]438@@ -0,0 +1,311 @@
[059822c]439+#!/bin/bash
440+
441+#----------------------------#
442+wrt_paco_inst() { #
443+#----------------------------#
[d748b31]444+
[50c8292]445+local paco_script="$1"
446+
447+check_build_model
[d748b31]448+
449+if [ $USE_PACO != 0 ]; then
[50c8292]450+ case $PROGNAME in
451+ clfs )
452+ paco_file="final-system/$paco_script"
453+ basicsystem="$basicsystem $paco_script" ;;
454+ * )
455+ paco_file="chapter06/$paco_script"
456+ chapter6="$chapter6 $paco_script" ;;
457+ esac
[6821737]458+
459+ # Copy the paco build script to the correct directory and make it executable
[799b0d1]460+ cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
[6821737]461+ chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
[059822c]462+
463+ # Write target, dependency and unpack
[50c8292]464+ if [ $CLFS_BOOT = 1 ]; then
465+ wrt_target_boot "$paco_script" "$PREV"
466+ wrt_unpack3 "$PACO_FILE"
467+ wrt_run_as_root2 "${paco_script}" "${paco_file}"
468+ wrt_remove_build_dirs2 "paco"
469+ else
470+ wrt_target "$paco_script" "$PREV"
471+ wrt_unpack2 "$PACO_FILE"
472+ wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
473+ wrt_remove_build_dirs "paco"
474+ fi
[059822c]475+
[2b88404]476+ wrt_touch
[059822c]477+
478+ # Override the PREV variable
[6821737]479+ PREV="$paco_script"
[059822c]480+fi
481+}
482+
483+
484+#----------------------------------#
485+wrt_paco_prep() { # Export Paco variables
486+#----------------------------------# and remove tmpfile
[d748b31]487+
[50c8292]488+local TMPFILEPATH
489+
490+check_build_model
[d748b31]491+
[b9ec725]492+check_log_package
493+
494+if [ $USE_PACO != 0 ] && [ $LOG_PACKAGE != 0 ]; then
[50c8292]495+ if [ $CLFS_BOOT = 1 ]; then
496+ TMPFILEPATH="$PACO_TMPFILE"
497+ else
498+ TMPFILEPATH="\$(MOUNT_PT)$PACO_TMPFILE"
499+ fi
[059822c]500+(
501+cat << EOF
502+ @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
[b9ec725]503+ echo "export PACO_EXCLUDE=\$(SRC):$PACO_EXCLUDE" >> envars && \\
[059822c]504+ echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
[50c8292]505+ rm -f $TMPFILEPATH
[059822c]506+EOF
507+) >> $MKFILE.tmp
508+fi
509+}
510+
511+
512+#----------------------------------#
513+wrt_paco_log() { # If the tmpfile exist, then log the current package
514+#----------------------------------# and remove tempfile
[d748b31]515+local PACKAGE
516+
[50c8292]517+# Extract package name and version from the tarball name
[2b88404]518+PACKAGE=`echo $1 | sed -e 's/.tar.*//'`
[059822c]519+
[50c8292]520+check_build_model
[059822c]521+
[50c8292]522+# Check if the package should be logged
[b9ec725]523+check_log_package
524+
[50c8292]525+
[b9ec725]526+if [ $USE_PACO != 0 ]; then
527+ if [ $LOG_PACKAGE != 0 ]; then
[50c8292]528+ # Only use this if doing CLFS boot build
529+ if [ $CLFS_BOOT = 1 ]; then
530+(
531+cat << EOF
532+ @if [ -e $PACO_TMPFILE ]; then \\
533+ paco -lp+ $PACKAGE < $PACO_TMPFILE && \\
534+ rm -f $PACO_TMPFILE; \\
535+ fi;
536+EOF
537+) >> $MKFILE.tmp
538+ # All else should use these commands
539+ else
[059822c]540+(
541+cat << EOF
542+ @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
[4795dfb]543+ \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\
[059822c]544+ rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
545+ fi;
546+EOF
547+) >> $MKFILE.tmp
[50c8292]548+ fi
[b9ec725]549+ fi
[50c8292]550+ # Add missing files to the logs if needed
[b9ec725]551+ wrt_paco_add_log
[059822c]552+fi
[b9ec725]553+}
[059822c]554+
[b9ec725]555+
556+#----------------------------------#
[50c8292]557+fnc_add_log() { #
558+#----------------------------------#
559+
560+MISSING_FILE=$1
561+
562+if [ $CLFS_BOOT = 1 ]; then
563+ echo -e "\t@$MISSING_FILE | paco -lp+ $PACKAGE" >> $MKFILE.tmp
564+else
565+ echo -e "\t@\$(CHROOT1) '$MISSING_FILE | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
566+fi
567+}
568+
569+
570+#----------------------------------#
[b9ec725]571+wrt_paco_add_log() { #
572+#----------------------------------#
573+# Some packages create files using bash redirection, which the LD_PRELOAD lib don't notice
574+# These rules will add the missing files to the proper logs.
575+# Most of these is not needed for HLFS, but they do no harm.
576+if [ $USE_PACO != 0 ]; then
[50c8292]577+ case $this_script in
[b9ec725]578+ *glibc)
[50c8292]579+ fnc_add_log "find /lib -type l"
580+ fnc_add_log "find /etc/{nsswitch.conf,ld.so.conf}"
[b9ec725]581+ ;;
582+ *ncurses)
[50c8292]583+ fnc_add_log "find /usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
[b9ec725]584+ ;;
585+ *bash)
[50c8292]586+ fnc_add_log "echo /bin/sh"
[b9ec725]587+ ;;
588+ *flex)
[50c8292]589+ fnc_add_log "echo /usr/bin/lex"
[b9ec725]590+ ;;
591+ *shadow)
[50c8292]592+ fnc_add_log "echo /etc/login.defs"
[b9ec725]593+ ;;
594+ *hotplug)
[50c8292]595+ fnc_add_log "echo /var/log/hotplug"
596+ fnc_add_log "echo /var/run/usb"
[b9ec725]597+ ;;
598+ *sysklogd)
[50c8292]599+ fnc_add_log "echo /etc/syslog.conf"
[b9ec725]600+ ;;
601+ *sysvinit)
[50c8292]602+ fnc_add_log "echo /etc/inittab"
[b9ec725]603+ ;;
604+ *udev)
[50c8292]605+ fnc_add_log "find /lib/udev/devices"
606+ fnc_add_log "echo /lib/firmware"
607+ fnc_add_log "find /etc/udev/rules.d -type f"
[b9ec725]608+ ;;
609+ *util-linux)
[50c8292]610+ fnc_add_log "echo /var/lib/hwclock"
611+ fnc_add_log "echo /etc/nologin.txt"
[b9ec725]612+ ;;
613+ *vim)
[50c8292]614+ fnc_add_log "echo /etc/vimrc"
[b9ec725]615+ ;;
[50c8292]616+ # Rules below here will log configuration files created in {C,H}LFS
617+ # They will end up in a log named {c,h}lfs-sysconf
[b9ec725]618+ *setclock)
[50c8292]619+ fnc_add_log "echo /etc/sysconfig/clock"
[b9ec725]620+ ;;
621+ *inputrc)
[50c8292]622+ fnc_add_log "echo /etc/inputrc"
[b9ec725]623+ ;;
624+ *profile)
[50c8292]625+ fnc_add_log "echo /etc/profile"
[b9ec725]626+ ;;
627+ *hostname)
[50c8292]628+ fnc_add_log "echo /etc/sysconfig/network"
[b9ec725]629+ ;;
630+ *localnet)
[50c8292]631+ fnc_add_log "echo /etc/sysconfig/network"
[b9ec725]632+ ;;
633+ *hosts)
[50c8292]634+ fnc_add_log "echo /etc/hosts"
[b9ec725]635+ ;;
636+ *network)
[50c8292]637+ fnc_add_log "echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4"
638+ fnc_add_log "echo /etc/resolv.conf"
[b9ec725]639+ ;;
640+ *fstab)
[50c8292]641+ fnc_add_log "echo /etc/fstab"
[b9ec725]642+ ;;
[50c8292]643+ *theend) # LFS and CLFS
644+ fnc_add_log "echo /etc/$PROGNAME-release"
[b9ec725]645+ ;;
646+ *finished) # HLFS
[50c8292]647+ fnc_add_log "echo /etc/$PROGNAME-release"
[b9ec725]648+ ;;
649+ esac
[059822c]650+fi
651+}
[b9ec725]652+
653+
654+#----------------------------------#
655+check_log_package() { #
656+#----------------------------------#
657+# Maybe don't need this function, but it will avoid writing some
658+# unnecessary paco commands in the Makefile.
659+
660+case $this_script in
[2b88404]661+ *changingowner) LOG_PACKAGE=0 ;;
[b9ec725]662+ *creatingdirs) LOG_PACKAGE=0 ;;
663+ *createfiles) LOG_PACKAGE=0 ;;
[2b88404]664+ *pwdgroup) LOG_PACKAGE=0 ;;
665+ *devices) LOG_PACKAGE=0 ;;
[50c8292]666+ *stripping) LOG_PACKAGE=0 ;;
[b9ec725]667+ *strippingagain) LOG_PACKAGE=0 ;;
[50c8292]668+ *adjusting) LOG_PACKAGE=0 ;;
669+ *temp-perl) LOG_PACKAGE=0 ;;
[b9ec725]670+ *readjusting) LOG_PACKAGE=0 ;;
671+ *setclock) LOG_PACKAGE=0 ;;
672+ *inputrc) LOG_PACKAGE=0 ;;
673+ *profile) LOG_PACKAGE=0 ;;
674+ *hostname) LOG_PACKAGE=0 ;;
675+ *localnet) LOG_PACKAGE=0 ;;
676+ *hosts) LOG_PACKAGE=0 ;;
677+ *network) LOG_PACKAGE=0 ;;
678+ *fstab) LOG_PACKAGE=0 ;;
679+ *theend) LOG_PACKAGE=0 ;;
680+ *finished) LOG_PACKAGE=0 ;;
681+ *) LOG_PACKAGE=1 ;;
682+esac
683+}
[d82b935]684+
685+#----------------------------------#
686+get_paco_src() { #
687+#----------------------------------#
688+# Download the paco sources
689+# We don't do any MD5SUM checking as of yet
690+# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
691+
692+local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
693+local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
694+
695+# Test if paco is to be used
[50c8292]696+[[ ! "$USE_PACO" = "1" ]] && return
[d82b935]697+
698+# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
699+if [ ! -z ${SRC_ARCHIVE} ] &&
700+ [ -d ${SRC_ARCHIVE} ] &&
701+ [ -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
702+ cp ${SRC_ARCHIVE}/$PACO_FILE .
703+ echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
704+ fromARCHIVE=1
705+else
706+ echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
707+ fromARCHIVE=0
708+ # If the file does not exist yet in /sources download a fresh one
709+ if [ ! -f $PACO_FILE ] ; then
710+ if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
711+ gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
712+ continue
713+ fi
714+ fi
715+fi
716+
717+# Copy the freshly downloaded file to the source archive.
718+if [ ! -z ${SRC_ARCHIVE} ] &&
719+ [ -d ${SRC_ARCHIVE} ] &&
720+ [ -w ${SRC_ARCHIVE} ] &&
721+ [ "$fromARCHIVE" = "0" ] ; then
722+ echo "Storing file:<$PACO_FILE> in the package archive"
723+ cp -f $PACO_FILE ${SRC_ARCHIVE}
724+fi
725+}
[50c8292]726+
727+
728+#----------------------------------#
729+check_build_model() { #
730+#----------------------------------#
731+# Check what script we're running, and set some switches accordingly
732+
733+CLFS_BOOT=0
734+
735+case $PROGNAME in
736+ hlfs)
737+ # Not using Paco with uClibc, even if requested
738+ if [ "$MODEL" = "uclibc" ]; then
739+ USE_PACO=0
740+ fi
741+ ;;
742+ clfs)
743+ # CLFS boot method require it's own commands
744+ if [ "$METHOD" = "boot" ]; then
745+ CLFS_BOOT=1
746+ fi
747+ ;;
748+esac
749+}
[799b0d1]750Index: common/paco-build-lfs.sh
[6821737]751===================================================================
[799b0d1]752--- common/paco-build-lfs.sh (revision 0)
753+++ common/paco-build-lfs.sh (revision 0)
[b9ec725]754@@ -0,0 +1,10 @@
[6821737]755+#!/bin/sh
756+set -e
757+
758+cd $PKGDIR
[b9ec725]759+./configure --sysconfdir=/etc \
760+ --enable-scripts \
761+ --disable-gpaco &&
[6821737]762+make &&
763+make install &&
764+make logme
[50c8292]765Index: common/paco-build-clfs.sh
766===================================================================
767--- common/paco-build-clfs.sh (revision 0)
768+++ common/paco-build-clfs.sh (revision 0)
769@@ -0,0 +1,10 @@
770+#!/bin/sh
771+set -e
772+
773+cd $PKGDIR
774+./configure --sysconfdir=/etc \
775+ --enable-scripts \
776+ --disable-gpaco &&
777+make &&
778+make install &&
779+make logme
[059822c]780Index: common/common-functions
781===================================================================
[7d2638a]782--- common/common-functions (revision 2906)
[059822c]783+++ common/common-functions (working copy)
[a708b15]784@@ -69,6 +69,9 @@
[059822c]785 in the configuration file has the proper packages and patches for the
786 book version being processed.
787
788+${BOLD} --no-paco${OFF}
789+ dissables paco logging feature.
790+
[f3ae556]791 ${BOLD} -O, --optimize${OFF}
792 Optimize [0-2]
793 0 = no optimization
[7d2638a]794@@ -683,6 +686,7 @@
[50c8292]795 --stringparam page $PAGE \
796 --stringparam lang $LANG \
797 --stringparam keymap $KEYMAP \
798+ --stringparam use_paco $USE_PACO \
799 -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
800 ;;
801 hlfs)
[7d2638a]802@@ -698,6 +702,7 @@
[059822c]803 --stringparam lc_all $LC_ALL \
804 --stringparam keymap $KEYMAP \
805 --stringparam grsecurity_host $GRSECURITY_HOST \
806+ --stringparam use_paco $USE_PACO \
807 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
808 ;;
809 lfs)
[7d2638a]810@@ -710,6 +715,7 @@
[059822c]811 --stringparam timezone $TIMEZONE \
812 --stringparam page $PAGE \
813 --stringparam lang $LANG \
814+ --stringparam use_paco $USE_PACO \
815 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
816 ;;
[8230977]817 *) exit 1 ;;
[7d2638a]818@@ -776,6 +782,9 @@
[d82b935]819 # Generate URLs file
820 create_urls
821
822+ # If Paco is to be used, then download the sources
823+ get_paco_src
824+
825 IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
826 for line in `cat urls.lst`; do
827 IFS=$saveIFS # Restore the system defaults
[059822c]828Index: HLFS/hlfs.xsl
829===================================================================
[7d2638a]830--- HLFS/hlfs.xsl (revision 2906)
[059822c]831+++ HLFS/hlfs.xsl (working copy)
[50c8292]832@@ -46,6 +46,9 @@
[c665386]833 <xsl:param name="lang" select="C"/>
834 <xsl:param name="lc_all" select="C"/>
[059822c]835
836+ <!-- Use paco? -->
837+ <xsl:param name="use_paco" select="1"/>
838+
839 <xsl:template match="/">
840 <xsl:apply-templates select="//sect1"/>
841 </xsl:template>
[50c8292]842@@ -192,6 +195,10 @@
[059822c]843 <!-- Fixing bootscripts installation -->
844 <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
845 string() = 'make install'">
846+ <!-- inserting LD_PRELOAD before installing bootscripts -->
847+ <xsl:if test="$use_paco != '0' and $model != 'uclibc'">
848+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
849+ </xsl:if>
850 <xsl:text>make install&#xA;</xsl:text>
851 <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
852 </xsl:when>
[50c8292]853@@ -280,6 +287,25 @@
[059822c]854 <xsl:apply-templates/>
855 <xsl:text> || true&#xA;</xsl:text>
856 </xsl:when>
857+ <!-- paco begin -->
858+ <!-- General rule -->
859+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
860+ ancestor::chapter[@id != 'chapter-temporary-tools'] and
861+ contains(string(),'make') and
862+ contains(string(),'install')">
863+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
[6921b21]864+ <xsl:apply-templates/>
[059822c]865+ <xsl:text>&#xA;</xsl:text>
866+ </xsl:when>
867+ <!-- Linux-libc-headers -->
868+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
[6921b21]869+ ancestor::sect1[@id='ch-system-linux-headers'] and
[059822c]870+ contains(string(),'install ')">
871+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
[6921b21]872+ <xsl:apply-templates/>
[059822c]873+ <xsl:text>&#xA;</xsl:text>
874+ </xsl:when>
875+ <!-- paco end -->
876 <!-- The rest of commands -->
877 <xsl:otherwise>
878 <xsl:apply-templates/>
879Index: HLFS/master.sh
880===================================================================
[7d2638a]881--- HLFS/master.sh (revision 2906)
[059822c]882+++ HLFS/master.sh (working copy)
[7d2638a]883@@ -40,7 +40,9 @@
[6921b21]884 EOF
885 ) >> $MKFILE.tmp
[50c8292]886 [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
[6921b21]887+ wrt_paco_prep
888 wrt_run_as_chroot1 "$toolchain" "$this_script"
889+ wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
890 ;;
891
892 *)
[7d2638a]893@@ -272,6 +274,11 @@
[8230977]894 # Keep the script file name
895 this_script=`basename $file`
896
897+ # If this script is *-paco, then skip it
898+ case $this_script in
899+ *paco ) continue ;;
900+ esac
901+
902 # Skip this script depending on jhalfs.conf flags set.
903 case $this_script in
904 # We'll run the chroot commands differently than the others, so skip them in the
[7d2638a]905@@ -281,6 +288,18 @@
[4795dfb]906 *-stripping* ) [[ "$STRIP" = "0" ]] && continue ;;
[6821737]907 esac
908
[4795dfb]909+ # Install paco as the first package in ch6, before installing
910+ # linux-libc-headers, except in iterartive builds
911+ if [[ -z "$N" ]]; then
912+ case $this_script in
[6921b21]913+ *linux-headers)
[799b0d1]914+ TMP_SCRIPT="$this_script"
[6921b21]915+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
[799b0d1]916+ wrt_paco_inst "$this_script"
917+ this_script="$TMP_SCRIPT" ;;
[4795dfb]918+ esac
919+ fi
[6821737]920+
[4795dfb]921 # Grab the name of the target
922 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
923
[7d2638a]924@@ -346,7 +365,9 @@
925 wrt_RunAsRoot "${this_script}" "${file}"
[059822c]926 ;;
927 *) # The rest of Chapter06
928+ wrt_paco_prep
929 wrt_run_as_chroot1 "${this_script}" "${file}"
[2b88404]930+ wrt_paco_log "$pkg_tarball"
[059822c]931 ;;
932 esac
933 #
[7d2638a]934@@ -366,6 +387,16 @@
[4795dfb]935 PREV=${this_script}${N}
936 # Set system_build envar for iteration targets
937 system_build=$chapter6
[059822c]938+
[6821737]939+ # Reinstall paco after the toolchain has been readjusted.
[059822c]940+ case "${this_script}" in
[6821737]941+ *readjusting)
[799b0d1]942+ TMP_SCRIPT="$this_script"
943+ this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'`
944+ wrt_paco_inst "$this_script"
945+ this_script="$TMP_SCRIPT" ;;
[059822c]946+ esac
947+
948 done # end for file in chapter06/*
949
950 }
[7d2638a]951@@ -424,9 +455,19 @@
[b9ec725]952 else # Initialize the log and run the script
[059822c]953 wrt_run_as_chroot2 "${this_script}" "${file}"
954 fi
[b9ec725]955+ wrt_paco_log "hlfs-sysconf"
[059822c]956 ;;
957+ *kernel) wrt_paco_prep
958+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]959+ wrt_paco_log "$(get_package_tarball_name "linux")"
[059822c]960+ ;;
961+ *bootscripts) wrt_paco_prep
962+ wrt_run_as_chroot2 "$this_script" "$file"
[2b88404]963+ wrt_paco_log "$(get_package_tarball_name "lfs-bootscripts")"
[059822c]964+ ;;
965 *) # All other scripts
966 wrt_run_as_chroot2 "${this_script}" "${file}"
[b9ec725]967+ wrt_paco_log "hlfs-sysconf"
[059822c]968 ;;
[b9ec725]969 esac
970
[d748b31]971Index: master.sh
972===================================================================
[7d2638a]973--- master.sh (revision 2906)
[d748b31]974+++ master.sh (working copy)
[a708b15]975@@ -149,6 +149,8 @@
[d748b31]976
977 --help | -h ) usage | more && exit ;;
978
979+ --no-paco ) USE_PACO=0 ;;
980+
[f3ae556]981 --optimize | -O )
[d748b31]982 test $# = 1 && eval "$exit_missing_arg"
983 shift
[a708b15]984@@ -440,6 +442,14 @@
[d29584b]985 [[ $VERBOSITY > 0 ]] && echo "OK"
986 fi
[f3ae556]987 #
[d29584b]988+# paco module
989+if [[ "$USE_PACO" = "1" ]]; then
990+ [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..."
991+ source $COMMON_DIR/paco-functions
992+ [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2
993+ [[ $VERBOSITY > 0 ]] && echo "OK"
994+fi
995+#
[f3ae556]996 # optimize module
997 if [[ "$OPTIMIZE" != "0" ]]; then
998 [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..."
[a708b15]999@@ -486,6 +496,8 @@
[d748b31]1000 if [[ "$PWD" != "$JHALFSDIR" ]]; then
[b9ec725]1001 cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
[c665386]1002 #
[8230977]1003+ [[ $USE_PACO != "0" ]] && cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/
1004+ #
[f3ae556]1005 [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
[c665386]1006 #
[4795dfb]1007 if [[ "$COMPARE" != "0" ]] ; then
Note: See TracBrowser for help on using the repository browser.