Difference between revisions of "RHEL5 Kernel HOWTO"
(→Step 5: boot-update) |
|||
| (14 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | == Introduction == | |
| − | + | This HOWTO will show you how to get a RHEL5-based OpenVZ kernel running on a Funtoo Linux system. | |
| − | 1 | + | == Step 1: Downgrade udev, lvm2 == |
| + | |||
| + | Downgrade udev to a version compatible with kernels previous than 2.6.27: | ||
<pre> | <pre> | ||
| Line 10: | Line 12: | ||
</pre> | </pre> | ||
| − | + | This will also require a downgrade of lvm2, if you are using it. Version 2.02.68 is a good one to use: | |
<pre> | <pre> | ||
| − | echo ">=sys- | + | echo ">=sys-fs/lvm2-2.02.69" >> /etc/portage/package.mask |
| + | emerge -u lvm2 | ||
</pre> | </pre> | ||
| − | + | Downgrade make to a version compatible with older kernel version | |
<pre> | <pre> | ||
| − | + | echo ">=sys-devel/make-3.82" > /etc/portage/package.mask | |
| + | emerge -u make | ||
</pre> | </pre> | ||
| − | + | == Step 2: Install binary kernel == | |
| − | + | The process for installing an RHEL5-based kernel with OpenVZ support has been drastically simplified. Simply perform the following steps: | |
| + | |||
| + | <pre> | ||
| + | # echo "sys-kernel/openvz-rhel5-stable binary" >> /etc/portage/package.use | ||
| + | </pre> | ||
| − | + | This will result in the kernel sources and a binary kernel and initrd being merged. Without <tt>binary</tt> in USE, only the sources will be merged. Then: | |
<pre> | <pre> | ||
| − | + | # emerge openvz-rhel5-stable | |
| − | + | </pre> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | > | + | |
| − | + | This will build and install a binary kernel image and initial RAM disk, and take care of installing all necessary dependencies like gcc-4.1.2. Once the binary kernel image and initrd is installed, configure <tt>/etc/boot.conf</tt> to find and boot the new kernel. | |
| − | + | ||
| − | + | Note: you may need to temporarily modify your <tt>CFLAGS</tt> settings to ensure they are compatible with gcc-4.1 systems. In particular, <tt>-march=native</tt> is not recognized by the older gcc. | |
| − | + | [1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options | |
| − | + | ||
| − | + | ||
| − | gcc | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | == Step 3: Enable vz initscript == | |
| − | + | ||
| + | When your system boots with OpenVZ support enabled, it will require /etc/init.d/vz to run: | ||
| − | |||
<pre> | <pre> | ||
| − | + | # rc-update add vz default | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
</pre> | </pre> | ||
| − | + | == Step 4: Edit boot.conf == | |
| + | |||
| + | Update /etc/boot.conf to point to your new kernel, ie: | ||
<pre> | <pre> | ||
| − | + | boot { | |
| − | + | generate grub | |
| − | "Funtoo Linux" { | + | default kernel-openvz-rhel5-stable-x86_64-2.6.18-028stab089.1 |
| − | kernel | + | timeout 3 |
| − | params | + | } |
| + | |||
| + | "Funtoo Linux with OpenVZ" { | ||
| + | kernel kernel-openvz[-v] | ||
| + | initrd initramfs-openvz[-v] | ||
| + | params += real_root=auto | ||
} | } | ||
</pre> | </pre> | ||
| − | + | Note that you must use the <tt>params += real_root=auto</tt> option. This will automatically | |
| + | configure your boot loader to specify your root fileysstem as the <tt>real_root</tt> to the | ||
| + | initrd. | ||
| + | |||
| + | == Step 5: boot-update == | ||
| + | |||
| + | Now, simply run <tt>boot-update</tt> as root: | ||
<pre> | <pre> | ||
| − | + | boot-update | |
</pre> | </pre> | ||
| + | |||
| + | <tt>boot-update</tt> should show the new kernel as being found and display it as the default | ||
| + | selection for the next boot. You can now reboot your system and start using OpenVZ. | ||
[[Category:HOWTO]] | [[Category:HOWTO]] | ||
| + | [[Category:Kernel]] | ||
Latest revision as of 13:39, 18 November 2012
Contents |
[edit] Introduction
This HOWTO will show you how to get a RHEL5-based OpenVZ kernel running on a Funtoo Linux system.
[edit] Step 1: Downgrade udev, lvm2
Downgrade udev to a version compatible with kernels previous than 2.6.27:
echo ">=sys-fs/udev-147" >> /etc/portage/package.mask emerge -u udev
This will also require a downgrade of lvm2, if you are using it. Version 2.02.68 is a good one to use:
echo ">=sys-fs/lvm2-2.02.69" >> /etc/portage/package.mask emerge -u lvm2
Downgrade make to a version compatible with older kernel version
echo ">=sys-devel/make-3.82" > /etc/portage/package.mask emerge -u make
[edit] Step 2: Install binary kernel
The process for installing an RHEL5-based kernel with OpenVZ support has been drastically simplified. Simply perform the following steps:
# echo "sys-kernel/openvz-rhel5-stable binary" >> /etc/portage/package.use
This will result in the kernel sources and a binary kernel and initrd being merged. Without binary in USE, only the sources will be merged. Then:
# emerge openvz-rhel5-stable
This will build and install a binary kernel image and initial RAM disk, and take care of installing all necessary dependencies like gcc-4.1.2. Once the binary kernel image and initrd is installed, configure /etc/boot.conf to find and boot the new kernel.
Note: you may need to temporarily modify your CFLAGS settings to ensure they are compatible with gcc-4.1 systems. In particular, -march=native is not recognized by the older gcc.
[edit] Step 3: Enable vz initscript
When your system boots with OpenVZ support enabled, it will require /etc/init.d/vz to run:
# rc-update add vz default
[edit] Step 4: Edit boot.conf
Update /etc/boot.conf to point to your new kernel, ie:
boot {
generate grub
default kernel-openvz-rhel5-stable-x86_64-2.6.18-028stab089.1
timeout 3
}
"Funtoo Linux with OpenVZ" {
kernel kernel-openvz[-v]
initrd initramfs-openvz[-v]
params += real_root=auto
}
Note that you must use the params += real_root=auto option. This will automatically configure your boot loader to specify your root fileysstem as the real_root to the initrd.
[edit] Step 5: boot-update
Now, simply run boot-update as root:
boot-update
boot-update should show the new kernel as being found and display it as the default selection for the next boot. You can now reboot your system and start using OpenVZ.