yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] coolexe:
its worked..:D:D:D

sometimes its failed to mount sdcard...:-( SDCard Prob. its working edify syntax...soon update on OP
[Desire Android Development] coolexe:
anyone know, how to format SDEXT in Edify Syntax...?
[Desire Android Development] baadnewz:
I give you to reasons why you don't need that.

1st. when user is wiping user data from recovery it also wipes cache and sd-ext

2nd. if the user chooses to update without wiping, if you put a format sd-ext in ur script, user will loose all installed apks (assuming he is using a2sd / d2sd). and the again update without wiping looses its meaning
[Desire Android Development] baadnewz:
this mounts ur ext as ext2 no matter what ext you have or recovery

~ # busybox mount -t auto /dev/block/mmcblk0p2 /sd-ext
busybox mount -t auto /dev/block/mmcblk0p2 /sd-ext
~ # mount | grep sd-ext
mount | grep sd-ext
/dev/block/mmcblk0p2 on /sd-ext type ext2 (rw,relatime,barrier=1,data=ordered)
~ #
[Desire Android Development] coolexe:
ya correct...:D
[Desire Android Development] coolexe:
Hi,

after learning more about Edify Syntax...found some useful info...

here is two method for writing boot.img

package_extract_file("boot.img","/tmp/boot.img");
write_raw_image("/tmp/boot.img", "boot");
delete("/tmp/boot.img");

or

assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
[Desire Android Development] roenano:
Great TUT!!!!

Could someone give an explanation of how the "show_progess" works?

Thanks
[Desire Android Development] roenano:
Anyone???

Please...
[Desire Android Development] coolexe:
maybe no one know...:D
[Desire Android Development] roalex:
#Clean up

format("yaffs2", "MTD", "system");

format("yaffs2", "MTD", "userdata");

run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/sd-ext");

run_program("/sbin/busybox", "rm", "-rf", "/sd-ext/*");

run_program("/sbin/busybox", "rm", "-rf", "/sdcard/.android_secure/*");

run_program("/sbin/busybox", "umount", "/sd-ext");

run_program("/sbin/e2fsck", "-pv", "/dev/block/mmcblk0p2");
[Desire Android Development] roenano:
Seriously? :rolleyes:

The greatest Android chefs are here @XDA...

You know is funny that most of the rom chefs just copy-paste from other build.props

Edit: I meant Updater-script, not build.prop. I guess too much learning on the last days... :D
[Desire Android Development] coolexe:
I'm joking man..! wait some time..
[Desire Android Development] roenano:
Don't take me too serious, just wanted to know if someone actually read my post.

I'll wait patiently now that I know someone pay attention to me ;)

Thanks
[Desire Android Development] NilsP:
You may have figured this out already but here it is anyway:

The left number is the % complete in the form of 0.9 for 90%, 1.0 for 100% etc. Seems to likes just whole number like 0.9 But 0.95 does not seem to work right. And it does not update until after the prior task ends

The right digit is how long it takes to paint the progress bar for the new % complete. I found that 1 is the best value for all but the last progress. Then for the last jumping from say 30 percent to 90 percent the best number is 4 or else it never display

100% is not worthwhile using since it never gets to display if all tasks are done. Just let it display Update Done on it's own.
[Desire Android Development] roalex:
What issues did you ever have while doing this?
[Desire Android Development] jm0077:
how can I generate the update-binary fro my updater-script

Great tutorial!

I have a problem, because I want to flash a AOSP compile for the HTC Desire, but when I try to flash the udpate.zip it give me an error:

can't open /dev/tty0: No such file or directory

I'm using the ClockworkMod recovery 2.5.0.7, and I don't know if that recovery can work with "updater-script" or just update-script.

Also, I figured that the updater-script have an update-binary file.. but I dont know how I can generate that file. Could be that the reason of the problem?

Thanks in advance..
[Desire Android Development] coolexe:
yes u need to have update-binary for using updater-script...

check attachment...
[Desire Android Development] jm0077:
Thanks !

this is a generic update-binary? can I use that for any device? independent of the Android platform (2.2 froyo / 2.3 gingerbread)?
[Desire Android Development] wwz7777:
Saving an Edify Update Script

This may seem really basic, but I've been reading so many threads that I'm boggled! When saving an updated script in Notepad++, what file type should it be saved as? Is there some specific method for saving a script? I want to modify a Verizon script and then save it. Any suggestions? BTW, this is a great TUT!
[Desire Android Development] oneyard:
A great tutorial indeed..

Anyway.. I'm totally newbie in the world of android..

Still learning here and there..

May I know how to convert this to edify script? :)

Or issit already in edify?

show_progress 0.1 0
write_radio_image PACKAGE:radio.img
show_progress 0.1 10

Thanks in advance..
[Desire Android Development] Rastaman-FB:
i would also like to know this, i used one from the rom i was currently using but i do not know what kind of affect that will have on other roms

how is an update-binary generated? can one generate it manually?

ive tried searching various forums and websites but havent really found any answers
[Desire Android Development] andQlimax:
This thread sound interesting:

http://xdaforums.com/showthread.php?p=10400641#post10400641

Program to convert an update-script (amend) to updater-script (edify)
[Desire Android Development] MarylandCookie:
Anyone know the arguments/parameters to format boot to ext4?

The Desire S is Ext4 by default but i keep getting a status 1 error code when using Ext4, however Ext3 works fine.

Ive tried mounting and unmounting prior to format but no luck what so ever :(

You can find the partition information for the DS here:

http://xdaforums.com/showthread.php?t=1057342
[Desire Android Development] Smurph82:
I am trying to learn how to create the edify scripts. I have several ring tones and live wall papers that I like to install and want to just flash them instead of using the adb. I have two folders in the root of the zip file the META-INF and system. Under the system folder I have an app folder, with apk's, and a lib folder for their libraries. These were created on Wnidows 7 64bit using Notepad++. One of the best test editors for Windows I may say, been using it for years. There is an extra blank line at the end, just does not show in the code blocks. I am testing this on my Evo 4g running CM7 nightly 91.

Here was my amend script that worked

show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
set_perm_recursive 0 0 0755 0644 SYSTEM:lib
show_progress 0.1 10

This is my first edify script that does not work (Status 6)

show_progress(0.1, 0);
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
set_perm_recursive(0, 0, 0755, 0644, "/system/lib");
unmount("/system");
show_progress(0.1, 10);

Then my latest edify script that runs but does not install the files

ui_print("Installing Live Wall Paper...");
ui_print("Mounting mount points...");
show_progress(0.1, 0);
run_program("/sbin/mount", "/dev/block/mtdblock4", "/system");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
ui_print("Setting Permissions...");
show_progress(0.2, 0);
set_perm_recursive(0, 0, 0755, 0644, "system/app");
set_perm_recursive(0, 0, 0755, 0644, "system/lib");
show_progress(0.2, 10);
ui_print("Unmounting mount points...");
run_program("/sbin/umount", "/system");
ui_print("Update Complete.");

This code works Finally!

ui_print("Installing Live Wall Paper...");
ui_print("Mounting mount points...");
show_progress(0.1, 0);
[B]run_program("/sbin/busybox", "mount", "/system");[/B]
package_extract_dir("system", "/system");
show_progress(0.1, 10);
ui_print("Setting Permissions...");
show_progress(0.2, 0);
set_perm_recursive(0, 0, 0755, 0644, "system/app");
set_perm_recursive(0, 0, 0755, 0644, "system/lib");
show_progress(0.2, 10);
ui_print("Unmounting mount points...");
[B]run_program("/sbin/busybox", "umount", "/system");[/B]
ui_print("Update Complete.");

I want to learn this but I'm just going in circles now.

1. Why would my first edify script not run and gave me a "Status 6".

2. Why does run_program("/sbin/busybox", "mount", "/system"); work but not mount("MTD", "system", "/system"); for me.

Any help would be really really helpful. Thanks in advance.
[Desire Android Development] adrianmak:
What are the two parameters passing to show_progress meaning of ?
[Desire Android Development] roenano:
http://xdaforums.com/showpost.php?p=11862597&postcount=40

Mate, there are only 5 pages in this thread. You could have searched for it.
[Desire Android Development] roalex:
i know many use the dsixda kitchen so here's another way on installing busybox:

Also useful as a temple for executing more then one operation :)
[Desire Android Development] blade2:
I am try to create a new folder with /mnt called sdcard-ext but not have much luck creating it.

here is my code

ui_print("Script generated by amend2edify v1.0.1.2.");

ui_print("Using mount points for DesireHD.");

ui_print("***********************************************");

ui_print("Performing Update...");

ui_print("Mounting mount points...");

mount("ext4", "/dev/block/mmcblk0p25", "/system");

mount("ext4", "/dev/block/mmcblk0p26", "/data");

mount("ext4", "/dev/block/mmcblk0p27", "/cache");

show_progress(0.1, 0);

run_program("/system/bin/busybox", "mkdir", "/mnt/sdcard-ext");

mount("ext4", "/dev/block/vold/179:66", "/mnt/sdcard-ext");

set_perm_recursive(1000, 1000, 0771, 0644, "/mnt/sdcard-ext");

show_progress(0.100000, 0);

ui_print("-Flashing Complete");

ui_print("Unmounting mount points...");

unmount("/system");

unmount("/sd-ext");

unmount("/data");

unmount("/cache");
[Desire Android Development] Rahulrulez:
Hello,

I have two script programs, I know edify scripting well but I really don't know how to make updater zip.

Can you please help me?
[Desire Android Development] hav0c:
I only see a copy_dir command. Is there a copy file command that you can use as well?
[Desire Android Development] fshami:
Guys,

I just to make a simple update.zip to flash bootanimation. I used only this line in updater-script:

package_extract_dir("system", "/system");

android folder contains only updater-script as i dont know how make a update-binary... :(

Can anyone help me with this. What exact set of commands i need, how can i change permissions for new bootanimation?
[Desire Android Development] seadersn:
grab an existing bin from another zip package ;)

and you have to mount /system first; syntax is depending on phone and rom. you can try

mount("MTD", "system", "/system");

package_extract_dir xxxxxxxxxx

unmount("/system");

should work, but don't rely on that. syntax is correct, but as said: depending on rom/phone... permissions aren't needed for that.
[Desire Android Development] fshami:
Thanks mate, actually i used script & binary but it working. Its saying error in update file. No problem. I'll try to use the same zip to check if it installs any. Will upfate u
[Desire Android Development] seadersn:
script file needs to be created / edited with an unix compatible editor like notepad++, proton or sth like that. maybe there's the error lying. simplest way: edit an existing script file with one of these editors.
[Desire Android Development] fshami:
Used g-apps for my purpose :). added my files & it worked perfect.
[Desire Android Development] ro7-alQulooB ali:
coolexe,

can we change font color? :)

thanks
[Desire Android Development] coolexe:
Hmm maybe no...hmm if yes then I don't know...sorry...
[Desire Android Development] Droidzone:
You're quite right.. Colors can be changed only by compiling a new recovery.
[Desire Android Development] surdu_petru:
Hello!

I need syntax for Clockword Recovery 5.0.2.0 (on Nexus S)for wipe data/factory rest, wipe data partition, Wipe Dalvik Cache, format /system, format /data, format /cache, format /boot . Thanks...

Of course I need for write updater_script .
[Desire Android Development] surdu_petru:
Thanks..I don t need any more...I'm know how.....:D
[Desire Android Development] seadersn:
what about telling it? :D maybe useful for other ppls ;)
[Desire Android Development] Schnello:
Has anyone build a script to flash a radio image (radio.img)?

I convert a old Radio File via the script converter and add the script commands from this post but it doesnt flash the radio file.

ui_print("Script generated by amend2edify v1.0.1.2.");
ui_print("Using mount points for Desire.");
ui_print("***********************************************");
ui_print("Performing Update...");
ui_print("Mounting mount points...");
run_program("/sbin/mount", "/dev/block/mtdblock3", "/system");
run_program("/sbin/mount", "/dev/block/mtdblock5", "/data");
run_program("/sbin/mount", "/dev/block/mtdblock4", "/cache");
show_progress(0.1, 0);
assert(package_extract_file("radio.img", "/tmp/radio.img");
write_firmware_image("/tmp/radio.img", "radio"));
show_progress(0.1, 10);
ui_print("Unmounting mount points...");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/data");
run_program("/sbin/umount", "/cache");
ui_print("Update Complete.");
[Desire Android Development] andQlimax:
seems that with any CWM 3.x and up write_firmware_image has been removed
[Desire Android Development] jukyO:
Some questions:

1. What commands should we use for mounting system and data? This one:

mount("MTD", "system", "/system");
mount("MTD", "userdata", "/data");

or this one:

mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "userdata", "/data");

or this one:

run_program("/sbin/mount", "/dev/block/mtdblock3", "/system");
run_program("/sbin/mount", "/dev/block/mtdblock5", "/data");

2. Set permissions:

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

What does each group of numbers mean for folder example and for file example?

EDIT:

for permissions:

Set file ownership and permissions.

set_perm(uid, gid, mode, "pathtofile");

Recursively set path ownership and permissions.

set_perm_recursive(uid, gid, dmode, fmode, "path");

So what users and groups we have in phone? root, system and which groups? What are UIDs and GIDs for each one? Found it here:

http://android-dls.com/wiki/index.php?title=Android_UIDs_and_GIDs

Now my question would be what are the usual permissions to set? Root, system and shell, or some others also?

Thanks,

jukyO
[Desire Android Development] Droidzone:
The mount options depend on the update-binary you include with the script
[Desire Android Development] jukyO:
Thanks. And update-binary is device dependent or rom dependent? Any list with devices/roms and update-binary?

What about users/groups?
[Desire Android Development] Droidzone:
Just try the command on whatever binary you have and the error message will tell you what to do. Permissions are a linux issue and there are lots of articles on the net describing it. Look inside init.rc for the default Android permissions, or do an ls -l on your phone
[Desire Android Development] jukyO:
Just thought like that, thanks for an buried idea :)

Thanks for the support.
[Desire Android Development] Difusal:
what is the update-binary file and where can i get it?

I'm failing to install a update.zip because it is missing i think
[Desire Android Development] Droidzone:
Open any flashable zip and see inside!
[Desire Android Development] Jwtiyar:
thanks for perfect tut.

i have some question:

1.i want to add fonts ? just adding to system/fonts ?

2.how to add update binary?

3.How To sign the zip?

thanks.
[Desire Android Development] suwandiapr:
thanks for the tut.. How can i do backup my recovery with dd in edify? Is possible?
[Desire Android Development] trevoryour:
I'm planning on using the UpdatezipCreator from this thread http://xdaforums.com/showthread.php?t=1274736 to build an update script for some APK updates I want to package up. It appears this app has the ability to build a update-binary file for you.

I have APK files in both the system/app and data/app that I want to be copied to my phone. I'm confused on a few things. First thing, can I have multiple destinations for the files in the script. I haven't found any examples with two destinations and there doesn't seem to be a spot to configure the source which makes me think it just takes everything in the zip and puts it in the folder you specifiy in the package_extract_dir function and that adding a second package_extract_dir function would confuse it.

The second question is I keep running across scripts that us busybox instead of the built in commands. Why would you need to/want to do that?

This is what I would think would work for my script:

ui_print("Preparing to update");
ui_print("Copying files..");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("Done! You can reboot your system now!");

I know I need a mount command before the package_extraction but I don't know which I should use and if I need a second mount for the /data/app folder as well.

"run_program("/sbin/busybox", "mount", "/system");"

or

"mount("/dev/block/stl6", "system", "/system", "rw");"

The folder structure of my zip is;

Zip

/system/app/apk files

/data/app/apk files

/META-INF
[Desire Android Development] BlueHarford:
Kill Data parition

n need to kill everything in data partition, a CWM wipe is not working, cant delete one file in it. would the below script delete? as elevate the delete to Su and delete? i can delete the files in root explorer but android re-creates them right away so i cant get into recovery to delete. i also cant SU in adb from recovery.

assert(getprop("ro.product.device") == "tf101" || getprop("ro.build.product") == "tf101");
show_progress(0.500000, 0);
format("MTD", "userdata");
mount("MTD", "userdata", "/data");
delete_recursive("/data/system");
run_program("/sbin/busybox", "rm", "-rf", "/data/*");
run_program("/sbin/busybox", "umount", "/data");
[Desire Android Development] orlith:
Hi

I Got a trouble and need ur point of view.

I encounter a strange behavior on my desire and my updater-script.

I'm not able to copy files from a folder on the sdcard to /data/app. I use this command :

run_program("/sbin/busybox", "mkdir", "-p", "/data/app");
run_program("/sbin/busybox", "cp", "-f", "/sdcard/apps/*", "/data/app");
run_program("/sbin/busybox", "cp", "-f", "/sdcard/yad2e.txt", "/sdcard/apps/yad2e.txt");
run_program("/sbin/busybox", "chmod", "0777", "/data/app/*");

When the second command is run nothing happend.

The 3rd command is well execute.

I'm miss for sure something stupid, but i don't know what.

Any help appreciate.

Thx
[Desire Android Development] anryl:
data/app/*

Sent from my HTC EVO 3D X515m
[Desire Android Development] orlith:
Thnkas but doesn't either.
[Desire Android Development] marius.a:
if you make a folder xyz, and try to copy from there... is it working?

run_program("/sbin/busybox", "cp", "-f", "/sdcard/xyz/yad2e.txt", "/sdcard/apps/yad2e.txt");
[Desire Android Development] orlith:
Hi

Yes it works

I found that id doesn't like the wildcards. So I write a little sf script that list the files in folder and the copy them one by one
[Desire Android Development] marius.a:
run_program("/sbin/busybox", "cp", "-f", "/sdcard/apps/*", "/data/app/*");

or

run_program("/sbin/busybox", "cp", "-f", "/sdcard/apps/*.*", "/data/app/*.*");

?

ps

now i wake up... and see that ur taking about 2nd not 3rd line :d
[Desire Android Development] taviaum:
Hi! Well, i have a question.

Is that possible to Freeze an app with updater-script?

How could i do that?

Thanks, awesome guide, mate!
[Desire Android Development] orlith:
Hi Guys

Coming back with potential stupid question :)

Is there a similar command to count available ?

I would like to list the number of files in a folder (like count all files in folder "misc" on sdcard) in order to set the progress bar during the installation of my rom

Or at least return the number in a vairable then I'll ba able to Ui_print it.

Do you think it something possible ?

Thanks
[Desire Android Development] marius.a:
In C, is like that, maybe someoane can modify it for android...

#include

...

int file_count = 0;
DIR * dirp;
struct dirent * entry;

dirp = opendir("path");

while ((entry = readdir(dirp)) != NULL) {
if (entry->d_type == DT_REG)
file_count++;
}
}
closedir(dirp);
[Desire Android Development] rodrigobauza82:
Hi guys, i need a little help... i need to flash the xt9 folder (with the files in it) to system/usr/ and i dont understand the script syntax plus i dont have time enough to read and learn it... thas why im screaming sos... i need the update-script or the updater-script, dont know, to do that...

Thanks to you all in advance!!
[Desire Android Development] tatubias:
Can you share the script. im trying to copy the complete content of a directory on the sd to the /data/app and i cant.
[Desire Android Development] androidnerd2:
What if I want to copy a "bootanimation.zip" to /system/media ??

What will be the code ?
[Desire Android Development] tatubias:
Final gixed other way
[Desire Android Development] inspiredbyhtc:
Heres the code for updater-script, there must be 2 empty lines under the text that aren't displayed on the code I posted.

ui_print("Preparing To Flash Bootanimation");
ui_print("Mounting System Partition");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Flashing System");
package_extract_dir("system", "/system");
ui_print("Unmounting System Partition");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Done!");
ui_print(" Updater-Script by inspiredbyhtc ")

Remember that the zip structure should be exactly like what you want to flash for example:

/system/media/bootanimation.zip
/META-INF/com/google/android/updater-script
/update-binary

Finally my question is, How can I make a script that:

Detects if a folder exist or not, and reacts upon the result.

Im planing to use it for detecting if busybox is at /system/sbin or /system/xbin and flash the mod to that location.

Please @me or pm me the response or any question as I don't visit this thread frequently.
[Desire Android Development] tatubias:
How do you sign the rom to not use wcm
[Desire Android Development] :
MOD EDIT: No need to quote the entire post.

i didnt understand . can you explain briefly ???
[Desire Android Development] androidnerd2:
Can somebody convert this to Edify updater-Script ? Please ?
[Desire Android Development] coolexe:
show_progress(0.500000, 0);

ui_print("Updating...");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
set_perm_recursive(0, 0, 0755, 0644, "/system/framework");
unmount("/system");

ui_print("Finished");
show_progress(0.100000, 0);
[Desire Android Development] Phil3759:
This thread is really a great guide, thanks

I have one question:

I use a script to install root through CWM 5 on my i9100

I never used the symlink command for su in /system/bin and /xbin

I never used symlink for busybox in bin and xbin

However, all works perfect for my root apps

Is this symlink command really important and for what (in busybox and su)

Thank you
[Desire Android Development] Dblfstr:
Coolexe,

I have posted a link to your tutorial in my Aroma, Edify, updater script Question and Answer thread.. I created this thread to serve as a place to ask questions about scripting and to help resolve errors. Feel free to stop by and offer up some help. The more help the better.

-Dblfstr​
[Desire Android Development] -NickHalden-:
does this update and updater cript change if add or remove apks from ROM
[Desire Android Development] forumber2:
Hi XDA community. I have a problem with aroma.I'm using aroma 2.00 and notepad++. I edited aroma-config but CWM give me syntax in aroma-config. I cant find where is wrong :( Error in line:287,Col:2. Thanks in advance :)
[Desire Android Development] Dblfstr:
Q&A thread for Aroma: http://xdaforums.com/showthread.php?p=28706093