Mercurial > hg > aboriginal
changeset 206:b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 29 Aug 2007 20:45:34 -0500 |
parents | 827b76efba8e |
children | d922fe34cd5d |
files | forkbomb.sh |
diffstat | 1 files changed, 35 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/forkbomb.sh Wed Aug 29 20:45:34 2007 -0500 @@ -0,0 +1,35 @@ +#!/bin/bash + +# Test script to build every target architecture, logging output. +# With --fork, it builds them in parallel +# With --nofork, it build them sequentially +# With --watch, it displays output from an existing parallel build + +function buildarch() +{ + nice -n 20 ./cross-compiler.sh $1 && + nice -n 20 ./mini-native.sh $1 && + nice -n 20 ./package-mini-native.sh $1 +} + +if [ "$1" != "--watch" ] +then + if [ $# -ne 0 ] + then + (nice -n 20 ./download.sh && nice -n 20 ./host-tools.sh) || exit 1 + fi + for i in `cd sources/configs; ls` + do + if [ "$1" == "--nofork" ] + then + buildarch $i 2>&1 | tee out-$i.txt || exit 1 + elif [ "$1" == "--fork" ] + then + (buildarch $i > out-$i.txt 2>&1 &)& + else + echo "Usage: forkbomb.sh [--fork] [--nofork] [--watch]" + exit 1 + fi + done +fi +watch -n 3 'for i in *.txt; do /bin/echo -e "\n$i"; tail -n 1 $i; done'