<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=3qdesigns123</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=3qdesigns123"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/3qdesigns123"/>
	<updated>2026-05-14T12:15:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_OpenVZ_LiveCD_based_on_Centos_4.4&amp;diff=9036</id>
		<title>Creating OpenVZ LiveCD based on Centos 4.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_OpenVZ_LiveCD_based_on_Centos_4.4&amp;diff=9036"/>
		<updated>2010-08-26T05:28:51Z</updated>

		<summary type="html">&lt;p&gt;3qdesigns123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is a step by step guide explaining how to add OpenVZ functionality to Centos 4.4 LiveCD.&lt;br /&gt;
As a result, you will have a LiveCD, that can boot in various OpenVZ kernels (rhel4-2.6.9, 2.6.18,&lt;br /&gt;
rhel5-2.6.18, 2.6.20) and in original CentOS kernel also. After booting from the CD, you will be able &lt;br /&gt;
to create [[VE]]s, start them, enter them - i.e. perform [[Getting started with OpenVZ live CD | common OpenVZ activity]].&lt;br /&gt;
&lt;br /&gt;
CentOS 5 LiveCD is already announced and as soon as it will be available we'll update the article.&lt;br /&gt;
&lt;br /&gt;
== General actions ==&lt;br /&gt;
It is quite easy to add OpenVZ functionality to existent LiveCD. The most difficult work is already done&lt;br /&gt;
by the original LiveCD creators. But it requires pretty much hand job. Probably some day some good guy will&lt;br /&gt;
automatize this process. ;)&lt;br /&gt;
&lt;br /&gt;
Actually you need to accomplish the following general actions - everything else is only technical details:&lt;br /&gt;
* Get a copy of CentOS 4.4 LiveCD image &lt;br /&gt;
* Use &amp;lt;tt&amp;gt;unsquashfs&amp;lt;/tt&amp;gt; tool to extract the contents of *.mo files, located on the image&lt;br /&gt;
* Construct '''booted''' LiveCD root filesystem from extracted files&lt;br /&gt;
* Create OpenVZ kernel RPM-packages  with &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; support&lt;br /&gt;
* Compile &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; kernel modules against OpenVZ kernels&lt;br /&gt;
* Get OpenVZ tools RPM-packages: vzctl, vzquota, vzpkg, etc. Get template metadatas and precreated templates&lt;br /&gt;
* Remove some RPM-packages from '''booted''' LiveCD root filesystem (conflicting with OpenVZ kernel packages and redundant packages - to free some disk space)&lt;br /&gt;
* Install OpenVZ kernels, tools and templates in '''booted''' LiveCD root filesystem&lt;br /&gt;
* Using &amp;lt;tt&amp;gt;mksquashfs&amp;lt;/tt&amp;gt; tool compress '''booted''' CD root filesystem&lt;br /&gt;
* Modify initrd image: add there kernel modules for OpenVZ kernels&lt;br /&gt;
* Introduce small modifications to isolinux configuration file&lt;br /&gt;
* Create new iso image&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
This part contains detailed description of LiveCD creation. I've removed the output of some&lt;br /&gt;
commands in order to simplify the reading.&lt;br /&gt;
&lt;br /&gt;
Note: before proceed with commands below, one needs to disable SE Linux on the host, otherwise rpm operations &lt;br /&gt;
in cdroot-ed environment described later on will fail due to inability to restore security file context. So, please,&lt;br /&gt;
do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setenforce 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will put SE linux in so-called 'permissive' mode, where all the blockers will be substituted by warnings.&lt;br /&gt;
If you wanna get rid of the warnings (rather annoying), the only way to do is to edit &amp;lt;tt&amp;gt;/etc/sysconfig/selinux&amp;lt;/tt&amp;gt;&lt;br /&gt;
to read &amp;lt;tt&amp;gt;SELINUX=disabled&amp;lt;/tt&amp;gt; and then reboot the host.&lt;br /&gt;
&lt;br /&gt;
=== Creating booted LiveCD root filesystem ===&lt;br /&gt;
Create a directory, that will be our &amp;quot;workbench&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd ~&lt;br /&gt;
# mkdir workbench&lt;br /&gt;
# cd workbench&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First of all we need some raw material - CentOS 4.4 LiveCD image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# wget http://mirror.nsc.liu.se/CentOS/4.4/isos/i386/CentOS-4.4-i386-LiveCD.iso&lt;br /&gt;
# wget http://mirror.nsc.liu.se/CentOS/4.4/isos/i386/md5sum.livecd&lt;br /&gt;
# md5sum --check md5sum.livecd &lt;br /&gt;
CentOS-4.4-i386-LiveCD.iso: OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the contents of CD to the directory, where we will form the OpenVZ LiveCD filesystem.&lt;br /&gt;
I named this directory &amp;quot;ovz-livecd&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir ovz-livecd&lt;br /&gt;
# mkdir mount&lt;br /&gt;
# mount -o loop -t iso9660 CentOS-4.4-i386-LiveCD.iso mount/&lt;br /&gt;
# cp -a mount/* ovz-livecd/&lt;br /&gt;
# umount mount&lt;br /&gt;
# rm -rf mount&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see, that &amp;lt;tt&amp;gt;ovz-livecd/base/&amp;lt;/tt&amp;gt; directory owns several *.mo files - images of squashfs filesystem,&lt;br /&gt;
and each image holds one directory of '''booted''' LiveCD root filesystem: &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;usr&amp;lt;/tt&amp;gt; and so on:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ls -1 ovz-livecd/base&lt;br /&gt;
bin.mo etc.mo lib.mo root.mo sbin.mo usr.mo var.mo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to decompress these images we need &amp;lt;tt&amp;gt;unsquashfs&amp;lt;/tt&amp;gt; tool. &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; source archive contains&lt;br /&gt;
patches for various kernel versions (to be able to mount &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt;) and user-space tools for compressing usual filesytem into &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; filesystem and for decompressing it back. Well, we don't need kernel patches right now (but we will need them later), we only want to install &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; user-space tools.&lt;br /&gt;
Here is '''an important''' note. We want, our LiveCD to be able to boot original Centos 4.4 kernel. This original kernel doesn't support&lt;br /&gt;
&amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; of version &amp;lt;tt&amp;gt;3&amp;lt;/tt&amp;gt;. Consequently we use &amp;lt;tt&amp;gt;sqashfs2.2-r2&amp;lt;/tt&amp;gt; for &amp;lt;tt&amp;gt;mksquasfs&amp;lt;/tt&amp;gt; tool, but for &amp;lt;tt&amp;gt;unsquashfs&amp;lt;/tt&amp;gt; tool and later for compiling fresh OpenVZ kernels with &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; support we use &amp;lt;tt&amp;gt;sqashfs3.2-r2&amp;lt;/tt&amp;gt; sources/patches, because they are back compatible with &amp;lt;tt&amp;gt;sqashfs v2&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# wget http://belnet.dl.sourceforge.net/sourceforge/squashfs/squashfs2.2-r2.tar.gz&lt;br /&gt;
# tar xzf squashfs2.2-r2.tar.gz&lt;br /&gt;
# cd squashfs2.2-r2/squashfs-tools/&lt;br /&gt;
# make&lt;br /&gt;
cc mksquashfs.o read_fs.o sort.o -lz -o mksquashfs&lt;br /&gt;
# cp mksquashfs /usr/bin/&lt;br /&gt;
&lt;br /&gt;
# cd -&lt;br /&gt;
# wget http://belnet.dl.sourceforge.net/sourceforge/squashfs/squashfs3.2-r2.tar.gz&lt;br /&gt;
# tar xzf squashfs3.2-r2.tar.gz&lt;br /&gt;
# cd squashfs3.2-r2/squashfs-tools/&lt;br /&gt;
# make&lt;br /&gt;
cc mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o mksquashfs&lt;br /&gt;
cc unsquashfs.o -lz -o unsquashfs&lt;br /&gt;
# cp unsquashfs /usr/bin/&lt;br /&gt;
# cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Well, having the intruments in hand, why not extract the images? Create a directory, called &amp;lt;tt&amp;gt;livecd-root&amp;lt;/tt&amp;gt;,&lt;br /&gt;
that will store the root filesystem of '''booted''' LiveCD. I.e. it will contain &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc&amp;lt;/tt&amp;gt; and other directories, which you will see after booting the LiveCD. Unfortunately &amp;lt;tt&amp;gt;unsquashfs&amp;lt;/tt&amp;gt;&lt;br /&gt;
tool is not very convenient, and I found only this way to use it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir livecd-root&lt;br /&gt;
&lt;br /&gt;
# for f in bin etc lib root sbin usr var; do \&lt;br /&gt;
    unsquashfs ovz-livecd/base/$f.mo; \&lt;br /&gt;
    mv squashfs-root/$f/ livecd-root; \&lt;br /&gt;
    rm -rf squashfs-root; \&lt;br /&gt;
  done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be patient, this will take a few minutes.&lt;br /&gt;
&lt;br /&gt;
Yet we have nearly complete root filesystem of '''booted''' LiveCD in &amp;lt;tt&amp;gt;livecd-root&amp;lt;/tt&amp;gt; directory. However some things&lt;br /&gt;
are missing, and I guess you know what are they: &amp;lt;tt&amp;gt;/dev&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/proc&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/sys&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/tmp&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/boot&amp;lt;/tt&amp;gt; directories. We need them, because some tools (&amp;lt;tt&amp;gt;rpm&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;, ...) will not work without them in chrooted environment later.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd livecd-root&lt;br /&gt;
# mkdir dev&lt;br /&gt;
# cp -a /dev/* dev/&lt;br /&gt;
# mkdir proc&lt;br /&gt;
# mount -t proc proc proc/&lt;br /&gt;
# mkdir sys&lt;br /&gt;
# mount -t sysfs sysfs sys/&lt;br /&gt;
# mkdir tmp&lt;br /&gt;
# mkdir boot&lt;br /&gt;
# cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's it. We have '''bootstrapped''' LiveCD root filesystem in &amp;lt;tt&amp;gt;livecd-root&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
Now we can &amp;lt;tt&amp;gt;chroot&amp;lt;/tt&amp;gt; in this directory and install all needed packages. But what&lt;br /&gt;
packages do we need?&lt;br /&gt;
* OpenVZ kernels&lt;br /&gt;
* OpenVZ tools: vzctl, vzquota, vzpkg, vzrpm43, vzrpm44, vzyum&lt;br /&gt;
* OpenVZ template metadatas: centos-4, fc-3, fc4 and fc-5&lt;br /&gt;
* Some OpenVZ precreated templates&lt;br /&gt;
* Some CentOS tool updates: sqlite package&lt;br /&gt;
Tools and templates related packages can be simply downloaded and installed.&lt;br /&gt;
But it is not so easy with kernel. Usual OpenVZ kernel won't work: it doesn't&lt;br /&gt;
support &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt;. The next chapter explains how to create RPM-package with&lt;br /&gt;
OpenVZ kernel, that supports &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building OpenVZ kernels ===&lt;br /&gt;
Let's consider, how to build &amp;lt;tt&amp;gt;2.6.18&amp;lt;/tt&amp;gt; OpenVZ kernel RPM-package with &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; support.&lt;br /&gt;
First  download and install OpenVZ source RPM:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# wget http://download.openvz.org/kernel/branches/2.6.18/028stab035.1/kernel-2.6.18-ovz028stab035.1.src.rpm&lt;br /&gt;
# rpm -ivh kernel-2.6.18-ovz028stab035.1.src.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; sources contain the patch against &amp;lt;tt&amp;gt;2.6.18&amp;lt;/tt&amp;gt;. Let's copy this patch to RPM build directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp squashfs3.2-r2/kernel-patches/linux-2.6.18/squashfs3.2-patch /usr/src/redhat/SOURCES/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we need to modify the spec-file (&amp;lt;tt&amp;gt;/usr/src/redhat/SPECS/kernel-ovz.spec&amp;lt;/tt&amp;gt;) in order to add &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; patch to build process. Below are the changes you should introduce in diff format.&lt;br /&gt;
The meaning of changes is transparent: firstly, do not build UP, enterprise and debug kernels (our LiveCD will be&lt;br /&gt;
based on SMP kernel) and secondly, apply &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; patch before compilation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- kernel-ovz.spec.orig        2007-06-09 11:40:15.000000000 +0400&lt;br /&gt;
+++ kernel-ovz.spec     2007-06-28 17:42:41.000000000 +0400&lt;br /&gt;
@@ -5,13 +5,13 @@ Summary: The Linux kernel (the core of t&lt;br /&gt;
&lt;br /&gt;
 # normal/debug/debuginfo&lt;br /&gt;
 %define buildnormal 1&lt;br /&gt;
-%define builddebug 1&lt;br /&gt;
+%define builddebug 0&lt;br /&gt;
 %define builddebuginfo 0&lt;br /&gt;
&lt;br /&gt;
 # kernels we want to build&lt;br /&gt;
-%define buildup 1&lt;br /&gt;
+%define buildup 0&lt;br /&gt;
 %define buildsmp 1&lt;br /&gt;
-%define buildenterprise 1&lt;br /&gt;
+%define buildenterprise 0&lt;br /&gt;
 %define buildentnosplit 0&lt;br /&gt;
&lt;br /&gt;
 # versions&lt;br /&gt;
@@ -161,6 +161,9 @@ Patch2104: linux-2.6.18-drbd-0.7.22-0.8.&lt;br /&gt;
 Patch2105: linux-2.6.18-drbd-8.0.0-8.0.2.patch&lt;br /&gt;
 Patch2106: linux-2.6.18-drbd-8.0.2-8.0.3.patch&lt;br /&gt;
&lt;br /&gt;
+# squashfs3.2-patch&lt;br /&gt;
+Patch2107: squashfs3.2-patch&lt;br /&gt;
+&lt;br /&gt;
 # ----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root&lt;br /&gt;
@@ -318,6 +321,8 @@ cd linux-%{kversion}&lt;br /&gt;
 %patch2105 -p1&lt;br /&gt;
 %patch2106 -p1&lt;br /&gt;
&lt;br /&gt;
+%patch2107 -p1&lt;br /&gt;
+&lt;br /&gt;
 # ----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 mkdir configs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We need one more tiny hack in order RPM-build process to walk smoothly.&lt;br /&gt;
There are config files for various OpenVZ kernel flavours &lt;br /&gt;
in &amp;lt;tt&amp;gt;/usr/src/redhat/SOURCES&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ls /usr/src/redhat/SOURCES/*.config.ovz&lt;br /&gt;
/usr/src/redhat/SOURCES/kernel-2.6.18-i686.config.ovz             /usr/src/redhat/SOURCES/kernel-2.6.18-ppc64.config.ovz&lt;br /&gt;
/usr/src/redhat/SOURCES/kernel-2.6.18-i686-enterprise.config.ovz  /usr/src/redhat/SOURCES/kernel-2.6.18-x86_64.config.ovz&lt;br /&gt;
/usr/src/redhat/SOURCES/kernel-2.6.18-i686-smp.config.ovz         /usr/src/redhat/SOURCES/kernel-2.6.18-x86_64-smp.config.ovz&lt;br /&gt;
/usr/src/redhat/SOURCES/kernel-2.6.18-ia64.config.ovz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''All''' these files should contain information about &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt;.&lt;br /&gt;
In fact, only two additional lines are necessary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONFIG_SQUASHFS=m&lt;br /&gt;
CONFIG_SQUASHFS_EMBEDDED=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I did it with the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/src/redhat/SOURCES/&lt;br /&gt;
# echo &amp;quot;CONFIG_SQUASHFS=m&lt;br /&gt;
&amp;gt; CONFIG_SQUASHFS_EMBEDDED=n&amp;quot; | tee -a *.config.ovz&lt;br /&gt;
CONFIG_SQUASHFS=m&lt;br /&gt;
CONFIG_SQUASHFS_EMBEDDED=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After all efforts, building the RPM-package is very easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/src/redhat/SPECS/&lt;br /&gt;
# rpmbuild --target=i686 -ba kernel-ovz.spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If everything goes smoothly, in several tens of minutes depending on the power of your node you willl have OpenVZ kernel RPM-package with &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; support. Let's copy it to our local directory &amp;lt;tt&amp;gt;to_booted_livecd/kernels/&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd ~/workbench/&lt;br /&gt;
# ls /usr/src/redhat/RPMS/i686/&lt;br /&gt;
kernel-smp-2.6.18-ovz028stab035.1.i686.rpm&lt;br /&gt;
# mkdir -p to_booted_livecd/kernels&lt;br /&gt;
# cp /usr/src/redhat/RPMS/i686/kernel-smp-2.6.18-ovz028stab035.1.i686.rpm to_booted_livecd/kernels/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OpenVZ LiveCD supports several kernels. So, the actions mentioned above should be accomplished to all kernels,&lt;br /&gt;
that you need on LiveCD. In this article I skip the description of building RPMS for all kernels. All description&lt;br /&gt;
below are based on &amp;lt;tt&amp;gt;028stab035&amp;lt;/tt&amp;gt; kernel, that has been just build above. But some important differences in building&lt;br /&gt;
kernel of version other then 2.6.18 one is summarized below.&lt;br /&gt;
==== Peculiarities of building 2.6.9-rhel4 ====&lt;br /&gt;
* You should also include this patch (http://git.openvz.org/?p=linux-2.6.18-openvz;a=commit;h=681d0b65dedd54d8c716cef56418ac1a478f94da)&lt;br /&gt;
in building process. Hopefully will be fixed in &amp;lt;tt&amp;gt;2.6.9-044stab044.8&amp;lt;/tt&amp;gt; kernel.&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;unionfs 1.0.14&amp;lt;/tt&amp;gt;, but not &amp;lt;tt&amp;gt;unionfs 1.1.5&amp;lt;/tt&amp;gt;, as offered at its official site!&lt;br /&gt;
* Small problems while building &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt;: arguments of &amp;lt;tt&amp;gt;vfs_permissions()&amp;lt;/tt&amp;gt;. Just add &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;&lt;br /&gt;
to appropriate places.&lt;br /&gt;
&lt;br /&gt;
==== Peculiarities of building 2.6.18-rhel5 ====&lt;br /&gt;
* Note, &amp;lt;tt&amp;gt;squashfs&amp;lt;/tt&amp;gt; patch is already there, but you should use &amp;lt;tt&amp;gt;3.2&amp;lt;/tt&amp;gt;! :)&lt;br /&gt;
* While building &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; some small fixes: &amp;lt;tt&amp;gt;i_blksize&amp;lt;/tt&amp;gt; field is missing in &amp;lt;tt&amp;gt;inode&amp;lt;/tt&amp;gt; structure, &amp;lt;tt&amp;gt;ino_t&amp;lt;/tt&amp;gt; should be changed to &amp;lt;tt&amp;gt;u64&amp;lt;/tt&amp;gt; in some functions.&lt;br /&gt;
&lt;br /&gt;
==== Peculiarities of building 2.6.20 ====&lt;br /&gt;
* Only &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;2.0&amp;lt;/tt&amp;gt; is available for 2.6.20 kernel and it is distributed as a patch. Consequently modify &amp;lt;tt&amp;gt;spec&amp;lt;/tt&amp;gt;-file and configs while building the kernel&lt;br /&gt;
* &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;2.0&amp;lt;/tt&amp;gt; doesn't support unionctl. Consequently you have to modify &amp;lt;tt&amp;gt;liblinuxlive&amp;lt;/tt&amp;gt; file on &amp;lt;tt&amp;gt;initrd&amp;lt;/tt&amp;gt; image to mount all branches at once, but don't add them by ioctls.&lt;br /&gt;
&lt;br /&gt;
=== Unionfs kernel module ===&lt;br /&gt;
In most present-day LiveCDs &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; filesystem is used. This filesystem &amp;quot;can appear to merge the contents of several directories, while keeping their physical content separate&amp;quot;. For example, after the command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mount -t unionfs -o dirs=/tmp/changes=rw:/cdrom=ro unionfs /union&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you will see merged contents of &amp;lt;tt&amp;gt;/cdrom&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/tmp/changes&amp;lt;/tt&amp;gt; directories in &amp;lt;tt&amp;gt;/union&amp;lt;/tt&amp;gt; directory. &lt;br /&gt;
At that, &amp;lt;tt&amp;gt;cdrom&amp;lt;/tt&amp;gt; will be read-only. I.e. if you will write to some file in &amp;lt;tt&amp;gt;/union&amp;lt;/tt&amp;gt; directory, &lt;br /&gt;
that resides in &amp;lt;tt&amp;gt;/cdrom&amp;lt;/tt&amp;gt; in fact, this modified file will be automatically moved to &amp;lt;tt&amp;gt;/tmp/changes&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Such useful property is logically used in LiveCDs: &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; merges cdrom contents (that is read-only)&lt;br /&gt;
and temporary in-memory filesystem.&lt;br /&gt;
In order to add support of &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; filesystem to OpenVZ kernel we need to compile &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; kernel&lt;br /&gt;
module against used kernel. Download the sources of unionfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# wget ftp://ftp.filesystems.org/pub/unionfs/unionfs-1.x/unionfs-1.4.tar.gz&lt;br /&gt;
# tar xzf unionfs-1.4.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In previous chapter we have created an RPM-package with OpenVZ kernel. We should install it: because&lt;br /&gt;
this packages contents kernel headers, required for building kernel modules.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -ivh to_booted_livecd/kernels/kernel-smp-2.6.18-ovz028stab035.1.i686.rpm &lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:kernel-smp             ########################################### [100%]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now compile &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd unionfs-1.4&lt;br /&gt;
# echo 'LINUXSRC=/lib/modules/2.6.18-ovz028stab035.1-smp/build/&lt;br /&gt;
&amp;gt; TOPINC=-I$(LINUXSRC)/include&lt;br /&gt;
&amp;gt; MODDIR=/lib/modules/2.6.18-ovz028stab035.1-smp/' &amp;gt; fistdev.mk&lt;br /&gt;
# make&lt;br /&gt;
# ls unionfs.ko &lt;br /&gt;
unionfs.ko&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later we will place &amp;lt;tt&amp;gt;unionfs.ko&amp;lt;/tt&amp;gt; to appropriate place in '''booted''' LiveCD filesystem.&lt;br /&gt;
At the moment copy it to local &amp;lt;tt&amp;gt;to_booted_livecd/unionfs-modules/2.6.18/&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir -p to_booted_livecd/unionfs-modules/2.6.18/&lt;br /&gt;
# cp unionfs-1.4/unionfs.ko to_booted_livecd/unionfs-modules/2.6.18/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I repeat once again: if you want to use several kernels on LiveCD - the operation above should&lt;br /&gt;
be repeated for each wishful kernel.&lt;br /&gt;
&lt;br /&gt;
=== OpenVZ tools and templates. CentOS updates ===&lt;br /&gt;
We have now the kernel RPM-package. But we also need OpenVZ tools RPM-packages.&lt;br /&gt;
It is much easier with them: just download these packages from http://openvz.org:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir to_booted_livecd/tools&lt;br /&gt;
# cd to_booted_livecd/tools/&lt;br /&gt;
&lt;br /&gt;
# wget http://download.openvz.org/utils/vzctl/3.0.16/vzctl-3.0.16-1.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/utils/vzctl/3.0.16/vzctl-lib-3.0.16-1.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/utils/vzquota/3.0.9/vzquota-3.0.9-1.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/utils/vzpkg/2.7.0-18/vzpkg-2.7.0-18.noarch.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/utils/vzrpm43/current/vzrpm43-4.3.3-7_nonptl.6.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/utils/vzrpm43/current/vzrpm43-python-4.3.3-7_nonptl.6.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/utils/vzrpm44/current/vzrpm44-4.4.1-22.5.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/utils/vzrpm44/current/vzrpm44-python-4.4.1-22.5.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/utils/vzyum/current/vzyum-2.4.0-11.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
# mkdir ../template-metadatas&lt;br /&gt;
# cd ../template-metadatas&lt;br /&gt;
&lt;br /&gt;
# wget http://download.openvz.org/template/metadata/centos-4/vztmpl-centos-4-2.0-2.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/metadata/fedora-core-3/vztmpl-fedora-core-3-2.0-2.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/metadata/fedora-core-4/vztmpl-fedora-core-4-2.0-2.i386.rpm&lt;br /&gt;
# wget http://download.openvz.org/template/metadata/fedora-core-5/vztmpl-fedora-core-5-2.0-2.i386.rpm&lt;br /&gt;
&lt;br /&gt;
# mkdir ../precreated&lt;br /&gt;
# cd ../precreated&lt;br /&gt;
&lt;br /&gt;
# wget http://download.openvz.org/template/precreated/centos-4-i386-minimal.tar.gz&lt;br /&gt;
# wget http://download.openvz.org/template/precreated/debian-3.1-i386-minimal.tar.gz&lt;br /&gt;
# wget http://download.openvz.org/template/precreated/fedora-core-5-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
# cd ~/workbench/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you understand, you can add other precreated templates to LiveCD. The main thing here is that usual CD is &lt;br /&gt;
not rubber and precreated templates are rather big! ;)&lt;br /&gt;
&lt;br /&gt;
Centos 4.4 LiveCD has a serios problem: &amp;lt;tt&amp;gt;sqlite&amp;lt;/tt&amp;gt; package is broken and consequently&lt;br /&gt;
&amp;lt;tt&amp;gt;yum&amp;lt;/tt&amp;gt; doesn't work. In order to fix this problem we need updated &amp;lt;tt&amp;gt;sqlite&amp;lt;/tt&amp;gt; package:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir to_booted_livecd/updates&lt;br /&gt;
# cd to_booted_livecd/updates&lt;br /&gt;
# wget http://centos.arcticnetwork.ca/4.5/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm&lt;br /&gt;
# cd ~/workbench/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install all these finally ===&lt;br /&gt;
We have all components that will be on '''booted''' LiveCD ready. Let's install them&lt;br /&gt;
in &amp;lt;tt&amp;gt;chrooted&amp;lt;/tt&amp;gt; environment. But before uninstall &amp;lt;tt&amp;gt;lsctp-tools&amp;lt;/tt&amp;gt; package,&lt;br /&gt;
because these tools need kernel version prior to 2.6.10. Then update &amp;lt;tt&amp;gt;sqlite&amp;lt;/tt&amp;gt;&lt;br /&gt;
package. Also we need to remove some other packages in order to free some disk space:&lt;br /&gt;
I've removed &amp;lt;tt&amp;gt;openoffice.org&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gimp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;dia&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gnome-games&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;tetex&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;latex&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;k3b&amp;lt;/tt&amp;gt; and printing related packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp -r to_booted_livecd/ livecd-root/tmp/&lt;br /&gt;
# chroot livecd-root/&lt;br /&gt;
&lt;br /&gt;
# rpm -e lksctp-tools-1.0.2-6.4E.1.i386&lt;br /&gt;
&lt;br /&gt;
# rpm -e openoffice.org-libs openoffice.org&lt;br /&gt;
# rpm -e gimp-data-extras xsane-gimp gimp-print-plugin gimp-print-utils&lt;br /&gt;
# rpm -e gimp gimp-print gimp-help gimp-gap&lt;br /&gt;
# rpm -e dia&lt;br /&gt;
# rpm -e planner&lt;br /&gt;
# rpm -e gnome-games&lt;br /&gt;
# rpm -e tetex-latex jadetex xmltex passivetex tetex tetex-afm \&lt;br /&gt;
tetex-dvips tetex-fonts tetex-xdvi&lt;br /&gt;
# rpm -e k3b&lt;br /&gt;
# rpm -e foomatic Omni Omni-foomatic system-config-printer \&lt;br /&gt;
system-config-printer-gui hal-cups-utils desktop-printing&lt;br /&gt;
&lt;br /&gt;
# cd /tmp/to_booted_livecd/&lt;br /&gt;
&lt;br /&gt;
# rpm -Uvh updates/sqlite-3.3.6-2.i386.rpm&lt;br /&gt;
&lt;br /&gt;
# rpm -ivh kernels/kernel-smp-2.6.18-ovz028stab035.1.i686.rpm &lt;br /&gt;
# rpm -ivh tools/*.rpm&lt;br /&gt;
# rpm -ivh template-metadatas/*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy precreated templates to appropriate place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp  precreated/* /vz/template/cache/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add &amp;lt;tt&amp;gt;unionfs.ko&amp;lt;/tt&amp;gt; to other kernel modules and run &amp;lt;tt&amp;gt;depmod&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /lib/modules/2.6.18-ovz028stab035.1-smp/kernel/fs/unionfs&lt;br /&gt;
# cp unionfs-modules/2.6.18/unionfs.ko /lib/modules/2.6.18-ovz028stab035.1-smp/kernel/fs/unionfs/&lt;br /&gt;
# depmod 2.6.18-ovz028stab035.1-smp&lt;br /&gt;
# exit&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
While being in chrooted environment bash history was written to &amp;lt;tt&amp;gt;~/.bash_history&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
Clean it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rm livecd-root/root/.bash_history&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we have to make one step to workaround [[Checkpointing and live migration]] problem. The thing is that at the moment&lt;br /&gt;
chekpointing isn't supported on &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt; filesystem ([http://bugzilla.openvz.org/show_bug.cgi?id=606  Bug #606]).&lt;br /&gt;
But we want of course checkpoiting to work on LiveCD. If we mount &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt; on &amp;lt;tt&amp;gt;/vz/private/&amp;lt;/tt&amp;gt; on '''booted''' LiveCD,&lt;br /&gt;
then all newly created VEs reside on &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt; and checkpointing works. Moreover we do not introduce any additional memory usage,&lt;br /&gt;
because even without &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt; all VEs reside in RAM (they contain new/updated files for &amp;lt;tt&amp;gt;unionfs&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Create &amp;lt;tt&amp;gt;/vz/private&amp;lt;/tt&amp;gt; directory, later, while modifying initrd image we will add the line that will mount &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt;&lt;br /&gt;
on this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir livecd-root/vz/private/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the moment vzquota doesn't support &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt; ([http://bugzilla.openvz.org/show_bug.cgi?id=558  Bug #558]).&lt;br /&gt;
We're working on this problem, but for now '''switching the disk quota off''' in &amp;lt;tt&amp;gt;/etc/vz/vz.conf&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;DISK_QUOTA=no&amp;lt;/tt&amp;gt;.&lt;br /&gt;
But when disk quota is off &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; fails! ;) This is the [http://bugzilla.openvz.org/show_bug.cgi?id=558  Bug #512].&lt;br /&gt;
So, don't forget to apply the patch attached to this bug report to &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Booted''' LiveCD filesystem is ready, congratulations!&lt;br /&gt;
&lt;br /&gt;
=== Compressing '''booted''' LiveCD filesystem ===&lt;br /&gt;
Since &amp;lt;tt&amp;gt;mksquashfs&amp;lt;/tt&amp;gt; tool is already installed we can simply use it to create&lt;br /&gt;
&amp;lt;tt&amp;gt;*.mo&amp;lt;/tt&amp;gt; files: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rm -f ovz-livecd/base/*.mo&lt;br /&gt;
# for f in bin etc lib root sbin usr var vz; do \&lt;br /&gt;
    mksquashfs livecd-root/$f ovz-livecd/base/$f.mo -keep-as-directory; \&lt;br /&gt;
  done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vmlinux, initrd and isolinux.cfg ===&lt;br /&gt;
The next step is to force &amp;lt;tt&amp;gt;isolinux&amp;lt;/tt&amp;gt; (cdrom boot loader) to boot OpenVZ kernel.&lt;br /&gt;
First, copy kernel image to OpenVZ CD. It is important to give '''short name''' (not greater&lt;br /&gt;
than 8 characters) to kernel image, otherwise &amp;lt;tt&amp;gt;isolinux&amp;lt;/tt&amp;gt; will not see it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp livecd-root/boot/vmlinuz-2.6.18-ovz028stab035.1-smp ovz-livecd/boot/ovz18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Modify initrd image. More precisely, we need to add OpenVZ kernel modules there&lt;br /&gt;
and apply small patches to &amp;lt;tt&amp;gt;liblinuxlive&amp;lt;/tt&amp;gt; file. Initrd image that goes with Centos 4.4 is&lt;br /&gt;
of size 40Mb. OpenVZ LiveCD will contain several kernels, so initrd should have several sets of&lt;br /&gt;
kernel modules (for each kernel) and 40Mb isn't enough in this case. I created an initrd of size 100Mb.&lt;br /&gt;
Don't forget to update &amp;lt;tt&amp;gt;ramdisk_size&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;isolinux.cfg&amp;lt;/tt&amp;gt; file later!&lt;br /&gt;
&lt;br /&gt;
Creating &amp;quot;big&amp;quot; initrd with original content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir initrd.d&lt;br /&gt;
# cp ovz-livecd/boot/initrd.gz initrd.d/initrd-old.gz&lt;br /&gt;
# cd initrd.d/&lt;br /&gt;
# mkdir mount-old&lt;br /&gt;
# gunzip initrd-old.gz &lt;br /&gt;
# mount -o loop initrd-old mount-old/&lt;br /&gt;
# dd if=/dev/zero of=initrd bs=1048576 count=100&lt;br /&gt;
# mke2fs initrd&lt;br /&gt;
initrd is not a block special device.&lt;br /&gt;
Proceed anyway? (y,n) y&lt;br /&gt;
...&lt;br /&gt;
# mkdir mount&lt;br /&gt;
# mount -o loop initrd mount/&lt;br /&gt;
# cp -a mount-old/* mount/&lt;br /&gt;
# umount mount-old/&lt;br /&gt;
# rm -rf mount-old initrd-old&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy modules to initrd:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp -r ../livecd-root/lib/modules/2.6.18-ovz028stab035.1-smp/ mount/lib/modules/&lt;br /&gt;
# rm -rf mount/lib/modules/2.6.18-ovz028stab035.1-smp/build                 # we don't neet it on initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I also delete some not necessary kernel modules from initrd to free space.&lt;br /&gt;
They are stil on CD, so init sctipts will be able to load them later.&lt;br /&gt;
&lt;br /&gt;
initrd image, that goes with Centos 4.4 LiveCD doesn't load cdrom kernel modules.&lt;br /&gt;
It works well for CentOS kernel, because cdrom support is built-in there.&lt;br /&gt;
But OpenVZ kernel supports cdrom (usual ide cdrom) via kernel module.&lt;br /&gt;
Consequetnly we need to apply the following patch to &amp;lt;tt&amp;gt;liblinuxlive&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- liblinuxlive.orig   2006-08-19 08:53:11.000000000 +0400&lt;br /&gt;
+++ liblinuxlive        2007-07-02 17:50:34.000000000 +0400&lt;br /&gt;
@@ -337,6 +337,9 @@ modprobe_essential_modules()&lt;br /&gt;
 {&lt;br /&gt;
    echolog &amp;quot;starting loop device support&amp;quot;&lt;br /&gt;
    modprobe_module loop max_loop=32&lt;br /&gt;
+   echolog &amp;quot;starting cdrom support&amp;quot;&lt;br /&gt;
+   modprobe_module cdrom&lt;br /&gt;
+   modprobe_module ide-cd&lt;br /&gt;
    echolog &amp;quot;starting cdrom filesystem support&amp;quot;&lt;br /&gt;
    modprobe_module isofs&lt;br /&gt;
    echolog &amp;quot;starting squashfs support&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As mentioned earlier we want to mount &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt; on /vz/private automatically. Just apply this patch to&lt;br /&gt;
&amp;lt;tt&amp;gt;liblinuxlive&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- liblinuxlive.orig-fstab     2007-07-02 17:50:34.000000000 +0400&lt;br /&gt;
+++ mount/liblinuxlive  2007-07-03 12:33:30.000000000 +0400&lt;br /&gt;
@@ -414,6 +414,7 @@ activate_fstab()&lt;br /&gt;
    echo &amp;quot;tmpfs            /                tmpfs       defaults         0   0&amp;quot; &amp;gt;$FSTAB&lt;br /&gt;
    echo &amp;quot;devpts           /dev/pts         devpts      gid=5,mode=620   0   0&amp;quot; &amp;gt;&amp;gt;$FSTAB&lt;br /&gt;
    echo &amp;quot;proc             /proc            proc        defaults         0   0&amp;quot; &amp;gt;&amp;gt;$FSTAB&lt;br /&gt;
+   echo &amp;quot;tmpfs            /vz/private      tmpfs       defaults         0   0&amp;quot; &amp;gt;&amp;gt;$FSTAB&lt;br /&gt;
&lt;br /&gt;
    # now done by fstab-sync&lt;br /&gt;
    # list_cdrom_devices | while read DEVICE; do&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finishing actions with initrd:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
# umount mount/&lt;br /&gt;
# gzip initrd&lt;br /&gt;
# cp initrd.gz ../ovz-livecd/boot/initrd.gz&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we should modify &amp;lt;tt&amp;gt;ovz-livecd/isolinux.cfg&amp;lt;/tt&amp;gt; file, that controls &amp;lt;tt&amp;gt;isolinux&amp;lt;/tt&amp;gt; boot loader.&lt;br /&gt;
We inform boot loader, that new kernel was added by introducing the following changes (in diff format):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- ovz-livecd/isolinux.cfg.orig   2006-08-19 08:53:09.000000000 +0400&lt;br /&gt;
+++ ovz-livecd/isolinux.cfg     2007-07-02 19:10:51.000000000 +0400&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 display boot/splash.cfg&lt;br /&gt;
-default linux&lt;br /&gt;
+default ovz18&lt;br /&gt;
 prompt 1&lt;br /&gt;
 timeout 300&lt;br /&gt;
 F1 boot/help1.txt&lt;br /&gt;
@@ -11,5 +11,9 @@ label linux&lt;br /&gt;
 kernel boot/vmlinuz&lt;br /&gt;
 append max_loop=32 vga=791 initrd=boot/initrd.gz init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=40000 root=/dev/ram0 rw rhgb quiet&lt;br /&gt;
&lt;br /&gt;
+label ovz18 &lt;br /&gt;
+kernel boot/ovz18&lt;br /&gt;
+append max_loop=32 vga=791 initrd=boot/initrd.gz init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=102400 root=/dev/ram0 rw rhgb&lt;br /&gt;
+&lt;br /&gt;
 label memtest&lt;br /&gt;
 kernel boot/memtest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also '''don't forget''' to change &amp;lt;tt&amp;gt;ramdisk_size&amp;lt;/tt&amp;gt; to 102400 for all kernels including Centos 4.4 default! &lt;br /&gt;
&lt;br /&gt;
And I suggest to remove &amp;lt;tt&amp;gt;quiet&amp;lt;/tt&amp;gt; parameter, to see what happens: it will help greatly if some problem will happen.&lt;br /&gt;
&lt;br /&gt;
=== Embellishment ===&lt;br /&gt;
If you want to release LiveCD to other people some &amp;quot;embelishments&amp;quot; should be added.&lt;br /&gt;
&lt;br /&gt;
First, edit &amp;lt;tt&amp;gt;splash.cfg&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;help1.txt&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;help2.txt&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;help3.txt&amp;lt;/tt&amp;gt;&lt;br /&gt;
files (that are in &amp;lt;tt&amp;gt;~/workbench/ovz-livecd/boot/help&amp;lt;/tt&amp;gt; directory) to contain appropriate information.&lt;br /&gt;
These messages appear on the LiveCD initial boot: they help to choose kernel and kernel options.&lt;br /&gt;
&lt;br /&gt;
Also, you can note, that CentOS logo appears at this moment. This logo resides in &amp;lt;tt&amp;gt;ovz-livecd/boot/splash.lss&amp;lt;/tt&amp;gt;&lt;br /&gt;
file. I added OpenVZ logo there. The following tools will help you: &amp;lt;tt&amp;gt;lss16toppm&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ppmtolss16&amp;lt;/tt&amp;gt; and&lt;br /&gt;
of course &amp;lt;tt&amp;gt;gimp&amp;lt;/tt&amp;gt; :)&lt;br /&gt;
&lt;br /&gt;
One more thing we change is default desktop background. It resides in &amp;lt;tt&amp;gt;usr/share/backgrounds/images/default.png&amp;lt;/tt&amp;gt;.&lt;br /&gt;
I added OpenVZ logo there.&lt;br /&gt;
&lt;br /&gt;
=== Creating ISO ===&lt;br /&gt;
Centos 4.4 LiveCD creators were very gentle and have placed &amp;lt;tt&amp;gt;make_iso.sh&amp;lt;/tt&amp;gt; script on CD.&lt;br /&gt;
Using this script, it is very easy to create iso:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd ovz-livecd&lt;br /&gt;
# ./make_iso.sh ../CentOS-4.4-i386-OpenVZ-LiveCD.iso&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging LiveCD ==&lt;br /&gt;
If you have trouble with created OpenVZ LiveCD, boot the kernel with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vga=0 debug&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
command line options. It will help you to diagnose the problem more precisely.&lt;br /&gt;
Also it can be useful to redirect kernel output to serial console:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
console=ttyS0,115200 console=tty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See more at [[remote console setup]].&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [http://centos.org Official CentOS community website]&lt;br /&gt;
* [http://kernel.org Linux kernel website]&lt;br /&gt;
* [http://redhat.com RedHat Inc. website]&lt;br /&gt;
* [http://squashfs.sourceforge.net/ squashfs website]&lt;br /&gt;
* [http://www.filesystems.org/project-unionfs.html uninonfs official homepage]&lt;br /&gt;
* [http://www.weprintdiscs.com/ CD Printing]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Live CD]]&lt;/div&gt;</summary>
		<author><name>3qdesigns123</name></author>
		
	</entry>
</feed>