Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "RHEL5 Kernel HOWTO"

From Funtoo
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 3: Line 3:
This HOWTO will show you how to get a RHEL5-based OpenVZ kernel running on a Funtoo Linux system.   
This HOWTO will show you how to get a RHEL5-based OpenVZ kernel running on a Funtoo Linux system.   


== Step 1: Downgrade udev, lvm2 ==
== Step 1: Downgrade {{Package|sys-fs/udev}}, {{Package|sys-fs/lvm2}} ==


Downgrade udev to a version compatible with kernels previous than 2.6.27:
Downgrade udev to a version compatible with kernels previous than 2.6.27:
 
<console>
<pre>
###i## echo ">=sys-fs/udev-147" >> /etc/portage/package.mask
echo ">=sys-fs/udev-147" >> /etc/portage/package.mask
###i## emerge -u udev
emerge -u udev
</console>
</pre>


This will also require a downgrade of lvm2, if you are using it. Version 2.02.68 is a good one to use:
This will also require a downgrade of lvm2, if you are using it. Version 2.02.68 is a good one to use:
<console>
###i## echo ">=sys-fs/lvm2-2.02.69" >> /etc/portage/package.mask
###i## emerge -u lvm2
</console>


<pre>
Downgrade make to a version compatible with older kernel version:
echo ">=sys-fs/lvm2-2.02.69" >> /etc/portage/package.mask
<console>
emerge -u lvm2
###i## echo ">=sys-devel/make-3.82" > /etc/portage/package.mask
</pre>
###i## emerge -u make
 
</console>
Downgrade make to a version compatible with older kernel version
 
<pre>
echo ">=sys-devel/make-3.82" > /etc/portage/package.mask
emerge -u make
</pre>


== Step 2: Install binary kernel ==
== 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:
The process for installing an RHEL5-based kernel with OpenVZ support has been drastically simplified. Simply perform the following steps:
<console>
###i## echo "sys-kernel/openvz-rhel5-stable binary" >> /etc/portage/package.use
</console>


<pre>
This will result in the kernel sources and a binary kernel and initrd being merged. Without <code>binary</code> in USE, only the sources will be merged. Then:
# echo "sys-kernel/openvz-rhel5-stable binary" >> /etc/portage/package.use
<console>
</pre>
###i## emerge openvz-rhel5-stable
</console>


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:
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 <code>/etc/boot.conf</code> to find and boot the new kernel.


<pre>
Note: you may need to temporarily modify your <code>CFLAGS</code> settings to ensure they are compatible with gcc-4.1 systems. In particular, <code>-march=native</code> is not recognized by the older gcc.
# 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
[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
Line 48: Line 43:
== Step 3: Enable vz initscript ==
== Step 3: Enable vz initscript ==


When your system boots with OpenVZ support enabled, it will require /etc/init.d/vz to run:
When your system boots with OpenVZ support enabled, it will require <code>/etc/init.d/vz</code> to run:
 
<console>
<pre>
###i## rc-update add vz default
# rc-update add vz default
</console>
</pre>


== Step 4: Edit boot.conf ==
== Step 4: Edit boot.conf ==


Update /etc/boot.conf to point to your new kernel, ie:
Update <code>/etc/boot.conf</code> to point to your new kernel, ie:
 
{{File
<pre>
|/etc/boot.conf|<pre>
boot {
boot {
         generate grub
         generate grub
Line 70: Line 64:
         params += real_root=auto
         params += real_root=auto
}
}
</pre>
</pre>}}
 
Note that you must use the  
Note that you must use the <tt>params += real_root=auto</tt> option. This will automatically
<console>
configure your boot loader to specify your root fileysstem as the <tt>real_root</tt> to the
params += real_root=auto
initrd.
</console> option. This will automatically configure your boot loader to specify your root file system as the  
<console>
real_root
</console>  
to the initrd.


== Step 5: boot-update ==
== Step 5: boot-update ==


Now, simply run <tt>boot-update</tt> as root:
Now, simply run <code>boot-update</code> as root:
 
<console>
<pre>
###i## boot-update
boot-update
</console>
</pre>


<tt>boot-update</tt> should show the new kernel as being found and display it as the default
<tt>boot-update</tt> should show the new kernel as being found and display it as the default

Revision as of 03:55, January 15, 2014

Introduction

This HOWTO will show you how to get a RHEL5-based OpenVZ kernel running on a Funtoo Linux system.

Step 1: Downgrade No results, No results

Downgrade udev to a version compatible with kernels previous than 2.6.27:

root # echo ">=sys-fs/udev-147" >> /etc/portage/package.mask
root # 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:

root # echo ">=sys-fs/lvm2-2.02.69" >> /etc/portage/package.mask
root # emerge -u lvm2

Downgrade make to a version compatible with older kernel version:

root # echo ">=sys-devel/make-3.82" > /etc/portage/package.mask
root # emerge -u make

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:

root # 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:

root # 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.

[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options

Step 3: Enable vz initscript

When your system boots with OpenVZ support enabled, it will require /etc/init.d/vz to run:

root # rc-update add vz default

Step 4: Edit boot.conf

Update /etc/boot.conf to point to your new kernel, ie:

   
{{{body}}}

Note that you must use the

params += real_root=auto

option. This will automatically configure your boot loader to specify your root file system as the

real_root

to the initrd.

Step 5: boot-update

Now, simply run boot-update as root:

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.