annotate build.sh @ 745:4abea1d0914f

Change a comment to silence a warning.
author Rob Landley <rob@landley.net>
date Thu, 11 Jun 2009 19:04:51 -0500
parents 759adf5a0fe9
children d8c780ed3686
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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...]"
744
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 719
diff changeset
8 . sources/include.sh
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 719
diff changeset
9 read_arch_dir
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 719
diff changeset
10
118
85582f847bd6 When run with no arguments, exit after showing usage message.
Rob Landley <rob@landley.net>
parents: 114
diff changeset
11 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
12 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
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 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
15
114
304fd441e6a4 Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents: 108
diff changeset
16 ./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
17
b2e353ae7566 Have host-tools populate build/host with 1) toybox, 2) all the remaining
Rob Landley <rob@landley.net>
parents: 186
diff changeset
18 # 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
19 # 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
20
186
f8dac531cbb5 Use shell builtin time instead of /usr/bin version not everybody has.
Rob Landley <rob@landley.net>
parents: 184
diff changeset
21 time ./host-tools.sh || 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"
539
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
27
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
28 if [ -f "build/cross-compiler-$i.tar.bz2" ]
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
29 then
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
30 echo "=== Skipping cross-compiler-$i (already there)"
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
31 else
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 699
diff changeset
32 rm -rf "build/root-filesystem-$i.tar.bz2"
539
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
33 time ./cross-compiler.sh $i || exit 1
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
34 fi
155
ce1ca3d0f95b Put zImage-$ARCH in build directory, not mini-native-$ARCH, and eliminate
Rob Landley <rob@landley.net>
parents: 118
diff changeset
35 echo "=== native ($i)"
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 699
diff changeset
36 if [ -f "build/root-filesystem-$i.tar.bz2" ]
539
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
37 then
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 699
diff changeset
38 echo "=== Skipping root-filesystem-$i (already there)"
539
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
39 else
690
ef758aacab0b Whitespace fixes.
Rob Landley <rob@landley.net>
parents: 600
diff changeset
40 rm -rf "build/system-image-$i.tar.bz2"
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 699
diff changeset
41 time ./root-filesystem.sh $i || exit 1
539
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
42 fi
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
43
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
44 if [ -f "build/system-image-$i.tar.bz2" ]
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
45 then
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
46 echo "=== Skipping system-image-$i (already there)"
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
47 else
719
428df726cf7f Have system-image.sh do its own setsid variant so when it does dienow() it can kill all its own backgrounded processes, but won't take down the parent shell that ran it.
Rob Landley <rob@landley.net>
parents: 711
diff changeset
48 time ./system-image.sh $i || exit 1
539
85979aa53fde Teach build.sh not to rerun build stages we already have the result of.
Rob Landley <rob@landley.net>
parents: 503
diff changeset
49 fi
114
304fd441e6a4 Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents: 108
diff changeset
50 done