Hack 100 Auto-Build Morphix Modules MapLab tutorial map

 < Day Day Up > 

Hack 100 Auto-Build Morphix Modules MapLab tutorial map

figs/moderate.gif figs/hack100.gif

Morphix is already easy to change due to its modular nature, but you can make module creation even easier and more powerful by using Module Maker to automate building Morphix modules .

[Hack #99] looks at how you can easily customize an existing Morphix live CD. This hack takes a look at Module Maker, or MMaker , a tool for auto-building Morphix modules.

Remastering modules is all fine and good, and you can do this just as you can with a compressed KNOPPIX image. However, laziness is seen as a virtue in Morphix-land: one command is all it should take to (re)build a module.

9.8.1 A Look at a Module Generator

MMaker is a tool under development at the moment, but it is quite simple in nature. Using a so-called template, an XML file with all the information about the module you want to build, you can auto-build a Morphix module:

 $  mmaker   mytemplate.xml mymodule.mod  

What MMaker does when you execute this command is debootstrap a new Debian filesystem using the details in the template, set up the necessary mainmodule directories, and install all packages specified in the template, using APT to handle any dependencies. Afterwards, it compresses the whole bunch into a fresh new module, ready to be added to a Morphix live CD in the usual manner.

As you might have guessed, the template is the key to all of this. Here is a sample template that is used for Morphix LightGUI:

 <comps>  <groups>   <version>0.5</version>   <id>lightgui</id>   <name>Morphix LightGUI</name>   <repositorylist>    <repository type="debian">ftp://ftp.debian.org/debian</repository>    <repository type="plain">http://www.morphix.org/debian</repository>   </repositorylist>   <description>Morphix LightGUI mainmodule. Includes XFCE4, Firefox,   Abiword and a host of other goodies</description>   <type>mainmod</type>   <suite>sid</suite>   <packagelist>    <packagereq>abiword</packagereq>    <packagereq>xfce4</packagereq>    <packagereq>mozilla-firefox</packagereq>    <!-- ... other goodies here ... -->   </packagelist>  </group> </comps> 

Seems simple, doesn't it? The actual template for LightGUI is quite a bit longer (it contains more packages in the <packagelist> section and contains a package to start xfce4 at boot time), but it's very simple to specify which repositories you want to use, which Debian suite you want, which type of Morphix module you want to auto-build, and, naturally, the packages you want. Currently, MMaker can build only base and main modules.

A few tags might need some extra explaining:


<repository>

With this tag, you define the Debian repository to build your module from. Use the type="plain " attribute when you have a repository without separate suites. (You can verify this by checking the repository. If it has a Packages file in the root directory of the repository, we call it "plain.") Normal Debian-style repositories are the default.


<type>

Mainmod or basemod. Minimod templates are in development (a separate minimodule generator was constructed before MMaker ). It would actually be fairly easy to even have a Knoppix type.


<suite>

Sid, sarge, woody (or unstable, testing, or stable). These are the three branches of Debian that Morphix is derived from.


<arch>

With this tag, you define the architecture that you are building your module for. Using an architecture different from the host system isn't recommended and can lead to very interesting errors. It defaults to the architecture of your host system, which should be fine most of the time.

There are a few other tags and command-line options for Mmaker ; consult the documentation for details.

After your module is built (which takes some time without a local Debian mirror), your uncompressed module exists in a directory in your /tmp directory. MMaker outputs details of how to recompress it if necessary. Hopefully, MMaker is useful in letting Morphix work for you!

9.8.2 See Also

  • The Mmaker Wiki page at http://am.xs4all.nl/phpwiki/index.php/ModuleMaker.

  • MapLab tutorial map

 < Day Day Up > 


Knoppix Hacks. 100 Tips and Tricks
Knoppix Hacks. 100 Tips and Tricks
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net