rom cooking - unyaffs

Search This thread

theresthatguy

Retired Forum Mod
Nov 9, 2009
424
11
I'm not daily Linux user but I'm usually savvy enough to figure things out; however unyaffs is giving me quite some trouble.

I have downloaded unyaffs from Lox's Rom cooking thread and placed it in the /bin/ folder but when I type /bin/unyaffs system.img I get "cannot get execute binary file". Help please?
 

jubeh

Senior Member
Mar 15, 2009
1,264
20
It needs to be in your computer's /bin/, not your phone's. Actually, it can be anywhere as long as it's on your $PATH. It's usually suggested that you create a /bin/ directory at your home folder (~) and then run all your personal binaries from there, then you can include that /bin/ in your .bashrc so that it gets loaded on every new terminal.
Open up a terminal window and do either
Code:
~$ gedit ~/.bashrc
or
Code:
~$ nano ~/.bashrc
depending on which editor you're comfortable with. Add the following to the end of your .bashrc
Code:
PATH=$PATH:/path-to-home/bin/
export PATH
where path-to-home is, ofcourse, the path to your home folder (usually /home/username), you can't use the ~ wildcard in the .bashrc script.
After you have your ~/bin set up, restart the terminal then move the unyaffs binary to ~/bin/ and then chmod a+x it, that way you can run the tool from any location.
To run the tool, just pass an image file as a parameter, note that the contents will be output to the directory where the image file is stored, so say I have a hero system file on my Desktop:
Code:
~$ cd ~/Desktop
~/Desktop$ mkdir HeroSystem
~/Desktop$ mv system.img HeroSystem
~/Desktop$ cd HeroSystem
~/Desktop/HeroSystem$ unyaffs system.img
end of file.
~/Desktop/Herosystem$_
The contents, along with the system.img will be in ~/Desktop/HeroSystem
 

theresthatguy

Retired Forum Mod
Nov 9, 2009
424
11
Okay so added the following to bottom of my bashrc:
PATH=$PATH:/home/tito/bin/
export PATH

New terminal:
Code:
cd ~/bin
chmod a+x unyaffs
cd ~/Desktop/HeroSystem
unyaffs system.img
bash /home/tito/bin/unyaffs: cannot execute binary file

Followed all directions but still getting this error.
 
Last edited:

theresthatguy

Retired Forum Mod
Nov 9, 2009
424
11
Found this site: hotrobots.blogspot.com/2009/07/useful-tool-unyaffs.html
Managed to unyaff my system.img; thanks for the help.
 

royalmitkaese

Member
Dec 17, 2009
36
1
Munich
Hi, I am getting the "cannot execute binary file" error aswell..

I copied unyaffs in /bin and it is executable for everyone.
Yet and still it won't work. Any ideas?

Or do I really have to put unyaffs in a seperate bin folder and then edit bashrc?

Oh, and I'm running Mac OS X, if that's of any importance.. Bash is bash I think, or are there any differences I'm not aware of?
 
Last edited:

kendong2

Inactive Recognized Developer
Sep 29, 2009
1,673
74
Hi, I am getting the "cannot execute binary file" error aswell..

I copied unyaffs in /bin and it is executable for everyone.
Yet and still it won't work. Any ideas?

Or do I really have to put unyaffs in a seperate bin folder and then edit bashrc?

Oh, and I'm running Mac OS X, if that's of any importance.. Bash is bash I think, or are there any differences I'm not aware of?

in this case you need the binary for osx, but the rest of the instructions should apply AFAIK (i have never used macos myself).
 

fwers

Senior Member
Nov 23, 2009
131
5
download xcode from apple developer site for free

download source unyaffs from google site
and run gcc -o unyaffs unyaffs.c.
thats it ur done
 

anika200

Senior Member
Jul 27, 2010
85
2
Maryland
i'm getting "Bad CPU type in executable"

Are you running a 32 or 64 bit kernel on osx. You need a compile binary that is correct for your cpu. Let me know I will attach the right one in a reply. Check under apple menu >> about this mac >> more info >> software >> 64 bit kernel and extensions, yes or no.
 

chenthil

Member
Jun 28, 2010
24
13
Are you running a 32 or 64 bit kernel on osx. You need a compile binary that is correct for your cpu. Let me know I will attach the right one in a reply. Check under apple menu >> about this mac >> more info >> software >> 64 bit kernel and extensions, yes or no.

@anika200 I'm also getting "Bad CPU type in executable". Mine is a 32bit one...

64-bit Kernel and Extensions: No

Could you please build one for 32bit kernel?
 

fone_fanatic

Senior Member
Aug 4, 2005
2,780
247
Central Texas
I got a hold of xcode (i love torrents :D) and compiled it myself.

Heres the attached compiled OSX 32 bit unyaffs

Extract it and place it wherever you want, and to use it in another directory make sure you append it to your .bash_profile
 

Attachments

  • unyaffs.zip
    2.4 KB · Views: 91
Last edited:

anika200

Senior Member
Jul 27, 2010
85
2
Maryland
Hey alright. You got it done before I could even check the thread again. I figured it was a 64 bit. Now we have both on here, nice.
 

wilnotdie

Senior Member
Sep 11, 2009
430
30
Anyone familiar with doing this on windows?

I tried a couple of binaries, but i get errors.

Microsoft Windows XP [Version 5.1.2600]

C:\g2orgsys>unyaffs systemg2.img
28852 [main] unyaffs 3212 _cygtls::handle_exceptions: Exception: STATUS_ACCESS
_VIOLATION
30677 [main] unyaffs 3212 open_stackdumpfile: Dumping stack trace to unyaffs.e
xe.stackdump
348883 [main] unyaffs 3212 _cygtls::handle_exceptions: Exception: STATUS_ACCESS
_VIOLATION
375003 [main] unyaffs 3212 _cygtls::handle_exceptions: Error while dumping stat
e (probably corrupted stack)

Perhaps windows just sucks with this. I've never really used bash, but I got some LiveCDs around. :/
 

erasmux

Retired Recognized Developer
May 22, 2010
1,437
455
I use the attached file, works fine on windows. I think you need cygwin installed but not sure.
 

Attachments

  • unyaffs-x86-win.zip
    3.9 KB · Views: 148