Mercurial > hg > aboriginal
annotate sources/more/native-static-build.sh @ 860:6b80bbc15ded
Add some comments.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 25 Oct 2009 03:27:17 -0500 |
parents | e0879d661b55 |
children | 0f7be5f83f3f |
rev | line source |
---|---|
843
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
860 | 3 # Launch a system image under the emulator and natively build static versions |
4 # of a few packages. | |
5 | |
6 # Takes the name of the architecture to build for as its first argument, | |
7 # with no arguments builds all architectures in build/system-image-* | |
8 # (If $FORK is set, run them in parallel.) | |
9 | |
843
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 . sources/functions.sh || exit 1 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 STAGE_DIR="$(pwd)/build/cron-temp" |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 # Create an hdc image with the source code and build script |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 sources/more/setup-native-static-build.sh "$STAGE_DIR" |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 # Fire off the ftp daemon, making sure it's killed when this script exits |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 build/host/netcat -s 127.0.0.1 -p 9876 -L build/host/ftpd -w "$STAGE_DIR" & |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 trap "kill $(jobs -p)" EXIT |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 disown $(jobs -p) |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 find build -name "hdb.img" | xargs rm |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 # Run emulator as a child process, feeding in -hdc and some extra environment |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 # variables so it auto-launches the build process. |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 function do_arch() |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 { |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 set_titlebar "Native build for $1" |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 HDC="$STAGE_DIR/hdc.sqf" KERNEL_EXTRA="OUTPORT=9876 ARCH=$1" \ |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 sources/timeout.sh 60 ./run-from-build.sh $1 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 } |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 # If we have a command line argument, build just that arch, otherwise build |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 # all arches that managed to create a system image. |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 if [ ! -z "$1" ] |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 then |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 do_arch "$1" |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 else |
850
e0879d661b55
Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
43 mkdir -p build/logs |
e0879d661b55
Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
44 |
e0879d661b55
Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
45 for i in $(ls build/system-image-*.tar.bz2 | sed 's@build/system-image-\(.*\)\.tar\.bz2@\1@' | grep -v system-image-hw-) |
843
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 do |
850
e0879d661b55
Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
47 maybe_fork "do_arch $i | tee build/log/native-static-$i.txt | maybe_quiet" |
843
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 done |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 wait |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 fi |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 |
2ca7ea5d3ec1
New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 echo End of native build |