Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Creating OpenVZ LiveCD based on Centos 4.4

1,672 bytes added, 14:31, 29 June 2007
Vmlinux, initrd and isolinux.cfg: this section is added
=== Vmlinux, initrd and isolinux.cfg ===
The next step is to force <tt>isolinux</tt> (cdrom boot loader) to boot OpenVZ kernel.
First, copy kernel image to OpenVZ CD:
<pre>
# cp root/boot/vmlinuz-2.6.18-ovz028stab035.1-smp ovz-livecd/boot/
</pre>
Modify initrd image. More precisely, we just need to add OpenVZ kernel modules there:
<pre>
# mkdir initrd.d
# cp ovz-livecd/boot/initrd.gz initrd.d/
# cd initrd.d/
# mkdir mount
# gunzip initrd.gz
# mount -o loop initrd mount/
# cp -r ../root/lib/modules/2.6.18-ovz028stab035.1-smp/ mount/lib/modules/
# rm -rf mount/lib/modules/2.6.18-ovz028stab035.1-smp/build # we don't neet it on initrd image
# sync
# umount mount/
# gzip initrd
# /bin/cp initrd.gz ../ovz-livecd/boot/initrd.gz
# cd ..
</pre>
Now we should modify <tt>ovz-livecd/isolinux.cfg</tt> file, that controls <tt>isolinux</tt> boot loader.
We inform boot loader, that new kernel was added by introducing the following changes (in diff format):
<pre>
--- ovz-livecd/isolinux.cfg.orig 2006-08-19 08:53:09.000000000 +0400
+++ ovz-livecd/isolinux.cfg 2007-06-29 18:22:29.000000000 +0400
@@ -1,5 +1,5 @@
display boot/splash.cfg
-default linux
+default ovz-2.6.18
prompt 1
timeout 300
F1 boot/help1.txt
@@ -11,5 +11,9 @@ label linux
kernel boot/vmlinuz
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
+label ovz-2.6.18
+kernel boot/vmlinuz-2.6.18-ovz028stab035.1-smp
+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
+
label memtest
kernel boot/memtest
</pre>
 
=== Creating ISO ===
== External Links ==
172
edits