source:
contrib/jhalfs-paco.patch@
8a43b5b
Last change on this file since 8a43b5b was f3ae556, checked in by , 19 years ago | |
---|---|
|
|
File size: 18.8 KB |
-
LFS/master.sh
180 180 *stripping*) [[ "${STRIP}" = "0" ]] && continue ;; 181 181 esac 182 182 183 # Install paco as the first package in ch6, before installing 184 # linux-libc-headers, except in iterartive builds 185 if [[ -z "$N" ]]; then 186 case $this_script in 187 *linux-libc-headers) 188 TMP_SCRIPT="$this_script" 189 this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'` 190 wrt_paco_inst "$this_script" 191 this_script="$TMP_SCRIPT" ;; 192 esac 193 fi 194 183 195 # Grab the name of the target 184 196 name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'` 185 197 … … 223 235 # and not to use chroot. 224 236 case "${this_script}" in 225 237 *kernfs) wrt_run_as_root "${this_script}" "$file" ;; 226 *) wrt_run_as_chroot1 "${this_script}" "$file" ;; 238 *) wrt_paco_prep 239 wrt_run_as_chroot1 "${this_script}" "$file" 240 wrt_paco_log "$name" "$vrs" ;; 227 241 esac 228 242 229 243 # Remove the build directory(ies) except if the package build fails. … … 243 257 PREV=${this_script}${N} 244 258 # Set system_build envar for iteration targets 245 259 system_build=$chapter6 260 261 # Reinstalling paco after readsjusting the toolchain. 262 case "${this_script}" in 263 *readjusting) 264 TMP_SCRIPT="$this_script" 265 this_script=`echo ${this_script} | sed -e 's/readjusting/x-paco/'` 266 wrt_paco_inst "$this_script" 267 this_script="$TMP_SCRIPT" ;; 268 esac 269 246 270 done # end for file in chapter06/* 247 271 } 248 272 … … 304 328 wrt_run_as_chroot2 "$this_script" "$file" 305 329 fi 306 330 ;; 331 *kernel) wrt_paco_prep 332 wrt_run_as_chroot2 "$this_script" "$file" 333 wrt_paco_log "linux-kernel" "$vrs" 334 ;; 335 *bootscripts) wrt_paco_prep 336 wrt_run_as_chroot2 "$this_script" "$file" 337 wrt_paco_log "lfs-bootscripts" "$vrs" 338 ;; 307 339 *) wrt_run_as_chroot2 "$this_script" "$file" 308 340 ;; 309 341 esac -
LFS/lfs.xsl
32 32 <!-- Locale settings --> 33 33 <xsl:param name="lang" select="en_CA"/> 34 34 35 <!-- Use paco? --> 36 <xsl:param name="use_paco" select="1"/> 37 35 38 <xsl:template match="/"> 36 39 <xsl:apply-templates select="//sect1"/> 37 40 </xsl:template> … … 190 193 <xsl:apply-templates/> 191 194 <xsl:text> || true
</xsl:text> 192 195 </xsl:when> 196 <!-- paco begin --> 197 <!-- General rule --> 198 <xsl:when test="$use_paco != '0' and 199 ancestor::chapter[@id != 'chapter-temporary-tools'] and 200 contains(string(),'make') and 201 contains(string(),'install')"> 202 <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so
</xsl:text> 203 <xsl:apply-templates/> 204 <xsl:text>
</xsl:text> 205 </xsl:when> 206 <!-- Linux-libc-headers --> 207 <xsl:when test="$use_paco != '0' and 208 ancestor::sect1[@id='ch-system-linux-libc-headers'] and 209 contains(string(),'install ')"> 210 <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so
</xsl:text> 211 <xsl:apply-templates/> 212 <xsl:text>
</xsl:text> 213 </xsl:when> 214 <!-- Unset LD_PRELOAD before second make in Zlib --> 215 <xsl:when test="$use_paco != '0' and 216 ancestor::sect1[@id='ch-system-zlib'] and 217 contains(string(),'make clean')"> 218 <xsl:text>unset LD_PRELOAD
</xsl:text> 219 <xsl:apply-templates/> 220 <xsl:text>
</xsl:text> 221 </xsl:when> 222 <!-- paco end --> 193 223 <!-- The rest of commands --> 194 224 <xsl:otherwise> 195 225 <xsl:apply-templates/> -
BLFS/master.sh
79 79 EOF 80 80 ) >> $MKFILE 81 81 82 if [[ $USE_PACO != 0 ]]; then 83 ( 84 cat << EOF 85 @echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >logs/$this_script && \\ 86 source $JHALFSDIR/pacovars && \\ 87 rm -f $PACO_TMPFILE && \\ 88 $JHALFSDIR/${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\ 89 echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >>logs/$this_script 90 EOF 91 ) >> $MKFILE 92 wrt_paco_log_blfs 93 94 else 82 95 # Insert date and disk usage at the top of the log file, the script run 83 96 # and date and disk usage again at the bottom of the log file. 84 97 ( … … 88 101 echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >>logs/$this_script 89 102 EOF 90 103 ) >> $MKFILE 104 fi 91 105 92 106 # Include a touch of the target name so make can check 93 107 # if it's already been made. -
BLFS/blfs.xsl
159 159 <xsl:when test="@role = 'nodump'"/> 160 160 <xsl:otherwise> 161 161 <xsl:if test="@role = 'root'"> 162 <xsl:text> sudo</xsl:text>162 <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so
</xsl:text> 163 163 </xsl:if> 164 164 <xsl:apply-templates select="userinput" mode="screen"/> 165 165 </xsl:otherwise> -
common/paco-build-hlfs.sh
1 #!/bin/sh 2 set -e 3 4 cd $PKGDIR 5 ./configure --with-pic \ 6 --disable-static \ 7 --disable-gpaco \ 8 --sysconfdir=/etc && 9 make && 10 make install && 11 make logme -
common/config
88 88 #--- Run farce testing 0(no)/1(yes) 89 89 RUN_FARCE=0 90 90 91 #==== PACO VARIABLES ==== 92 #--- Use paco? 0(no)/1(yes) 93 USE_PACO=1 94 PACO_VERSION=1.10.7 95 96 #--- Name of the Paco source package 97 PACO_FILE=paco-$PACO_VERSION.tar.* 98 91 99 #==== INTERNAL VARIABLES ==== 92 100 # Don't edit it unless you know what you are doing 93 101 … … 100 108 101 109 #--- farce report log directory 102 110 FARCELOGDIR=$LOGDIR/farce 111 112 #--- Variables needed by paco 113 PACO_INCLUDE=/ 114 PACO_EXCLUDE=/sys:/dev:/proc:/tmp:/usr/src:/usr/share/info/dir:/jhalfs 115 PACO_TMPFILE=/tmp/paco.tmp 116 LD_PRELOAD=/usr/lib/libpaco-log.so -
common/func_validate_configs.sh
84 84 inline_doc 85 85 86 86 # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables 87 local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG DEPEND TEST OPTIMIZE"88 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 KEYMAP PAGE TIMEZONE LANG LC_ALL"89 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 KEYMAP VIMLANG PAGE TIMEZONE LANG"90 local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG VIMLANG PAGE TIMEZONE LANG"87 local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG DEPEND TEST OPTIMIZE" 88 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 KEYMAP PAGE TIMEZONE LANG LC_ALL" 89 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 KEYMAP VIMLANG PAGE TIMEZONE LANG" 90 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 VIMLANG PAGE TIMEZONE LANG" 91 91 92 92 local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,' 93 93 local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}' … … 179 179 # Validate general parameters.. 180 180 GETPKG) validate_against_str "x0x x1x" ;; 181 181 RUNMAKE) validate_against_str "x0x x1x" ;; 182 USE_PACO) validate_against_str "x0x x1x" ;; 182 183 REPORT) validate_against_str "x0x x1x" 183 184 if [[ "${!config_param}" = "1" ]]; then 184 185 if [[ `type -p bc` ]]; then -
common/paco-functions
1 #!/bin/bash 2 3 4 #----------------------------# 5 wrt_paco_inst() { # 6 #----------------------------# 7 8 # Not using Paco with uClibc, even if requested 9 if [ $PROGNAME = "hlfs" ]; then 10 if [ $MODEL = "uclibc" ]; then 11 USE_PACO=0 12 fi 13 fi 14 15 if [ $USE_PACO != 0 ]; then 16 paco_script="$1" 17 paco_file="chapter06/$paco_script" 18 chapter6="$chapter6 $paco_script" 19 20 # Copy the paco build script to the correct directory and make it executable 21 cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file && 22 chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file 23 24 # Write target, dependency and unpack 25 wrt_target "$paco_script" "$PREV" 26 wrt_unpack2 "$PACO_FILE" 27 28 # Run the script 29 wrt_run_as_chroot1 "${paco_script}" "${paco_file}" 30 31 # Clean up 32 wrt_remove_build_dirs "paco" 33 echo -e '\t@touch $@' >> $MKFILE.tmp 34 35 # Override the PREV variable 36 PREV="$paco_script" 37 fi 38 } 39 40 41 #----------------------------------# 42 wrt_paco_prep() { # Export Paco variables 43 #----------------------------------# and remove tmpfile 44 45 # Not using Paco with uClibc, even if requested 46 if [ $PROGNAME = "hlfs" ]; then 47 if [ $MODEL = "uclibc" ]; then 48 USE_PACO=0 49 fi 50 fi 51 52 if [ $USE_PACO != 0 ] && [ "$vrs" != "" ]; then 53 ( 54 cat << EOF 55 @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\ 56 echo "export PACO_EXCLUDE=\$(SRC):$JHALFSDIR:$PACO_EXCLUDE" >> envars && \\ 57 echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\ 58 rm -f \$(MOUNT_PT)$PACO_TMPFILE 59 EOF 60 ) >> $MKFILE.tmp 61 fi 62 } 63 64 65 #----------------------------------# 66 wrt_paco_log() { # If the tmpfile exist, then log the current package 67 #----------------------------------# and remove tempfile 68 local PACKAGE 69 70 # Allow packages to be logged without version 71 if [[ $2 != "" ]] ; then 72 PACKAGE="$1-$2"; 73 else 74 PACKAGE="$1" 75 fi 76 77 # Not using Paco with uClibc, even if requested 78 if [ $PROGNAME = "hlfs" ]; then 79 if [ $MODEL = "uclibc" ]; then 80 USE_PACO=0 81 fi 82 fi 83 84 if [ $USE_PACO != 0 ] && [ "$vrs" != "" ]; then 85 ( 86 cat << EOF 87 @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\ 88 \$(CHROOT1) 'paco -lp+ $PACKAGE < $PACO_TMPFILE' && \\ 89 rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\ 90 fi; 91 EOF 92 ) >> $MKFILE.tmp 93 fi 94 } 95 96 97 #----------------------------------# 98 wrt_paco_log_blfs() { # If the tmpfile exist, then log the current package 99 #----------------------------------# and remove tempfile 100 if [ $USE_PACO != 0 ] ; then 101 ( 102 cat << EOF 103 @PACKAGE=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ 104 if [ -e $PACO_TMPFILE ]; then \\ 105 paco -lp \$\$PACKAGE < $PACO_TMPFILE && \\ 106 rm -f $PACO_TMPFILE; \\ 107 fi; 108 EOF 109 ) >> $MKFILE 110 fi 111 } 112 -
common/paco-build-lfs.sh
1 #!/bin/sh 2 set -e 3 4 cd $PKGDIR 5 ./configure --disable-gpaco \ 6 --sysconfdir=/etc && 7 make && 8 make install && 9 make logme -
common/common-functions
65 65 in the configuration file has the proper packages and patches for the 66 66 book version being processed. 67 67 68 ${BOLD} --no-paco${OFF} 69 dissables paco logging feature. 70 68 71 ${BOLD} -O, --optimize${OFF} 69 72 Optimize [0-2] 70 73 0 = no optimization … … 581 584 --stringparam lc_all $LC_ALL \ 582 585 --stringparam keymap $KEYMAP \ 583 586 --stringparam grsecurity_host $GRSECURITY_HOST \ 587 --stringparam use_paco $USE_PACO \ 584 588 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1 585 589 ;; 586 590 lfs) … … 592 596 --stringparam timezone $TIMEZONE \ 593 597 --stringparam page $PAGE \ 594 598 --stringparam lang $LANG \ 599 --stringparam use_paco $USE_PACO \ 595 600 -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1 596 601 ;; 597 602 blfs) -
HLFS/hlfs.xsl
39 39 <xsl:param name="lang" select="en_CA"/> 40 40 <xsl:param name="lc_all" select="en_CA"/> 41 41 42 <!-- Use paco? --> 43 <xsl:param name="use_paco" select="1"/> 44 42 45 <xsl:template match="/"> 43 46 <xsl:apply-templates select="//sect1"/> 44 47 </xsl:template> … … 191 194 <!-- Fixing bootscripts installation --> 192 195 <xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and 193 196 string() = 'make install'"> 197 <!-- inserting LD_PRELOAD before installing bootscripts --> 198 <xsl:if test="$use_paco != '0' and $model != 'uclibc'"> 199 <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so
</xsl:text> 200 </xsl:if> 194 201 <xsl:text>make install
</xsl:text> 195 202 <xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;
</xsl:text> 196 203 </xsl:when> … … 248 255 <xsl:apply-templates/> 249 256 <xsl:text> || true
</xsl:text> 250 257 </xsl:when> 258 <!-- paco begin --> 259 <!-- General rule --> 260 <xsl:when test="$use_paco != '0' and $model != 'uclibc' and 261 ancestor::chapter[@id != 'chapter-temporary-tools'] and 262 contains(string(),'make') and 263 contains(string(),'install')"> 264 <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so
</xsl:text> 265 <xsl:apply-templates/> 266 <xsl:text>
</xsl:text> 267 </xsl:when> 268 <!-- Linux-libc-headers --> 269 <xsl:when test="$use_paco != '0' and $model != 'uclibc' and 270 ancestor::sect1[@id='ch-system-linux-libc-headers'] and 271 contains(string(),'install ')"> 272 <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so
</xsl:text> 273 <xsl:apply-templates/> 274 <xsl:text>
</xsl:text> 275 </xsl:when> 276 <!-- paco end --> 251 277 <!-- The rest of commands --> 252 278 <xsl:otherwise> 253 279 <xsl:apply-templates/> -
HLFS/master.sh
254 254 *-stripping* ) [[ "$STRIP" = "0" ]] && continue ;; 255 255 esac 256 256 257 # Install paco as the first package in ch6, before installing 258 # linux-libc-headers, except in iterartive builds 259 if [[ -z "$N" ]]; then 260 case $this_script in 261 *linux-libc-headers) 262 TMP_SCRIPT="$this_script" 263 this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'` 264 wrt_paco_inst "$this_script" 265 this_script="$TMP_SCRIPT" ;; 266 esac 267 fi 268 257 269 # Grab the name of the target 258 270 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'` 259 271 … … 324 336 wrt_run_as_root "${this_script}" "${file}" 325 337 ;; 326 338 *) # The rest of Chapter06 339 wrt_paco_prep 327 340 wrt_run_as_chroot1 "${this_script}" "${file}" 341 wrt_paco_log "$name" "$vrs" 328 342 ;; 329 343 esac 330 344 # … … 357 371 PREV=${this_script}${N} 358 372 # Set system_build envar for iteration targets 359 373 system_build=$chapter6 374 375 # Reinstall paco after the toolchain has been readjusted. 376 case "${this_script}" in 377 *readjusting) 378 TMP_SCRIPT="$this_script" 379 this_script=`echo $this_script | sed -e 's/readjusting/x-paco/'` 380 wrt_paco_inst "$this_script" 381 this_script="$TMP_SCRIPT" ;; 382 esac 383 360 384 done # end for file in chapter06/* 361 385 362 386 } … … 419 443 wrt_run_as_chroot2 "${this_script}" "${file}" 420 444 fi 421 445 ;; 446 *kernel) wrt_paco_prep 447 wrt_run_as_chroot2 "$this_script" "$file" 448 version=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'` 449 wrt_paco_log "linux-kernel" "$version" 450 ;; 451 *bootscripts) wrt_paco_prep 452 wrt_run_as_chroot2 "$this_script" "$file" 453 wrt_paco_log "hlfs-bootscripts" 454 ;; 422 455 *) # All other scripts 423 456 wrt_run_as_chroot2 "${this_script}" "${file}" 424 457 ;; -
master.sh
147 147 148 148 --help | -h ) usage | more && exit ;; 149 149 150 --no-paco ) USE_PACO=0 ;; 151 150 152 --optimize | -O ) 151 153 test $# = 1 && eval "$exit_missing_arg" 152 154 shift … … 464 466 [[ $VERBOSITY > 0 ]] && echo "OK" 465 467 fi 466 468 # 469 # paco module 470 if [[ "$USE_PACO" = "1" ]]; then 471 [[ $VERBOSITY > 0 ]] && echo -n "Loading paco module..." 472 source $COMMON_DIR/paco-functions 473 [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit 2 474 [[ $VERBOSITY > 0 ]] && echo "OK" 475 fi 476 # 467 477 # optimize module 468 478 if [[ "$OPTIMIZE" != "0" ]]; then 469 479 [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..." … … 507 517 508 518 if [[ "$PWD" != "$JHALFSDIR" ]]; then 509 519 cp $COMMON_DIR/makefile-functions $JHALFSDIR/ 520 if [[ $USE_PACO != "0" ]] ; then 521 if [[ $PROGNAME != "blfs" ]]; then 522 cp $COMMON_DIR/paco-build-$PROGNAME.sh $JHALFSDIR/ 523 else 524 echo -e "export PACO_INCLUDE=$PACO_INCLUDE" > $JHALFSDIR/pacovars 525 echo -e "export PACO_EXCLUDE=~/sources:$JHALFSDIR:$PACO_EXCLUDE" >> $JHALFSDIR/pacovars 526 echo -e "export PACO_TMPFILE=$PACO_TMPFILE" >> $JHALFSDIR/pacovars 527 fi 528 fi 510 529 [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/ 511 530 if [[ "$COMPARE" != "0" ]] ; then 512 531 mkdir -p $JHALFSDIR/extras
Note:
See TracBrowser
for help on using the repository browser.