Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: DavidRawson on September 26, 2007, 07:25:10 PM

Title: Patching
Post by: DavidRawson on September 26, 2007, 07:25:10 PM
I looked at the wiki, however, I could not figure out why 'patch' is a source code. I can't find any binaries and I can't figure out how to compile it. Thanks.
Title: Re: Patching
Post by: saratoga on September 26, 2007, 07:31:07 PM
A patch file is a description of a change to source code.  The 'why' is because a way is needed to distribute changes to source code between people in a compact and human readable manner.  

Quote
I can't find any binaries

Check the unsupported builds forum.
Title: Re: Patching
Post by: DavidRawson on September 27, 2007, 12:54:49 AM
What I meant about the binaries were the patch program files. What do I need to compile patch? Or are there binaries somewhere? I tried google with no luck.

Edit: If you find a perfectly working patch in the flyspray, would you make it standard in future rockbox builds?
Title: Re: Patching
Post by: scorche on September 27, 2007, 02:15:24 AM
Are you talking about this? http://www.gnu.org/software/patch/

Quote
If you find a perfectly working patch in the flyspray, would you make it standard in future rockbox builds?

Not just any patch is accepted...there are many different factors that go into deciding what is worthy of being included.  It is better to point to a specific patch and ask "Why isn't this patch accepted?" than to ask why a patch would have to look like to be included.
Title: Re: Patching
Post by: krazykit on September 27, 2007, 08:45:22 AM
What I meant about the binaries were the patch program files. What do I need to compile patch? Or are there binaries somewhere? I tried google with no luck.

If you've set up your build environment correctly, patch is already installed.
Title: Re: Patching
Post by: GodEater on September 27, 2007, 08:48:32 AM
And if you haven't then "patch" on it's own isn't going to help you much.
Title: Re: Patching
Post by: Heriver on September 27, 2007, 11:26:44 AM
What do I need to compile patch? Or are there binaries somewhere?

This online book tell's you more about working with and using 'Patch' and 'Diff' files and invoking as command.
I have reading this mostley and i've learn how to use .patch files or .diff files,
without any C programming knowledge.

Look here. www.network-theory.co.uk/docs/diff/index.html
Title: Re: Patching
Post by: DavidRawson on September 28, 2007, 02:31:44 AM
Are you saying that by running rockboxdev.sh, that patch and diff are already installed? I tried patch, but all it did was make a blank line and nothing happens.
Title: Re: Patching
Post by: dionoea on September 28, 2007, 03:54:01 AM
Did you read http://www.rockbox.org/twiki/bin/view/Main/WorkingWithPatches ?
Title: Re: Patching
Post by: Heriver on September 28, 2007, 09:58:13 AM
Are you saying that by running rockboxdev.sh

No, i did not.

Quote
 patch and diff are already installed? I tried patch, but all it did was make a blank line and nothing happens.

Oke, from the beginning.

Did you ever compiled a Rockbox source?
If not?
Look at: www.rockbox.org/twiki/bin/view/Main/DevelopmentGuide#Setup_Your_Environment
You must set-up an enviroment, but it depends on your PC, Linux or Windows!

I choose first CygWin (i have an windows-PC) and now i work only with VMWare
(coLinux setup fails here, during the installation),
i can advise you, choose for the VMWare, its much faster then CygWin.
Again, if you have a Windows-PC!

After this:
Look here: www.rockbox.org/twiki/bin/view/Main/HowToCompile

If you can make a build, then you can try to apply an patch to the source,
but an patch is not always needed, it depends.
Example: i like the REP-patch (search in the forums) so i invoke this one,
because i need this one, just like that!
Title: Re: Patching
Post by: DavidRawson on October 09, 2007, 10:31:25 PM
I did the stuff that does the thing and it did the install thing. I did the compile thing and it worked made the rockbox binary that works. Then I use diff on patch to compile patch and take the .diff file and rename it rockboxpatch.c and insert it into the rockbox directory when compiling. It makes a folder that I look in and there it is. I test it on rockbox but nothing happened. I put the player in manufacture mode and renamed rockboxpatch.c to BL_SDboardSupport.rom and patched it to my player with e200tool. Now my player is bricked. I had to take apart my player and short circut the chip and now it starts again. It can't read the flash memory though. Is there a way to fix it so it works again?
Title: Re: Patching
Post by: saratoga on October 09, 2007, 10:37:46 PM
I did the stuff that does the thing and it did the install thing. I did the compile thing and it worked made the rockbox binary that works. Then I use diff on patch to compile patch

Did the patch work?  If nothing happens, it sounds like patch did not work.  Go back to this step and make sure the patch command didn't return an error.

and take the .diff file and rename it rockboxpatch.c and insert it into the rockbox directory when compiling.

diff files aren't c files, so this won't do anything (and anyway putting c files in the rockbox directory when compiling generally doesn't do anything anyway since the make file ignores any extra c files).

It makes a folder that I look in and there it is. I test it on rockbox but nothing happened. I put the player in manufacture mode and renamed rockboxpatch.c to BL_SDboardSupport.rom

Oh my.  Why on earth would you do this?  

Title: Re: Patching
Post by: DavidRawson on October 10, 2007, 06:47:57 PM
I thought it would patch it to the bootloader and the bootloader would patch it to rockbox when it started. And diff files look like c files only combined into one file.
Title: Re: Patching
Post by: GodEater on October 11, 2007, 03:42:45 AM
Seriously - you clearly haven't understood a thing about patching and compiling.

If you keep this up you WILL wreck your device. Stop what you're doing - leave it alone, and let people who understand this better than you get on with it.
Title: Re: Patching
Post by: Mad Cow on October 11, 2007, 07:53:54 AM
Seriously - you clearly haven't understood a thing about patching and compiling.

If you keep this up you WILL wreck your device. Stop what you're doing - leave it alone, and let people who understand this better than you get on with it.

He already has. He replaced the OF bootloader with a diff file.

See? That's what happens when you assume, and don't think before you do something. Don't just blindly rename and replace files. And I thought it was impossible to brick a player by installing rockbox unless you actually tried, I guess I was wrong. ::)
Title: Re: Patching
Post by: GodEater on October 11, 2007, 07:58:18 AM
And I thought it was impossible to brick a player by installing rockbox unless you actually tried, I guess I was wrong. ::)

I think "replacing your firmware binary with a text file" counts as trying...
Title: Re: Patching
Post by: Febs on October 11, 2007, 01:39:57 PM
And I thought it was impossible to brick a player by installing rockbox unless you actually tried, I guess I was wrong. ::)

This goes waaaayyyy beyond just "installing Rockbox."