Introduction > Documentation > HowTo Create A LiveCD

HowTo Create A LiveCD


Building a LiveCD based on Mandrakelinux 10.1 Official


 This step by step HowTo describes how you can master a LiveCD from an installed system. You should be familiar with: doing basic works on command line, setup additional software sources on a Mandrake system, using 'urpmi' to install and remove software.

 0. Mastering a LiveCD requires a minimum of 256 MB RAM and in addition a swap partition. 250 MB should be enough if you create a small LiveCD ( ~ 300 MB ), go for 2 GB if you are planning a bigger system.

 1. Install a clean Mandrakelinux 10.1 Official on one / partition. Don't forget the swap partition. Install the available official updates. Don't install nvidia or ati drivers.

 2. Keep your system simple, and: keep it small. Start with a used space of 800 - 900 MB, this is a full featured KDE system. 'df' is the command to control the used space on your harddrive. Take your time to uninstall (Mandrake Control Center) all unneeded software. A default Mandrake installation includes a lot of stuff that you can safely get rid off. And if urpmi complains about dependencies and wants to uninstall too much, you may want to experiment with: rpm -e --nodeps. That will erase single packages.
 Configure the 'look and feel' of your graphical environment. The LiveCD will look the same.
 Make sure that /etc, /home, /lib, /root, /var is not too big. Otherwise you'll be running out of RAM when starting the LiveCD. Examples: Don't put many (already compressed) video or music files into your home directory. Don't have two kernel versions (/lib) installed. Clean or uninstall your urpmi databases in /var/lib/urpmi.

 3. Add 'contrib' and 'main' to your urpmi software sources. Install the 'kernel 2.6.7 tmb' from 'contrib' on your system. (MCC) The default kernel 2.6.8 won't work on a LiveCD! Reboot with your new kernel, make sure you are running it: uname -r. Uninstall the default 2.6.8 kernel, again reboot.

 4. The next step is to install the mklivecd scripts that will build your .iso file. I've made an archive which contains: a working mklivecd.rpm (from cvs, 01.01.2005), the file install_any.pm and this HowTo. Download the archive here: livecd_101.tar.gz
 Unpack the archive to your home directory and install the rpm, using the urpmi command. This will take care of all dependencies and will download and install more stuff. You did setup your urpmi sources (contrib, main), hey?
 As root copy the file install_any.pm to /usr/lib/libDraKX

 If you want to include an installer into your LiveCD you also need the package livecd-utils.rpm. Get it here

 5. Clickup a console. Get root. Run: mklivecd --help
 The command to build your iso is as simple/enhanced as you want.
 Examples:
 # mklivecd myown.iso
 # mklivecd --verbose --resolution 800x600 --fstab=rw,auto --splash=no --keyboard=fr rainbow.iso
 The script takes care of compressing the files and building a bootable image, and will cleanup after it is done.
 Burn your iso. Have fun.

 6. If you are running into problems, please read the archives of the livecd-users mailinglist at berlios.de, or even better, join the list.

 7. Some notes on Kernel problems with Mandrake 10.1 OE. To build a LiveCD with the mklivecd scripts the kernel has to be patched with squashfs. The default Mandrake 10.1 kernel (2.6.8.1) has the wrong, not working patch! And the 2.6.8 kernel has broken append options! You can use the 2.6.7 tmb kernel from contrib. It's working fine. If you want a newer kernel version (2.6.9 or 2.6.10), you need to patch and compile your own kernel. More info on the users-list or on the irc channel #pclinuxos (efnet), where you can talk to the developers of the mklivecd scripts.

 8. When building your iso, you can specify a standard keyboard layout. Default is the US keyboard. Later on your LiveCD you can use a cheatcode (keyb=fr) to alter the layout. If you want an easy way to change the keyboard while running the LiveCD, you need to edit the file '/usr/lib/libDrakX/Xconfig/xfree.pm ', before building your iso. Lines 25 and 71, change the resp. 'keyboard' to 'kbd', that will load the correct keyboard driver.
_________________________________

Building a LiveCD with Mandrakelinux 10.0 OE


 Step 1
 * Install Mandrakelinux 10.0 Official on one / partition, 3 - 5 GB, that depends on your needs. Make sure you have enough RAM and/or SWAP. Example: I am building a ~300 MB iso off a 700 MB big installed system, got 256 MB RAM and a big SWAP partition (but 250 MB SWAP might be enough). Make sure you have the syslinux rpm installed: # urpmi syslinux
 Extract the file install_any.pm.gz from your first mdk install cd (/Mandrake/mdkinst/usr/bin/perl-install) to /usr/lib/libDrakX

 Step 2
 * Make your system as small as possible. You iso is limited to 700 MB, your system should not extend 1,8 GB. Better start with a pretty small installation.

 Step 3
 * Add contrib (for 10.0) to your urpmi sources.

 Step 4
 * Install the kernel-tmb-2.6.7-2.tmb.6mdk-1-1mdk.i586.rpm on your system. You can find the rpm on the *contrib 10.1* ftp mirrors.

 Step 5
 * Install the latest stable mklivecd scripts for 10.0, the version is 0.5.8-1mdk, get them here .
 The mklivecd rpm contains the scripts for building your livecd, the livecd-utils rpm is only needed if you want to implement a harddisk installation in your LiveCD. Use urpmi to install the rpms, it will take care of the dependencies, you have added contrib to your urpmi sources, don't you? And you might need CD 4, if you don't have it, just add also the /main ftp tree to your sources!

 Step 6
 Clickup a console. Get root. Run: mklivecd --help
 The command to build your iso is as simple/enhanced as you want.
 Examples:
 # mklivecd myown.iso
 # mklivecd --verbose --kernel 2.6.7-2.tmb.6mdk --resolution 800x600 --fstab=rw,auto --splash=no --keyboard=fr --usbhome rain.iso
 The script takes care of compressing the files and building a bootable image, and will cleanup after it is done.

 Step 7
 Burn your iso. Have fun. - Problems? Read the mailing list.
________________________________________

Mandrakelinux 9.2.: Make your own Linux Live CD


 Step 1
 Install a 'basic' Mandrake 9.2 - on a separate partition. Choose individual package selection, concentrate on one Desktop Environment, KDE or Gnome or a light one. Or install as the only OS on your PC, does not matter. You will need 'one' ~5 GB partition. And a swap partition, you can use your already existing swap. 250 MB is the minimum swap, it's ok, when you plan to create a small Live CD. More swap will speed up the creation process. Your RAM is also important, minimum 256 MB! Create one user with a password, and root of course. If you have a multi-boot box, tell the installer to write lilo to /, not to the mbr. Modify your lilo in your main install to call lilo in your new partition. Or do what you use to do in this case.

 Step 2
 Boot your fresh MDK. Run immediately menudrake, choose 'menustyle' - second choice: Mandrake Menu. Save it. Now you won't get the menu bug and you don't have to install all the updates.
 Get the following rpm's from a Mandrake 9.2 ftp/contrib mirror:
 - kernel-tmb-2.4.22.21.tmb.1mdk-1-1mdk.i586.rpm
 - busybox-1.00-0.4mdk.i586.rpm
 - cloop-utils-1.02-1mdk.i586.rpm

 Get the latest stable version of mklivecd- scripts (mklivecd-0.5.7-0.cvs.20031118.1mdk.noarch.rpm) here: developer.berlios.de Install the kernel on the new partition, using the softwaremanagement tool. Uninstall the old kernel. Reboot and make sure everything is ok. Install the rpms busybox, cloop and mklivecd on your new partition.

 Step 3
 - Remove all stuff using the Mandrake Control Center, that you don't need. Hints: python, gimp etc. Don't remove the gnome-libs, mdk config tools need them. Check in a terminal how big your used space is:
 # df
 Hint: clean /usr/share/doc and /usr/share/man and /usr/share/wallpapers (~200 MB)
 - Install additional stuff from contrib and plf etc.
 - You iso should have a maximum of 700 MB to fit on a cd. Your used space should be < 1,7 GB. The compression rate is ~ 41 %

 Step 4
 Make your desktop look nice. Configure everything - your live cd will look and behave almost exactly like your installed system. Don't forget to clean your browser cache, the cookies, your trash can, stuff in your home directory. Once again: # df

 Step 5
 Open a terminal, su to root :
 # mklivecd --help
 Here you'll find all options to run the script. Most simple is:
 # mklivecd name.iso (where 'name' is your choice)
 This will create an iso file in your current directory. This is what I am using:
 # mklivecd --verbose --keyboard=pt --fstab=rw,auto --splash=no livecd.iso
 
 Explanation:
 --verbose
 You can see in your console window, how the sript is working. Very nice!
 --keyboard=de_nodeadkeys
 Default is the US layout, so this is your keyboard for the LiveCD.
 --fstab=rw,auto
 Default creates the script a fstab without mounting the partitions on the hd. This option creates a fstab with read-write mounted partitions, Windows and Linux partitions, exception is NTFS (you have to mount it manually to an already set mount point)
 --splash=no
 This will create a live cd without the Mandrake bootsplash and the background while booting. I've set it this way to get rid of it. When you have your own bootsplash theme, and you want to use it, dont set this option. Default is with bootsplash.
 livecd.iso
 This is the name of the iso file, that the script creates. Your choice.

 There are many options you can use like: writing the iso to a different partition, excluding directories and files from the creation, using a different /tmp dir for the whole process. One of the most interesting is: you can install the script to your *main* OS and not into the new partition, so you would build the iso from 'outside'. Then you need to tell the script where it can find the 'root' directory of the system which will get compressed, for example:
 --root /mnt/spiel
 The mountpoint of course must exist, and the partition has to be mounted before running your script.
 How long does it take: on a Pentium 4, 2 Ghz with 256 MB RAM and a swap of 250 MB it took 7 minutes to create a 230 MB iso from a used space of ~600 MB.

 Step 6
 Burn the iso to a cd-rw or a cd-r. Or copy it to a different partition where you have your burning application.

 Step 7
 Boot your cd.

 Step 8: Add a grahical installer to your Live CD
 You need to learn:
 - how to work with CVS versions
 - how to work with sources and build them
 - to figure out which additional software und which kernel is required to use this version
 You will find the information usually in the archives of the mailing lists.
______________________________

--chris, mcnlive.org