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