annotate www/build-stages.html @ 1729:7c89513343ea draft

Remove old filesystem combining script, it happens in sbin/init.sh now.
author Rob Landley <rob@landley.net>
date Tue, 10 Feb 2015 20:58:05 -0600
parents 6da94a74a8a9
children 3a66b5554d1e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1352
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
1 <html>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
2 <title>Aboriginal Linux - Build Stages</title>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
3 <body>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
4 <!--#include file="header.html" -->
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
5
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
6 <p>The Aboriginal Linux build scripts are the source code for the Aboriginal
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
7 Linux project. If you would like to build your own cross compiler or target
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
8 system image from source, use these build scripts. They're written in bash
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
9 and should be fairly easy to read.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
10
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
11 <h2>Quick start</h2>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
12
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
13 <p>Run <b>build.sh</b> with no arguments to see a list of targets. Select
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
14 a target, and run <b>build.sh $TARGET</b> with the target name in place of
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
15 $TARGET. When it finishes, run <b>more/dev-environment.sh $TARGET</b> to
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
16 boot the resulting system image under QEMU, configured for use as a
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
17 development environment. Type <b>exit</b> to shut down the emulator.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
18
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
19 <h2>Overview</h2>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
20
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
21 <p>The build runs the following stages, in order:</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
22
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
23 <ul>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
24 <li><b>download.sh</b> - Download source packages used by the rest of the build.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
25 <li><b>host-tools.sh</b> - Build prerequisites host needs to run remaining stages.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
26 <li><b>simple-cross-compiler.sh</b> - Build cross compiler for selected target architecture.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
27 <li><b>[</b>cross-compiler.sh<b>]</b> - optionally produce a more portable cross compiler (not needed by rest of build).</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
28 <li><b>native-compiler.sh</b> - Build native compiler to install/run on target.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
29 <li><b>simple-root-filesystem.sh</b> - Build root filesystem that can boot to a shell prompt.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
30 <li><b>root-filesystem.sh</b> - Combine output of native-compiler and simple-root-filesystem stages into a single directory.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
31 <li><b>root-image.sh</b> - Create ext2/squashfs/initramfs image file from root-filesystem or simple-root-filesystem output.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
32 <li><b>linux-kernel.sh</b> - Build bootable Linux kernel.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
33 <li><b>system-image.sh</b> - Package together filesystem image and kernel with scripts to launch them under an emulator.</li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
34 </ul>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
35
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
36 <p>The top level wrapper script <b>build.sh</b> runs the above stages in order,
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
37 but each stage script can also be run individually. Each of the above
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
38 build scripts (except download.sh and host-tools.sh) take a single argument:
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
39 the name of the target architecture to build code for. Run build.sh with no
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
40 arguments to see a list of available targets.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
41
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
42 <p>Each build stage (except download.sh and host-tools.sh) produces its output
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
43 in the "build" directory under a subdirectory named after the script plus the
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
44 target. It also produces a tarball of that directory if the build stage
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
45 completed successfully. (The download.sh script populates the "packages"
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
46 directory instead, and host-tools.sh produces its output the directory
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
47 "build/host" with no tarball version since those programs are intended to
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
48 run locally.)</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
49
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
50 <p>All downloaded files wind up in the "packages" directory. Output from
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
51 compiles is generated in the "build" directory. These are the only two
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
52 directories the build writes to, and both directories may be deleted and
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
53 then recreated by the build scripts. (The equivalent of "distclean" is
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
54 <b>rm -rf build packages</b> from the top level directory.)</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
55
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
56 <p>None of these scripts need to be run as root -- an explicit design goal of
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
57 Aboriginal Linux is that root access on the host is never required.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
58
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
59 <h2>Build stages</h2>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
60
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
61 <p>The files in the top level directory of the Aboriginal Linux source
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
62 are:</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
63
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
64 <ul>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
65 <li><b>configure</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
66 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
67 <p>Contains several variables that can be set to control the build's behavior,
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
68 with descriptions of each. These variables may be set in this file, or
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
69 exported as environment variables.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
70
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
71 <p>A useful shell syntax to export environment variables for just a single
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
72 command, without persistently altering the environment, is to list the
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
73 assignments before the command on the same line. For example:</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
74
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
75 <blockquote><pre><b>CROSS_HOST=i686 SYSIMAGE_TYPE=ext2 ./build.sh armv5l</b></pre></blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
76 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
77
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
78 <li><b>build.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
79 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
80 <p>Top level wrapper script which builds a system image for a target,
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
81 by calling most of the other scripts listed here in the appropriate
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
82 order. It requires one argument, which is the target platform to build
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
83 for. When run without arguments, build.sh lists available architectures.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
84
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
85 <p>This script is just a wrapper, it contains no actual build logic (except
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
86 checking some of the configuration variables).</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
87 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
88
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
89 <li><b>download.sh</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
90
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
91 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
92 <p>Uses wget to download the source code required by the later build stages,
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
93 saving it in the "packages" directory. It compares the sha1 checksum
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
94 of any existing tarballs to an expected value, only downloading new
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
95 source tarballs when it needs to.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
96
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
97 <p>If a package's primary site is down, it checks a series of fallback mirrors.
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
98 The environment variable PREFERRED_MIRROR can insert a new mirror at
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
99 the start of the list, which is checked before even the official website.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
100
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
101 <p>This script is not target-specific, and only needs to be called once
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
102 even when building multiple architectures.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
103 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
104 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
105
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
106 <li><b>host-tools.sh</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
107
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
108 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
109 <p>Sanitizes the host environment by building known versions of needed tools
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
110 from source code, then restricting the $PATH to just those tools. This is
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
111 an optional step which can be skipped, but without it the build process
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
112 is very brittle.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
113
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
114 <p>This "airlock" step serves a similar purpose to the temporary system built
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
115 by Linux From Scratch's chapter 5, isolating the new system from variations
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
116 in the host. It also acts as an early check that the resulting system
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
117 images offer a sufficient development environment to rebuild themselves
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
118 from source, because the host tool versions used to build them in the first
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
119 place are the same ones the scripts install into the target root filesystem.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
120
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
121 <p>This script populates the "build/host" directory, which is automatically
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
122 <p>used by later stages if it exists. It is not target specific, and only
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
123 <p>needs to be run once when building multiple architectures.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
124 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
125 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
126
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
127 <li><b>simple-cross-compiler.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
128
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
129 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
130 <p>Creates a cross compiler for the selected target architecture, built from
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
131 gcc, binutils, uClibc, and the Linux kernel headers. This compiler runs
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
132 on the host and produces programs that run on the target.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
133
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
134 <p>This compiler is sufficient to build a system image for the target, but
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
135 isn't as powerful as the compilers created by cross-compiler.sh or
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
136 native-compiler.sh. (It doesn't include thread support, uClibc++, or the
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
137 shared version of libgcc.)</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
138 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
139 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
140
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
141 <li><b>cross-compiler.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
142
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
143 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
144 <p>This optional step creates a more full-featured cross compiler, with
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
145 thread support, uClibc++, and the shared version of libgcc. This is
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
146 not required to build a system image, but the prebuilt binary compilers
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
147 shipped in the downloads/binaries directory are built this way.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
148
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
149 <p>The build.sh wrapper script only calls this stage if the config variable
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
150 CROSS_HOST is set, indicating which host architecture to build for.
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
151 (For PC hardware, i686 is a good value, since most 64 bit PCs can run 32 bit
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
152 code.)</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
153
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
154 <p>This compiler is statically linked against uClibc, for maximum
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
155 portability. (You can set BUILD_STATIC=none to dynamically link instead,
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
156 but then have to install uClibc's shared libraries on the host.)</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
157 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
158 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
159
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
160 <li><b>native-compiler.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
161
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
162 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
163 <p>This step creates a compiler for the selected target, using one
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
164 or more of the existing simple cross compilers. The compiler it produces
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
165 runs on the target and produces programs that also run on the target.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
166
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
167 <p>By default this compiler is statically linked so you can add it to an
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
168 existing target root filesystem. Use BUILD_STATIC=none to disable this.,/p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
169
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
170 <p>This compiler includes binutils, gcc, make, bash, and distcc. Because
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
171 it's a native compiler, the executable names do not have any prefixes the
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
172 way the cross compilers do. (I.E. just "ld" instead of "$TARGET-ld".)</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
173 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
174 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
175
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
176 <li><b>simple-root-filesystem.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
177
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
178 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
179 <p>Creates a root filesystem (with uCLibc, BusyBox, and an init script)
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
180 that contains just enough infrastructure to boot up to a shell prompt.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
181
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
182 <p>The config variable SIMPLE_ROOT_OVERLAY can supplement this stage.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
183 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
184 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
185
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
186 <li><b>root-filesystem.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
187 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
188 <p>Combines the simple root filesystem and native compiler into a single
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
189 root filesystem, producing a bootable root filesystem with development
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
190 tools.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
191 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
192 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
193
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
194 <li><b>root-image.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
195 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
196 <p>Creates a filesystem image from the root-filesystem
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
197 (or simple-root-filesystem) directory. The default is squashfs, but
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
198 the config variable SYSIMAGE_TYPE can also select ext2 or initramfs formats.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
199 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
200 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
201
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
202 <li><b>linux-kernel.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
203 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
204 <p>Builds a bootable Linux kernel for the target, generally configured for use
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
205 with QEMU.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
206
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
207 <p>The kernel configuration combines the sources/baseconfig-linux settings
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
208 (which are the same for each $TARGET) with the target-specific LINUX_CONFIG
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
209 entries from sources/targets/$TARGET/settings. This configuration mechanism
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
210 essentially starts with "allnoconfig" and then switches on each mentioned
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
211 symbol, resolving dependencies as it goes, just as if you opened up menuconfig
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
212 and set that list of symbols by hand.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
213
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
214 <p>Alternately, you could put your own kernel config in
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
215 "sources/targets/$TARGET/miniconfig-linux". Or just build your own kernel.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
216 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
217 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
218
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
219 <li><b>system-image.sh $TARGET</b>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
220 <blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
221 <p>Combines the output of root-image and linux-kernel, and adds emulator
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
222 launch scripts.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
223
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
224 <p>For more information, see the <a href=prebuilt-binaries.html>the binary
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
225 docs</a></p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
226 </blockquote>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
227 </li>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
228 </ul>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
229
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
230 <p>The sources/more directory contains additional scripts the user can run,
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
231 but which are not called from build.sh. This directory contains the external
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
232 user interfaces the user can call directly which are not build stages.
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
233 See more/README in the Aboriginal source code for details.</p>
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
234
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
235 <!--
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
236 run-from-build.sh ARCH
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
237
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
238 Boot up a system image under its emulator, with full native development
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
239 environment options (a 2 gigabyte /dev/hdb mounted on /home and distcc
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
240 calling out to the appropriate cross compiler).
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
241
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
242 Note that targets with the hw- prefix are aimed at actual hardware, and do
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
243 not have an emulator configured. Hardware targets are derived from an
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
244 existing architecture, repackaging the other architecture's root filesystem
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
245 with a different Linux kernel configuration.
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
246 -->
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
247
6da94a74a8a9 Convert downloads/README into build-stages.html
Rob Landley <rob@landley.net>
parents:
diff changeset
248 <!--#include file="footer.html" -->