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:
kernel-2.6.9-11.EL.src.rpm
(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 a.aaaa@mymail.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.
Alfred Madl
that the driver was avaliable only in rpm form and there were no source.
Have you ever installed a binary driver that is only compiled to RH using RH's
kernel in Debian?
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Alfred Madl
[ Parent | Reply to this comment ]
i.e. including not only the same glibc version, with red hat's patches, but everything else in the distro.
[ Parent | Reply to this comment ]
Thanks much for the recipe, Alfred!
[ Parent | Reply to this comment ]
As always: Who cares if it works ?! Right. But what if it doesnt ? I am sure discussions with hardware vendors are easier with Redhat kernel sources...
Alfred
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
We can to use MODULES=most [initrd size > 25 MB], but add parameter to menu.lst
...
kernel /vmlinuz..... ramdisk_size=30000
...
for 30 MB RamDisk . And do not forget to set CRAMFS=y to this kernel config.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[1] http://www.togaware.com/linux/survivor/Oracle_10g.shtml
[2] http://www.togaware.com/linux/survivor/survivor.shtml
[ Parent | Reply to this comment ]
Thank's a lot.
[ Parent | Reply to this comment ]
Hello!
What if I need to apply a debian patch package to the redhat debianised kernel source??? That is, what if I need to apply kernel-patch-vserver?
I'm constrained to use RH kernel 2.6.9-11.ELsmp for my "consolidation" project, in order to install and use IBMsdd proprietary multipathing software (for fault tolerant IBM SHARK S.A.N. access via FC HBAs).
Something like
make-kpkg -append-to-version=-11.ELsmp -initrd -added-patches vserver buildpackage
will work???
Best regards
F. Simonetti
[ Parent | Reply to this comment ]