Mercurial > hg > aboriginal
annotate sources/more/native-build.sh @ 1003:6d3db5bf731a
Make the native build timeout configurable.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 18 Mar 2010 05:44:47 -0500 |
parents | cfa6262528f3 |
children | d62c5c8734b2 |
rev | line source |
---|---|
972 | 1 #!/bin/bash |
2 | |
3 # setup hdc.sqf | |
4 # find build -name "hdb.img" | xargs rm | |
5 | |
6 # Launch a system image under the emulator under the control of a filesystem | |
7 # image, with an FTP server to upload results to. | |
8 | |
9 . sources/functions.sh || exit 1 | |
10 | |
11 # Parse arguments | |
12 | |
1003
6d3db5bf731a
Make the native build timeout configurable.
Rob Landley <rob@landley.net>
parents:
972
diff
changeset
|
13 if [ $# -lt 3 ] |
972 | 14 then |
1003
6d3db5bf731a
Make the native build timeout configurable.
Rob Landley <rob@landley.net>
parents:
972
diff
changeset
|
15 echo "usage: $0 ARCH HDCFILE OUTPUTDIR [TIMEOUT_SECONDS]" >&2 |
972 | 16 exit 1 |
17 fi | |
18 | |
19 ARCH="$1" | |
20 if [ ! -f "$2" ] | |
21 then | |
22 echo "Filesystem image $2 missing" >&2 | |
23 exit 1 | |
24 fi | |
25 HDCFILE="$(readlink -f $2)" | |
26 mkdir -p "$3" || dienow | |
27 STAGE_DIR="$(readlink -f $3)" | |
28 | |
1003
6d3db5bf731a
Make the native build timeout configurable.
Rob Landley <rob@landley.net>
parents:
972
diff
changeset
|
29 [ ! -z "$4" ] && DO_TIMEOUT="sources/timeout.sh $4" |
6d3db5bf731a
Make the native build timeout configurable.
Rob Landley <rob@landley.net>
parents:
972
diff
changeset
|
30 |
972 | 31 # Fire off the ftp daemon, making sure it's killed when this script exits |
32 | |
33 . sources/toys/unique-port.sh || exit 1 | |
34 PORT=$(unique_port) | |
35 build/host/netcat -s 127.0.0.1 -p $PORT -L build/host/ftpd -w "$STAGE_DIR" & | |
36 trap "kill $(jobs -p)" EXIT | |
37 disown $(jobs -p) | |
38 | |
39 # Run emulator as a child process, feeding in -hdc and some extra environment | |
40 # variables so it auto-launches the build process. | |
41 | |
42 echo === Begin native build for $ARCH | |
43 | |
44 rm -f sources/system-image-"$ARCH"/hdb.img | |
45 HDC="$HDCFILE" KERNEL_EXTRA="OUTPORT=$PORT ARCH=$ARCH" \ | |
1003
6d3db5bf731a
Make the native build timeout configurable.
Rob Landley <rob@landley.net>
parents:
972
diff
changeset
|
46 $DO_TIMEOUT ./run-from-build.sh "$ARCH" |
972 | 47 |
48 echo === End native build for $ARCH |