Development/Packaging/Tools/mklivecd
From Mandriva Community Wiki
NOTE: mklivecd has seen superseded by draklive.
Contents |
[edit] Introduction
As we know, there are many Linux live cd distributions. Well known is Knoppix which is based on the Debian distribution. Knoppix have famous hardware detection and use cloop (which is described later). Another good livecd distribution (from reviews) is Slackware Live CD. Gentoo developers created a live cd too. SuSE company have a product which he called SuSE Live-Eval. This can be freely downloaded from his ftp server. BBC-Linux is a live Linux distribution which is suitable for booting from minicd (small cd media, 200MB), optionally with business card format. And of course, there is a MiniCD project which is based on Mandriva Linux. Unfortunatelly, latest iso is too old, but...
[edit] cloop
Cloop is the acronym for compressed loopback filesystem and this explains what this is doing. This kernel module is developed under the Debian distribution and it is used by Knoppix, amongst others. Usage of this module is easy:
# insmod cloop file=image_with_compressed_filesystem.clp # mount /dev/cloop /mnt/bla
Cloop support was added into the official Mandriva kernel starting with version 2.4.22-0.5mdk (aug 15 2003 - Juan Quintela).
Userspace tools for manipulation of compressed images was called cloop-utils. This package was added into contrib 15 sep 2003 - Buchan Milne).
[edit] mklivecd script
The mklivecd script is developed by Jaco Greeff as a product of his own project MiniCD. mklivecd is a script, which generates a cloop image and adds some stuff which is needed to boot from cd. mklivecd needed a busybox binary, which is used in the initial initrd image before loading the system from cd.
[edit] Real usage
[edit] Preliminary tasks
At first, we need some working Mandriva installation. There are three ways what we can make it:
- make a minimal Mandriva installation on a separate partition
- instal the minimally needed packages into chroot
- use your own working linux system
I prefer the first method which is IMHO better than others. A second method is a little described on the page ChrootHowTo. The third method has a limitation regarding cd media size, so if you have a bigger linux instalation this is not usable.
When you follow the first or second method, after installation you can optionally define cooker and contrib sources (with the urpmi.addmedia command) and install packages that you want. Don't forget to install the mklivecd package, which requires other packages (busybox, cloop-utils, mkisofs) and with urpmi it can be installed altogether in one step.
[edit] Create a iso image
Before iso creation you must have real memory which corresponds with the size of your installation that can be used. This can be done by adding some extra swap space. As swap you cau use a file too, but the preferred way is to create an extra partition. After this you must turn on this swapspace with the swapon command.
If the system is prepared, then we can create a bootable iso image. At first, check how mklivecd works:
# mklivecd + Using /var/tmp as temporary directory. usage: mklivecd [--version] [--verbose] [--exclude-dir=<excludes>] [--tmpdir=<tmpdir>] [--root=<rootdir>] [--cloop=<image>] <livecd-image> <kernel-version> (ex: mklivecd /tmp/livecd-2.4.22-3mdk.iso 2.4.22-3mdk)
As we can see there are only two mandatory parameters: name of the iso image and exact version of the kernel that we want to use for our livecd. If we provide this, the scripts start to create our bootable iso, which we can find in livecd-image. Of course, you must have free space for a temporary directory and space for cloop and the final iso image.
If the iso image is created you can burn it and boot from this cd.
[edit] Future
With that we can create a Mandriva Linux based live cd distribution, but I don't know if we need it. There is much work to be done beforehand, mainly i18n support etc. But I think if we start testing and using mklivecd we can make and release it soon.
[edit] Comments
There is space for your comments :)
LuisMenina: It can be good to have this kind of live CD for a (ubuntu|GNOME)-like daily CD. It allows more testing for those who don't want to use cooker on their machine, but want to help debugging MandrivaLinux releases. Tests can therefore start sooner.