Gentoo Archives: gentoo-releng

From: david@×××××××××.com
To: gentoo-releng@l.g.o
Cc: gentoo-embedded@l.g.o
Subject: [gentoo-releng] embedded extensions for catalyst
Date: Fri, 20 Feb 2004 18:43:02
Message-Id: 20040220183957.GC8956@redhate.futuretel.com
1 Preamble
2
3 It has become apparent through my development with the
4 gentoo-embedded project that the project needs a way of dynamically
5 and predicably producing 'embedded' gentoo images. At first I took it
6 upon myself to write my own little program which proved useful, but
7 not extensible or convenient.
8 Some time later catalyst was released. It automatically builds gentoo
9 stage1, stage2, and stage3 tarballs for gentoo base systems. With a
10 bit of modification it looked as though it could be used for building
11 embedded images.
12
13 Short Term Catalyst Requirements
14
15 To get 'stage3' target produced with embedded methodologies there are
16 a few requirements:
17
18 * Use a native stage{2,3} to produce a cross-capable stage{1,2,3}
19 * Inform portage of the proper cross-compiler use
20 * Merge cross packages into a non-native stageroot
21 * Perform various 'house cleaning' tasks on a non-native stage3 image
22
23 To get a bit more in-depth:
24
25 embedded-stage1:
26 This image is produced from a native stage{2,3}. It can include, some
27 sort of non-native target. A Non-native target produces binaries that
28 the native system does not have the capability to. This could be
29 something like a cross libc(uClibc-cross) or a architechture cross
30 gcc(powerpc-cross).
31
32 embedded-stage2:
33 This image is produced from a embedded-stage1 and includes
34 cross-merged packages. These packages are merged into a
35 user-defineable sub-directory of the embedded-stage1 stageroot. Since
36 these binaries might not be executable on the current architechture,
37 they must be merged into this seperate directory. This also allows
38 for a native portage, compiler, and system utils(from the
39 embedded-stage1) to still allow us modify the embedded-stage2 target.
40 The tarball produced at the end is the contents of the user-defined
41 sub-directory into which packages are merged.
42
43 embedded-stage3:
44 This image is produced from a embedded-stage2 and allows
45 user-definable 'house cleaning' procedures to be performed. This should
46 include but is not limited to: unmerging unneeded packages, removing
47 unneeded directories and files(ex: rm -rf /usr/share/man), arbitrary
48 shell script/commands executed for final packaged(ex: place into cramfs).
49
50 Long Term Catalyst Requirements
51
52 In attempting to implement some of the previous requirements myself I
53 noticed the following improvements on catalyst a much more effective
54 tool in the future.
55
56 * Allow developers to easily extend catalyst with their own custom
57 non-standard stage targets using object-oriented design.
58 * Catalyst should be able to load and integrate these standalone plug-in's
59 dynamically at run time into itself.
60
61 This would allow newer projects and end users to create their own
62 stage targets(like the embedded project) without having to modify the
63 catalyst codebase.
64
65 There has also been interest in using the native filesystem cross
66 toolchain to produce these embedded stages rather than having self
67 contained stages with toolchains inside. This is most likely possible
68 but warrents some additional investigation for a method of easily
69 integrating it.
70
71 End Notes
72
73 The goal of this document was to layout the requirements of the
74 gentoo-embedded project to streamline production of embedded images.
75 Further steps were taken to make future efforts in customizing images
76 easier for other individuals and projects. This includes long term
77 changes to the design of catalyst in order to accomidate modularity.
78
79 Ideally these short term goals could be implemented into catalyst
80 fairly soon as well as putting the long term goals into the catalyst
81 release schedule.
82
83 -------------------
84
85 Notes on the attached code:
86
87 I attached code that provides basic 'embedded-stage3' capabilities in
88 catalyst. I attached two files:
89
90 embedded-catalyst.patch
91 embedded.sh
92
93 to make the embedded images one must make directory 'embedded' in the
94 catalyst targets directory, and place the embedded.sh script in there:
95
96 /usr/local/catalyst/targets/embedded/embedded.sh
97
98 then apply the patch to catalyst. Instead of a 'stage3' target one
99 can now use 'embedded'. Be warned it does not check dependancies for
100 packages, this is so one can only put in what is needed.

Attachments

File name MIME type
embedded-catalyst.patch text/plain
embedded.sh application/x-sh