Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Unable to patch the source code
« previous next »
  • Print
Pages: [1]

Author Topic: Unable to patch the source code  (Read 3462 times)

Offline psgarcha92

  • Member
  • *
  • Posts: 36
Unable to patch the source code
« on: May 19, 2011, 03:41:25 AM »
Hey guys
i've been trying hard to compile my own Build of rockbox for my Sansa Fuze V2 since a couple of days, and i wanted it to have the Line Out Dock patch as posted in

 "http://www.rockbox.org/tracker/task/12074?string=sansa+fuze+dock&project=1&type[0]=4&sev[0]=&pri[0]=&due[0]=&reported[0]=&cat[0]=&status[0]=open&percent[0]=&opened=&dev=&closed=&duedatefrom=&duedateto=&changedfrom=&changedto=&openedfrom=&openedto=&closedfrom=&closedto="

Now, i follow the Steps as on http://www.rockbox.org/wiki/LinuxSimpleGuideToCompiling,
and i have downloaded and installed all repositories needed, including the source code.

Now, i believe, or by as much i have understood, this is the time to apply a patch, prior to compiling.
So, i check if i have the Patch program/code installed, and i do.
now, i type in and get the following.

prabhdeepsingh@ubuntu:~$ cd rockbox/tools
prabhdeepsingh@ubuntu:~/rockbox/tools$ sudo patch < /home/prabhdeepsingh/fuze22.patch
[sudo] password for prabhdeepsingh:
patching file as3514.c
Hunk #1 FAILED at 78.
Hunk #2 FAILED at 265.
Hunk #3 FAILED at 275.
Hunk #4 FAILED at 316.
4 out of 4 hunks FAILED -- saving rejects to file as3514.c.rej
patching file as3514.h
Hunk #1 FAILED at 23.
Hunk #2 FAILED at 30.
2 out of 2 hunks FAILED -- saving rejects to file as3514.h.rej
patching file sansafuzev2.h
Hunk #1 FAILED at 209.
1 out of 1 hunk FAILED -- saving rejects to file sansafuzev2.h.rej
patching file power-as3525.c
Hunk #1 FAILED at 73.
1 out of 1 hunk FAILED -- saving rejects to file power-as3525.c.rej

why am i so unable to patch the files? what am i doing wrong?
Logged

Offline marc2003

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #1 on: May 19, 2011, 04:35:00 AM »
http://www.rockbox.org/wiki/WorkingWithPatches#Applying_A_Patch

Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Unable to patch the source code
« Reply #2 on: May 19, 2011, 07:58:16 AM »
What strip setting did you use?

The patch was generated with git, so you'll need to use the -p1 strip option.

patch -p1 < name_of_patch.patch

If after that, you still get failed hunks, then the patch is so out of sync that patch can't even make an educated guess at where to apply the code, so it will fail.
At that point you'll need to patch by hand, if it indeed comes to that.
I suspect in this case that changing the strip option will "just work", though.


[St.]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline psgarcha92

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #3 on: May 19, 2011, 09:20:04 AM »
In the page that describes Working with patches, the "patch < patchfile"
command is used first, and i use,
patch < fuze22.patch.
Using the strings is to be done after this command results in something right? In my case patch < fuze22.patch fails already, how do i use the strings then?i am going to try right now.
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Unable to patch the source code
« Reply #4 on: May 19, 2011, 11:49:21 AM »
Quote from: psgarcha92 on May 19, 2011, 09:20:04 AM
In the page that describes Working with patches, the "patch < patchfile"

1)  p option
2)  wrong folder


A patch is just a list of files and changes to make to them.  Open up the patch and take a look at the paths it uses.   Unless your path matches the one in the patch file, you will need to use a p option.  In this case probably "-p 1".
Logged

Offline psgarcha92

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #5 on: May 19, 2011, 12:09:42 PM »
Ok, now i've built the Build. have completed compiling and have made the Zip by using the Make Zip command.
but where is the Zip file placed? i just cant locate it> where do i look for it? the root folder is locked, that i can just browse using the Terminal, nothing else.
Where is the Zip file that i made from the source code?
Logged

Offline marc2003

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #6 on: May 19, 2011, 12:39:46 PM »
you are joking right?  ;D

(it's inside the "build" folder that you must have created and ran tools/configure and make from)
Logged

Offline psgarcha92

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #7 on: May 19, 2011, 01:02:53 PM »
am not kidding at all.
i am using Ubuntu particularly, there wasnt any point where i created any builds folder.
i was using cd rockbox/tools
to start compiling, but sadly, i just cant find where the folder exists.
Logged

Offline marc2003

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #8 on: May 19, 2011, 01:28:52 PM »
Quote from: psgarcha92 on May 19, 2011, 03:41:25 AM
Now, i follow the Steps as on http://www.rockbox.org/wiki/LinuxSimpleGuideToCompiling,
and i have downloaded and installed all repositories needed, including the source code.

you really read that but you don't have a build folder???

Quote
Type cd ~/rockbox. The last line in your terminal should read username@computername:~/rockbox$ . Type mkdir build (mkdir means "make directory"), then type cd build . Your current line should say username@computername:~/rockbox/build$ Now type ../tools/configure - and make sure you include those two periods.

A table of ALL the devices Rockbox supports will come up, and each device will have a number beside it. Simply type the number for the device you want to make a build for. I use a Sansa c200, so I would type 52.

Next, you'll see a few choices for the type of build you'd like to make. Let's make a normal build: type n. Wait for a few seconds. When it says "Created makefile", type make (or make -j for a multicore system) and wait. Type make zip to prepare a rockbox.zip and wait a little more. That's your build, ready to install onto a real device. Use it like you would for a manual update (that is, unzip its contents into the root of your device, overwriting old files if necessary). When it's done, congratulations! You've compiled your own copy of Rockbox, and made a .zip file like the one you download from the website!
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Unable to patch the source code
« Reply #9 on: May 19, 2011, 01:35:21 PM »
We have detailed instructions on how to build Rockbox in the wiki. If you decide not to follow them you shouldn't expect people helping you. Building from the tools folder is wrong wrong wrong and will cause you all kind of trouble. But feel free to ignore what others have already figured and documented and waste lots of time. If you can't figure it from the documentation you might be better not compiling your own build at all. You *can* seriously damage your player so making the process too simple is a bad thing.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Unable to patch the source code
« Reply #10 on: May 19, 2011, 01:55:44 PM »
Quote from: psgarcha92 on May 19, 2011, 01:02:53 PM
i was using cd rockbox/tools
to start compiling, but sadly, i just cant find where the folder exists.

The configure script won't' even let you build in that folder, so I don't think this is right.  What did you do?
Logged

Offline psgarcha92

  • Member
  • *
  • Posts: 36
Re: Unable to patch the source code
« Reply #11 on: May 20, 2011, 01:42:03 PM »
and how exactly did you guys come to the conclusion that i wasnt reading the instructions on the wiki? I read and followed the last guide that had been there a couple of djys ago. As i observed, i bet that the wiki has been updated yesterday or day before. And, i have compiled my version of RB with the patch already. I had to use the -p1 parameter and it finally compiled. I even used the newer wiki and was able to compile it in 20mins.
The problew i now face is, my Sansa Fuze v2 always stays in the line out mode.there is nothing in the build that lets me select between line out and headphone mode.
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Unable to patch the source code
« Reply #12 on: May 20, 2011, 02:31:13 PM »
Quote from: psgarcha92 on May 20, 2011, 01:42:03 PM
and how exactly did you guys come to the conclusion that i wasnt reading the instructions on the wiki?

Because you didn't follow them.

Quote from: psgarcha92 on May 20, 2011, 01:42:03 PM
I read and followed the last guide that had been there a couple of djys ago. As i observed, i bet that the wiki has been updated yesterday or day before.

Edit date:

r20 - 14 Jul 2010 - 00:10:49 - MichaelCarr

So no.  And why would the wiki have ever had instructions that couldn't possibly work?

Quote from: psgarcha92 on May 20, 2011, 01:42:03 PM
The problew i now face is, my Sansa Fuze v2 always stays in the line out mode.there is nothing in the build that lets me select between line out and headphone mode.

The patch description describes how to disable line out mode.  Did you read it?
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: Unable to patch the source code
« Reply #13 on: May 20, 2011, 07:19:57 PM »
psgarcha92 is probably talking about the edit a couple of days ago to the WorkingWithPatches page.  However, as anybody can see, the only change was to place the instructions about applying and reverting patches earlier in the page.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Unable to patch the source code
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.105 seconds with 16 queries.