| 1 |
<h1>Auto-Building Morphix Modules</h1> |
|---|
| 2 |
|
|---|
| 3 |
<p>In the last two hacks we've looked at what Morphix is, and how we |
|---|
| 4 |
can easily customize an existing Morphix Live CD. In this last hack, |
|---|
| 5 |
we will take a look at Module Maker, or MMaker, a tool for autobuilding Morphix |
|---|
| 6 |
modules. Remastering modules is all fine and well, and you can do this |
|---|
| 7 |
just as you can with a compressed KNOPPIX image. However, laziness is |
|---|
| 8 |
seen as a virtue in Morphix-land: one command is all it should take to |
|---|
| 9 |
(re)build a module. |
|---|
| 10 |
|
|---|
| 11 |
<h2>A look at a module generator</h2> |
|---|
| 12 |
|
|---|
| 13 |
<p>MMaker is a tool under development at the moment, but is quite |
|---|
| 14 |
simple in nature. Using a so-called template, an xml file with all the |
|---|
| 15 |
information about the module you want to build, you can auto-build a |
|---|
| 16 |
Morphix module: |
|---|
| 17 |
|
|---|
| 18 |
<pre> |
|---|
| 19 |
mmaker mytemplate.xml mymodule.mod |
|---|
| 20 |
</pre> |
|---|
| 21 |
|
|---|
| 22 |
<p>What MMaker does when you execute this command is debootstrap a new |
|---|
| 23 |
debian filesystem using the details in the template, set up the |
|---|
| 24 |
necessary mainmodule directories and installs all packages specified |
|---|
| 25 |
in the template, while using apt to handle any |
|---|
| 26 |
dependancies. Afterwards it compresses the whole bunch into a fresh |
|---|
| 27 |
new module, ready to be added to a Morphix Live CD in the usual |
|---|
| 28 |
manner. |
|---|
| 29 |
|
|---|
| 30 |
<p/>As you might have guessed, the template is the key to all of |
|---|
| 31 |
this. A look at one for Morphix LightGUI: [note to editor: the |
|---|
| 32 |
template uses an xml notation, so might not appear when viewing in html] |
|---|
| 33 |
|
|---|
| 34 |
<pre> |
|---|
| 35 |
|
|---|
| 36 |
<comps> |
|---|
| 37 |
<groups> |
|---|
| 38 |
<version>0.5</version> |
|---|
| 39 |
<id>lightgui</id> |
|---|
| 40 |
<name>Morphix LightGUI</name> |
|---|
| 41 |
<repositorylist> |
|---|
| 42 |
<repository type="debian">ftp://ftp.debian.org/debian</repository> |
|---|
| 43 |
<repository type="plain">http://www.morphix.org/debian</repository> |
|---|
| 44 |
</repositorylist> |
|---|
| 45 |
<description>Morphix LightGUI mainmodule. Includes XFCE4, Firefox, |
|---|
| 46 |
Abiword and a host of other goodies</description> |
|---|
| 47 |
<type>mainmod</type> |
|---|
| 48 |
<suite>sid</suite> |
|---|
| 49 |
<packagelist> |
|---|
| 50 |
<packagereq>abiword</packagereq> |
|---|
| 51 |
<packagereq>xfce4</packagereq> |
|---|
| 52 |
<packagereq>mozilla-firefox</packagereq> |
|---|
| 53 |
<!-- ... other goodies here ... --> |
|---|
| 54 |
</packagelist> |
|---|
| 55 |
</group> |
|---|
| 56 |
</comps> |
|---|
| 57 |
</pre> |
|---|
| 58 |
|
|---|
| 59 |
<p>Seems simple, doesn't it? The actual template for LightGUI is |
|---|
| 60 |
quite a bit longer (and contains a package to start xfce4 at boot |
|---|
| 61 |
time), but it's very simple to specify which repositories you want to use, |
|---|
| 62 |
what Debian suite you want, what type of Morphix module you want to |
|---|
| 63 |
autobuild and naturally the packages you want. Currently, MMaker can |
|---|
| 64 |
only build base and main modules . A few tags might need some extra |
|---|
| 65 |
explaining: |
|---|
| 66 |
<p/> |
|---|
| 67 |
<repository> - With this tag you define the Debian repository/repositories from |
|---|
| 68 |
which to build your module. Use the type="plain" attribute when you |
|---|
| 69 |
have a repository without separate suites (You can verify this by |
|---|
| 70 |
checking the repository, if it has a Packages file in the root directory of |
|---|
| 71 |
the repository we call it 'plain'). Normal, Debian-style repositories |
|---|
| 72 |
is default |
|---|
| 73 |
<p/> |
|---|
| 74 |
<type> - mainmod, basemod. minimod-type templates are coming up |
|---|
| 75 |
(a separate minimodule generator was constructed before MMaker). It |
|---|
| 76 |
would actually be fairly easy to even have a knoppix-type. |
|---|
| 77 |
<p/> |
|---|
| 78 |
<suite> - sid, sarge, woody (or unstable, testing or stable). These |
|---|
| 79 |
are the three branches of Debian, of which Morphix is derived from. |
|---|
| 80 |
<p/> |
|---|
| 81 |
<arch> - the architecture for which you are building your |
|---|
| 82 |
module. Using an architecture different from the host system isn't |
|---|
| 83 |
recommended and can lead to very interesting errors. It defaults to |
|---|
| 84 |
the architecture of your host system, which should be fine most of the |
|---|
| 85 |
time. |
|---|
| 86 |
|
|---|
| 87 |
<p/>There are a few other tags and commandline options for MMaker, |
|---|
| 88 |
consult the documentation for details. |
|---|
| 89 |
|
|---|
| 90 |
<p/>After your module is built (which takes some time without a local |
|---|
| 91 |
Debian mirror) your uncompressed module will exist in a directory in |
|---|
| 92 |
your /tmp. MMaker will output details of how to recompress it if |
|---|
| 93 |
necessary. We hope MMaker will be useful in letting Morphix work for you! |
|---|
| 94 |
|
|---|
| 95 |
<h2>References</h2> |
|---|
| 96 |
|
|---|
| 97 |
Module Maker Wiki page: |
|---|
| 98 |
http://www.alextreme.org/phpwiki/index.php/ModuleMaker |
|---|