annotate sources/more/setup-native-static-build.sh @ 843:2ca7ea5d3ec1

New native-static-build.sh to compile static dropbear, strace, and busybox inside the emulator and export 'em out via ftp.
author Rob Landley <rob@landley.net>
date Sun, 11 Oct 2009 01:56:04 -0500
parents
children 63d79a2b0816
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
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 # Build 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
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
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 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
47 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
48 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
49 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
50 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
51 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
52 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
53
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 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
55 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
56 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
57 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
58 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
59 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
60
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 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
62 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
63 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
64 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
65 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
66
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 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
68
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 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
70
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 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
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 mksquashfs "$WORK" "$WORK"/../hdc.sqf -noappend -all-root