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