Creation of a Redhat RHEL Kernel 2.6.9-11 for Debian 3.1r0a Sarge
Posted by a_madl on Mon 17 Oct 2005 at 11:19
Did you ever want to have a Redhat kernel and drivers installed upon a Debian system? Here is how you can manage that easily.
Login as User "root" and run "cat /proc/version" - this will show the Kernel version you are running. This is the Debian kernel which will be replaced by a debianized Redhat kernel.
If you wish you can backup your current kernel to Floppy: I never did that :-) "mkboot /boot/vmlinuz-2.6.8" (substitute your kernel version).
To get started you'll need to install some packages:
apt-get install bzip2 docbook-utils gs kernel-package \ transfig fakeroot rpm libncurses5-dev
Now download the package kern2deb - currently you can find this here:
Install the package with :
dpkg -i kern2deb_1.2_all.deb
(There is an "intent to package" bug already filed on the Debian bug tracking system - #329770 - however the package is not yet included within Debian's archive.)
Now that you have th software you can start work on Debianizing your Redhat kernel.
Copy the Kernel sources from Redhat to the directory /usr/src, eg:
(e.g. from ftp://ftp.redhat.com/pub/redhat/linux/updates/enterprise/4ES/en/os/SRPMS/)
Convert the kernel sources to Debian layout:
kern2deb -k -m email@example.com -r no kernel-2.6.9-11.EL.src.rpm
This conversion takes some time. The mesage "No Packages found...." can be ignored since there is simply no corresponding Debian kernel-source Package (yet) available from Debian.org.
Copy a working configuration file from somewhere within the new tree:
cd kernel-source-2.6.9.redhat-2.6.9.redhat.11.el cp ../kernel-2.6.9-11.EL.dir/kernel-2.6.9-i686-smp.config .config
(The kernel configuration files for any installed Debian kernels will be available as /boot/config-*)
Now you can run "make oldconfig", or "make menuconfig" to configure the kernel.
Configure mkinitrd to only include needed modules (otherwise initrd.img gets too big and kernel will not start...I think because of a GRUB limitation or so...!)
edit /etc/mkinitrd/mkinitrd.conf and set MODULES=dep!
To build your configured kernel run "make-kpkg clean" and "make-kpkg -append-to-version=-rh11-0001-i686-smp -initrd buildpackage".
Answer "N" to the mkinitrd question regarding the needed patch.
"cd .." and "ls -la kernel*rh11*" should now show your Debianized RedHat kernel.
The kernel can be installed with:
dpkg -i kernel-image-2.6.9-rh11-0001-i686_i386.deb
(Change the name if you appended a different string to your package)
Boot your new kernel...good luck !
After a successful reboot and login a "cat /proc/version" should show your new kernel running.
I hope this helps somebody.