[0170229] | 1 | #!/bin/bash
|
---|
[dd810ea] | 2 |
|
---|
| 3 | # $Id$
|
---|
| 4 |
|
---|
| 5 | set +e
|
---|
[0170229] | 6 |
|
---|
| 7 | # VT100 colors
|
---|
| 8 | declare -r BLACK=$'\e[1;30m'
|
---|
| 9 | declare -r DK_GRAY=$'\e[0;30m'
|
---|
| 10 |
|
---|
| 11 | declare -r RED=$'\e[31m'
|
---|
| 12 | declare -r GREEN=$'\e[32m'
|
---|
| 13 | declare -r YELLOW=$'\e[33m'
|
---|
| 14 | declare -r BLUE=$'\e[34m'
|
---|
| 15 | declare -r MAGENTA=$'\e[35m'
|
---|
| 16 | declare -r CYAN=$'\e[36m'
|
---|
| 17 | declare -r WHITE=$'\e[37m'
|
---|
| 18 |
|
---|
| 19 | declare -r OFF=$'\e[0m'
|
---|
| 20 | declare -r BOLD=$'\e[1m'
|
---|
| 21 | declare -r REVERSE=$'\e[7m'
|
---|
| 22 | declare -r HIDDEN=$'\e[8m'
|
---|
| 23 |
|
---|
| 24 | declare -r tab_=$'\t'
|
---|
| 25 | declare -r nl_=$'\n'
|
---|
| 26 |
|
---|
[65d83a6] | 27 | declare -r DD_BORDER="${BOLD}==============================================================================${OFF}"
|
---|
| 28 | declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
|
---|
| 29 | declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
|
---|
[0170229] | 30 |
|
---|
| 31 | # bold yellow > < pair
|
---|
| 32 | declare -r R_arrow=$'\e[1;33m>\e[0m'
|
---|
| 33 | declare -r L_arrow=$'\e[1;33m<\e[0m'
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | usage() {
|
---|
| 37 | cat <<- -EOF-
|
---|
| 38 | ${DD_BORDER}
|
---|
| 39 | ${BOLD}
|
---|
| 40 | Usage: $0 ${BOLD}[OPTION]
|
---|
| 41 |
|
---|
[d20c553] | 42 | ${RED}IMPORTANT:${OFF} Only supported command line switches are listed here.
|
---|
| 43 | For more fine-grained setups you must edit the relevant
|
---|
| 44 | configuration files placed under ${BOLD}common/${OFF} and ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])/${OFF}
|
---|
| 45 |
|
---|
[0297f33] | 46 | Options:
|
---|
| 47 | ${BOLD} -h, --help${OFF}
|
---|
| 48 | print this help, then exit
|
---|
[b1624ac] | 49 |
|
---|
[0297f33] | 50 | ${BOLD} -V, --version${OFF}
|
---|
[2db0869] | 51 | print version information, then exit
|
---|
[b1624ac] | 52 |
|
---|
| 53 | ${BOLD} -B, --book VER${OFF}
|
---|
[d20c553] | 54 | use VER version of the book as the system to build.
|
---|
| 55 | Supported versions are: dev*, trunk, SVN
|
---|
| 56 | These are aliases for the Development version of {C,H,B}LFS
|
---|
[b1624ac] | 57 |
|
---|
[0297f33] | 58 | ${BOLD} -D --directory DIR${OFF}
|
---|
[b1624ac] | 59 | use DIR directory for building ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF}; all files jhalfs-X produces
|
---|
| 60 | will be in the directory DIR/jhalfs.
|
---|
[65d83a6] | 61 | The current setting for BUILDDIR is "$BUILDDIR"
|
---|
[b1624ac] | 62 |
|
---|
[0297f33] | 63 | ${BOLD} -G, --get-packages${OFF}
|
---|
[b1624ac] | 64 | download the packages and patches. This assumes that the server declared
|
---|
| 65 | in the configuration file has the proper packages and patches for the
|
---|
| 66 | book version being processed.
|
---|
| 67 |
|
---|
[53588e2] | 68 | ${BOLD} -O, --optimize${OFF}
|
---|
| 69 | Optimize [0-2]
|
---|
| 70 | 0 = no optimization
|
---|
| 71 | 1 = optimize chapter06 only
|
---|
| 72 | 2 = optimize both chapter05 and chapter06
|
---|
| 73 | Edit common/opt_config{,.d/*} and common/opt_override as desired.
|
---|
| 74 |
|
---|
[0297f33] | 75 | ${BOLD} -T, --testsuites N ${OFF}
|
---|
| 76 | Run test suites [0-3]
|
---|
| 77 | 0 = none
|
---|
[d20c553] | 78 | 1 = only final system Glibc, GCC and Binutils testsuites
|
---|
| 79 | 2 = all final system testsuites
|
---|
| 80 | 3 = all temporary tools and final system testsuites
|
---|
[b1624ac] | 81 | In CLFS, 3 is an alias to 2
|
---|
[d20c553] | 82 | In BLFS, 1, 2, and 3 are equivalents and means that the testsuites
|
---|
| 83 | will be run.
|
---|
[b1624ac] | 84 |
|
---|
[0297f33] | 85 | ${BOLD} -W, --working-copy DIR${OFF}
|
---|
[2db0869] | 86 | use the local working copy placed in DIR as the $(echo $PROGNAME | tr [a-z] [A-Z]) book
|
---|
[b1624ac] | 87 | -EOF-
|
---|
| 88 |
|
---|
| 89 | [[ ${PROGNAME} != "blfs" ]] &&
|
---|
| 90 | cat <<- -EOF-
|
---|
| 91 |
|
---|
[4612459] | 92 | ${BOLD} -C, --comparasion TYPE${OFF}
|
---|
[d20c553] | 93 | do iterative comparison analysis. This extends the total build time
|
---|
| 94 | considerably because the entire final system will rebuild itself
|
---|
| 95 | the number of times specified by ITERATIONS in common/config.
|
---|
| 96 | Types allowed are:
|
---|
| 97 | ICA = do ICA as designed by Greg Schafer
|
---|
[c58f330] | 98 | farce = do the farce analysis designed by Ken Moffat
|
---|
| 99 | both = perfom both ICA and farce analysis
|
---|
[42346b2] | 100 |
|
---|
[0297f33] | 101 | ${BOLD} -F, --fstab FILE${OFF}
|
---|
| 102 | use FILE as the /etc/fstab file for the ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF} system. If not specified,
|
---|
| 103 | a default /etc/fstab file with dummy values is created.
|
---|
[b1624ac] | 104 |
|
---|
[0297f33] | 105 | ${BOLD} -K, --kernel-config FILE${OFF}
|
---|
| 106 | use the kernel configuration file specified in FILE to build the kernel.
|
---|
| 107 | if the file is not found, or if not specified, the kernel build is skipped.
|
---|
[b1624ac] | 108 |
|
---|
[0297f33] | 109 | ${BOLD} -M, --run-make${OFF}
|
---|
| 110 | run make on the generated Makefile
|
---|
[b1624ac] | 111 |
|
---|
| 112 | ${BOLD} -R --rebuild${OFF}
|
---|
[d20c553] | 113 | clean the build directory before perfoming any other task. The directory
|
---|
[b1624ac] | 114 | is cleaned only if it was populated by a previous jhalfs-X run.
|
---|
[0297f33] | 115 | -EOF-
|
---|
| 116 |
|
---|
| 117 | [[ ${PROGNAME} = "clfs" ]] &&
|
---|
| 118 | cat <<- -EOF-
|
---|
[e794f06] | 119 |
|
---|
[0297f33] | 120 | ${BOLD} -A, --arch ARCH ${OFF}
|
---|
| 121 | Select the TARGET architecture, valid selections are:
|
---|
| 122 | 32bit builds
|
---|
[fe187bf] | 123 | x86, i486, i586, ppc, mips, mipsel, sparc
|
---|
[0297f33] | 124 | 64bit builds
|
---|
| 125 | x86_64-64, mips64-64, mipsel64-64, sparc64-64, alpha
|
---|
| 126 | 64bit multi-lib
|
---|
| 127 | x86_64, mips64, mipsel64, sparc64, ppc64
|
---|
[b1624ac] | 128 |
|
---|
[a702b4d] | 129 | ${BOLD} --boot-config FILE ${OFF}
|
---|
[0297f33] | 130 | The configuration file for the bootstrap kernel if method=boot
|
---|
[b1624ac] | 131 |
|
---|
| 132 | ${BOLD} --method BUILDMETHOD ${OFF}
|
---|
| 133 | Select the build method, chroot or boot
|
---|
[0297f33] | 134 | -EOF-
|
---|
| 135 |
|
---|
| 136 | [[ ${PROGNAME} = "hlfs" ]] &&
|
---|
| 137 | cat <<- -EOF-
|
---|
[e794f06] | 138 |
|
---|
[0297f33] | 139 | ${BOLD} --model STYLE ${OFF}
|
---|
| 140 | Select the library model for the HLFS system
|
---|
[6afdfcc] | 141 | Valid choices are: glibc or uclibc
|
---|
[0297f33] | 142 | -EOF-
|
---|
[0170229] | 143 |
|
---|
[e794f06] | 144 | [[ ${PROGNAME} = "blfs" ]] &&
|
---|
[0170229] | 145 | cat <<- -EOF-
|
---|
| 146 |
|
---|
[e794f06] | 147 | ${BOLD} --dependencies 0/1/2${OFF}
|
---|
[0170229] | 148 | add dependencies of type TYPE to the build tree.
|
---|
[623c323] | 149 | If not set, both required and recommended are used.
|
---|
[0170229] | 150 |
|
---|
| 151 | Possible values are:
|
---|
[e794f06] | 152 | 0 - required only required dependecies are used
|
---|
| 153 | 1 - recommended both required a recommended dependencies are used
|
---|
| 154 | 2 - optional all dependencies are used
|
---|
| 155 | -EOF-
|
---|
| 156 |
|
---|
| 157 | cat <<- -EOF-
|
---|
[0170229] | 158 | ${DD_BORDER}
|
---|
| 159 | -EOF-
|
---|
| 160 | exit
|
---|
| 161 | }
|
---|
| 162 |
|
---|
| 163 | version="
|
---|
[6608a67] | 164 | ${BOLD} \"jhalfs-X\"${OFF} builder tool (experimental) \$Rev$
|
---|
[6afdfcc] | 165 | \$Date$
|
---|
| 166 |
|
---|
| 167 | ${BOLD} \"${PROGNAME}\"${OFF} script module
|
---|
[0170229] | 168 |
|
---|
[67e3bc3] | 169 | Written by George Boudreau,
|
---|
[6afdfcc] | 170 | Manuel Canales Esparcia,
|
---|
[67e3bc3] | 171 | Jeremy Huntwork
|
---|
[0170229] | 172 |
|
---|
| 173 | This program is published under the ${BOLD}Gnu General Public License, Version 2.${OFF}
|
---|
| 174 | "
|
---|
| 175 |
|
---|
| 176 |
|
---|
| 177 | no_empty_builddir() {
|
---|
| 178 | 'clear'
|
---|
| 179 | cat <<- -EOF-
|
---|
| 180 | ${DD_BORDER}
|
---|
| 181 |
|
---|
| 182 | ${tab_}${tab_}${BOLD}${RED}W A R N I N G${OFF}
|
---|
| 183 | Looks like the \$BUILDDIR directory contains subdirectories
|
---|
| 184 | from a previous HLFS build.
|
---|
| 185 |
|
---|
| 186 | Please format the partition mounted on \$BUILDDIR or set
|
---|
[60b56fd] | 187 | a different build directory before running jhalfs-X.
|
---|
[0170229] | 188 | ${OFF}
|
---|
| 189 | ${DD_BORDER}
|
---|
| 190 | -EOF-
|
---|
| 191 | exit
|
---|
| 192 | }
|
---|
| 193 |
|
---|
| 194 |
|
---|
| 195 | help="${nl_}Try '$0 --help' for more information."
|
---|
| 196 |
|
---|
| 197 |
|
---|
| 198 | exit_missing_arg="\
|
---|
| 199 | echo \"Option '\$1' requires an argument\" >&2
|
---|
| 200 | echo \"\$help\" >&2
|
---|
| 201 | exit 1"
|
---|
| 202 |
|
---|
| 203 | no_dl_client="\
|
---|
[f80c1e0] | 204 | echo \"Could not find a way to download the ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF} sources.\" >&2
|
---|
[0170229] | 205 | echo \"Attempting to continue.\" >&2"
|
---|
| 206 |
|
---|
[60b56fd] | 207 | HEADER="# This file is automatically generated by jhalfs-X
|
---|
[0170229] | 208 | # DO NOT EDIT THIS FILE MANUALLY
|
---|
| 209 | #
|
---|
| 210 | # Generated on `date \"+%F %X %Z\"`"
|
---|
| 211 |
|
---|
| 212 |
|
---|
| 213 |
|
---|
| 214 | #----------------------------------#
|
---|
[5359c48] | 215 | wrt_target() { # Create target and initialize log file
|
---|
[0170229] | 216 | #----------------------------------#
|
---|
| 217 | local i=$1
|
---|
| 218 | local PREV=$2
|
---|
[b414549] | 219 | case $i in
|
---|
| 220 | iteration* ) local LOGFILE=$this_script.log ;;
|
---|
| 221 | * ) local LOGFILE=$this_script ;;
|
---|
| 222 | esac
|
---|
[0170229] | 223 | (
|
---|
| 224 | cat << EOF
|
---|
| 225 |
|
---|
| 226 | $i: $PREV
|
---|
| 227 | @\$(call echo_message, Building)
|
---|
[b414549] | 228 | @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >logs/$LOGFILE
|
---|
[0170229] | 229 | EOF
|
---|
| 230 | ) >> $MKFILE.tmp
|
---|
| 231 | }
|
---|
| 232 |
|
---|
| 233 |
|
---|
| 234 | #----------------------------------#
|
---|
[60b56fd] | 235 | wrt_unpack() { # Unpack and set 'ROOT' var
|
---|
[0170229] | 236 | #----------------------------------#
|
---|
| 237 | local FILE=$1
|
---|
| 238 | (
|
---|
| 239 | cat << EOF
|
---|
| 240 | @\$(call unpack,$FILE)
|
---|
| 241 | @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
---|
| 242 | echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\
|
---|
[2fbc503] | 243 | chown -R lfs \$(MOUNT_PT)\$(SRC)/\$\$ROOT
|
---|
[0170229] | 244 | EOF
|
---|
| 245 | ) >> $MKFILE.tmp
|
---|
| 246 | }
|
---|
| 247 |
|
---|
| 248 |
|
---|
| 249 | #----------------------------------#
|
---|
| 250 | wrt_unpack2() { #
|
---|
| 251 | #----------------------------------#
|
---|
| 252 | local FILE=$1
|
---|
| 253 | (
|
---|
| 254 | cat << EOF
|
---|
| 255 | @\$(call unpack2,$FILE)
|
---|
| 256 | @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
---|
| 257 | echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars
|
---|
| 258 | EOF
|
---|
| 259 | ) >> $MKFILE.tmp
|
---|
| 260 | }
|
---|
| 261 |
|
---|
| 262 |
|
---|
[65d83a6] | 263 | #----------------------------------#
|
---|
| 264 | wrt_unpack3() { #
|
---|
| 265 | #----------------------------------#
|
---|
[0170229] | 266 | local FILE=$1
|
---|
| 267 | (
|
---|
| 268 | cat << EOF
|
---|
[c3c4e1d] | 269 | @\$(call unpack3,$FILE)
|
---|
[0170229] | 270 | @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
---|
| 271 | echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars
|
---|
| 272 | EOF
|
---|
| 273 | ) >> $MKFILE.tmp
|
---|
| 274 | }
|
---|
| 275 |
|
---|
| 276 |
|
---|
| 277 | #----------------------------------#
|
---|
| 278 | wrt_target_vars() { # Target vars for hlfs (cross-build method)
|
---|
| 279 | #----------------------------------#
|
---|
| 280 | (
|
---|
| 281 | cat << EOF
|
---|
[7d018d1] | 282 | @echo "export target=$(uname -m)-${TARGET}" >> envars && \\
|
---|
[0170229] | 283 | echo "export ldso=/lib/${LOADER}" >> envars
|
---|
| 284 | EOF
|
---|
| 285 | ) >> $MKFILE.tmp
|
---|
| 286 |
|
---|
| 287 | }
|
---|
| 288 |
|
---|
| 289 |
|
---|
[17c7894] | 290 | #----------------------------------#
|
---|
| 291 | wrt_optimize() { # Apply pkg specific opt's to build
|
---|
| 292 | #----------------------------------#
|
---|
| 293 | local pkg=$1
|
---|
| 294 | local optLvl optVal OPT_VAR
|
---|
| 295 |
|
---|
| 296 | optLvl=`awk -v pkg="$pkg" '$1 == pkg { print $2 }' $JHALFSDIR/opt_override`
|
---|
| 297 | if [[ "$optLvl" = "" ]] ; then
|
---|
| 298 | optLvl=$DEF_OPT_LVL;
|
---|
| 299 | fi
|
---|
| 300 |
|
---|
[53588e2] | 301 | for OPT_VAR in $ACTIVE_OPT_VARS ; do
|
---|
[17c7894] | 302 | eval optVal=\$${OPT_VAR}_$optLvl
|
---|
| 303 |
|
---|
| 304 | if [[ "$optVal" != "unset" ]]; then
|
---|
| 305 | (
|
---|
| 306 | cat << EOF
|
---|
| 307 | @echo "export $OPT_VAR=\"$optVal\"" >> envars
|
---|
| 308 | EOF
|
---|
| 309 | ) >> $MKFILE.tmp
|
---|
| 310 | else
|
---|
| 311 | continue
|
---|
| 312 | fi
|
---|
| 313 | done
|
---|
| 314 | }
|
---|
| 315 |
|
---|
| 316 |
|
---|
[0170229] | 317 | #----------------------------------#
|
---|
[5359c48] | 318 | wrt_run_as_su() { # Execute script inside time { }, footer to log file
|
---|
[0170229] | 319 | #----------------------------------#
|
---|
| 320 | local this_script=$1
|
---|
| 321 | local file=$2
|
---|
| 322 | (
|
---|
| 323 | cat << EOF
|
---|
[5359c48] | 324 | @( time { su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
---|
| 325 | echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/$this_script
|
---|
[0170229] | 326 | EOF
|
---|
| 327 | ) >> $MKFILE.tmp
|
---|
| 328 | }
|
---|
| 329 |
|
---|
| 330 |
|
---|
| 331 | #----------------------------------#
|
---|
[5359c48] | 332 | wrt_run_as_root() { # Some scripts must be run as root..
|
---|
[0170229] | 333 | #----------------------------------#
|
---|
| 334 | local this_script=$1
|
---|
| 335 | local file=$2
|
---|
| 336 | (
|
---|
| 337 | cat << EOF
|
---|
[5359c48] | 338 | @( time { export LFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
---|
| 339 | echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/$this_script
|
---|
[0170229] | 340 | EOF
|
---|
| 341 | ) >> $MKFILE.tmp
|
---|
| 342 | }
|
---|
| 343 |
|
---|
| 344 |
|
---|
[65d83a6] | 345 | #----------------------------------#
|
---|
| 346 | wrt_run_as_root2() { #
|
---|
| 347 | #----------------------------------#
|
---|
[0170229] | 348 | local this_script=$1
|
---|
| 349 | local file=$2
|
---|
| 350 | (
|
---|
| 351 | cat << EOF
|
---|
[5359c48] | 352 | @( time { source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
---|
| 353 | echo -e "\nKB: \`du -skx --exclude=jhalfs \`\n" >>logs/$this_script
|
---|
[0170229] | 354 | EOF
|
---|
| 355 | ) >> $MKFILE.tmp
|
---|
| 356 | }
|
---|
| 357 |
|
---|
| 358 |
|
---|
| 359 |
|
---|
| 360 | #----------------------------------#
|
---|
| 361 | wrt_run_as_chroot1() { #
|
---|
| 362 | #----------------------------------#
|
---|
| 363 | local this_script=$1
|
---|
| 364 | local file=$2
|
---|
| 365 | (
|
---|
| 366 | cat << EOF
|
---|
[5359c48] | 367 | @( time { \$(CHROOT1) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
|
---|
| 368 | echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/${this_script}
|
---|
[0170229] | 369 | EOF
|
---|
| 370 | ) >> $MKFILE.tmp
|
---|
| 371 | }
|
---|
| 372 |
|
---|
| 373 |
|
---|
| 374 | #----------------------------------#
|
---|
| 375 | wrt_run_as_chroot2() { #
|
---|
| 376 | #----------------------------------#
|
---|
| 377 | local this_script=$1
|
---|
| 378 | local file=$2
|
---|
| 379 | (
|
---|
| 380 | cat << EOF
|
---|
[5359c48] | 381 | @( time { \$(CHROOT2) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
|
---|
| 382 | echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/${this_script}
|
---|
[0170229] | 383 | EOF
|
---|
| 384 | ) >> $MKFILE.tmp
|
---|
| 385 | }
|
---|
| 386 |
|
---|
| 387 |
|
---|
| 388 | #----------------------------------#
|
---|
| 389 | wrt_copy_fstab() { #
|
---|
| 390 | #----------------------------------#
|
---|
| 391 | local i=$1
|
---|
| 392 | (
|
---|
| 393 | cat << EOF
|
---|
[5359c48] | 394 | @cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
|
---|
[0170229] | 395 | EOF
|
---|
| 396 | ) >> $MKFILE.tmp
|
---|
| 397 | }
|
---|
| 398 |
|
---|
| 399 | #----------------------------------#
|
---|
[5359c48] | 400 | wrt_copy_fstab2() { #
|
---|
[0170229] | 401 | #----------------------------------#
|
---|
| 402 | local i=$1
|
---|
| 403 | (
|
---|
| 404 | cat << EOF
|
---|
[5359c48] | 405 | @cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
|
---|
[0170229] | 406 | EOF
|
---|
| 407 | ) >> $MKFILE.tmp
|
---|
| 408 | }
|
---|
| 409 |
|
---|
| 410 |
|
---|
| 411 | #----------------------------------#
|
---|
[5359c48] | 412 | wrt_remove_build_dirs() { #
|
---|
[0170229] | 413 | #----------------------------------#
|
---|
[5359c48] | 414 | local name=$1
|
---|
[0170229] | 415 | (
|
---|
[5359c48] | 416 | cat << EOF
|
---|
| 417 | @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
---|
| 418 | rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
|
---|
| 419 | if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
|
---|
| 420 | rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\
|
---|
| 421 | fi;
|
---|
| 422 | EOF
|
---|
| 423 | ) >> $MKFILE.tmp
|
---|
| 424 | }
|
---|
| 425 |
|
---|
| 426 |
|
---|
| 427 | #----------------------------------#
|
---|
| 428 | wrt_remove_build_dirs2() { #
|
---|
| 429 | #----------------------------------#
|
---|
| 430 | local name=$1
|
---|
| 431 | (
|
---|
| 432 | cat << EOF
|
---|
| 433 | @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
---|
| 434 | rm -r \$(SRC)/\$\$ROOT && \\
|
---|
| 435 | if [ -e \$(SRC)/$name-build ]; then \\
|
---|
| 436 | rm -r \$(SRC)/$name-build; \\
|
---|
| 437 | fi;
|
---|
[0170229] | 438 | EOF
|
---|
| 439 | ) >> $MKFILE.tmp
|
---|
| 440 | }
|
---|
| 441 |
|
---|
| 442 |
|
---|
[9e4b9a1] | 443 | #----------------------------------#
|
---|
[65d83a6] | 444 | wrt_report() { #
|
---|
[9e4b9a1] | 445 | #----------------------------------#
|
---|
| 446 | (
|
---|
| 447 | cat << EOF
|
---|
| 448 |
|
---|
| 449 | create-sbu_du-report: $PREV
|
---|
| 450 | @\$(call echo_message, Building)
|
---|
[3cc7540] | 451 | @./create-sbu_du-report.sh logs $VERSION
|
---|
[9e4b9a1] | 452 | @\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
|
---|
| 453 | @touch \$@
|
---|
| 454 | EOF
|
---|
| 455 | ) >> $MKFILE.tmp
|
---|
| 456 |
|
---|
| 457 | chapter789="$chapter789 create-sbu_du-report"
|
---|
| 458 | }
|
---|
| 459 |
|
---|
| 460 |
|
---|
[0170229] | 461 | #----------------------------#
|
---|
[65d83a6] | 462 | run_make() { #
|
---|
[0170229] | 463 | #----------------------------#
|
---|
| 464 | # Test if make must be run.
|
---|
| 465 | if [ "$RUNMAKE" = "1" ] ; then
|
---|
| 466 | # Test to make sure we're running the build as root
|
---|
| 467 | if [ "$UID" != "0" ] ; then
|
---|
[60b56fd] | 468 | echo "You must be logged in as root to successfully build the system."
|
---|
[0170229] | 469 | exit 1
|
---|
| 470 | fi
|
---|
| 471 | # Build the system
|
---|
| 472 | if [ -e $MKFILE ] ; then
|
---|
[60b56fd] | 473 | echo -ne "Building the system...\n"
|
---|
[54b4b32] | 474 | cd $JHALFSDIR && make
|
---|
[0170229] | 475 | echo -ne "done\n"
|
---|
| 476 | fi
|
---|
| 477 | fi
|
---|
| 478 | }
|
---|
| 479 |
|
---|
| 480 |
|
---|
| 481 | #----------------------------#
|
---|
[65d83a6] | 482 | clean_builddir() { #
|
---|
[0170229] | 483 | #----------------------------#
|
---|
| 484 | # Test if the clean must be done.
|
---|
| 485 | if [ "$CLEAN" = "1" ] ; then
|
---|
| 486 | # Test to make sure we're running the clean as root
|
---|
| 487 | if [ "$UID" != "0" ] ; then
|
---|
| 488 | echo "You must be logged in as root to clean the build directory."
|
---|
| 489 | exit 1
|
---|
| 490 | fi
|
---|
| 491 | # Test to make sure that the build directory was populated by jhalfs
|
---|
| 492 | if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
|
---|
[60b56fd] | 493 | echo "Looks like $BUILDDIR was not populated by a previous jhalfs-X run."
|
---|
[0170229] | 494 | exit 1
|
---|
| 495 | else
|
---|
| 496 | # Clean the build directory
|
---|
| 497 | echo -ne "Cleaning $BUILDDIR...\n"
|
---|
[3465451] | 498 | rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var}
|
---|
[0170229] | 499 | echo -ne "Cleaning $JHALFSDIR...\n"
|
---|
[3465451] | 500 | rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
|
---|
[0170229] | 501 | echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n"
|
---|
| 502 | rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
|
---|
| 503 | echo -ne "done\n"
|
---|
| 504 | fi
|
---|
| 505 | fi
|
---|
| 506 | }
|
---|
| 507 |
|
---|
| 508 | #----------------------------#
|
---|
[65d83a6] | 509 | get_book() { #
|
---|
[0170229] | 510 | #----------------------------#
|
---|
| 511 | cd $JHALFSDIR
|
---|
| 512 |
|
---|
| 513 | if [ -z $WC ] ; then
|
---|
| 514 | # Check for Subversion instead of just letting the script hit 'svn' and fail.
|
---|
| 515 | test `type -p svn` || eval "echo \"This feature requires Subversion.\"
|
---|
| 516 | exit 1"
|
---|
| 517 | echo -n "Downloading the $PROGNAME document, $LFSVRS version... "
|
---|
| 518 |
|
---|
| 519 | case $PROGNAME in
|
---|
| 520 | lfs) svn_root="LFS" ;;
|
---|
| 521 | hlfs) svn_root="HLFS" ;;
|
---|
| 522 | clfs) svn_root="cross-lfs" ;;
|
---|
| 523 | blfs) svn_root="BLFS" ;;
|
---|
| 524 | *) echo "BOOK not defined in function <get_book>"
|
---|
| 525 | exit 1 ;;
|
---|
| 526 | esac
|
---|
[60b56fd] | 527 | # Grab a fresh book if it's missing, otherwise, update it from the
|
---|
[0170229] | 528 | # repo. If we've already extracted the commands, move on to getting the
|
---|
| 529 | # sources.
|
---|
| 530 | if [ -d ${PROGNAME}-$LFSVRS ] ; then
|
---|
| 531 | cd ${PROGNAME}-$LFSVRS
|
---|
[65d83a6] | 532 | if LC_ALL=C svn up | grep -q At && test -d $JHALFSDIR/${PROGNAME}-commands && \
|
---|
| 533 | test -f $JHALFSDIR/packages ; then
|
---|
[0170229] | 534 | echo -ne "done\n"
|
---|
| 535 | # Set the canonical book version
|
---|
| 536 | cd $JHALFSDIR
|
---|
| 537 | VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
|
---|
| 538 | get_sources
|
---|
| 539 | else
|
---|
| 540 | echo -ne "done\n"
|
---|
| 541 | # Set the canonical book version
|
---|
| 542 | cd $JHALFSDIR
|
---|
| 543 | VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
|
---|
| 544 | extract_commands
|
---|
| 545 | fi
|
---|
| 546 | else
|
---|
| 547 | case $LFSVRS in
|
---|
[60b56fd] | 548 | development)
|
---|
[0170229] | 549 | svn co $SVN/${svn_root}/trunk/BOOK ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1 ;;
|
---|
| 550 | esac
|
---|
| 551 | echo -ne "done\n"
|
---|
| 552 | # Set the canonical book version
|
---|
| 553 | cd $JHALFSDIR
|
---|
| 554 | VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
|
---|
| 555 | extract_commands
|
---|
| 556 | fi
|
---|
| 557 | else
|
---|
| 558 | echo -ne "Using $BOOK as book's sources ...\n"
|
---|
| 559 | # Set the canonical book version
|
---|
| 560 | cd $JHALFSDIR
|
---|
| 561 | VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
|
---|
| 562 | extract_commands
|
---|
| 563 | fi
|
---|
| 564 | }
|
---|
| 565 |
|
---|
| 566 | #----------------------------#
|
---|
| 567 | extract_commands() { #
|
---|
| 568 | #----------------------------#
|
---|
[9e1915a] | 569 |
|
---|
[0170229] | 570 | # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
|
---|
| 571 | test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
|
---|
| 572 | exit 1"
|
---|
| 573 |
|
---|
| 574 | cd $JHALFSDIR
|
---|
| 575 | VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
|
---|
| 576 |
|
---|
| 577 | # Start clean
|
---|
[3e3e28b] | 578 | if [ -d ${PROGNAME}-commands ]; then
|
---|
| 579 | rm -rf ${PROGNAME}-commands
|
---|
| 580 | mkdir -v ${PROGNAME}-commands
|
---|
[0170229] | 581 | fi
|
---|
[bef0a98] | 582 | echo -n "Extracting commands for"
|
---|
[0170229] | 583 |
|
---|
| 584 | # Dump the commands in shell script form from the HLFS book.
|
---|
| 585 | case ${PROGNAME} in
|
---|
| 586 | clfs)
|
---|
[9c90294] | 587 | echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
|
---|
[e676ffa] | 588 | xsltproc --nonet \
|
---|
| 589 | --xinclude \
|
---|
| 590 | --stringparam method $METHOD \
|
---|
| 591 | --stringparam testsuite $TEST \
|
---|
| 592 | --stringparam vim-lang $VIMLANG \
|
---|
| 593 | --stringparam timezone $TIMEZONE \
|
---|
| 594 | --stringparam page $PAGE \
|
---|
| 595 | --stringparam lang $LANG \
|
---|
| 596 | --stringparam keymap $KEYMAP \
|
---|
[a9490ab] | 597 | -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
|
---|
[0170229] | 598 | ;;
|
---|
| 599 | hlfs)
|
---|
[60b56fd] | 600 | echo -n " ${L_arrow}${BOLD}$MODEL${R_arrow} HLFS libc implementation"
|
---|
[ad71d98] | 601 | xsltproc --nonet \
|
---|
| 602 | --xinclude \
|
---|
| 603 | --stringparam model $MODEL \
|
---|
| 604 | --stringparam testsuite $TEST \
|
---|
| 605 | --stringparam timezone $TIMEZONE \
|
---|
| 606 | --stringparam page $PAGE \
|
---|
[d87b293] | 607 | --stringparam lang $LANG \
|
---|
| 608 | --stringparam lc_all $LC_ALL \
|
---|
[ad71d98] | 609 | --stringparam keymap $KEYMAP \
|
---|
| 610 | --stringparam grsecurity_host $GRSECURITY_HOST \
|
---|
| 611 | -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
---|
[0170229] | 612 | ;;
|
---|
| 613 | lfs)
|
---|
[9c90294] | 614 | echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build"
|
---|
[0170229] | 615 | xsltproc --nonet \
|
---|
| 616 | --xinclude \
|
---|
| 617 | --stringparam testsuite $TEST \
|
---|
| 618 | --stringparam vim-lang $VIMLANG \
|
---|
[ad71d98] | 619 | --stringparam timezone $TIMEZONE \
|
---|
| 620 | --stringparam page $PAGE \
|
---|
[d87b293] | 621 | --stringparam lang $LANG \
|
---|
[0170229] | 622 | -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 623 | ;;
|
---|
| 624 | blfs)
|
---|
[9c90294] | 625 | echo -n " ${L_arrow}${BOLD}BLFS${R_arrow} build"
|
---|
[0170229] | 626 | xsltproc --nonet \
|
---|
| 627 | --xinclude \
|
---|
[c6225224] | 628 | --stringparam testsuite $TEST \
|
---|
| 629 | --stringparam server $SERVER \
|
---|
[0170229] | 630 | -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 631 | ;;
|
---|
[3e7af38] | 632 | *) exit 1 ;;
|
---|
[0170229] | 633 | esac
|
---|
[dd810ea] | 634 |
|
---|
[bef0a98] | 635 | echo " ...OK"
|
---|
[0170229] | 636 |
|
---|
| 637 | # Make the scripts executable.
|
---|
| 638 | chmod -R +x $JHALFSDIR/${PROGNAME}-commands
|
---|
| 639 |
|
---|
[3e7af38] | 640 | # Create the packages file. We need it for proper Makefile creation
|
---|
| 641 | rm -f packages
|
---|
[9c90294] | 642 | case "${PROGNAME}" in
|
---|
| 643 | clfs)
|
---|
[3e7af38] | 644 | echo -n "Creating <${PROGNAME}> specific packages file"
|
---|
[9c90294] | 645 | grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
|
---|
| 646 | -e 's@">@"@' \
|
---|
[3e7af38] | 647 | -e '/generic/d' > packages
|
---|
[9c90294] | 648 | echo " ...OK"
|
---|
| 649 | ;;
|
---|
[9e1915a] | 650 |
|
---|
[d2a9d60] | 651 | hlfs)
|
---|
[60b56fd] | 652 | echo -n "Creating <${PROGNAME}> specific packages file"
|
---|
[d2a9d60] | 653 | grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' \
|
---|
| 654 | -e 's@">@"@' \
|
---|
| 655 | -e '/generic/d' >> packages
|
---|
| 656 | echo " ...OK"
|
---|
| 657 | ;;
|
---|
| 658 |
|
---|
| 659 | lfs)
|
---|
[60b56fd] | 660 | echo -n "Creating <${PROGNAME}> specific packages file"
|
---|
[9c90294] | 661 | grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' \
|
---|
| 662 | -e 's@">@"@' \
|
---|
| 663 | -e '/generic/d' >> packages
|
---|
[0271c0c] | 664 | echo " ...OK"
|
---|
[9e1915a] | 665 | ;;
|
---|
[9c90294] | 666 | esac
|
---|
[0170229] | 667 |
|
---|
| 668 | # Done. Moving on...
|
---|
| 669 | get_sources
|
---|
| 670 | }
|
---|
| 671 |
|
---|
| 672 | #----------------------------#
|
---|
[3e7af38] | 673 | get_sources() { # Download file, write name to MISSING_FILES.DMP if an error
|
---|
[0170229] | 674 | #----------------------------#
|
---|
[3e7af38] | 675 | local saveIFS=$IFS
|
---|
[65d83a6] | 676 | local IFS line URL1 URL2 FILE MD5 HAVEMD5 fromARCHIVE
|
---|
| 677 |
|
---|
| 678 | # Test if the packages must be downloaded
|
---|
| 679 | [ ! "$GETPKG" = "1" ] && return
|
---|
| 680 |
|
---|
| 681 | gs_wrt_message(){
|
---|
| 682 | echo "${RED}$1${OFF}"
|
---|
| 683 | echo "$1" >> MISSING_FILES.DMP
|
---|
| 684 | }
|
---|
| 685 | # Housekeeping
|
---|
| 686 | [[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources
|
---|
| 687 | cd $BUILDDIR/sources
|
---|
| 688 | [[ -f MD5SUMS ]] && rm MD5SUMS
|
---|
| 689 | [[ -f MD5SUMS-$VERSION ]] && rm MD5SUMS-$VERSION
|
---|
| 690 | [[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP
|
---|
| 691 | [[ -f urls.lst ]] && rm urls.lst
|
---|
[3e7af38] | 692 |
|
---|
| 693 | # Download a fresh MD5SUMS file
|
---|
[65d83a6] | 694 | wget $SERVER/pub/lfs/conglomeration/MD5SUMS
|
---|
[3e7af38] | 695 |
|
---|
| 696 | # Generate URLs file
|
---|
[65d83a6] | 697 | create_urls
|
---|
[3e7af38] | 698 |
|
---|
[65d83a6] | 699 | IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
|
---|
| 700 | for line in `cat urls.lst`; do
|
---|
| 701 | IFS=$saveIFS # Restore the system defaults
|
---|
[3e7af38] | 702 |
|
---|
| 703 | # Skip some packages if they aren't needed
|
---|
[65d83a6] | 704 | case $line in
|
---|
[3e7af38] | 705 | */tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* )
|
---|
| 706 | [[ "$TEST" = "0" ]] && continue
|
---|
| 707 | ;;
|
---|
| 708 | */vim-*-lang* )
|
---|
| 709 | [[ "$VIMLANG" = "0" ]] && continue
|
---|
| 710 | ;;
|
---|
[65d83a6] | 711 | esac
|
---|
[3e7af38] | 712 |
|
---|
[65d83a6] | 713 | # Locations
|
---|
| 714 | URL1=`echo $line | cut -d" " -f2` # Preferred URL
|
---|
| 715 | URL2=`echo $line | cut -d" " -f1` # Fallback Upstream URL
|
---|
| 716 | FILE=`basename $URL2` # File name
|
---|
[3e7af38] | 717 |
|
---|
| 718 | # Find the md5 sum for this package.
|
---|
[65d83a6] | 719 | set +e
|
---|
| 720 | HAVEMD5=1 # Always assume we have a MD5SUM
|
---|
| 721 | MD5=`grep " $FILE" MD5SUMS`
|
---|
| 722 | if [ $? -ne 0 ]; then
|
---|
[0170229] | 723 | set -e
|
---|
[65d83a6] | 724 | gs_wrt_message "$FILE not found in MD5SUMS"
|
---|
| 725 | # IMPORTANT:: There is no MD5SUM for this file.
|
---|
| 726 | HAVEMD5=0
|
---|
| 727 | fi
|
---|
[0170229] | 728 |
|
---|
[65d83a6] | 729 | set -e
|
---|
| 730 | # If the file exists in the archive copy it to the
|
---|
| 731 | # $BUILDDIR/sources dir. MD5SUM will be validated later.
|
---|
| 732 | if [ ! -z ${SRC_ARCHIVE} ] &&
|
---|
| 733 | [ -d ${SRC_ARCHIVE} ] &&
|
---|
| 734 | [ -f ${SRC_ARCHIVE}/$FILE ]; then
|
---|
| 735 | cp ${SRC_ARCHIVE}/$FILE .
|
---|
| 736 | echo "$FILE: -- copied from $SRC_ARCHIVE"
|
---|
| 737 | fromARCHIVE=1
|
---|
| 738 | else
|
---|
| 739 | echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE}${OFF}"
|
---|
| 740 | fromARCHIVE=0
|
---|
| 741 | # If the file does not exist in /sources download a fresh one
|
---|
[3e7af38] | 742 | if [ ! -f $FILE ] ; then
|
---|
[65d83a6] | 743 | if ! wget $URL1 && ! wget $URL2 ; then
|
---|
| 744 | gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
|
---|
| 745 | continue
|
---|
| 746 | fi
|
---|
[3e7af38] | 747 | fi
|
---|
[65d83a6] | 748 | fi
|
---|
[0170229] | 749 |
|
---|
[65d83a6] | 750 | # Is there a MD5SUM to validate the file against.
|
---|
| 751 | if [[ "$HAVEMD5" = "1" ]] ; then
|
---|
| 752 | # IF the md5sum does not match the existing files
|
---|
| 753 | if ! echo "$MD5" | md5sum -c - >/dev/null ; then
|
---|
| 754 | [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}"
|
---|
| 755 | [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}"
|
---|
| 756 | # Remove the old file and download a new one
|
---|
| 757 | rm -fv $FILE
|
---|
| 758 | # Force generation of MD5SUM and storage in SRC_ARCHIVE
|
---|
| 759 | fromARCHIVE=0; HAVEMD5=0
|
---|
| 760 | # Try and retrieve the file
|
---|
| 761 | if ! wget -N $URL1 && ! wget -N $URL2 ; then
|
---|
| 762 | gs_wrt_message "$FILE not found on the servers.. SKIPPING"
|
---|
| 763 | continue
|
---|
| 764 | fi
|
---|
[3e7af38] | 765 | fi
|
---|
[65d83a6] | 766 | fi
|
---|
[e1edff3] | 767 |
|
---|
[65d83a6] | 768 | # Validate the MD5SUM one last time
|
---|
| 769 | if [[ "$HAVEMD5" = "1" ]] && ! echo "$MD5" | md5sum -c - >/dev/null ; then
|
---|
| 770 | gs_wrt_message "$FILE does not match MD5SUMS value"
|
---|
| 771 | fi
|
---|
[3e7af38] | 772 |
|
---|
[65d83a6] | 773 | # Generate a fresh MD5SUM for this file
|
---|
| 774 | if [[ "$HAVEMD5" = "0" ]] ; then
|
---|
| 775 | echo "${BOLD}${YELLOW}Generating a new MD5SUM for ${OFF}$FILE"
|
---|
| 776 | echo "NEW MD5SUM $(md5sum $FILE)" >> MISSING_FILES.DMP
|
---|
[3e7af38] | 777 | fi
|
---|
[e1edff3] | 778 |
|
---|
[65d83a6] | 779 | # Good or bad we write the original md5sum to a file
|
---|
| 780 | echo "$MD5" >> MD5SUMS-$VERSION
|
---|
| 781 |
|
---|
| 782 | # Copy the freshly downloaded file
|
---|
| 783 | # to the source archive.
|
---|
| 784 | if [ ! -z ${SRC_ARCHIVE} ] &&
|
---|
| 785 | [ -d ${SRC_ARCHIVE} ] &&
|
---|
| 786 | [ -w ${SRC_ARCHIVE} ] &&
|
---|
| 787 | [ "$fromARCHIVE" = "0" ] ; then
|
---|
| 788 | echo "Storing file:<$FILE> in the package archive"
|
---|
| 789 | cp -f $FILE ${SRC_ARCHIVE}
|
---|
| 790 | fi
|
---|
| 791 |
|
---|
| 792 | done
|
---|
| 793 |
|
---|
| 794 | if [[ -s MISSING_FILES.DMP ]]; then
|
---|
| 795 | echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have a bad MD5SUMS chechsum.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n"
|
---|
| 796 | # Do not allow the automatic exection of the Makefile.
|
---|
| 797 | echo "${tab_}${BOLD}${RED}*** ${YELLOW}Automatic execution of the generated makefile has been inhibited. ${RED}***${OFF}${nl_}"
|
---|
| 798 | RUNMAKE=0
|
---|
[3e7af38] | 799 | fi
|
---|
[0170229] | 800 | }
|
---|
| 801 |
|
---|
| 802 |
|
---|
| 803 | #----------------------------#
|
---|
[3e7af38] | 804 | create_urls() { #
|
---|
[0170229] | 805 | #----------------------------#
|
---|
[3e7af38] | 806 | cd $JHALFSDIR
|
---|
[0170229] | 807 |
|
---|
[3e7af38] | 808 | case ${PROGNAME} in
|
---|
| 809 | clfs)
|
---|
| 810 | echo -n "Creating CLFS <${ARCH}> specific URLs file"
|
---|
| 811 | xsltproc --nonet --xinclude \
|
---|
| 812 | --stringparam server $SERVER \
|
---|
| 813 | -o $BUILDDIR/sources/urls.lst urls.xsl \
|
---|
| 814 | $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 815 | echo " ...OK"
|
---|
| 816 | ;;
|
---|
| 817 | hlfs)
|
---|
| 818 | echo -n "Creating HLFS <${MODEL}> specific URLs file"
|
---|
| 819 | xsltproc --nonet --xinclude \
|
---|
| 820 | --stringparam server $SERVER \
|
---|
| 821 | --stringparam model $MODEL \
|
---|
| 822 | -o $BUILDDIR/sources/urls.lst urls.xsl \
|
---|
| 823 | $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 824 | echo " ...OK"
|
---|
| 825 | ;;
|
---|
| 826 | lfs)
|
---|
| 827 | echo -n "Creating LFS specific URLs file"
|
---|
| 828 | xsltproc --nonet --xinclude \
|
---|
| 829 | --stringparam server $SERVER \
|
---|
| 830 | -o ../sources/urls.lst urls.xsl \
|
---|
| 831 | $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 832 | echo " ...OK"
|
---|
| 833 | ;;
|
---|
| 834 | esac
|
---|
[0170229] | 835 |
|
---|
[3e7af38] | 836 | cd $BUILDDIR/sources
|
---|
[0170229] | 837 | }
|
---|