a HOWTO for creating a live CD
This commit is contained in:
parent
4c6b2cd4d3
commit
84bcac3e0d
|
@ -44,6 +44,8 @@ environment</a></li>
|
|||
<li><a href="release.html">release process</a></li>
|
||||
<li><a href="studioLocalization.html">localizing LS Studio</a></li>
|
||||
<li><a href="preferences.html">definitions of shared station/user preferences</a></li>
|
||||
<li>HOWTO <a href="repositoryCdHowto.html">create a repository CD</a></li>
|
||||
<li>HOWTO <a href="liveCdHowto.html">create a live CD</a></li>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Generated documentation</h1>
|
||||
|
|
|
@ -0,0 +1,292 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>Campcaster live CD creation process documentation</title>
|
||||
<meta content="$Author$" name="author">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Preface</h1>
|
||||
This document is part of the <a href="http://campcaster.campware.org/">Campcaster</a>
|
||||
project, Copyright © 2004 <a href="http://www.mdlf.org/">Media
|
||||
Development Loan Fund</a>, under the GNU <a
|
||||
href="http://www.gnu.org/licenses/gpl.html">GPL</a>.<br>
|
||||
<ul>
|
||||
<li>Author: $Author$</li>
|
||||
<li>Version: $Revision$</li>
|
||||
<li>Location: $URL$</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>Scope</h1>
|
||||
This document describes the process of creating a custom Ubuntu live CD
|
||||
with the Campcaster packages added.
|
||||
|
||||
|
||||
<h1>Acknowledgement</h1>
|
||||
|
||||
The following HOWTO has been copied from Alberto Turelli's HOWTO at
|
||||
<a href="http://www.atworkonline.it/~bibe/ubuntu/custom-livecd.htm">http://www.atworkonline.it/~bibe/ubuntu/custom-livecd.htm</a>, with some modifications.
|
||||
|
||||
|
||||
<h1>Introduction</h1>
|
||||
<p>
|
||||
A live CD is a bootable CD with a complete Linux system on it. A live CD
|
||||
which contains the Campcaster packages can be used to demo Campcaster
|
||||
without having to install anything on the hard drive.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It can also be used to create a new, complete Ubuntu system on the hard drive,
|
||||
with Campcaster automatically installed on it.
|
||||
</p>
|
||||
|
||||
The live CD creation process consists of the following steps:<br>
|
||||
<ol>
|
||||
<li>Copy the live CD</li>
|
||||
<li>Free some space</li>
|
||||
<li>Mount the compressed filesystem</li>
|
||||
<li>Create an image for the modified filesystem</li>
|
||||
<li>Copy the compressed filesystem</li>
|
||||
<li>Chroot to, and tweak the system</li>
|
||||
<li>Finish the modified filesystem</li>
|
||||
<li>Build the modified compressed filesystem</li>
|
||||
<li>Create the new live CD</li>
|
||||
</ol>
|
||||
|
||||
|
||||
<h1>Notes</h1>
|
||||
|
||||
<p>
|
||||
The live CD produced with this HOWTO (as of revision 3055) has the following issues:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>It is very slow if your computer has less than 1 GB of memory.</li>
|
||||
<li>Installing on the hard drive does not work well. There is an error message:
|
||||
<pre>
|
||||
Error removing campcaster-station.
|
||||
</pre>
|
||||
during the installation process, and the campcaster packages are not installed on the finished system.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>The steps in detail</h1>
|
||||
|
||||
<h2>1. Copy the live CD</h2>
|
||||
Export a shell variable (say, <i>WORK</i>) pointing to a working directory somewhere on your disk (say, <i>~/mylivecd</i>), so you can use this page as a copy-and-paste howto.
|
||||
<pre>
|
||||
$ export WORK=~/mylivecd
|
||||
$ mkdir -p $WORK
|
||||
</pre>
|
||||
|
||||
Mount a (K)Ubuntu Linux Live CD
|
||||
<pre>
|
||||
$ mount -t iso9660 /dev/hdc /cdrom
|
||||
</pre>
|
||||
or the ISO image:
|
||||
<pre>
|
||||
$ sudo mount -t iso9660 -o loop /path/to/dapper-live-i386.iso /cdrom
|
||||
</pre>
|
||||
|
||||
Then copy the content of the disk into a new directory, set the write permission on the new directory's content, and unmount the Live CD (or the ISO image):
|
||||
<pre>
|
||||
$ cd $WORK
|
||||
$ mkdir ubuntu-livecd
|
||||
$ cp -a /cdrom/. ubuntu-livecd
|
||||
$ chmod -R u+w ubuntu-livecd
|
||||
$ sudo umount /cdrom
|
||||
</pre>
|
||||
The directory contains about 690 MB.
|
||||
You need a copy, because it will be modified.
|
||||
|
||||
|
||||
<h2>2. Free some space</h2>
|
||||
The copy of the Live CD has various subdirectories.
|
||||
I removed one of them, containing some Windows applications.
|
||||
<pre>
|
||||
$ rm -rf $WORK/ubuntu-livecd/programs
|
||||
</pre>
|
||||
The Live CD works fine without these programs.
|
||||
That saves about 30 MB.
|
||||
|
||||
|
||||
<h2>3. Mount the compressed filesystem</h2>
|
||||
|
||||
<p>
|
||||
The visible content of the Live CD is mainly used for booting.
|
||||
(K)Ubuntu Linux itself is contained in a compressed filesystem image in <i>$WORK/ubuntu-livecd/casper/filesystem.squashfs</i>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To decompress and read this file, you need the squashfs module (installed by default on Ubuntu Dapper), and the <code>squashfs-tools</code> package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Finally loopback mount the compressed filesystem on a new mount point, say <i>$WORK/old</i>:
|
||||
|
||||
<pre>
|
||||
$ mkdir $WORK/old
|
||||
$ sudo mount -t squashfs -o loop,ro $WORK/ubuntu-livecd/casper/filesystem.squashfs $WORK/old
|
||||
</pre>
|
||||
|
||||
Have a look at <i>$WORK/old</i>.
|
||||
You should see the root of the (K)Ubuntu filesystem.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>4. Create an image for the modified compressed filesystem</h2>
|
||||
|
||||
This requires abount 2.5 GB of disk space. Make an empty file of 2.5 GB size:
|
||||
<pre>
|
||||
$ sudo dd if=/dev/zero of=$WORK/ubuntu-fs.ext2 bs=1M count=2500
|
||||
</pre>
|
||||
Format the file with an Ext2 filesystem:
|
||||
|
||||
<pre>
|
||||
$ sudo mke2fs $WORK/ubuntu-fs.ext2
|
||||
</pre>
|
||||
mke2fs will warn you that <i>ubuntu-fs.ext2</i> a not a real device.
|
||||
This is ok, proceed.
|
||||
|
||||
<br />
|
||||
Now loopback mount the freshly formatted filesystem on a new mount point, say <i>$WORK/new</i>:
|
||||
<pre>
|
||||
$ mkdir $WORK/new
|
||||
$ sudo mount -o loop $WORK/ubuntu-fs.ext2 $WORK/new
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>5. Copy the compressed filesystem</h2>
|
||||
|
||||
To modify the (K)Ubuntu filesystem, we need to decompress and copy it:
|
||||
<pre>
|
||||
$ sudo cp -a $WORK/old/. $WORK/new
|
||||
</pre>
|
||||
|
||||
We can umount <i>$WORK/old</i> now, because we have copies of all the data we need:
|
||||
<pre>
|
||||
$ sudo umount $WORK/old
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>6. Chroot to, and tweak the system</h2>
|
||||
|
||||
<p>
|
||||
Now it's time to fine-tune the system to your needs, chrooting into the new system and using the standard Debian/Ubuntu tools.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, prepare the <i>/proc</i> filesystem and create the <i>/etc/resolv.conf</i> and <i>/etc/hosts</i> files in the copied filesystem. Then stop some services to make sure their ports are available in the chrooted system. Finally, chroot into you live CD environment:
|
||||
<pre>
|
||||
$ sudo mount -t proc -o bind /proc $WORK/new/proc
|
||||
$ sudo cp /etc/resolv.conf /etc/hosts $WORK/new/etc/
|
||||
$ sudo /etc/init.d/campcaster-scheduler stop
|
||||
$ sudo /etc/init.d/postgresql-8.1 stop
|
||||
$ sudo /etc/init.d/apache2 stop
|
||||
$ sudo chroot $WORK/new /bin/bash
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now you are at the root of the (K)Ubuntu filesystem.
|
||||
Tweak the system as you like:
|
||||
<pre>
|
||||
# vi /etc/apt/sources.list # (Enable the universe and campware repositories.)
|
||||
# apt-get update
|
||||
# apt-get install campcaster-studio
|
||||
# apt-get clean
|
||||
# vim /opt/campcaster/etc/campcaster-scheduler.xml # (Change the sound
|
||||
# vim /opt/campcaster/etc/campcaster-studio.xml # devices to "default".)
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Stop the services started by the package installer, and leave the (K)Ubuntu filesystem:
|
||||
<pre>
|
||||
# /etc/init.d/campcaster-scheduler stop
|
||||
# /etc/init.d/postgresql-8.1 stop
|
||||
# /etc/init.d/apache2 stop
|
||||
# exit
|
||||
$ sudo umount $WORK/new/proc
|
||||
$ sudo rm $WORK/new/etc/resolv.conf $WORK/new/etc/hosts
|
||||
</pre>
|
||||
|
||||
You are back at your own system.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>7. Finish the modified filesystem</h2>
|
||||
|
||||
First, update the manifest file to reflect the modified packages:
|
||||
<pre>
|
||||
$ sudo chroot $WORK/new dpkg-query -W --showformat='${Package} ${Version}\n' \
|
||||
> $WORK/ubuntu-livecd/casper/filesystem.manifest
|
||||
</pre>
|
||||
|
||||
Next, clear the free disk space.
|
||||
Even if some Debian packages were removed, the unused space on the modified filesystem still holds the content.
|
||||
Fill all free space on the modified filesystem with zeroes (this will eventually fail with "no space left"), then remove the zero file:
|
||||
<pre>
|
||||
$ sudo dd if=/dev/zero of=$WORK/new/dummyfile
|
||||
$ sudo rm $WORK/new/dummyfile
|
||||
</pre>
|
||||
|
||||
Now, all unused data blocks are filled with zeroes and compress to almost nothing.
|
||||
|
||||
|
||||
<h2>8. Build the modified compressed filesystem</h2>
|
||||
|
||||
Re-generate the modified filesystem:
|
||||
<pre>
|
||||
$ sudo rm $WORK/ubuntu-livecd/casper/filesystem.squashfs
|
||||
$ cd $WORK/new
|
||||
$ sudo mksquashfs . $WORK/ubuntu-livecd/casper/filesystem.squashfs
|
||||
</pre>
|
||||
This is the most time-consuming step.
|
||||
|
||||
Umount <i>$WORK/new</i> now, we are done:
|
||||
<pre>
|
||||
$ cd $WORK
|
||||
$ sudo umount $WORK/new
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>9. Create the new live CD</h2>
|
||||
|
||||
On the Live-CD there is a MD5 hash.
|
||||
Adjust it to the modified content of the CD:
|
||||
<pre>
|
||||
$ cd $WORK/ubuntu-livecd
|
||||
$ sudo find . -type f -print0 |xargs -0 md5sum |sudo tee md5sum.txt
|
||||
</pre>
|
||||
|
||||
Now build the ISO image file, ubuntu-new.iso:
|
||||
<pre>
|
||||
$ cd $WORK
|
||||
$ sudo mkisofs \
|
||||
-o Ubuntu+Campcaster.iso \
|
||||
-b isolinux/isolinux.bin \
|
||||
-c isolinux/boot.cat \
|
||||
-no-emul-boot \
|
||||
-boot-load-size 4 \
|
||||
-boot-info-table \
|
||||
-r \
|
||||
-V "Ubuntu+Campcaster Live CD" \
|
||||
-cache-inodes \
|
||||
-J \
|
||||
-l \
|
||||
ubuntu-livecd
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Burn Ubuntu+Campcaster.iso to a disk and you are done!
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For testing, a virtual PC like <i>qemu</i> is great.
|
||||
</p>
|
||||
|
||||
<br />
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue