Mercurial > hg > aboriginal
annotate sources/native-builds/static-tools.sh @ 1260:fecb576b7e18
Dropbear's scp shouldn't call /usr/bin/dbclient, it should just call ssh out of $PATH.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 07 Oct 2010 23:53:23 -0500 |
parents | 13c22a46b1c9 |
children | b41dbea3ba14 |
rev | line source |
---|---|
972 | 1 #!/bin/bash |
2 | |
3 # Download all the source tarballs we haven't got up-to-date copies of. | |
4 | |
5 # The tarballs are downloaded into the "packages" directory, which is | |
6 # created as needed. | |
7 | |
8 source sources/include.sh || exit 1 | |
9 | |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
10 [ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1 |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
11 [ -e "$1" ] && echo "$1" exists && exit 0 |
972 | 12 |
1073
9f62cd761498
Teach static-tools.sh to look in its own patch directory.
Rob Landley <rob@landley.net>
parents:
1025
diff
changeset
|
13 PATCHDIR="$SOURCES/native-builds/static-tools-patches" |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
14 SRCDIR="$SRCDIR/native" && mkdir -p "$SRCDIR" || dienow |
1111
6b20e20bb291
Vary $WORK directory so making multiple control images in parallel with FORK=1 doesn't conflict.
Rob Landley <rob@landley.net>
parents:
1095
diff
changeset
|
15 WORK="$WORK"/static-tools && blank_tempdir "$WORK" |
1188
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1138
diff
changeset
|
16 SRCTREE="$WORK" |
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1138
diff
changeset
|
17 |
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1138
diff
changeset
|
18 EXTRACT_ALL=1 |
972 | 19 |
20 echo "=== Download source code." | |
21 | |
22 # Note: set SHA1= blank to skip checksum validation. | |
23 | |
24 URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \ | |
25 SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \ | |
1095
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1073
diff
changeset
|
26 maybe_fork download || dienow |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
27 |
1138
6ad249bd2005
Make static-tools.sh use the same version of zlib as host-tools.sh.
Rob Landley <rob@landley.net>
parents:
1111
diff
changeset
|
28 URL=http://zlib.net/zlib-1.2.5.tar.bz2 \ |
6ad249bd2005
Make static-tools.sh use the same version of zlib as host-tools.sh.
Rob Landley <rob@landley.net>
parents:
1111
diff
changeset
|
29 SHA1=543fa9abff0442edca308772d6cef85557677e02 \ |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
30 maybe_fork "download || dienow" |
972 | 31 |
32 URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2 \ | |
33 SHA1=8c1745a9b64ffae79f28e25c6fe9a8b96cac86d8 \ | |
1095
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1073
diff
changeset
|
34 maybe_fork download || dienow |
972 | 35 |
36 echo === Got all source. | |
37 | |
38 cleanup_oldfiles | |
39 | |
40 cat > "$WORK"/init << 'EOF' || dienow | |
41 #!/bin/bash | |
42 | |
1015
cf7d68a74efa
Factor out the upload into a shell function, and upload each package's results as available, rather than waiting until the end to upload everything at once.
Rob Landley <rob@landley.net>
parents:
1009
diff
changeset
|
43 upload_result() |
cf7d68a74efa
Factor out the upload into a shell function, and upload each package's results as available, rather than waiting until the end to upload everything at once.
Rob Landley <rob@landley.net>
parents:
1009
diff
changeset
|
44 { |
1073
9f62cd761498
Teach static-tools.sh to look in its own patch directory.
Rob Landley <rob@landley.net>
parents:
1025
diff
changeset
|
45 ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1" |
1015
cf7d68a74efa
Factor out the upload into a shell function, and upload each package's results as available, rather than waiting until the end to upload everything at once.
Rob Landley <rob@landley.net>
parents:
1009
diff
changeset
|
46 } |
972 | 47 |
1015
cf7d68a74efa
Factor out the upload into a shell function, and upload each package's results as available, rather than waiting until the end to upload everything at once.
Rob Landley <rob@landley.net>
parents:
1009
diff
changeset
|
48 echo Started second stage init |
972 | 49 |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
50 echo === Native build static zlib |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
51 |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
52 cp -sfR /mnt/zlib zlib && |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
53 cd zlib && |
1138
6ad249bd2005
Make static-tools.sh use the same version of zlib as host-tools.sh.
Rob Landley <rob@landley.net>
parents:
1111
diff
changeset
|
54 # |
6ad249bd2005
Make static-tools.sh use the same version of zlib as host-tools.sh.
Rob Landley <rob@landley.net>
parents:
1111
diff
changeset
|
55 rm -f Makefile && |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
56 ./configure && |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
57 make -j $CPUS && |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
58 cd .. || exit 1 |
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
59 |
1073
9f62cd761498
Teach static-tools.sh to look in its own patch directory.
Rob Landley <rob@landley.net>
parents:
1025
diff
changeset
|
60 echo === $HOST Native build static dropbear |
972 | 61 |
62 cp -sfR /mnt/dropbear dropbear && | |
63 cd dropbear && | |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
64 CFLAGS="-I ../zlib -Os" LDFLAGS="--static -L ../zlib" ./configure && |
1260
fecb576b7e18
Dropbear's scp shouldn't call /usr/bin/dbclient, it should just call ssh out of $PATH.
Rob Landley <rob@landley.net>
parents:
1188
diff
changeset
|
65 sed -i 's@/usr/bin/dbclient@ssh@' options.h && |
972 | 66 make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 && |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
67 strip dropbearmulti && |
1015
cf7d68a74efa
Factor out the upload into a shell function, and upload each package's results as available, rather than waiting until the end to upload everything at once.
Rob Landley <rob@landley.net>
parents:
1009
diff
changeset
|
68 upload_result dropbearmulti && |
972 | 69 cd .. && |
70 rm -rf dropbear || exit 1 | |
71 | |
1073
9f62cd761498
Teach static-tools.sh to look in its own patch directory.
Rob Landley <rob@landley.net>
parents:
1025
diff
changeset
|
72 echo === $HOST native build static strace |
972 | 73 |
74 cp -sfR /mnt/strace strace && | |
75 cd strace && | |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
76 CFLAGS="--static -Os" ./configure && |
972 | 77 make -j $CPUS && |
1025
ec5b62d300c0
Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
Rob Landley <rob@landley.net>
parents:
1017
diff
changeset
|
78 strip strace && |
1015
cf7d68a74efa
Factor out the upload into a shell function, and upload each package's results as available, rather than waiting until the end to upload everything at once.
Rob Landley <rob@landley.net>
parents:
1009
diff
changeset
|
79 upload_result strace && |
972 | 80 cd .. && |
81 rm -rf strace || dienow | |
82 | |
1073
9f62cd761498
Teach static-tools.sh to look in its own patch directory.
Rob Landley <rob@landley.net>
parents:
1025
diff
changeset
|
83 echo === $HOST native build rsync |
9f62cd761498
Teach static-tools.sh to look in its own patch directory.
Rob Landley <rob@landley.net>
parents:
1025
diff
changeset
|
84 |
972 | 85 sync |
86 | |
87 EOF | |
88 | |
89 chmod +x "$WORK"/init || dienow | |
90 | |
91 cd "$TOP" | |
92 | |
93 mksquashfs "$WORK" "$1" -noappend -all-root |