Mercurial > hg > aboriginal
annotate download.sh @ 11:1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 30 Nov 2006 14:58:26 -0500 |
parents | 7a1c606fd387 |
children | 6b726de18f05 |
rev | line source |
---|---|
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/sh |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
11
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
3 export SRCDIR=sources/packages |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
4 export STAGE2SRC=../packages |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
5 mkdir -p "$SRCDIR" |
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 function download() |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 { |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 FILENAME=`echo "$URL" | sed 's .*/ '` |
11
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
10 BASENAME=`echo "$FILENAME" | sed -r -e 's/-*([0-9\.]|-rc)*(\.tar\..z2*)$/\2/'` |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
11 |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
12 if [ ! -z "$STAGEDIR" ] |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
13 then |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
14 rm -f "$STAGEDIR/$BASENAME" 2> /dev/null |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
15 ln -s "$STAGE2SRC/$FILENAME" "$STAGEDIR/$BASENAME" |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
16 fi |
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 # The extra "" is so we test the sha1sum after the last download. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 for i in "$URL" http://www.landley.net/code/firmware/mirror/"$FILENAME" "" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 do |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 # Return success if we have a valid copy of the file |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 # Test first (so we don't re-download a file we've already got). |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 SUM=`cat "$SRCDIR/$FILENAME" | sha1sum | awk '{print $1}'` |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 if [ x"$SUM" == x"$SHA1" ] |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 then |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 touch "$SRCDIR/$FILENAME" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 echo "Confirmed $FILENAME" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 return 0 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 fi |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 # If there's a corrupted file, delete it. In theory it would be nice |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 # to resume downloads, but wget creates "*.1" files instead. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 rm "$SRCDIR/$FILENAME" 2> /dev/null |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 # If we have another source, try to download file. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 if [ -n "$i" ] |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 then |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 wget -P "$SRCDIR" "$i" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
44 fi |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
45 done |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
47 # Return failure. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 echo "Could not download $FILENAME" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 return 1 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 } |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 # Lots and lots of source code. Download everything we haven't already got |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 # a copy of. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 echo "=== Download source code." && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
57 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 export SRCDIR=sources/packages |
11
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
59 mkdir -p "$SRCDIR" |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
60 |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
61 # Required for cross compile toolchain |
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
62 |
11
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
63 export STAGEDIR=sources/build-cross |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
64 mkdir -p "$STAGEDIR" |
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
65 |
11
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
66 URL=http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.bz2 \ |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
67 SHA1=c00d5891e2461bce45be51c1ef7846ee842792dd \ |
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
68 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
69 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
70 URL=http://www.uclibc.org/downloads/snapshots/uClibc-20061128.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
71 SHA1=50c024ac137262981348ad54e0f64d83db1bce4e \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
72 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
73 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
74 URL=ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
75 SHA1=a557686eef68362ea31a3aa41ce274e3eeae1ef0 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
76 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
77 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
78 URL=ftp://ftp.gnu.org/gnu/gcc/gcc-4.1.1/gcc-core-4.1.1.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
79 SHA1=147e12bf96a8d857fda1d43f0d7ea599b89cebf9 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
80 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
81 |
11
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
82 # Required for native build environment |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
83 |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
84 export STAGEDIR=sources/build-native |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
85 mkdir -p "$STAGEDIR" |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
86 |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
87 URL=http://superb-east.dl.sourceforge.net/sourceforge/squashfs/squashfs3.1.tar.gz \ |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
88 SHA1=89d537fd18190402ff226ff885ddbc14f6227a9b \ |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
89 download && |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
90 |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
91 URL=http://www.busybox.net/downloads/busybox-1.2.2.tar.bz2 \ |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
92 SHA1=59670600121c9dacfd61e72e34f4bd975ec2c36f \ |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
93 download && |
1b1de34e3122
Teach the download script to make symlinks, and update kernel to 2.6.19.
Rob Landley <rob@landley.net>
parents:
10
diff
changeset
|
94 |
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
95 URL=ftp://ftp.gnu.org/gnu/make/make-3.81.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
96 SHA1=41ed86d941b9c8025aee45db56c0283169dcab3d \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
97 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
98 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
99 echo === Got all source. |