HowTo: Some Examples to help you start Morphing

Some updated How Tos to help you get started with Morphing. These HowTos are available on interacive How To LiveCD called Morphing-Morphix, much better than a boring document.

A look at MorphingMorphix 0.3

The purpose of MorphingMorphix is to provide a quick way to start Morphing and to showcase all the Morphix tools - a LiveCD contruction kit. Just boot the CD and start Morphing, no need to install tools, compile applications or switch operating systems. All that is required is some space on a connected hard drive.

You do not have to use MorphingMorphix you just need a debian based system and Set Up the Build Environment

On MorphingMorphix there are a number of interactive HowTo/examples. The examples work best if you work though them in order. First configure MorphingMorphix so that some extra disk space is available. Then work through the examples in order.

Some of the examples, such as using mmaker and isomaker require access to the internet, so that software can be downloaded from repositories to build new parts of a MorphixCD. The examples are very machine intensive, using lots of disk space, memory, and bandwidth.

The following Morphs can be completed from the LiveCD.

ScreenShots of MorphingMorphix running are shown on a separate page. It shows the ease of use for MorphingMorphix.

Introduction

LiveCD are stored as .iso files. Which can then be written to a CD. One of the morphing-tools is isomorph. This can be used to manipulate morphix iso files.

Isomorph can list, add, del and get files on the Morphix LiveCDs.

Isomorph is used in all of the other examples.

For example we will now run the command

isomorph --list MyMorph.iso

Remove Modules

We have now got our CD Image file, by copying this running CD. As you have seen in the last example, this image contains the MainModule and lots of MiniModules. The easy way to make a new LiveCD is to build new MiniModules and a new MainModule.

Hence the first task is to delete the MainModule and MiniModules from the LiveCD image. Remove Modules

We will again use isomorph

isomorph --del-all main ./MyMorph.iso ./tmp.iso
mv ./tmp.iso ./MyMorph.iso
isomorph --del-all mini ./MyMorph.iso ./tmp.iso
mv ./tmp.iso ./MyMorph.iso

MiniMorph Example

The next Morph is making the MiniModule to auto run an application once the window manager has loaded.

This Morph is to demonstrate the use of one of the morphix tools - morphmini. This is mmaker's little brother. As in other examples this makes use of XML template files.

<comps>
 <group>
  <minimod>
   <version>0.0.1</version>
   <description>MorphMini launch Morphing-Morphix-GUI</description>
   <minitag>MorphixMini-Launch-MM-GUI</minitag>
   <maintag>ALL</maintag>
   <bootoption>ALL</bootoption>
   <root> <!-- Files or Packages to be overlaid on the rootfile system - good for saving ramspace -->
    <files>
     <local>
      <from>/home/morph/morphix/trunk/morph-scripts/mmorphix/morphing-morphix-gui.sh</from>
      <to>/usr/sbin/morphing-morphix-gui</to>
     </local>
     <local>
      <from>/home/morph/morphix/trunk/morph-scripts/mmorphix/MorphingMorphix.xpm</from>
      <to>/usr/share/morphing-morphix/</to>
      </local>
    </files>
   </root>
   <commandlist> <!-- Commands to be started from minimodule -->
    <X>         <!-- Commands to run in X windows -->
     <command>/usr/sbin/morphing-morphix-gui &amp; </command><!-- &amp; is xml format for & -->
    </X>
   </commandlist>
  </minimod>
 </group>
</comps>

We will now build the MiniModule then add the MiniModule to the the LiveCD.

morphmini ./MorphixMini-Launch-MM-GUI.xml ./MorphixMini-Launch-MM-GUI.mod
isomorph --add mini ./MorphixMini-Launch-MM-GUI.mod ./MyMorph.iso ./tmp.iso
mv ./tmp.iso ./MyMorph.iso

Other templates for morphmini are available

Morphing the Home Directory

The next Morph is to save the files in the users home directory.

The following will be saved

  • Any files and directories in /home/morph
  • Hidden system files. (These are the files beginning with a . e.g. .icewm)

The following will not be saved

  • The X server setting - these are generated on boot up.

Basically all the files and directories in /home/morph will be zipped into placed in to a self-extracting MiniModule.

So feel free to save some files, settings, etc within the home directory before continuing.This is really useful for setting default homepages, menus etc.

The power of a MiniModule is that they are very simple to build, but really useful to change the whole impression of the cd.

We make the mini-module using one of the morphix-tools make-mini, along with isomorph to add the MiniModule to the image file.

make-mini --homedir --hidden MorphixMini-MM-Saved-Home.mod
isomorph --add mini MorphixMini-MM-Saved-Home.mod ./MyMorph.iso ./tmp.iso
mv ./tmp.iso ./MyMorph.iso

Mmaker Example

MMaker is a tool that 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 MainModule.

That's it kids, we will just have a look at morphing-morphix.xml used to build this MainModule currently running.

We will then use mmaker to build a new version of the MainModule. Unless you one of the lucky people who has a local repository, you will be using the main Debian repository.

You need a fast connection to Debian repository and a lot of space to build the MainModule before it is compressed.

This step could take up to 45 minutes, but hey it is automated!

We will use these commands

mmaker /usr/share/morphing-morphix/morphing-morphix.xml /tmp/morphing-morphix.mod
isomorph --add main /tmp/morphing-morphix.mod ./MyMorph.iso ./tmp.iso
mv ./tmp.iso ./MyMorph.iso

As you might have guessed, the template is the key to all of this. A look at one for Morphix LightGUI: [note to editor: the template uses an xml notation, so might not appear when viewing in html]

<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>
</groups>
</comps>

NB This is a partial template see http://svn.sourceforge.net/viewcvs.cgi/morphix/trunk/mmaker/templates/ for template examples.

Seems simple, doesn't it? The actual template for MorphingMorphix is quite a bit longer (and contains a package to start xfce4 at boot time), but it's very simple to specify which repositories you want to use, what Debian suite you want, what type of Morphix module you want to autobuild and naturally the packages you want. Currently, MMaker can only build base and main modules . A few tags might need some extra explaining:

<repository> - With this tag you define the Debian repository/repositories from which to build your module. 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 is default

<type> - mainmod, basemod. minimod-type templates are coming up (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, of which Morphix is derived from.

<arch> - the architecture for which you are building your module. 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 commandline 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 will exist in a directory in your /tmp. MMaker will output details of how to recompress it if necessary. We hope MMaker will be useful in letting Morphix work for you! References Module Maker Wiki page

Below is a quick overview on the layout of a template.

Chrooting a Main Module

One of the easiest ways to modify a MainModule is to extract the compressed filesystem then change the root directory to the extracted file system - chroot.

Once you have issued the chroot command it is just like you are running the compressed file system, rather than the current filesystem.

You can for example

  • apt-get install new-applications
  • Edit configuration files
  • Have fun ….

We will now extract the MainModule. This can take a while as ~800M is extracted. We started then dropped in to the MainModule root. Once we exit we re-compress the MainModule.

We will use the commands

isomorph --get main ./MyMorph.iso /tmp/
morphix-chroot /tmp/morphing-morphix.mod
isomorph --add main /tmp/morphing-morphix.mod ./MyMorph.iso ./tmp.iso
mv ./tmp.iso ./MyMorph.iso

Rebrand an ISO

This script Re-brands a Morphix CD image using a graphic file.

The following will be changed

  • Grub Titles
  • Grub Background
  • Username, Hostname
  • Boot-up message
  • Boot-up background
  • Window Manager Wallpaper

Any Graphic file will do. Rebrand.png, Rebrand.jpg or Rebrand.gif The name of the graphics file is important as the script takes Rebrand as the new title for the LiveCD.

We will use these commands

morphix-rebrand ./MyMorph.iso ./tmp.iso Rebrand.jpg
mv ./tmp.iso ./MyMorph.iso

Building a whole ISO from Scratch

See Building a LiveCD using two commands

Testing an iso using Qemu

The next Morph is not really a Morph. It is used to test other morphs. It is a common tool for Morphers to use.

Qemu is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation.

In short: Boot your LiveCD inside your current operating system. A little slower but faster than burning a cd and rebooting. Good for testing.

qemu -boot d -cdrom ./MyMorph.iso