You are not logged in.

#1 2005-02-25 10:00:53

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Problem Using more than one patchset for Kernels

I'm using vanilla 2.6.10 sources, with the -mh4 bluetooth patch, but I also want to apply the -as patch, as Arch has now adopted it for the standard kernel. So I have the following lines in the PKGBUILD:

##### Apply any patches here, if you set the patch variable above uncommment the following line
  patch -Np1 -i ../patch-2.6.10-as5 || return 1
  patch -Np1 -i ../patch-2.6.10-mh4 || return 1

and I have the patches downloaded into the build directory. When I run makepkg, I get a HUNK FAILED error at the patching stage, and makepkg aborts. If I run it with the -mh4 patch only, it works OK.

I realise this is nothing to do with the PKGBUILD, which I am sure will produce a uniquely-named package in about 30 minutes or so. Would you have any general advice regarding the use of more than one patch?

Offline

#2 2005-02-25 10:22:39

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Problem Using more than one patchset for Kernels

yeah - i have done this with a few patchsets.  it's easy if you know what you are doing.

i'll explain what is happening just in case you don't know - all patches are created based on the original code and work by matching existing code and replacing it with new code - if you apply one patch then another the first patch may alter some of the references that the second patch is try to match - so it fails.  what you need to do is to check where it has failed.

it will say patching core.c or something and the it will say HUNK FAILED - that means the first patchset changed the core.c code and the second patch can't find what it is looking for.

you then need to open the first patch - find out where core.c was changed and how and then open the second patch to see what it now needs to look for and then you'll then have to make new diffs to finish the process or eidt the old diffs (which is tricky but shorter)

it ain't easy.  if you have more than a few hunk failed don't even bother - there is no guarantee that they patches will provide a build-able kernel.

this whole process lies at the core of creating these massive patchsets - if you can combine both patchsets and get a successful build out of it you can consider yourself a novice kernel hacker. it can be done.

i can't help much more than that i'm afraid - i'll ask cactus to split these two posts too a new thread for you

Offline

#3 2005-02-25 11:15:46

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Problem Using more than one patchset for Kernels

Thanks again. I thought it was something like that, and yes, it should be in a separate thread - the kernel board is probably the place for it.

And as promised, makepkg has now finished, and I've just installed a uniquely-named 2.6.10-mh4 kernel, alongside my existing selection of 2.6.9 ones. Perfect dibble - thanks again.

Now, where do I sign up for the kernel-hacker's club?  wink  wink

Offline

#4 2005-02-25 20:38:25

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Problem Using more than one patchset for Kernels

dibblethewrecker wrote:

i'll ask cactus to split these two posts too a new thread for you

Done.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2005-02-25 21:44:21

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Problem Using more than one patchset for Kernels

This particular case was easy enough in the end. The only conflict was in the top-level Makefile. Patch -as5 set

EXTRAVERSION = -as5
NAME=Excuse Me Mr.

whereas patch -mh4 was expecting both parameters to be blank. I edited the -mh4 patch to look for the values set by -as5, and both patches worked. There was a message about

Hunk #1 succeeded at 1 with fuzz 1

which I've looked up, and I think it means that my editing of patch -mh4 was out by one line, but that the patch process compensated for my mistake.

I got a build out of it, anyway, so I'm happy. Thanks again for the advice, dibb.

Offline

#6 2005-02-26 08:00:19

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Problem Using more than one patchset for Kernels

no worries and thanks cactus! smile

Offline

Board footer

Powered by FluxBB