Mercurial > hg > aboriginal
annotate forkbomb.sh @ 212:d685eda11ca7
Minor display improvement.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 06 Sep 2007 04:03:04 -0500 |
parents | b328036dbdb1 |
children | 8b0d2080707c |
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 |
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
|
19 (nice -n 20 ./download.sh && nice -n 20 ./host-tools.sh) || 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
|
20 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
|
21 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
|
22 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
|
23 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
|
24 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
|
25 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
|
26 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
|
27 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
|
28 (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
|
29 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
|
30 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
|
31 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
|
32 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
|
33 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
|
34 fi |
212 | 35 watch -n 3 'X=; for i in *.txt; do /bin/echo -e "$X$i"; X="\n"; tail -n 1 $i; done' |