Mercurial > hg > aboriginal
annotate README @ 792:b364ed2adf49
Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 31 Jul 2009 01:00:45 -0500 |
parents | 20ba34b54140 |
children | bd2ea96aac53 |
rev | line source |
---|---|
663 | 1 This is a brief intro, see http://impactlinux.com/fwl/documentation.html for |
2 full documentation. | |
3 | |
4 --- What is it? | |
5 | |
6 Firmware Linux (FWL) is a build system that creates cross compilers and | |
7 bootable system images for various targets, such as arm, mips, powerpc, and | |
8 x86. | |
9 | |
10 --- How do I use it? | |
11 | |
12 List available targets: | |
13 | |
14 ./build.sh | |
15 | |
16 Build the mipsel (mips little endian) target: | |
17 | |
18 ./build.sh mipsel | |
19 | |
20 Boot the result under qemu, right out of the build directory: | |
21 | |
22 ./run-from-build.sh mipsel | |
23 | |
24 After the kernel boot messages scroll by, you should have a shell prompt | |
25 inside qemu. Try "cat /proc/cpuinfo" to confirm it's not the same as your | |
26 host. Type "exit" to shut it down. | |
27 | |
28 Finally, look at the output in the "build" directory. | |
29 | |
30 ls -l build/*.tar.bz2 | |
31 | |
32 For each target you built, the build tars up the cross compiler, the | |
33 root filesystem, and a bootable system image. Each system image contains an | |
34 ext2 formatted virtual hard drive image, a kernel configured for qemu, and a | |
35 run-emulator.sh shell script to invoke qemu in various ways. | |
36 | |
37 If you'd like to use the cross compiler to build something else, just add | |
38 its "bin" subdirectory to the $PATH, and use the build tools prefixed with | |
39 the target name: | |
40 | |
41 PATH=$(pwd)/build/cross-compiler-mipsel/bin:$PATH | |
42 mipsel-gcc -static hello.c -o hello | |
43 qemu-mipsel hello | |
44 | |
45 Note that the run-emulator.sh script has several command line options: | |
46 | |
47 cd build/system-image-mipsel | |
48 ./run-emulator.sh --help | |
49 | |
50 If you'd like to build every target in parallel (needs about 2 gigs of ram): | |
51 | |
52 ./buildall.sh --fork | |
53 | |
54 The file "configure" contains several environment variables you can set to | |
55 control the behavior of FWL. (If this file doesn't set them, you can set | |
56 them in your environment before running a build.) | |
57 | |
698
9e2a020195d3
Mention how to do "make clean" and "make distclean" equivalents.
Rob Landley <rob@landley.net>
parents:
663
diff
changeset
|
58 The equivalent of "make clean" is "rm -rf build". The equivalent of |
9e2a020195d3
Mention how to do "make clean" and "make distclean" equivalents.
Rob Landley <rob@landley.net>
parents:
663
diff
changeset
|
59 "make distclean" is "rm -rf build packages". |
9e2a020195d3
Mention how to do "make clean" and "make distclean" equivalents.
Rob Landley <rob@landley.net>
parents:
663
diff
changeset
|
60 |
663 | 61 --- What's it for? |
62 | |
63 Although Firmware Linux creates reusable cross compilers, the purpose of FWL | |
64 is actually to eliminate the need for cross compiling. | |
65 | |
711
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
66 The FWL build does all the cross compiling necessary to create a root |
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
67 filesystem for a target containing a minimal native development environment, |
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
68 then packages it into a system image. Once that target system is up and |
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
69 running (usually under qemu), you can build your software natively in there, |
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
70 and no longer need to cross compile anything from the host. |
663 | 71 |
72 FWL is also designed to be readable. The build is a series of bash scripts, | |
73 with comments where necessary. They document how to make a cross compiler, | |
74 how to create a simple development environment, and how to package and boot | |
75 the result under an emulator. If you don't know how something works, read | |
76 the script. If something's unclear, ask us. | |
77 | |
78 --- How does it work? | |
79 | |
80 The build.sh script is a wrapper around other scripts. The main three are: | |
81 | |
711
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
82 cross-compiler.sh - create a cross compiler for the target. |
663 | 83 |
711
20ba34b54140
Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents:
698
diff
changeset
|
84 root-filesystem.sh - use the cross compiler to build a root filesystem. |
663 | 85 |
86 system-image.sh - build a kernel and ext2 image to run under emulator. | |
87 | |
88 # Or when building a cross-compile aware package, do something like: | |
89 # export PATH=`pwd`/build/cross-compiler-i686/bin:$PATH | |
90 # make CROSS_COMPILE=i686- | |
91 | |
92 This file is a brief introduction, for full documentation see | |
93 | |
94 http://impactlinux.com/fwl/documentation.html |