Mercurial > hg > aboriginal
annotate sources/more/setup-native-static-build.sh @ 848:63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 14 Oct 2009 03:51:57 -0500 |
parents | 2ca7ea5d3ec1 |
children | 858297fa5ad0 |
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 |
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
|
3 # Create hdc image to build dropbear, strace, and busybox statically. |
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
|
4 |
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
|
5 . sources/include.sh |
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
|
6 |
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
|
7 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
|
8 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
|
9 print "Need directory name" >&2 |
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 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 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
|
12 |
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 # Set up working directories |
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 |
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 WORK="$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
|
16 blank_tempdir "$WORK" |
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 WORK="$WORK"/sub |
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 mkdir -p "$WORK" || dienow |
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 # Extract source code into new image directory |
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 |
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 setupfor dropbear |
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 setupfor strace |
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 setupfor busybox |
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 cp "$SOURCES"/trimconfig-busybox "$WORK" || dienow |
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 |
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 cat > "$WORK"/init << 'EOF' || dienow |
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 #!/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
|
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 echo Started second stage init |
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 |
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 cd /home && |
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 mkdir output && |
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 |
848
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
36 echo === Native build static dropbear |
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
|
37 |
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 cp -sfR /mnt/dropbear dropbear && |
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 cd dropbear && |
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 LDFLAGS="--static" ./configure --disable-zlib && |
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 make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=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 cp dropbearmulti /home/output && |
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
|
43 cd .. && |
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
|
44 rm -rf dropbear || 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
|
45 |
848
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
46 echo === Native build static strace |
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
47 |
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 cp -sfR /mnt/strace strace && |
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 cd strace && |
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 CFLAGS="--static" ./configure && |
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 make -j $CPUS && |
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 cp strace /home/output && |
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 cd .. && |
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
|
54 rm -rf strace || dienow |
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
|
55 |
848
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
56 echo === Native build static busybox |
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
57 |
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
|
58 cp -sfR /mnt/busybox busybox && |
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
|
59 cd busybox && |
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
|
60 make allyesconfig KCONFIG_ALLCONFIG=/mnt/trimconfig-busybox && |
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
|
61 LDFLAGS="--static" make -j $CPUS && |
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
|
62 cp busybox /home/output && |
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
|
63 rm -rf busybox || dienow |
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
|
64 |
848
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
65 echo === Upload |
63d79a2b0816
Cosmetic improvement, allows log monitoring to see stages.
Rob Landley <rob@landley.net>
parents:
843
diff
changeset
|
66 |
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
|
67 cd /home/output |
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
|
68 for i in * |
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
|
69 do |
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
|
70 ftpput 10.0.2.2 -P $OUTPORT $ARCH-$i $i |
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
|
71 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
|
72 |
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
|
73 sync |
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
|
74 |
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
|
75 EOF |
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
|
76 |
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
|
77 chmod +x "$WORK"/init || dienow |
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
|
78 |
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
|
79 mksquashfs "$WORK" "$WORK"/../hdc.sqf -noappend -all-root |