LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-09-2010, 02:55 AM   #1
akaash1087
LQ Newbie
 
Registered: May 2010
Posts: 4

Rep: Reputation: 0
cant understand patch file


Hi
I am trying to put patch on my customized OS but it gives an error
saying
Hunk #1 succeeded at 38 (offset -2 lines).
Hunk #2 succeeded at 113 with fuzz 2 (offset -2 lines).
Hunk #3 FAILED at 152.
there is no reject file in the current dir.Any possible explanations why it is not getting formed?
there are lines like @@ -52,12 +115,16 @@ int patch file.what does it mean?
what can be the possible reason for HUNK FAILED?
 
Old 06-09-2010, 02:59 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well the failure means that the changes defined in the file were not able to be applied, as the lines used to identify the area of code to be modified were probably not consistent. Just look at it yourself and verify what is trying to be done.
 
Old 06-09-2010, 03:19 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,373

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
I am presuming this is a patch with diff -u ( has - and +). Hunk 1 and 2 succeed at low offsets. To find out what is going on, look at hunk 3. As you read through the patch, watch iout for a line like
patching file somedir/foo.c

There might be many of these, so watch for the one relating to hunk 3
@@ -52,12 +115,16 @@

This is the beginning of a hunk. The usual invocation of patch is
diff -Naur mysoftware-version.orig mysoftware.version
The first being the original software and the second the same package with a bug fixed.
So That hunk begins at line 52 and goes on for 12 lines in the .orig file marked with a - and it goes in at 115 in the patched file and goes on for 16 lines. So 12 come out and 16 go in.

The usual reason patches fail is that they are already applied - you're fixing a bug that's already fixed. Next main reason is getting the p number wrong. The way I use patch is to put the patch beside the source tree, cd into the source tree, and run patch -p1 ../the_patch.patch
 
  


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
patch problem - can't find file to patch jnutt Linux - Kernel 3 02-10-2010 03:45 PM
please help me understand this WIFI PATCH, its too vague for me lxquestions000019 Linux - Newbie 1 08-25-2009 11:09 AM
Can anyone help me understand an rpm spec file kkprankk Linux - Software 1 10-25-2008 07:18 PM
device file to understand superstition Linux - General 1 11-11-2005 05:01 PM
to understand log file diego-bellini Linux - Security 3 10-22-2004 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:39 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