Difference between revisions of "RHEL5 Kernel HOWTO"
(pointed to the renamed category) |
|||
| Line 1: | Line 1: | ||
1. Downgrade udev to a version compatible with kernels previous than 2.6.27: | 1. Downgrade udev to a version compatible with kernels previous than 2.6.27: | ||
| + | |||
| + | <pre> | ||
echo ">=sys-fs/udev-147" >> /etc/portage/package.mask | echo ">=sys-fs/udev-147" >> /etc/portage/package.mask | ||
emerge -u udev | emerge -u udev | ||
| + | </pre> | ||
2. Mask any openvz-sources version equal or newer than 2.6.27: | 2. Mask any openvz-sources version equal or newer than 2.6.27: | ||
| + | |||
| + | <pre> | ||
echo ">=sys-kernel/openvz-sources-2.6.27" >> /etc/portage/package.mask | echo ">=sys-kernel/openvz-sources-2.6.27" >> /etc/portage/package.mask | ||
| + | </pre> | ||
3. openvz-sources-2.6.18* needs gcc-4.1*, so you must install it prior build your future downgraded kernel. If you have newer versions than gcc-4.1* then you must install this one. Also check your CFLAGS if you are using gcc-4.3* or later *AND* your make.conf CFLAGS has -march=native, due previous GCC versions doesn't allow it. Check [1] and put a correct -march directive in your CFLAGS. You also need to change CXXFLAGS in the same way, ie: | 3. openvz-sources-2.6.18* needs gcc-4.1*, so you must install it prior build your future downgraded kernel. If you have newer versions than gcc-4.1* then you must install this one. Also check your CFLAGS if you are using gcc-4.3* or later *AND* your make.conf CFLAGS has -march=native, due previous GCC versions doesn't allow it. Check [1] and put a correct -march directive in your CFLAGS. You also need to change CXXFLAGS in the same way, ie: | ||
| + | |||
| + | <pre> | ||
CFLAGS="-march=amd64" CXXFLAGS="-march=amd64" emerge =sys-devel/gcc-4.1.2 | CFLAGS="-march=amd64" CXXFLAGS="-march=amd64" emerge =sys-devel/gcc-4.1.2 | ||
| + | </pre> | ||
That may take a while, take a cup of your favourite beverage and wait until finish. | That may take a while, take a cup of your favourite beverage and wait until finish. | ||
| Line 14: | Line 23: | ||
4. Switch to gcc-4.1* on your system: | 4. Switch to gcc-4.1* on your system: | ||
| + | |||
| + | <pre> | ||
localhost ~ # gcc-config -l | localhost ~ # gcc-config -l | ||
[1] x86_64-pc-linux-gnu-4.1.2 | [1] x86_64-pc-linux-gnu-4.1.2 | ||
| Line 35: | Line 46: | ||
localhost ~ # | localhost ~ # | ||
| + | </pre> | ||
5. Rebuild your sources: | 5. Rebuild your sources: | ||
| + | <pre> | ||
cd /usr/src/linux | cd /usr/src/linux | ||
make menuconfig | make menuconfig | ||
| Line 42: | Line 55: | ||
make | make | ||
cp arch/x86/boot/bzImage /boot/linux-2.6.18-openvz-028.068.9 | cp arch/x86/boot/bzImage /boot/linux-2.6.18-openvz-028.068.9 | ||
| + | </pre> | ||
6. Update /etc/boot.conf to point to your new kernel, ie: | 6. Update /etc/boot.conf to point to your new kernel, ie: | ||
| + | |||
| + | <pre> | ||
vi /etc/boot.conf | vi /etc/boot.conf | ||
[inside /etc/boot.conf now] | [inside /etc/boot.conf now] | ||
| Line 50: | Line 66: | ||
params root=/dev/sda3 | params root=/dev/sda3 | ||
} | } | ||
| + | </pre> | ||
7. Reboot your computer and enjoy | 7. Reboot your computer and enjoy | ||
| + | |||
| + | <pre> | ||
reboot | reboot | ||
| + | </pre> | ||
| + | |||
[[Category:HOWTO]] | [[Category:HOWTO]] | ||
Revision as of 05:07, 7 November 2010
1. 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
2. Mask any openvz-sources version equal or newer than 2.6.27:
echo ">=sys-kernel/openvz-sources-2.6.27" >> /etc/portage/package.mask
3. openvz-sources-2.6.18* needs gcc-4.1*, so you must install it prior build your future downgraded kernel. If you have newer versions than gcc-4.1* then you must install this one. Also check your CFLAGS if you are using gcc-4.3* or later *AND* your make.conf CFLAGS has -march=native, due previous GCC versions doesn't allow it. Check [1] and put a correct -march directive in your CFLAGS. You also need to change CXXFLAGS in the same way, ie:
CFLAGS="-march=amd64" CXXFLAGS="-march=amd64" emerge =sys-devel/gcc-4.1.2
That may take a while, take a cup of your favourite beverage and wait until finish.
4. Switch to gcc-4.1* on your system:
localhost ~ # gcc-config -l [1] x86_64-pc-linux-gnu-4.1.2 [2] x86_64-pc-linux-gnu-4.4.3 * localhost ~ # gcc-config 1 * Switching native-compiler to x86_64-pc-linux-gnu-4.1.2... >>> Regenerating /etc/ld.so.cache... [ok] * If you intend to use the gcc from the new profile in an already * running shell, please remember to do: * # source /etc/profile localhost ~ # source /etc/profile localhost ~ # gcc --version gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.3) gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.3) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. localhost ~ #
5. Rebuild your sources:
cd /usr/src/linux make menuconfig [do your work] make cp arch/x86/boot/bzImage /boot/linux-2.6.18-openvz-028.068.9
6. Update /etc/boot.conf to point to your new kernel, ie:
vi /etc/boot.conf
[inside /etc/boot.conf now]
"Funtoo Linux" {
kernel linux-2.6.18-openvz-028.068.9
params root=/dev/sda3
}
7. Reboot your computer and enjoy
reboot