2003-03-09 20:58:26

by joe briggs

[permalink] [raw]
Subject: patching the kernel

My apologies for this question that is so basic to all of you, but can any of
you please point me toward a howto or instructions for exactly how to 'patch
a kernel'? For example, at kernel.org, the latest stable kernel is 2.4.20,
and is actually a patch. I currently use 2.4.19 under Debian and routinely
rebuild & install it no problem. If I download a kernel 'patch', do I apply
it to the entire directory, or the compiled kernel, etc.? Thanks so much.

Joe


2003-03-09 21:09:25

by Sam Ravnborg

[permalink] [raw]
Subject: Re: patching the kernel

On Sun, Mar 09, 2003 at 05:11:21PM -0500, joe briggs wrote:
> My apologies for this question that is so basic to all of you, but can any of
> you please point me toward a howto or instructions for exactly how to 'patch
> a kernel'? For example, at kernel.org, the latest stable kernel is 2.4.20,
> and is actually a patch. I currently use 2.4.19 under Debian and routinely
> rebuild & install it no problem. If I download a kernel 'patch', do I apply
> it to the entire directory, or the compiled kernel, etc.? Thanks so much.

Did you read README in the top-level directory of your kernel src?
It is wise to run
$ cp .config ../saved-config
$ make mrproper <= this one deletes all .o files etc.
$ cp ../saved-config .config
$ make oldconfig dep bzImage modules
after patching the kernel

Did not build a 2.4.* kernel for a while, but the README should provide
all the details.

Sam

2003-03-09 21:14:45

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: patching the kernel

On Sun, 2003-03-09 17:11:21 -0500, joe briggs <[email protected]>
wrote in message <[email protected]>:
> My apologies for this question that is so basic to all of you, but can any of
> you please point me toward a howto or instructions for exactly how to 'patch
> a kernel'? For example, at kernel.org, the latest stable kernel is 2.4.20,
> and is actually a patch. I currently use 2.4.19 under Debian and routinely
> rebuild & install it no problem. If I download a kernel 'patch', do I apply
> it to the entire directory, or the compiled kernel, etc.? Thanks so much.

tar xzf .../linux-2.4.19.tar.gz
-or-
tar xjf .../linux-2.4.19.tar.bz2

and then apply the patch:

cd linux-2.4.19
zcat .../patch-2.4.20.gz | patch -p1
-or-
bzcat .../patch-2.4.20.bz2 | patch -p1

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA));


Attachments:
(No filename) (1.10 kB)
(No filename) (189.00 B)
Download all attachments

2003-03-10 04:30:25

by scott thomason

[permalink] [raw]
Subject: Re: patching the kernel

On Sunday 09 March 2003 04:11 pm, joe briggs wrote:
> My apologies for this question that is so basic to all of you,
> but can any of you please point me toward a howto or
> instructions for exactly how to 'patch a kernel'? For
> example, at kernel.org, the latest stable kernel is 2.4.20,
> and is actually a patch. I currently use 2.4.19 under Debian
> and routinely rebuild & install it no problem. If I download
> a kernel 'patch', do I apply it to the entire directory, or
> the compiled kernel, etc.? Thanks so much.

I usually use these patch commands, as they make finding any
errors so much easier:

bunzip patchfile.bz2 ## or...
gunzip patchfile.gz

cd linux-2.4.x
## To see if the patch is actually going to work
patch -p1 --batch --quiet --dry-run < ../patchfile
## To actually apply the patch
patch -p1 --batch --quiet < ../patchfile

---scott