< Day Day Up > |
Hack 99 Morph Morphix
The modular nature of Morphix that has made it so popular also makes it very easy for a user to create custom discs . Morphix [Hack #80] is a Knoppix-based distribution that has made many changes to the structure of Knoppix to make it more modular. These modules make it much easier to add and remove software for your own remastering . This hack takes a closer look at how Morphix is built, how it can be changed, and how you can have the modularity of Morphix make your life easier. If you want to skip the details and dive into making your first "morph," jump down to Section 9.7.2, below. 9.7.1 Structure of a Morphix Live CDA Morphix live CD has a number of unique directories:
One difference in these directories is the file types: the first three ( /base , /mainmod , and /minimod ) are compressed filesystems (modules); the last three are provided for extra flexibility. Morphix's modules can be compressed using a number of compression techniques, like cloop , squashfs , or zisofs . Of course, each of these directories has a special purpose, which are described below:
There are minimodule s for console-specific tools, Quake 3 Arena and Unreal Tournament 2003 demos, OpenOffice.org, Speedtouch USB modems, PHP4/Nanoweb/MySQL, and a whole range of others. Morphix offers preliminary scripts to automatically generate these minimodule s from Debian packages; however, this area is still under quite a lot of discussion and development. You can also do more down-to-earth changes using minimodule s. If you want to have different minimodule s containing different home directories for your live CDs, take a look at CD-Persistant , a minimodule that even allows you to burn your home directory directly to a running live CD using multisession CD-ROMs, or Xbroadcast , which attempts to locate remote XDMCP hosts on your local network. Needless to say, minimodule s offer an extreme amount of flexibility, maybe even too much. For this reason, the following three directories for applying changes to your live CD during boot time have become a part of Morphix over the last year. No more do you have to rebuild your compressed images for small changes.
9.7.2 Your First MorphNow that you know how a Morphix live CD can be structured, it is time to make a new live CD. Even if you skimmed over the last section, "morphing" isn't hard to start with. This first example is simple: it changes the default background of a live CD. There are plenty of scripts available to automate most or all of the process, but I won't use them here. Please note that you must be root for some of these commands. For this morph, you must change the contents of your CD-ROM ISO. So you must make sure you can access the files on it. Make a directory and mount the ISO: # mkdir /tmp/morphlight # mount -o loop MorphixCombined-LightGUI-0.4-1.iso /tmp/morphlight Alas, you can't directly modify the files on the ISO, so you must copy the files on the ISO to a new directory: # mkdir /tmp/mylivecd # cp -a /tmp/morphlight/* /tmp/mylivecd The background is located at /morphix/background.png . Instead of figuring out in which module it is located, use the /copy directory to copy your new background (located at ~/mybackground.png for this example) over the original one at boot time: # mkdir /tmp/mylivecd/copy/morphix # cp ~/mybackground.png /tmp/mylivecd/copy/morphix/background.png Now make a new CD-ROM ISO from the /tmp/mylivecd directory: # mkisofs -l -v -J -V " My New LiveCD " -r -b base/boot.img -c base/boot.cat -hide -rr -moved -o /tmp/mylivecd.iso /tmp/mylivecd Well, that's it! You can burn your ISO using your favorite CD-R burning tool, and you're done. One freshly baked live CD with your own background, coming right up: # cdrecord speed=8 dev=0,0,0 /tmp/mylivecd.iso Of course, this was a pretty simple morph. You can do quite amazing things using Morphix without remastering modules directly. For lots of step-by-step recipes and more elaborate documentation, take a look at the HOWTOs on http://www.morphix.org. |
< Day Day Up > |