Gentoo Archives: gentoo-embedded

From: Christopher Friedt <cfriedt@××××××××××××××.com>
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] gentoo-embedded buildroot utility
Date: Wed, 14 Mar 2007 18:25:42
Message-Id: 45F83D98.5020904@visible-assets.com
1 I may have already mentioned this once, but I don't see any harm in
2 doing it again.
3
4 Have any of you used Kuroo ? This is a similar idea - although not
5 nearly as far along - for managing embedded system builds with portage.
6
7 Are there any developer libraries for interfacing with Portage that are
8 fairly available - [Java, C, C#, ... I've really never used python]
9
10 ********
11
12 As an gentoo user & embedded developer, I can see the massive benefits
13 to both general purpose package management, as well as build automation
14 for embedded systems, through the use of portage & emerge.
15
16 Portage has a major advantage and should really be asserting itself more
17 in the world of embedded package management. The crossdev utility is by
18 far an excellent piece of work - I use it for practically every
19 toolchain now.
20
21 However, there are a few questions that I've been asked several times -
22 (mostly by my boss), such as -
23
24 i) why not just use OpenWRT, which will generage a filesystem image,
25 download your sources, _and_ build a kernel automatically...
26
27 ii) why not use that thing from openembedded.org ? ... same idea as above...
28
29 Why not? because I think that portage is clearly better, the source is
30 more current, dependencies are better resolved, more flexible, etc.
31
32
33 What appears to be a constant theme, in terms of what the 'competition'
34 has on gentoo-embedded, is an easy-to-use build system.
35
36
37
38 The good news is, I've actually done some extensive work on this!
39
40 I've been working on a _single_bash_script_ that is exceeding 2000+
41 lines of code. What it does, is interactively help the user set up a
42 buildroot and manage portage overlays for different targets. That is, a
43 stage1 filesystem, a local portage tree, a cross-toolchain, etc.
44
45 The reasons for this are:
46
47 1) portability across linux vendors (i.e. the developer does not need to
48 run gentoo natively, only needs to chroot to get the advantages of portage)
49
50 2) separability from the main os - none of the host
51 /etc/portage/package.* files are not adjusted - so there is practically
52 nothing changed at all on the host machine except for the addition of a
53 new buildroot directory.
54
55 3) extensibility - I'm seriously considering developing user interfaces,
56 libraries, etc, all to make this _more_developer_friendly_ ... even a
57 context free grammar for all possible buildroot / configuration
58 operations. Likely any extensions to this will be done either in C
59 (libs), Java, or C# ... maybe even an extension of some kind for
60 Eclipse. This could be somewhat similar to Kuroo
61
62 4) enables embedded developers to simply manage their embedded devices
63 using a portage overlay, in a very portable way.
64
65 5) easy generation of a root filesystem
66
67
68 By basically mounting or systematically copying/destroying key portage /
69 crossdev / configuration files to the chroot upon chroot (mount -n -o
70 bind, etc). This (will / has) enabled the same buildroot to be used for
71 _several_ configurations (portage overlays), targets (with versioned
72 toolchains), as well as developer and stable profiles. I'm working in a
73 way to automate compressed configuration backups as well, organized by
74 date. Hopefully, this will all be SVN friendly too - except for device
75 nodes of course :P
76
77 The user is interactively prompted to select a target / toolchain, etc,
78 these are all selected based on __tested__ compilations on each
79 architecture using crossdev - a sort of build matrix like that from Dan
80 Kegel.
81
82 There is a list of toolchains for each architecture that were cleanly
83 built using crossdev. I've only done a fraction of the build automations
84 for X86, and it took something like 2 days.
85
86 What's really interesting about this script, is that i've made the
87 script copy itself to the chroot, upon every chroot, but with a
88 different name. So when the program chroots, it actually calls itself
89 upon transition with
90
91 LIST=of \
92 ENVIRONMENT=variables \
93 chroot ${DIR} ${PROG2_NAME}
94
95 which allows for a somewhat 'seamless' routine carryover - that is if
96 the program needs to install a toolchain, it will pass certain
97 environment variables once it moves to the chroot, etc.
98
99 I think that this could be a pretty good addition to the embedded
100 development utilities for gentoo.
101
102
103 Please inform me if you have any interest in this project at all, I
104 would be very happy to have any assistance or input.
105
106
107 ~/Chris
108 --
109 gentoo-embedded@g.o mailing list

Replies

Subject Author
Re: [gentoo-embedded] gentoo-embedded buildroot utility Hanni Ali <hanni.ali@×××××.com>
Re: [gentoo-embedded] gentoo-embedded buildroot utility Cliff Brake <cliff.brake@×××××.com>
Re: [gentoo-embedded] gentoo-embedded buildroot utility Ned Ludd <solar@g.o>