You are not logged in.

#1 2011-04-11 18:14:09

ethail
Member
From: Spain
Registered: 2011-02-10
Posts: 225

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

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)


My GitHub Page

Best Testing Repo Warning: [testing] means it can eat you hamster, catch fire and you should keep it away from children. And I'm serious here, it's not an April 1st joke.

Offline

#2 2011-04-11 18:27:34

combuster
Member
From: Serbia
Registered: 2008-09-30
Posts: 711
Website

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

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.

Offline

#3 2011-04-11 19:14:22

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

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

I think you should use ABS. It's a great tool and a big part of ArchLinux's appeal imho. It's simple, easy and fast yet doesn't conceal the build process - quite the opposite.

What you'll want to do is read the archwiki article on ABS, install and run it once. Then grab the PKGBUILD for kernel26 (from testing as core will probably still be 2.6.37) and all you'll have to do is change a line to apply a patch.

Using the kernel26 PKGBUILD will also appy the -ARCH patchset and generally avoid some confusion/errors that might occur. At the end you'll get a nice clean kernel package you can install/remove via pacman.

Regards,
demian

Last edited by demian (2011-04-11 19:16:29)


no place like /home
github

Offline

#4 2011-04-12 06:30:20

ethail
Member
From: Spain
Registered: 2011-02-10
Posts: 225

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

Thank you boh for your answers. I'm thinking to give the ABS way a try.

(Going to mark this as solved)


My GitHub Page

Best Testing Repo Warning: [testing] means it can eat you hamster, catch fire and you should keep it away from children. And I'm serious here, it's not an April 1st joke.

Offline

#5 2011-04-12 07:54:54

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

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

Manual compilation is highly discouraged on Arch, you should use ABS as the preferred way to install a custom kernel. This will make sure your system stays easily manageable in the future.


ᶘ ᵒᴥᵒᶅ

Offline

#6 2011-04-12 16:42:36

ethail
Member
From: Spain
Registered: 2011-02-10
Posts: 225

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

On the end, I used the ABS way. It turned to be easier than i thought and "fast" (half hour or so). Kernel compiled and installed without any error (now i'm running it) and made  my troubles with hibernation gone.

Thank you all for your help and information.

Last edited by ethail (2011-04-12 16:43:03)


My GitHub Page

Best Testing Repo Warning: [testing] means it can eat you hamster, catch fire and you should keep it away from children. And I'm serious here, it's not an April 1st joke.

Offline

Board footer

Powered by FluxBB