Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: joetermini on October 15, 2006, 03:23:16 PM

Title: Trouble with compiling some patches and adding new plugins
Post by: joetermini on October 15, 2006, 03:23:16 PM
Hey, I have been using Rockbox for a while on my 5G iPod, and have a pretty good understanding of how it works. I am running a custom build, Senab's Experimental.
I tried creating my own custom build, and I have a few questions about applying patches

When installing many of the patches which I know work, I get a bunch of messages such as "HUNK #1 Failed at 53". After one or two lines like this, the rest are successful. Is there anything I need to do to get these patches working?

Second Question: I have a few patches for new plugins, such as one called pegbox. Sometimes I get a .patch file, and sometimes it’s accompanied by a .c file. I know that .c is a plugin, but what do I do with it. And what do I do if I only get the .c file?

Final question: With some patches, I am given a number of separate patches. None of them work. (As in at the end of the text I get after entering the command, it says "File to Patch:" What do I do with this?
Title: Re: Trouble with compiling some patches and adding new plugins
Post by: saratoga on October 15, 2006, 04:17:48 PM
If the c file contains the entire plugin, you probably just need to add it to the plugins directory and edit the SOURCES (IIRC this is what its called) file to list your plugin.c so that when you ./configure it adds that plugin to the make file.
Title: Re: Trouble with compiling some patches and adding new plugins
Post by: joetermini on October 15, 2006, 10:08:42 PM
Thanks man, but what about the failed hunks and the multiple patches?
Title: Re: Trouble with compiling some patches and adding new plugins
Post by: Kratos on October 15, 2006, 10:34:00 PM
The HUNK errors mean that the patches dont work with the more recent builds of rockbox.

so you either have to apply the changes to the firmware manually, or change the patches to match the firmware changes
Title: Re: Trouble with compiling some patches and adding new plugins
Post by: joetermini on October 16, 2006, 01:06:24 PM
That sounds a little difficult. What would I be changing?
Title: Re: Trouble with compiling some patches and adding new plugins
Post by: Rincewind on October 16, 2006, 03:48:56 PM
That sounds a little difficult. What would I be changing?

That really depends.
I suggest you open both the patch file and the source file where the hunk failed in an editor. Then in the source file you go to the line-number of the failed hunk. You view both files side by side and try to understand what the hunk does and why it failed. Then you manually do what the patch utility would do with the hunk (removing lines with - , adding lines with + and changing lines with !).
If the result doesn't look like C-Code anymore, then you either have done something wrong or the patch is badly out if date. An editor with syntax coloring can help you spotting bad mistakes.

I don't know if the patch tool stops after a failed hunk, if it does you have to apply the hunks after the failed one, too. I use use a different tool to patch, so I can't help you with commandline switches that might help you here.

If you have multiple patches you apply them one after the other, in the same order the author of the patch suggests.

If you get a .c file, the author should mention somewhere where to put this file (a good guess is /apps if it is a patch to rockbox or /apps/plugins if it is a plugin)
Title: Re: Trouble with compiling some patches and adding new plugins
Post by: joetermini on October 16, 2006, 08:21:20 PM
thanks a ton man