Mercurial > hg > aboriginal
annotate build.sh @ 1116:2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 16 Jun 2010 08:11:51 -0500 |
parents | affef1edbdba |
children | e5f9681a8b3c |
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 |
888 | 3 # Run all the steps needed to build a system image from scratch. |
4 | |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
5 # Simplest: download, simple-cross-compiler, simple-root-filesystem, |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
6 # system-image. |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
7 |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
8 # More likely: download, host-tools, simple-cross-compiler, cross-compiler, |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
9 # native-compiler, simple-root-filesystem, root-filesystem, system-image |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
10 |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
11 # 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
|
12 |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
13 if [ $# -ne 1 ] |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
14 then |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
15 echo "Usage: $0 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
|
16 . 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
|
17 read_arch_dir |
114
304fd441e6a4
Re-teach build.sh to build more than one architecture in sequence.
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
18 fi |
941
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
915
diff
changeset
|
19 ARCH="$1" |
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
|
20 |
1028
5897a868313e
Jean-Christophe Dubois pointed out that if build.sh doesn't source config, it doesn't get things like NO_NATIVE_COMPILER.
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
21 [ -e config ] && source config |
5897a868313e
Jean-Christophe Dubois pointed out that if build.sh doesn't source config, it doesn't get things like NO_NATIVE_COMPILER.
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
22 |
984
9840847885e8
Add export_if_blank and make lots of build paths overrideable.
Rob Landley <rob@landley.net>
parents:
944
diff
changeset
|
23 [ -z "$BUILD" ] && BUILD="build" |
9840847885e8
Add export_if_blank and make lots of build paths overrideable.
Rob Landley <rob@landley.net>
parents:
944
diff
changeset
|
24 |
941
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
915
diff
changeset
|
25 # A function to skip stages that have already been done (because the |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
26 # tarball they create is already there). Stages delete the tarballs of |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
27 # later stages as a simple form of dependency tracking. |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
28 |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
29 # If you need to rebuild a stage and everything after it, delete its |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
30 # tarball out of "build" and re-run build.sh. |
941
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
915
diff
changeset
|
31 |
786
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
32 not_already() |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
33 { |
984
9840847885e8
Add export_if_blank and make lots of build paths overrideable.
Rob Landley <rob@landley.net>
parents:
944
diff
changeset
|
34 if [ -f "$BUILD/$1-$ARCH.tar.bz2" ] |
786
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
35 then |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
36 echo "=== Skipping $1-$ARCH (already there)" |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
37 return 1 |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
38 fi |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
39 |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
40 return 0 |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
41 } |
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
42 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
43 # The first two stages (download.sh and host-tools.sh) are architecture |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
44 # independent. In order to allow multiple builds in parallel, re-running |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
45 # them after they've already completed must be a safe NOP. |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
46 |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
47 # Download source code. |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
48 |
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
49 time ./download.sh || exit 1 |
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
50 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
51 # Build host tools. This populates a single directory with every command the |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
52 # build needs, so we can ditch the host's $PATH afterwards. |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
53 |
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
54 time ./host-tools.sh || exit 1 |
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
55 |
941
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
915
diff
changeset
|
56 # Do we need to build the simple cross compiler? |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
57 |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
58 if not_already simple-cross-compiler |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
59 then |
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
60 # If we need to build cross compiler, assume root filesystem is stale. |
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
61 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
62 rm -rf "$BUILD/simple-root-filesystem-$ARCH.tar.bz2" |
1007
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
63 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
64 time ./simple-cross-compiler.sh "$ARCH" || exit 1 |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
65 fi |
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
66 |
1007
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
67 # Optionally, we can build a more capable statically linked compiler via |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
68 # canadian cross. (It's more powerful than we need here, but if you're going |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
69 # to use the cross compiler in other contexts this is probably what you want.) |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
70 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
71 if [ ! -z "$CROSS_HOST_ARCH" ] && not_already cross-compiler |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
72 then |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
73 rm -rf "$BUILD/simple-root-filesystem-$ARCH.tar.bz2" |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
74 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
75 ./cross_compiler.sh "$ARCH" || exit 1 |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
76 fi |
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
77 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
78 # Build a native compiler. It's statically linked by default so it can |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
79 # run on an arbitrary host system. |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
80 |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
81 if not_already native-compiler && [ -z "$NO_NATIVE_COMPILER" ] |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
82 then |
984
9840847885e8
Add export_if_blank and make lots of build paths overrideable.
Rob Landley <rob@landley.net>
parents:
944
diff
changeset
|
83 rm -rf "$BUILD/root-filesystem-$ARCH.tar.bz2" |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
84 |
998
bbcafba8a594
Another bug Wolfgang Denk reported: make BUILD_STATIC=none actually work.
Rob Landley <rob@landley.net>
parents:
984
diff
changeset
|
85 ./native-compiler.sh "$ARCH" || exit 1 |
784
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
86 fi |
037488e9889d
New build.sh that actually uses the new infrastructure, if STATIC_CROSS_COMPILER_HOST or BUILD_STATIC_NATIVE_COMPILER are set.
Rob Landley <rob@landley.net>
parents:
781
diff
changeset
|
87 |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
88 # Do we need to build the root filesystem? |
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
|
89 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
90 if not_already simple-root-filesystem |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
91 then |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
92 # If we need to build root filesystem, assume root-filesystem and |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
93 # system-image are stale. |
786
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
94 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
95 rm -rf "$BUILD/root-filesystem-$ARCH.tar.bz2" |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
96 rm -rf "$BUILD/system-image-$ARCH.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
|
97 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
98 time ./simple-root-filesystem.sh "$ARCH" || exit 1 |
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
99 |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
100 fi |
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
101 |
1062
abc8ddd4d9f0
Don't have root-filesystem.sh suck in the native-compiler.sh output, have build.sh collate those instead before calling system-image.sh. (That way the root-filesystem.sh tarball does't include the native compiler output.)
Rob Landley <rob@landley.net>
parents:
1045
diff
changeset
|
102 # Install the native compiler into the root filesystem (if any). |
abc8ddd4d9f0
Don't have root-filesystem.sh suck in the native-compiler.sh output, have build.sh collate those instead before calling system-image.sh. (That way the root-filesystem.sh tarball does't include the native compiler output.)
Rob Landley <rob@landley.net>
parents:
1045
diff
changeset
|
103 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
104 if not_already root-filesystem && [ -z "$NO_NATIVE_COMPILER" ] |
1062
abc8ddd4d9f0
Don't have root-filesystem.sh suck in the native-compiler.sh output, have build.sh collate those instead before calling system-image.sh. (That way the root-filesystem.sh tarball does't include the native compiler output.)
Rob Landley <rob@landley.net>
parents:
1045
diff
changeset
|
105 then |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
106 rm -rf "$BUILD/system-image-$ARCH.tar.bz2" |
1062
abc8ddd4d9f0
Don't have root-filesystem.sh suck in the native-compiler.sh output, have build.sh collate those instead before calling system-image.sh. (That way the root-filesystem.sh tarball does't include the native compiler output.)
Rob Landley <rob@landley.net>
parents:
1045
diff
changeset
|
107 |
1116
2b68517f5b62
Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents:
1090
diff
changeset
|
108 time ./root-filesystem.sh "$ARCH" || exit 1 |
1062
abc8ddd4d9f0
Don't have root-filesystem.sh suck in the native-compiler.sh output, have build.sh collate those instead before calling system-image.sh. (That way the root-filesystem.sh tarball does't include the native compiler output.)
Rob Landley <rob@landley.net>
parents:
1045
diff
changeset
|
109 fi |
abc8ddd4d9f0
Don't have root-filesystem.sh suck in the native-compiler.sh output, have build.sh collate those instead before calling system-image.sh. (That way the root-filesystem.sh tarball does't include the native compiler output.)
Rob Landley <rob@landley.net>
parents:
1045
diff
changeset
|
110 |
786
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
111 if not_already system-image |
781
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
112 then |
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
113 time ./system-image.sh $1 || exit 1 |
d8c780ed3686
Simplify build.sh to take exactly one argument. (Otherwise use buildall.sh.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
114 fi |
786
8b5ea56e7507
Teach build.sh not to rebuild static compilers if they're already there.
Rob Landley <rob@landley.net>
parents:
785
diff
changeset
|
115 |
1068
31b5d683ecc9
Try again: extract native compiler into usr, not into /.
Rob Landley <rob@landley.net>
parents:
1064
diff
changeset
|
116 # Optionally build a system image with a writeable root filesystem. |
31b5d683ecc9
Try again: extract native compiler into usr, not into /.
Rob Landley <rob@landley.net>
parents:
1064
diff
changeset
|
117 |
1045
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
118 if [ ! -z "$BUILD_RW_SYSTEM_IMAGE" ] && not_already rw-image |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
119 then |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
120 # Optimization: don't rebuild kernel if we don't need to. |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
121 mkdir -p "$BUILD/rw-system-image-$ARCH" && |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
122 cp "$BUILD/system-image-$ARCH"/zImage-* "$BUILD/rw-system-image-$ARCH" |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
123 |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
124 STAGE_NAME=rw-system-image SYSIMAGE_TYPE=ext2 SYSIMAGE_HDA_MEGS=2048 time ./system-image.sh $1 || exit 1 |
a5b0f0a11792
Add BUILD_RW_SYSTEM_IMAGE=1 config option to build 2 gig writeable HDA (new stage named rw-system-image-$ARCH).
Rob Landley <rob@landley.net>
parents:
1028
diff
changeset
|
125 fi |