Gentoo Archives: gentoo-embedded

From: Christopher Friedt <cfriedt@××××××××××××××.com>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] gentoo-embedded buildroot utility
Date: Wed, 14 Mar 2007 20:56:27
Message-Id: 45F86125.3030908@visible-assets.com
In Reply to: Re: [gentoo-embedded] gentoo-embedded buildroot utility by Cliff Brake
1 Hi Cliff,
2
3 Cliff Brake wrote:
4 > Sounds interesting. I use OE extensively and it works well for what I
5 > do. How does this solution handle cross compiling (for example ARM
6 > architectures)? Can you point me to some reading or Google search
7 > phrases. How is it different/similar to OE or scratchbox?
8
9 I always had portage in mind as soon as i started my embedded job about
10 1 year ago - I looked at OpenEmbedded but found that compiling bitbaker
11 always failed - Then I (and others) tried to get my board
12 (embeddedarm.com) supported in OpenWRT, but the developer never ended up
13 doing anything with the boards we gave him.
14
15 What my solution does, is create a chroot environment (much like how one
16 goes about a stage1 gentoo installation), and installs crossdev.
17
18 When the actually building takes place, it simply enters the chroot, and
19 you use 'xmerge' (see gentoo docs) to install the package, automatically
20 generating a binary tarball.
21
22 I haven't used OE or scratchbox actually, but I knew what my own
23 requirements were:
24
25 1) support multiple configurations
26
27 - varies on a per-client or per-application basis
28 which basically means you can use your embedded
29 system to run several different applications
30 customized for various clients, including varying
31 default configuration files, source patches, and
32 service definitions (through portage overlays)
33
34 - you can copy configuration to a different target
35 (i.e. the same app on different hardware)
36
37 - a configuration is basically the same as an overlay
38 - developers are free to impose a strict group of
39 GENTOO_MIRRRORS with their specific overlays and
40 portage trees.
41
42 2) support multiple targets (architectures)
43
44 - program creates a directory called 'toolchains'
45 and each toolchain resides in its own directory.
46 - support toolchain version numbers, so the above
47 directories would be called something like
48
49 'arm-softfloat-gnu__${binutilsver}__${libcver}__${kernelver}__${gccver}
50
51 - You can share the same toolchain between
52 configurations
53 (i.e. multiple applications can run on the same hardware)
54 - you can copy a configuration to a different target.
55
56 3) support a devel and stable profile for each configuration
57
58
59 This might not be so obvious, but a new embedded root filesystem image
60 is generated based on the active profile in the selected configuration,
61 not just on the configuration itself.
62
63
64 As i mentioned earlier, the above list only partially accounts for the
65 complexit of the app. Another big job is deciphering the way that
66 crossdev installs the libraries and the way that gcc-config deals with
67 cross-compiling (i.e. where are the compiler profiles for gcc-config,
68 where is the c library, where are the headers & asm files, where do we
69 store application libraries, etc).
70
71 This is due to the fact that the system should support more than one
72 toolchain - that is a requirement that I imposed myself. However, the
73 reason for this complexity, is because this app exploits a sort of
74 backdoor within portage that I'm not sure has been leveraged yet.
75
76 That is, the mechanism for entering and exiting the chroot is really the
77 key - and also the __really__ complicated part.
78
79 This app is intended to mount -o bind and unmount the necessary
80 directories, create / copy / destroy the necessary files, and perform
81 all sanity checks to ensure that _inside_ the buildroot all functions as
82 expected - for the selected target, configuration, and profile. It goes
83 without saying that something done with one profile should be completely
84 independent of something done with another profile.
85
86
87 The installation directory would look something like this:
88
89 $BR_HOME/
90
91 toolchains/
92 x86/
93 arm-9tdmi-linux-gnu__${binutilsver}__ ...
94 arm-softfloat-linux-uclibc__${binutilsver}__ ...
95 x86_64/
96 arm-9tdmi-linux-gnu__${binutilsver}__ ...
97 sparc/
98 arm-softfloat-linux-gnu__${binutilsver}__ ...
99
100 buildroots/
101 x86/
102 /bin
103 /usr
104 * portage/
105 * target -> arm-9tdmi-linux-gnu
106 * arm-9tdmi-linux-gnu
107 ...
108 * /sysroot
109 * /binpkgs
110 x86_64/
111 sparc/
112
113 portage/
114
115
116 I hope that offers a bit more information. There is still a lot of work
117 to do here, but at least it's contained, portable, etc.
118
119 Likely, a non-interactive mode will also be developed, where commands like
120
121 cp config <src_target> <dest_target>
122 rm profile <target> <config> <profile>
123 make sysroot <target> <config> <profile>
124
125 will be parsed and so on... allowing lots of possibilities ;-)
126
127
128 ~/Chris
129 --
130 gentoo-embedded@g.o mailing list