Mercurial > hg > aboriginal
annotate forkbomb.sh @ 258:863e15b54e17
Make the display slightly more selective.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 24 Jan 2008 03:45:19 -0600 |
parents | f93932523a08 |
children | b2e353ae7566 |
rev | line source |
---|---|
206
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Test script to build every target architecture, logging output. |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 # With --fork, it builds them in parallel |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 # With --nofork, it build them sequentially |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 # With --watch, it displays output from an existing parallel build |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 function buildarch() |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 { |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 nice -n 20 ./cross-compiler.sh $1 && |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 nice -n 20 ./mini-native.sh $1 && |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 nice -n 20 ./package-mini-native.sh $1 |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 } |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 if [ "$1" != "--watch" ] |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 then |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 if [ $# -ne 0 ] |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 then |
222
8b0d2080707c
Be smarter about extracting tarballs: extract one copy of each tarball
Rob Landley <rob@landley.net>
parents:
212
diff
changeset
|
19 (nice -n 20 ./download.sh && |
253
f93932523a08
Reorder forkbomb build so ./host-tools.sh gets built first. Then toybox
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
20 nice -n 20 ./host-tools.sh && |
f93932523a08
Reorder forkbomb build so ./host-tools.sh gets built first. Then toybox
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
21 nice -n 20 ./download.sh --extract ) || exit 1 |
206
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 fi |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 for i in `cd sources/configs; ls` |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 do |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 if [ "$1" == "--nofork" ] |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 then |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 buildarch $i 2>&1 | tee out-$i.txt || exit 1 |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 elif [ "$1" == "--fork" ] |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 then |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 (buildarch $i > out-$i.txt 2>&1 &)& |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 else |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 echo "Usage: forkbomb.sh [--fork] [--nofork] [--watch]" |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 exit 1 |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 fi |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 done |
b328036dbdb1
Of course I'd find a way to make 2 gigs of memory in my new laptop insufficient.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 fi |
258
863e15b54e17
Make the display slightly more selective.
Rob Landley <rob@landley.net>
parents:
253
diff
changeset
|
37 watch -n 3 'X=; for i in out-*.txt; do /bin/echo -e "$X$i"; X="\n"; tail -n 1 $i; done' |