Mercurial > hg > aboriginal
annotate build.sh @ 262:b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
busybox commands the build can use, 3) symlinks for the other dozen or so
commands the build needs. Then set $PATH to _just_ build/host, yanking
the rest of the $PATH so it won't call other things from the host.
This way, the environmental dependencies are more explicit. (Note that
some commands symlinked from the host could be built by busybox, but the
busybox versions of those don't work correctly in the build.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 25 Jan 2008 03:26:35 -0600 |
parents | f8dac531cbb5 |
children | 1782b77fae15 |
rev | line source |
---|---|
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
1 #!/bin/bash |
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
2 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
3 # If run with no arguments, list architectures. |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
105
diff
changeset
|
4 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
5 if [ $# -eq 0 ] |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
6 then |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
7 echo "Usage: $0 ARCH [ARCH...]" |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
8 ./include.sh |
118
85582f847bd6
When run with no arguments, exit after showing usage message.
Rob Landley <rob@landley.net>
parents:
114
diff
changeset
|
9 exit 1 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
10 fi |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
105
diff
changeset
|
11 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
12 # Download source code and build host tools. |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
105
diff
changeset
|
13 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
14 ./download.sh || exit 1 |
262
b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
15 |
b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
16 # host-tools populates one directory with every command the build needs, |
b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
17 # so we can ditch the old $PATH afterwards. |
b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
18 |
186
f8dac531cbb5
Use shell builtin time instead of /usr/bin version not everybody has.
Rob Landley <rob@landley.net>
parents:
184
diff
changeset
|
19 time ./host-tools.sh || exit 1 |
262
b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
20 PATH=`pwd`/build/host |
b2e353ae7566
Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
21 [ -f "$PATH"/toybox ] || exit 1 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
22 |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
23 # Run the steps in order for each architecture listed on the command line |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
24 for i in "$@" |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
25 do |
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
26 echo "=== Building ARCH $i" |
186
f8dac531cbb5
Use shell builtin time instead of /usr/bin version not everybody has.
Rob Landley <rob@landley.net>
parents:
184
diff
changeset
|
27 time ./cross-compiler.sh $i || exit 1 |
155
ce1ca3d0f95b
Put zImage-$ARCH in build directory, not mini-native-$ARCH, and eliminate
Rob Landley <rob@landley.net>
parents:
118
diff
changeset
|
28 echo "=== native ($i)" |
186
f8dac531cbb5
Use shell builtin time instead of /usr/bin version not everybody has.
Rob Landley <rob@landley.net>
parents:
184
diff
changeset
|
29 time ./mini-native.sh $i || exit 1 |
f8dac531cbb5
Use shell builtin time instead of /usr/bin version not everybody has.
Rob Landley <rob@landley.net>
parents:
184
diff
changeset
|
30 time ./package-mini-native.sh $i || exit 1 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
31 done |