[SOLVED]How to patch the kernel? And other questions

10-11  Source: Network gathering  Views:0 

Advertisement
Like the same user who started this thread I'm suffering from hibernation resuming troubles using kernel 2.6.38. In that thread was posted a soluttion that involves patching the kernel.
The patch to apply is this:
http://git.kernel.org/?p=linux/kernel/g … e3e9fc8684
Waiting for the bug to be corrected and a new version supplied is not an option, because this laptop is my main computer and I heavly rely on hibernation.
Here's my trouble now. I don't know if it is possible to patch without recompiling the whole kernel, or it has to be compiled with that patch applied. I have seen the archlinux's wiki guide about compiling the kernel, but found nothing about applying patches (maybe I didn't searched with enought depth).
In case there is needed a full compilation, should I use the vanilla kernel, the Arch Linux one or any of the AUR ones (I said AUR because they're the first that came to my mind)? Should i expect a performance gain with this (apart from fixing the hibernation bug)?
Maybe i'm just doing a bunch of dumb questions, and the only thing I need is to search deeply on the wiki. In that case, please tell me. If not, I rather get some answers around kernel patching and / or compiling questions.
Edit: In addittion, it is possible that all this questions are just newbie ones, I don't know, but as I am willing to learn from this I will appreciate any info or documentation about it.
Thank you.
Last edited by ethail (2011-04-12 06:30:48)
From the source tree (/usr/src/linux-whatever) execute
patch -p1 < /path/to/fix.patch
then recompile kernel from the source tree.
Basically that consists of executing the following commands from the source tree:
make menuconfig
make
make modules_install
cp -v System.map /boot/System.map-CUSTOM
cp -v arch/x86/boot/bzImage /boot/vmlinuz-CUSTOM
mkinitcpio -k 2.6.38-CUSTOM -g /boot/kernel-CUSTOM.img
and you need to add menu entry in /boot/grub/menu.lst
-k 2.6.38-CUSTOM should corespond to /lib/modules/2.6.38-CUSTOM (replace 2.6.38-CUSTOM with the name of your module directory, name depends on the kernel version and suffix that you gave in menuconfig). Regarding kernel configuration in menuconfig - I can't help you, you could use arch stock kernel config (zcat /proc/config.gz > /usr/src/linux-whatever/.config)
I do these kind of things this way - maybe someone else have a more elegant solution.
Related articles