LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-13-2005, 04:37 AM   #1
new.thing
LQ Newbie
 
Registered: Jul 2005
Posts: 15

Rep: Reputation: 0
Kernel patching..


Hi all,
I'd like to compile kernel sources 2.6.12 with the following patch 2.6.12.2, 2.6.13-rc2, 2.6.13-rc5 but when I apply the second one I obtain the following error:

patch --dry-run -p1 < /root/WORKING/KERNEL/PATCHES
/patch-2.6.13-rc2 | less

...


patching file Makefile
Hunk #1 FAILED at 1.
1 out of 3 hunks FAILED -- saving rejects to file Makefile.rej

...etc..

what does "Hunk #n FAILED" mean?
Thanks a lot!
>m<
 
Old 07-13-2005, 06:16 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
It means there was a conflict applying the 2.6.13-rc2 patch. The 2.6.13-rc2 patch is supposed to be applied to the 2.6.12 source and it contains the 2.6.12.2 patch, so start again and don't use the 2.6.12.2 patch
 
Old 07-13-2005, 06:18 AM   #3
eqxro
Member
 
Registered: Apr 2004
Location: Outer space :D
Distribution: Gentoo 2005.0 amd64 2.6.14-dfx3
Posts: 203

Rep: Reputation: 30
It means that the patch program can't apply a part of the patch because he can't figure out what needs to be modified. The patches can modify certain parts of a file, e.g: in line 10, replace "static void.." with "void...", then in line 324 change from "int a;" to "unsigned int a;". Take this for example:

Code:
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -52,6 +52,8 @@
      *  Frame buffer device initialization and setup routines
      */
 
+extern int vesafb_init_thread(void);
+
 #define FBPIXMAPSIZE	(1024 * 8)
 
 static struct notifier_block *fb_notifier_list;
@@ -1155,6 +1157,10 @@ fbmem_init(void)
 		printk(KERN_WARNING "Unable to create fb cl[...]
 		fb_class = NULL;
 	}
+
+#if defined(CONFIG_FB_VESA_TNG) || defined(CONFIG_FB_VESA_TNG_MODULE)
+	vesafb_init_thread();
+#endif
 	return 0;
 }
This patch file has two HUNKS: the first one starts with "@@ -52,6 +52,8 @@" and tells the patch file to add the new function between the comment and the #define. The second hunk follows: "@@ -1155,6 +1157,10 @@ fbmem_init(void)" and adds the #if defined part.

If the file to be patched is different than the files the patch is supposed to work for - as in, instead of "#define FBPIXMAPSIZE (1024 * 8)" the patch app finds "#define SOMETHINGELSE 1", that hunk will not be patched as patch does not know how to handle this difference - the result is "HUNK #1 FAILED at ...".

If you have experience in C++, you can ignore this errors and try to manually patch the files (looking at the .rej file and the half-patched file). Sometimes the hunks fail just because the patch is already applied or someone corrected a typo in a comment.
 
Old 07-13-2005, 06:36 AM   #4
new.thing
LQ Newbie
 
Registered: Jul 2005
Posts: 15

Original Poster
Rep: Reputation: 0
thanks a lot for your help!
It was quite difficult to understand the exact meaning of "hunk" and "context" from the man page and kernel-howtos.., but the example is clear
I restart from 2.6.12 source code and try to add 2.6.13-rc2 .. and then check the libata patch I need is at the correct place.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Patching the Kernel Zuggy Linux - General 3 12-27-2004 08:34 AM
Patching a 2.6 kernel with a 2.4 kernel keyboard driver..possible? dxx Linux - Laptop and Netbook 3 11-18-2004 04:18 AM
kernel patching pfunk Linux - Software 3 10-06-2004 06:55 PM
patching kernel paulr1984 Linux - Software 1 07-07-2004 10:32 PM
kernel patching erikm103 Linux - General 2 03-19-2003 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration