view more/buildall-native.sh @ 1737:1acbe7e78d9d draft

Switch from bz2 to gz tarball output. bz2 is slowly being replaced by lz variants, but gzip isn't going anywhere. (It retains a niche as a streaming protocol, it's the 80/20 solution optimizing for speed, low memory requirements, and simple compressor implementation.)
author Rob Landley <rob@landley.net>
date Fri, 20 Feb 2015 13:12:45 -0600
parents bd385934451f
children
line wrap: on
line source

#!/bin/bash

# Run a native build with a control image for every architecture,
# using existing system-images under build, saving log files to build/log,
# uploading output into build.

# If $FORK is set, build them in parallel.

# Kill any build that doesn't produce output for $TIMEOUT (default 60) seconds.

. sources/utility_functions.sh || exit 1

if [ ! -f "$1" ]
then
  echo "Can't find control image at \"$1\"" >&2
  exit 1
fi

trap "killtree $$" EXIT

# Build the hdb images sequentially without timeout.sh, to avoid potential
# I/O storm triggering timeouts

[ ! -z "$FORK" ] && FORK= more/for-each-target.sh \
  '. sources/toys/make-hdb.sh; HDBMEGS=2048; HDB=build/system-image-$TARGET/hdb.img; echo "$HDB"; rm -f "$HDB"; make_hdb'

# Put each control image's output in the build directory

mkdir -p build/logs || dienow

# Run a control image for each target, using existing hdb.img

[ -z "$TIMEOUT" ] && export TIMEOUT=60
[ -z "$LOGFILE" ] && LOGFILE="$(echo $1 | sed 's@.*/\(.*\)\.hdc@\1@')"
more/for-each-target.sh \
  'ln -sfn .. build/system-image-$TARGET/upload && more/timeout.sh $TIMEOUT "HDB=hdb.img more/native-build-from-build.sh $TARGET '"$1 | tee build/logs/native-$LOGFILE-"'$TARGET.txt"'