Advertisment

Multiboot Live DVDs

author-image
PCQ Bureau
New Update

A couple of months back we covered how to build your own Fedora-based Live

CDs using Revisor. And some of you must have tried and built quite a few

different live distros based on Fedora. So this month we thought of telling you

how to combine and preserve all your Fedora based live distros in one single

dual or single layer multiboot DVD. Way back in 2004 we did an article on

building a multiboot DVD, which was a pioneering piece on this subject. Such was

the complexity of the process that it took us 4 pages to explain. This time it's

going to be easy. No, we are not going to use any graphical tool for this,

because no such tool is available yet. But it would still be easy as all distros

are going to be based on Fedora and as all the distros share a similar directory

structure and booting process, it's going to be easier than building a multiboot

DVD with live CDs based on different distros. Let's see how to do it.

Advertisment

Direct Hit!

Applies To: IT managers



USP: Use the power of Live OSes to
enhance portability



Primary Link: None


Google Keywords: Live OSes

Pre-requisites



In this case the pre-requisites are very minimal. All you need are live

distros built on Fedora versions (8 and later) and a Linux machine; just make

sure that their total size doesn't exceed 8.0 GB if you are using a dual layer

DVD or 4.0 GB if you are using a single layer DVD. A Fedora 10 machine will be

preferred as the build machine as we ran our tests on it! But technically it

should work with any standard Linux distro. The machine could be based on any

hardware platform but should have atleast 20GB hard disk space.

Getting started



To begin with first create a folder called Buildroot by running the following
command:

Advertisment
This his how your

Buildroot/LiveOS folder will look like once you have run commands given

under 'Creating the Build Tree' section.

#mkdir Buildroot

Now create one folder for each live CD you have. And name them as dist1,

Dist2,.. etc. If you have ISO images of the live distros then mount them one by

one on the newly created folders or if you have CDs of the live distros then

copy all the files to the folders. For mounting the ISOs, the command will be

similar to this:

Advertisment

#mount —o loop /'path-of —iso/isofile.img' /dist1

And if you have CDs of the distros, then mount the CDs and run the following

command to copy them.

#cp —rf /media/cdrom /dist1

Advertisment

Creating the Build Tree



Now you have to create a folder structure inside the Buildroot folder. For

this copy the isolinux folder from any of the distros to the buildroot folder

and create a folder called LiveOS. You can do so by running the following

commands:

To configure the

Boot Loader, open the isolinux.cfg file from /Buildroot/isolinux folder and

modify the code as given in the 'Configuring Boot Loader' section.

#cp —rf /dist1/isolinux /Buildroot



#mkdir /Buildroot/LiveOS

Advertisment

Now go to the first distro by running cd dist1 and cd to the LiveOS folder.

Here you will see two files: osmin.img and squashfs.img. These two files contain

the file system of the Live OS for the distro 1. Now copy these two files to

Buildroot/LiveOS but make sure you have to give it a different name because in

all distros you will find files with the same name. You have to copy all of them

to the Buildroot/LiveOS folder. While renaming it, make sure you don't change

the number of characters in the file name. We will call the osmin.img of distro

one as min01.img and squashfs.img as squash01.img. and similarly for distro 2 it

will be min02.img and squash02.img and so on. The command you will run to do so

will be similar to this:

#cd /distro1/LiveOS



#cp osmin /Buildroot/LiveOS/min01.img


#cp squashfs.img /Buildroot/LiveOS/squash01.img

Modifying the Initrd



Now as your Folder structure is ready, modify and create an initrd for each
distro which will be called by the bootloader and then which will call the

correct Squash FS. To do so, first create a new folder call /initbuild. Now copy

the initrd image file from /Buildroot/isolinux folder to this newly created

folder. You can do so by running the following command:

Advertisment
After your Folder

structure is ready, you need to modify and create an initrd for each distro

which will be called by the bootloader.

#cp /Buildroot/isolinux/initrd0.img /initbuild/

Now extract the initrd file by running the following command. It's actually a

gziped file so first you have to rename it and then unzip.

Advertisment

#mv initrd0.img initrd0.gz



#gunzip initrd0.gz

Now this will generate a cpio zipped file. Extract it by running the

following command:

#cpio -iv < initrd0

Open the file called sbin/real-init by using your text editor. Once the file

is open search for a string 'if < -e /sysroot/LiveOS/squashfs.img'. now replace

squashfs.img with squash01.img and just next to this line there will be another

line similar to 'SQUASHED="/sysroot/ LiveOS/squashfs.img.”' Here change

squashfs.img squash01.img.

Now search for a line 'if < -e /sysroot/LiveOS/osmin.img' and change

osmin.img to min01.img. Again similar to the last step, just below this line you

will find one more instance of osmin.img. Change it as well to min01.img. Once

this is done save and exit from this file. Now come to the initbuild folder and

recreate the initrd file. But this time give it a new name. Something like

initrd1.img, so that it represents the distr01, squash01 and min01. To recreate

this file you have to first create the cpio file of this directory structure and

then zip it with gzip. Following is a single command which will do the needful:

#find . -print | cpio -o |gzip > initrd1.gz

But before running this command don't forget to remove the existing initrd0

file else your new initrd file will unnecessary become bigger in size.

Once this is done move this initrd1.gz file to /Buildroot/isolinux folder.

Now, repeat this process for each distro and create one initrd file for each

distro. So you have four distros in your multiboot with squashfs image names:

squash01.img, squash02.img, squash03.img and squash04.img, then you have to

create four initrd files similar to initrd1.img, initrd2.img, initrd3.img and

initrd4.img; one for each distro with the correct names of the squashfs and

osmin images in the real-init file. Once you are done with all initrds, copy all

of them to /Buildroot/isolinux folder.

Configuring Boot Loader



Now configure the boot loader so that it can show you the list of all the

Linux distros you have in your multiboot DVD and when you select one, the system

should boot from it. To do so open the isolinux.cfg file from /Buildroot/isolinux

folder.

In the window, copy the following lines as many number of times as the

distros you have. So let's say you have four distros, then copy all four lines,

four times in the same file.

Advertisment