Editing Creating OpenVZ LiveCD based on Centos 4.4

Jump to: navigation, search

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 28: Line 28:
 
This part contains detailed description of LiveCD creation. I've removed the output of some
 
This part contains detailed description of LiveCD creation. I've removed the output of some
 
commands in order to simplify the reading.
 
commands in order to simplify the reading.
 
Note: before proceed with commands below, one needs to disable SE Linux on the host, otherwise rpm operations
 
in cdroot-ed environment described later on will fail due to inability to restore security file context. So, please,
 
do:
 
<pre>
 
# setenforce 0
 
</pre>
 
This will put SE linux in so-called 'permissive' mode, where all the blockers will be substituted by warnings.
 
If you wanna get rid of the warnings (rather annoying), the only way to do is to edit <tt>/etc/sysconfig/selinux</tt>
 
to read <tt>SELINUX=disabled</tt> and then reboot the host.
 
  
 
=== Creating booted LiveCD root filesystem ===
 
=== Creating booted LiveCD root filesystem ===
Line 116: Line 106:
 
# cd livecd-root
 
# cd livecd-root
 
# mkdir dev
 
# mkdir dev
# cp -a /dev/* dev/
+
# cp -a /dev/* root/dev
 
# mkdir proc
 
# mkdir proc
 
# mount -t proc proc proc/
 
# mount -t proc proc proc/
# mkdir sys
+
# mkdir root/sys
 
# mount -t sysfs sysfs sys/
 
# mount -t sysfs sysfs sys/
 
# mkdir tmp
 
# mkdir tmp
Line 346: Line 336:
 
<tt>tetex</tt>, <tt>latex</tt>, <tt>k3b</tt> and printing related packages:
 
<tt>tetex</tt>, <tt>latex</tt>, <tt>k3b</tt> and printing related packages:
 
<pre>
 
<pre>
# cp -r to_booted_livecd/ livecd-root/tmp/
+
# cp -r to_booted_livecd/ root/tmp/
# chroot livecd-root/
+
# chroot root/
  
 
# rpm -e lksctp-tools-1.0.2-6.4E.1.i386
 
# rpm -e lksctp-tools-1.0.2-6.4E.1.i386
Line 387: Line 377:
 
Clean it:
 
Clean it:
 
<pre>
 
<pre>
# rm livecd-root/root/.bash_history
+
# rm root/root/.bash_history
 
</pre>
 
</pre>
 
Here we have to make one step to workaround [[Checkpointing and live migration]] problem. The thing is that at the moment
 
Here we have to make one step to workaround [[Checkpointing and live migration]] problem. The thing is that at the moment
Line 398: Line 388:
 
on this directory:
 
on this directory:
 
<pre>
 
<pre>
mkdir livecd-root/vz/private/
+
mkdir root/vz/private/
 
</pre>
 
</pre>
 
At the moment vzquota doesn't support <tt>tmpfs</tt> ([http://bugzilla.openvz.org/show_bug.cgi?id=558  Bug #558]).
 
At the moment vzquota doesn't support <tt>tmpfs</tt> ([http://bugzilla.openvz.org/show_bug.cgi?id=558  Bug #558]).
Line 413: Line 403:
 
# rm -f ovz-livecd/base/*.mo
 
# rm -f ovz-livecd/base/*.mo
 
# for f in bin etc lib root sbin usr var vz; do \
 
# for f in bin etc lib root sbin usr var vz; do \
     mksquashfs livecd-root/$f ovz-livecd/base/$f.mo -keep-as-directory; \
+
     mksquashfs root/$f ovz-livecd/base/$f.mo -keep-as-directory; \
 
   done
 
   done
 
</pre>
 
</pre>
Line 422: Line 412:
 
than 8 characters) to kernel image, otherwise <tt>isolinux</tt> will not see it.
 
than 8 characters) to kernel image, otherwise <tt>isolinux</tt> will not see it.
 
<pre>
 
<pre>
# cp livecd-root/boot/vmlinuz-2.6.18-ovz028stab035.1-smp ovz-livecd/boot/ovz18
+
# cp root/boot/vmlinuz-2.6.18-ovz028stab035.1-smp ovz-livecd/boot/ovz18
 
</pre>
 
</pre>
 
Modify initrd image. More precisely, we need to add OpenVZ kernel modules there
 
Modify initrd image. More precisely, we need to add OpenVZ kernel modules there
Line 451: Line 441:
 
Copy modules to initrd:
 
Copy modules to initrd:
 
<pre>
 
<pre>
# cp -r ../livecd-root/lib/modules/2.6.18-ovz028stab035.1-smp/ mount/lib/modules/
+
# 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
 
# rm -rf mount/lib/modules/2.6.18-ovz028stab035.1-smp/build                # we don't neet it on initrd image
 
</pre>
 
</pre>
Line 494: Line 484:
 
# umount mount/
 
# umount mount/
 
# gzip initrd
 
# gzip initrd
# cp initrd.gz ../ovz-livecd/boot/initrd.gz
+
# /bin/cp initrd.gz ../ovz-livecd/boot/initrd.gz
 
# cd ..
 
# cd ..
 
</pre>
 
</pre>

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)