Skip to contentSkip to conversation

patching the kernel

DISCUSSION joe briggs 4 participants 4 messages Mar 9, 2003 – Mar 10, 2003

lore
Share & tools
lore

joe briggs

author
#0 lore raw

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

#1 lore raw
Quoted 6 lines · joe briggs

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

#2 lore raw
In reply to joe briggs

On Sun, 2003-03-09 17:11:21 -0500, joe briggs <[email protected]> wrote in message <[email protected]>:

Quoted 6 lines

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

Signature · 4 lines
   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));
#3 lore raw
In reply to joe briggs
Quoted 8 lines · joe briggs

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