Open main menu

OpenVZ Virtuozzo Containers Wiki β

Editing Creating OpenVZ LiveCD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 89: Line 89:
 
</pre>
 
</pre>
  
Now we should set up OpenVZ environment in obtained tree: kernel, vzctl, vzquota, template. For vzctl and vzquota we can use precompiled packages from http://debian.systs.org. But at the moment we have to create kernel Debian package by self, because we need additional patches in order all to work smoothly (but it will be unnecessary soon, when patches will be included in main OpenVZ patch). This is important to use KNOPPIX default kernel config! The creators of LiveCD take a lot of care about customizing config file in such manner, that CD will suite as many users as possible. We shouldn't throw away such great job. We do `make oldconfig` and press enter all the time. Additionally some config options should be turn off at the moment. (http://bugzilla.openvz.org/show_bug.cgi?id=433): CONFIG_MATH_EMULATION, CONFIG_SJCD, CONFIG_OPTCD, CONFIG_AZTCD, CONFIG_BLK_DEV_XD, CONFIG_AUTOFS_FS, CONFIG_SND_WAVEFRONT.
+
Now we should set up OpenVZ environment in obtained tree: kernel, vzctl, vzquota, template. For vzctl and vzquota we can use precompiled packages from http://debian.systs.org. But at the moment we have to create kernel Debian package by self, because we need additional patches in order all to work smoothly (but it will be unnecessary soon, when patches will be included in main OpenVZ patch). I created a Debian VE on my machine and install there kernel-package package, that allows to create Debian kernel packages easily. After that the creation of package is something like that:
I created a Debian VE on my machine and install there kernel-package package, that allows to create Debian kernel packages easily. After that the creation of package is something like that:
 
 
<pre>
 
<pre>
 
mkdir ovz-kernel
 
mkdir ovz-kernel
Line 103: Line 102:
 
mv linux-2.6.18 linux-2.6.18-8.el5-028test027
 
mv linux-2.6.18 linux-2.6.18-8.el5-028test027
 
vim linux-2.6.18-8.el5-028test027/Makefile                  # here we add right extraversion: -8.el5-028test027
 
vim linux-2.6.18-8.el5-028test027/Makefile                  # here we add right extraversion: -8.el5-028test027
cp linux-2.6.19 linux-2.6.18/.config
+
cp kernel-2.6.18-i686.config.ovz linux-2.6.18/.config
cd linux-2.6.18-8.el5-028test027
 
make oldconfig                                              # pressing enter here
 
vim .config                                                  # switching off some config options
 
 
make-kpkg --revision=.1 kernel_image
 
make-kpkg --revision=.1 kernel_image
cd ..
 
 
cd ..
 
cd ..
 
</pre>
 
</pre>
Line 173: Line 168:
  
 
That's great, now we have all the tree ready,
 
That's great, now we have all the tree ready,
let's compress it in the new image using create_compressed_fs tool
+
let's compress it in the new image using create_compressed_fs tool:
and copy to the right place:
 
 
<pre>
 
<pre>
 
mkisofs -R -iso-level 4 -force-rr -J  ./KNOPPIX-content-modif/ > KNOPPIX-modif.img
 
mkisofs -R -iso-level 4 -force-rr -J  ./KNOPPIX-content-modif/ > KNOPPIX-modif.img
 
./cloop-2.05/create_compressed_fs KNOPPIX-modif.img 65536 > KNOPPIX-modif
 
./cloop-2.05/create_compressed_fs KNOPPIX-modif.img 65536 > KNOPPIX-modif
cp KNOPPIX-modif cd-contents/KNOPPIX/KNOPPIX
 
 
</pre>
 
</pre>
  
Line 257: Line 250:
 
</pre>
 
</pre>
  
Now you have aufs.ko file in current directory. Next we need to add these modules to the disc:
+
Now you have an aufs.ko file in current directory. Next we need to add these modules to the disc.
<pre>
 
cp aufs.ko cloop.ko cd-contents/KNOPPIX/modules/
 
</pre>
 
 
 
 
 
When booting KNOOPIX uses initrd image,
 
where it stores some kernel modules required to get access to the CD-drive.
 
We need to remove old modules and add new one to initrd image. Extracting and
 
mounting initrd:
 
<pre>
 
mkdir initrd
 
cd initrd
 
cp cd-contents/boot/isolinux/minirt.gz ./
 
gunzip minirt.gz
 
mkdir mnt
 
mount -o loop minirt mnt
 
</pre>
 
 
 
The modules directory on initrd contents kernel modules. Now we should replace these modules by
 
equivalents from OpenVZ kernel. Note, that some modules can missing, because we use other kernel.
 
Just remove modules, that are missing. After this operation is done copy new minirt.gz to the appropriate place:
 
<pre>
 
umount mnt
 
gzip minirt
 
cp minirt.gz ../cd-contents/boot/isolinux/
 
cd ..
 
</pre>
 
 
 
The last major step is to copy vmlinuz to isolinux directory:
 
<pre>
 
cp vmlinuz-2.6.18-8.el5-028stab027 cd-contents/boot/isolinux/linux
 
</pre>
 
 
 
Actually, now we're ready to create iso image with KNOPPIX OpenVZ LiveCD.
 
But I describe a bit cosmetic changes now. First, we want to add OpenVZ logo and slogan
 
to the startup screen of KNOPPIX. This picture is stored in boot/isolinux/logo.16 file in lss16 format.
 
To convert this image to gif format we should install syslinux and netpbm-progs packages.
 
After that the following actions should be done:
 
<pre>
 
mkdir boot-picture
 
cp cd-contents/boot/isolinux/logo.16 boot-picture/
 
cd boot-picture
 
lss16toppm < logo.16 > logo.ppm
 
ppmtogif < logo.ppm > logo.gif
 
</pre>
 
  
Then I  edit OpenVZ logo using gimp and save the image in bmp format.
 
Converting and copying logo to the appropriate place:
 
<pre>
 
bmptoppm < logo.bmp > logo.ppm
 
ppmtolss16 < logo.ppm > logo.16
 
cd ..
 
cp boot-picture/logo.16 cd-contents/boot/isolinux/logo.16
 
</pre>
 
 
Knoppix uses KDE as Window Manager and after KDE is loaded you can see the web page
 
with information about using KNOPPIX. Of course, we want you to see the information
 
about basics of using OpenVZ. So we write a page: [[Basic operations in OpenVZ]] and saved it
 
in cd-contents/KNOPPIX/ directory. Then we just edited etc/X11/Xsession.d/45xsession file so,
 
that Basic_operations_in_OpenVZ.html.html file is opened on KDE start.
 
 
Great, let's write it all on CD:
 
<pre>
 
chmod -R u+w cd-contents
 
rm cd-contents/boot/isolinux/boot.cat
 
mkisofs -b boot/isolinux/isolinux.bin -o KNOPPIX_V5.1.1-OPENVZ-CD-2007-01-04-EN.iso -no-emul-boot \
 
-l -J -r -boot-load-size 4 -boot-info-table KNOPPIX_V5.1.1CD-2007-01-04-EN.iso-content
 
</pre>
 
  
 
== Result ==
 
== Result ==
[todo]
 
  
 
== Links ==
 
== Links ==
Line 334: Line 259:
 
# http://www.knoppix.net/wiki/Knoppix_Remastering_Howto
 
# http://www.knoppix.net/wiki/Knoppix_Remastering_Howto
 
# http://debian.systs.org/
 
# http://debian.systs.org/
 
 
[[Category: HOWTO]]
 
[[Category: Live CD]]
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)