yashsingh1/xdaforums huggingface dataset:
[Android] mbfan3686:
Help with Flashing a custom rom.

Hello, I am completely new to making my own roms. I am having trouble when i flash my rom. I am using a eris with the latest amon ra recovery and i have a engienering bootloader (i don't know if that matters). i am getting this error;

minzip: Error writing 12288 bytes from zip file from 0xbe9d7a3c: No space left on device

minzip: Process function elected to fail (in inflate)

minzip: Can't extract entry to file.

minzip: Error extracting "/system/tts/lang_pico/fr-FR_nk0_sg.bin"

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

calling command set_perm

E:Can't chown/mod /system/xbin/a2sd

(No such file or directory)

E:Failure at line 30:

set_perm 0 0 0777 SYSTEM:xbin/a2sd

Please help.
[Android] dsixda:
That's a problem with your operating system installation. "rm" and "ls" should work on any machine without having to specify a path. Also make sure you are not su/root user. No need to do something fancy like "which rm" or "which ls" as you suggested, it should just work.
[Android] Kanzie:
The problem is that there is another copy of ls and rm in the current directory during the execution if the script. If the user's PATH variable has ./ at the start (like me), when your script calls ls, WORKING_/system/bin/ls is executed, not /bin/ls as it should. I'm not sure whether the assumption that the user does not have ./ in its path is a good idea.

I think having the script halting when a command failed (checking $?) would have made me realise something was wrong at step one. (I spent a couple of days wondering whether I have stuffed up some config or something, and was about to set up a x86 environment just for the kitchen as I was thinking it might have been a problem with 64 bit binaries.)
[Android] andrewwai18:
@Kanzie:

If you do include ./ into your path environment variable you should add this to the end of your path so that you do not override the system path.
[Android] dsixda:
Ok, now I understand what you are talking about... You are saying the working folder's system/bin had an Android version of 'ls' and 'rm'. That is actually quite funny... But it never occurred to me nor nor did I make an assumption. I don't think it's fair to say that I am making assumptions here, Kanzie, or that I am aware of every single thing that may happen with the dozens of scripts in this kitchen used by so many people. It's not like I'm going to put "$?" statements in every single line of code, you actually expect me to do that? However, there are many places where checks like these are done to ensure something doesn't go wrong.

Anyways I'm sorry about that and I'll fix it. *sigh* Just when I thought I could take a break from this crazy project. ;)

If you had told me about this script error from the start then you wouldn't have spent "a couple of days". It was your choice my friend. Two days... I wish *I* coulda spent TWO Days rather than four straight weeks trying to get this kitchen to finally work after all the begging from people to add deodexing, darktremor apps2sd, apk signing, and so on, even though I only intended it to be a basic kitchen. But that was my choice too :D
[Android] dsixda:
Not necessarily, usually it's the right idea to have the "." path to the start of your system path variable, so that whatever is in the current folder has priority over everything else.

But I'd prefer my script to take these things into account. I've been trying to make the kitchen as user-friendly as possible and intelligent enough to correct user errors and also take into account the various configurations.
[Android] Kanzie:
Sorry - I didn't mean to sound rude. I'm happy to offer a patch for it (I've pretty much done it already to figure that out (well, not the $? part...), but I just want to make it more generic before sending it to you - even though most systems would have ls and rm at /bin).
[Android] dsixda:
No, no problem at all. I didn't mean to sound harsh about it. In fact, thanks for the feedback, it just helps to improve the kitchen ;)

Anyways, if you can, unzip the following attachment to to your scripts folder, and try the same scenario again. Hopefully there are no more issues like this in the kitchen, I searched for other areas with /system/bin but didn't notice anything yet.
[Android] Kanzie:
All good :)
[Android] dsixda:
You tried the file?
[Android] TMartin:
Will there be support for this. http://xdaforums.com/showthread.php?t=740319

Sent from my HTC Evo 4G!
[Android] dsixda:
What do you mean by support?
[Android] lpasq:
dsixda

It's been some time since I thanked you for staying committed to this project.

v0.79 is doing great for me on Ubuntu 10.04 LTS on MacBook virtual machine.

I take my ROM built right from AOSP for Passion into the kitchen. I complile the output to an "otapackage" and run it through your kitchen to root it and such. The updater-script conversion works great. The kernel extract and re-packing also seemless. No boot issues.

Awesome!!!

Not sure if explained myself in terms that make sense but I wanted to let you know a ROM built from AOSP and packaged as an OTA zip using Java 1.5 on Ubuntu 32bit plays nice with your .79...

If I can provide any info to help someone, please ask and be patient if it takes me a couple times to understand what you ask or need.

Sent from N1...
[Android] aamikam:
needs an update to smali/backsmali.

there was a revision to Fix an issue when assembling a file with blank annotation sets

i attached my files. (unless someone knows a better way of building them these should work just fine)

this fixed all my issues with deodexing the new Evo Froyo rom.
[Android] Kanzie:
Yep, the file works.
[Android] TMartin:
Trying to dump....it's been giving me some wierd things and is looking pretty odd once it's dumped. I don't, it's probably just me.
[Android] dsixda:
Good to know! Yeah, with the new signing tool we can use Java 5 (a.k.a. 1.5). There is no longer a restriction to use Java 6.

When I have some time I want to work with the Nexus One AOSP sources, and also I want to do my testing on an emulator for this kitchen, rather than flashing to my N1 all the time. I notice there are some guides in this particular section of the forum for doing so, but if you can assist me whenever I ask, then that would be great!
[Android] dsixda:
Excellent, I'm assuming you built this one from the source? So it's not really the official 1.2.4 version, right?

I'm also assuming it has the Google Maps.apk fix from a couple of weeks ago.
[Android] dsixda:
0.81 is up!
[Android] aamikam:
yeah... i built it from the source.

its not really 1.2.4 but thats how it named it when i created it so... i left it like that.

i went through the revisions fixing the source code and since it works im assuming i did a good job... but im not really an expert on java.
[Android] lpasq:
No problem. I am a rookie but have been scratching my way through enough guides to grasp some basics.

Sent from N1...
[Android] BesFen:
Hi dsixda,

do you know how to combine OTA update into stock rom?

Thanks
[Android] dsixda:
Nope, sorry. Let us know if you find anything.
[Android] juansuandi:
Error: baksmali.jar not found!

when trying to deodex desire froyo. any fix?
[Android] dsixda:
Can you be specific and tell me exactly how you saw it? Screen shot, etc.

Thanks
[Android] KyleIsTheBeast:
Ok... I am a total linux n00b so I just installed the Cygwin files like you recommended. I have it all done, except being able to open the menu? Seems dumb, I know. But you lost me when you said "change to the folder containing the kitchen, and type: ./menu" How do I change to the folder? I have it in C:\cygwin\home\Kyle\Kitchen

NEVERMIND I got it HAHA
[Android] :
How do you cd????
[Android] listyb01:
You type cd.

Sent from my KaosFroyoEris
[Android] juansuandi:
here is the screen shoot it's fail when trying to deodex app and framework. or its because its only have baksmali-1.2.3.jar smail-1.2.3.jar on deodex_files folder?

edit : its because of double baksmali from the previous version.. deleting one of them then its run.. but now i found this error when trying to odex /framework. thanks
[Android] dsixda:
You have to start from a fresh new kitchen, don't just overwrite the old files.

The RSS error is normal, just ignore that one, it will deodex it successfully at the end (if you searched for it in Google you will notice there is a lot of mention of it). Next time just use Google first ;)
[Android] dsixda:
Sorry, should have made it more clear in the FAQ.. Yes, as someone said,just do cd your_kitchen_folder_name
[Android] BesFen:
Deodex

I ever read there is a significant benefit by deodex app and framework, but why in my case i have a few free internal storage at first boot???

Usually without deodex = free internal storage 160MB

With deodex = 80Mb

It's only me or there are someone else encounter it?

Thanks.
[Android] TMartin:
I'm at 322MB free...Deodex'd Evo 2.2 ROM
[Android] aamikam:
deodexing apks and framework will result in bigger apk/jar file... but not that much bigger.
[Android] TMartin:
But at the same time your getting rid of the extra odex files too.
[Android] mainstreamer:
I tried changing my nandroid backup (adding apk's) VE5.0

Finding update package...
Opening update package...
Verifying update package...
Installing update...
FORMATTING SYSTEM:...
Deleting files...
Deleting files..
Copying files...
E:Can't symlink /system/bin/sh
E:Failure at line 60:
symlink /system/bin/bash SYSTEM:
bin/sh

Am i doing something wrong?

Everything is signed and i get no errors when building the package?
[Android] listyb01:
You have to remove the sh symlink from your system/bin.
[Android] dsixda:
For now just follow listyb01's advice. It looks like a problem with the kitchen setting that symbolic link by mistake. You can delete the /system/bin/sh file from the working folder.

BTW was Bash originally in your nandroid file? Did you add Bash after extracting the nandroid to a working folder?
[Android] aamikam:
smali got updated to 1.2.4:

http://code.google.com/p/smali/downloads/list
[Android] han.azuki:
i'm trying to make update.zip so it would install apks into data/app folder. i can install to system no problems, but it never can install to data/app. please help me what i need to do :*(

here is my updater-script:

package_extract_dir("data", "/data");

set_perm(1000, 1000, 0771, "/data/app");
[Android] dsixda:
I think there is another line needed, which specifies "userdata".
[Android] TheAshMan:
I've run a comparison between the working folder contents and the update.zip produced by the kitchen before signing.

Almost all the contents are the same, however, the /system/xbin folder is:

4.2MB in the working folder

583.2MB in the update.zip file!!!

Not sure what could be causing that, but obviously that's creating the massive update.zip and in turn the signed zip.
[Android] mr.bang:
i know the cause i mean!

i suppose that "zip -r" (recursive) try to compress all directories and files in the arg path!

so it try to copress "." directory and ".."directory for many times!

i'm just discovering the right zip flag..
[Android] TheAshMan:
I had another look in the xbin folder, and compared with that of Modaco ROM.

There was a whole load of files which were simply aliases to busybox, and not actual standalone application.

After removing these files my signed file is about 90MB.

Now, is there any easy way I can use an existing custom ROM and customise into my own?
[Android] mr.bang:
but now you haven't links to binary!

so.. why after zip compression with right-click i chek out a update.zip->80 MB?
[Android] dsixda:
I am trying to compile together all the useful information required for Mac users of this kitchen. Is this correct information so far for people who use OSX?

For OSX 10.5 and lower, use these binaries:

http://xdaforums.com/showpost.php?p=5638249&postcount=36

For OSX 10.6 and higher, use these binaries:

http://xdaforums.com/showpost.php?p=5670462&postcount=136

For OSX 10.5 and lower, use SoyLatte instead of the regular Java JDK:

http://blog.adsdevshop.com/2008/02/26/installing-the-jdk-16-on-mac-os-x/

For OSX 10.6 and higher, use the latest Java JDK

To ZIP your folders into an update.zip, use right-click instead of the command-line (the correct command-line option is still to be determined).

===

Also, instead of providing the binaries, can't we just put the source code files in the tools folder, and the script can be smart enough to detect whether or not it needs to compile them?

For example, open "make_kitchen" and see how I made unyaffs.exe work for Cygwin, without requiring the user to do extra work.

For Mac we can make the script look for a binary called "unyaffs.mac". For Ubuntu we just use "unyaffs".

Now, the issue is, we'd need to provide the source files for mkbootfs and mkbootimg in the tools folder. I already found mkbootfs.c and android_filesystem_config.h for mkbootfs (I attached the files yesterday in this thread) and was able to compile them, but mkbootimg is tricky.

Are you guys able to copy all the required files for mkbootimg into a separate folder and be able to build a working mkbootimg.mac (or mkbootimg.exe for cygwin)? I think you need mkbootimg.c, bootimg.h, sha.h, inttypes.h, etc. We could put those files into the tools folder, as long as they can be compiled from there.

OR we can just put all the binaries in the tools folder, e.g.

For Ubuntu, use unyaffs

For Cygwin, use unyaffs.exe

For OSX 10.6 and higher, use unyaffs.mac.new

For OSX 10.5 and lower, use unyaffs.mac.old

But I am not sure if unyaffs.exe works with all versions of Cygwin (it crashes on my work PC if it is compiled on my home PC!!)

Now, I wonder what uname / uname -a / uname -r will return for different Mac versions, so that we can determine which one to use in the kitchen.
[Android] dsixda:
You can copy the entire contents of the MCR's Update.zip into the kitchen, just put them under a folder with name "WORKING_xxxxxx", where "xxxxx" can be blank or anything you want to call it. e.g. "WORKING_" or "WORKING_MCR".

You will need to delete the 3 files under META-INF though, before you zip the file again and sign.
[Android] TheAshMan:
To get the basic kitchen working on 10.6:

1) Download the kitchen

2) Download the binaries from here

3) Run the menu - everything including signing works.

Still unable to figure out the cause of the zip data explosion.

I've temporarily created a new option 15 in the menu which lets me sign update.zip

I create update.zip manually by right-click Compress

All my reading shows that to create zip files on Mac you do use zip -r dest_file_name source_folders which is the same as what's in your script.

I have a feeling the problem is caused by the alias files I mentioned in the xbin folder. They are making the zip function run recursively on that folder resulting in huge files
[Android] TheAshMan:
Awesome, I'll try that now!
[Android] dsixda:
Ok, good.. So for Macs I can just copy the binaries over. For Cygwin I'll need the source files.

What do you get with the "uname" command? I will need to differentiate between different Mac versions.

And, you mean the signing method that mr. bang showed doesn't work?
[Android] dsixda:
It would probably be convenient to add a porting tool to the menu, that can do what you just did. I'll think about it.
[Android] TheAshMan:
1) That works for 10.6 anyway, maybe you'll need mr.bang to confirm for other versions

2) uname returns Darwin

"sw_vers" command gives:

ProductName:	Mac OS X

ProductVersion:	10.6.2

BuildVersion:	10C540

3) I didn't need to try his method. I just pressed 9 and everything zipped and signed fine (except the file size problem).

***********************

With regards to the file size issue, I just created the Modaco 3.1 working folder as mentioned by you above, added a few custom apks and used the build ROM function - everything working fine and the result was 90MB-ish.

I've modified your zip function to:

zip -r update *

so that everything in the working folder is zipped (including the data folder in Modaco)
[Android] mr.bang:
actually i use kitchen with unyaffs mkbootimg and mkbootfs compiled for mac with gcc!

and i took little changes to script build_rom!

the testsign.jar work 10.3 10.4 10.5 with a updated JDK (Soylatte, see old post)

for 10.6 it's ok because 10.6 have updated apple jdk (java)!

i think there aren't difference between mkbootimg/fs compiled on 10.5 and mkbootimg/fs compiled on 10.6
[Android] kendong2:
i didn't check if this is valid, but i vote for it. if /data is there it should be included.

other than that i think option 15 should be "exit 0", as it is a user requested end of the script, not an error. doesn't matter probably, but while we're at it... ;)

this is really good work, kinda similar to my own script collection. just didn't take the time to make one control script for everything. i think i'll give it a testrun, seems easier for everything that is more than just re-zipping the rom. again, great stuff.
[Android] dsixda:
Thanks for the comments and tips, guys.
[Android] dsixda:
Try: zip -r -y update *
[Android] dsixda:
Ok guys, I have updated the kitchen. It should work flawlessly for Mac OS X now, hopefully.. If you have OS X < 10.6, then the only extra thing you have to do is install SoyLatte.
[Android] TheAshMan:
I got:

The problem I guess is that sw_vers returns a string with : that causes problems.

Seems to work if I change:

elif [ `sw_vers | grep Mac` ]

to

elif [ `sw_vers | grep -o Mac` ]

I'd also assume you'll have to do the same for

elif [ `sw_vers | grep 10.5` ] || [ `sw_vers | grep 10.4` ] || [ `sw_vers | grep 10.3` ]
[Android] TheAshMan:
I've tried cooking a custom ROM - Modaco with a few extra applications and everything signs and all using the new kitchen.

When I try flashing the zip it installs, but on reboot it hangs on the splash screen (T-Mobile G2).

I've tried with 0.9 and same problem.

I also had a go at just building the ROM after copying the modaco files into my working folder and not making any changes, still no luck.

Anything I could be doing wrong?
[Android] idflood:
I had similar problems. If you are on osx you can try to create a .dmg like I descibed here: http://xdaforums.com/showpost.php?p=5670462&postcount=136

( I really think this step is required for 99% of mac users )
[Android] cTnko:
could you give me some more info? :)
[Android] han.azuki:
mount("MTD", "userdata", "/data");

package_extract_dir("data", "/data");

set_perm(1000, 1000, 0771, "/data/app");

unmount("/userdata");

i already tried this too
[Android] aamikam:
ok... so ... go to META-INF/com/google/android/

using a text editor make sure u have the following lines in your update-script file.

copy_dir PACKAGE:data DATA:

set_perm_recursive 1000 1000 0771 0644 DATA:app

if u dont... than it wont copy it... so add them if its missing and make sure they come after any format:... lines or delete:.... lines.

that should do it.
[Android] han.azuki:
I tried to do

copy_dir PACKAGE:data DATA:

set_perm_recursive 1000 1000 0771 0644 DATA:app

and

copy_dir PACKAGE:data DATA:

set_perm_recursive 1000 1000 0771 0644 DATA:app

set_perm 1000 1000 0771 DATA:data

i also tried doing it in updater-script, which i use. what is the difference anyways?

package_extract_dir("data", "/data");

set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");

set_perm(1000, 1000, 0771, "/data/app");

didn't work either. what is wrong?

i have the update zip as data, system, META-INF. data folder -> app -> apks stored
[Android] dsixda:
There's probably no point in changing the updater-script, because if it comes with an update-binary then you gotta rebuild that as well.

Anyways, your question doesn't really relate to the kitchen, because it doesn't handle updater-scripts for the reason I mentioned above. Please ask in the forum in a new thread so that the relevant talk stays here. I am assuming you are not using my kitchen.
[Android] han.azuki:
Yeah, I apologize. I just asked everywhere and I get no replies whatsoever. Before I leave, could someone explain what is the difference between update-script and updater-script? Which is more new?
[Android] dsixda:
I think the updater-script is newer, it's produced by AOSP builds. Cyanogen uses that format for his ROMs. I think the update-script format is used only by HTC because I notice other manufacturers like Motorola are looking for the update-binary/updater-script.
[Android] aamikam:
i got a few quick questions...

im not sure if its the right place... but still i'd bet some people here know how to.

on htc evo.

how would i make the rom run zipalign every boot? or change properties in the rom?

also, i wanna replace the default keyboard with the htc_ime_mod and also i want to replace the clockwidget with the fancywidget...

so far i have been successful only if i ported a bunch of dirs from my data/data folder after installing everything on the device and then cooking in those folders also.

any help would be great... thank you.
[Android] Alex-V:
How can i enable dalvik cache to sd (a2sd cachesd) before i make the rom..??

with kind regards...Alex
[Android] furniel:
+1 ?
[Android] TMartin:
For the zipalign, I believe you add this file, inside the zip attached, to /system/bin then add this line to you update-script:

set_perm 0 0 04755 SYSTEM:bin/zipalign

I'm not an expert but I think that's right. As far as the other stuff, you might want to pm Calkulin. Let me know if you get htc ime mod to work on 2.2.
[Android] dsixda:
But you also need something in the startup scripts to launch zipalign, no?
[Android] dsixda:
Good question, why don't you try adding a script with the command "a2sd cachesd", and call it up the same way Busybox is launched in my update-script? I have not tried this but it could work.
[Android] dsixda:
Thanks for letting me know. Life has been pretty hectic the last few days so I haven't been able to work on the kitchen updates. But hopefully soon.
[Android] dsixda:
By the way, this is probably the main stumbling block that is preventing me from making ROMs for other devices with this kitchen. I could write a script that converts update-script back to updateR-script, but then I also need to build the update-binary from it. There must be something in the Android source that does this but I haven't checked.

If anyone has an idea please let me know!
[Android] Alex-V:
thats the info the op of darktremor give...:

1. Symlink the /data/dalvik-cache to /system/sd/dalvik-cache

2. Place a file called .dalvikcache in /data

That's pretty much what the program does.

Is this a good info for you...?

and how can i symlink..?

with kind regards..Alex
[Android] mainstreamer:
Can anyone tell me what is happening here?

update-script

set_perm 0 0 04755 SYSTEM:xbin/su
symlink /system/xbin/su SYSTEM:bin/su

when running:

E:Can't symlink /system/xbin/su SYSTEM:bin/su
E:Failure at line 63:
symlink /system/xbin/su SYSTEM:bin/su

i checked and /system/bin/su is not present?

Only in /system/xbin

So why would it fail to create a symlink?
[Android] dsixda:
Were you tweeting me just now? ;) You forgot to mention that you were porting a Desire ROM to Nexus.

It's a known fact that porting the Desire to Nexus is not a straight procedure. You have to remove stuff from /system in order for the Desire ROM to work on Nexus. Likely your "su" binary was not copied to /system on the device. I'm not a porting expert, so you'll have to search the N1 forums.
[Android] mainstreamer:
I'm using HTC Hero rom (nandroid backup as source), and upgraded the packge with apks.

Destination device is also Hero.

;)
[Android] dsixda:
Check the update-script, you'll see how it works.

symlink <source_file> <new_symbolic_link>

Or in Linux/Android/Unix/etc. command line:

ln -s <source_file> <new_symbolic_link> <---- "ln" starts with the small letter "L", not the number "1"

e.g.. ln -s /etc/blah /sdcard/blah <-- This will create a file in your sdcard called "blah" which is actually a shortcut to /etc/blah.