Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Patching kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mozzi
n00b
n00b


Joined: 27 Oct 2004
Posts: 3

PostPosted: Fri Mar 04, 2005 10:55 am    Post subject: Patching kernel Reply with quote

Hi

If I want to patch the kernel with something that is not included, what would be the best way to go about it?

Mozzi
Back to top
View user's profile Send private message
thebigslide
l33t
l33t


Joined: 23 Dec 2004
Posts: 792
Location: under a car or on top of a keyboard

PostPosted: Fri Mar 04, 2005 12:35 pm    Post subject: Reply with quote

download the kernel source tarball to /usr/src/linux
download the patch .diff to /usr/src
cd /usr/src/linux
cat ../file.diff | patch -p1 --dry-run
if the patch is gzipped or bzip2'd, replace cat with gzcat or bzcat respectively.

If you get an error about 'cannot find file to patch at line1', and then a bunch of text,
try -p0 instead of -p1 or maybe even try -p2 if -p0 doesn't work.

This will tell you if the patch will apply cleanly. If there are FAILure's you have to either edit the source that has changed by hand, which takes little programming knowledge at best, or indepth knowledge of the kernel's inner workings at worst, depending on why the patch failed.

The kernel source won't actually be patched by the above command because of the --dry-run argument. If you want to proceed with the patch (no or few failures), remove the --dry-run bit.

Then you have to make mrproper and recompile the kernel. When you make mrproper, it will delete your configuration unless you backup the .config file in /usr/src/linux somewhere safe first.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum