Page 1 of 1

Can't find file to patch

PostPosted: Wed Jul 23, 2008 9:55 am
by evilangel
Hi all,

I am experiencing problems to patch a vanillia kernel.
I followed this howto: http://www.tuxmachines.org/node/8676

I am using the latest GrSecurity patch 2.1.1 with the latest stable kernel 2.6.26.
The system already install is a Debian Etch on a x86 system.

So i:
1) moved as /usr/src
2) downloaded kernel and patch
3) decompressed the kernel
Code: Select all
pax:/usr/src# ls -alh
total 49M
drwxrwsr-x  3 root src   104 2008-07-23 16:29 .
drwxr-xr-x 11 root root  109 2008-07-23 14:13 ..
-rw-r--r--  1 root src  255 2008-07-23 13:20 grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz
drwxr-xr-x 21 root root 4.0K 2008-07-13 23:51 linux-2.6.26
-rw-r--r--  1 root src   48M 2008-07-23 13:08 linux-2.6.26.tar.bz2
pax:/usr/src#
4) patched the kernel, but i got error
Code: Select all
pax:/usr/src# gunzip < grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz | patch -p0
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urNp linux-2.6.24.5/arch/alpha/kernel/module.c linux-2.6.24.5/arch/alpha/kernel/module.c
|--- linux-2.6.24.5/arch/alpha/kernel/module.c  2008-03-24 14:49:18.000000000 -0400
|+++ linux-2.6.24.5/arch/alpha/kernel/module.c  2008-03-26 20:21:07.000000000 -0400
--------------------------
File to patch:
Any ideas ?
Thanks

Re: Can't find file to patch

PostPosted: Wed Jul 23, 2008 10:31 am
by evilangel
Ok, I copied the patch into the new linux directory, and i used the -p1 argument instead of -p0.

It worked better.

However, I am experiencing another similar problem:
Code: Select all
Hunk #2 succeeded at 37 (offset -2 lines).
patching file arch/x86/boot/boot.h
Hunk #1 succeeded at 76 (offset -2 lines).
Hunk #2 succeeded at 172 (offset -2 lines).
patching file arch/x86/boot/compressed/head_32.S
can't find file to patch at input line 3083
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urNp linux-2.6.24.5/arch/x86/boot/compressed/misc_32.c linux-2.6.24.5/arch/x86/boot/compressed/misc_32.c
|--- linux-2.6.24.5/arch/x86/boot/compressed/misc_32.c  2008-03-24 14:49:18.000000000 -0400
|+++ linux-2.6.24.5/arch/x86/boot/compressed/misc_32.c  2008-03-26 20:21:07.000000000 -0400
--------------------------
File to patch:
Any idea ?

Re: Can't find file to patch

PostPosted: Wed Jul 23, 2008 4:30 pm
by PaX Team
evilangel wrote:Ok, I copied the patch into the new linux directory, and i used the -p1 argument instead of -p0.

It worked better.

However, I am experiencing another similar problem:
which kernel do you think grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz is for? ;)

Re: Can't find file to patch

PostPosted: Thu Jul 24, 2008 12:23 am
by nowshining
the patch works fine on 2.6.24.7 tho - the last of the 2.6.24.x series. ;)

Re: Can't find file to patch

PostPosted: Thu Jul 24, 2008 5:41 am
by evilangel
which kernel do you think grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz is for?
:oops:

Well,...., it works now with 2.6.24.7 :D