[Q] redbend error in updater-script - Galaxy S I9000 Q&A, Help & Troubleshooting

No views? Cmon

mount("MTD", "system", "/system");
package_extract_file("redbend_ua", "redbend_ua");
package_extract_file("zImage", "zImage");
set_perm(0, 0, 0755, "redbend_ua");
run_program("redbend_ua", "restore", "zImage", "/dev/block/bml7");
(from voodoo script, working for me)

Okay, will try to mount system first. But i dont think that this is the error -.-
And the other lines are the same from mine...
Doesnt work. Still the same error...

Exchanged the update-binary with the one from Voodoo and now it works. ****, i have to learn how to compile my own update-binary. Help in this?

Related

[SOLVED] Updater-script How to flash userdata in "data/data" with cwm???

Hi guys...
I'm trying to make a flashable zip that copy my user data in "data/data" folder.
I did this:
1) Create a zip file with "data" folder
2) "data" folder has contains "app" and "data"
3) Updater-script contains this:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
unmount("/data");
Click to expand...
Click to collapse
My rom.zip flash correctly the rom and the apps in "data\app" but I don't see my preferences because the files in "data\data" were not copied.
What can I do?
What I must write on updater-script?
Thank you very much!
Example of my rom.zip: DOWNLOAD
SOLUTION:
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0771, "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/data");
package_extract_dir("sdcard", "/sdcard");
run_program("/sbin/busybox", "umount", "/data");
thanks to (Roadrunner Team Member)
Could you attach a sample zip with some random data (doesn't have to be some paid apps, free ones are sufficient)? Then I could look at the structure...
TheSSJ said:
Could you attach a sample zip with some random data (doesn't have to be some paid apps, free ones are sufficient)? Then I could look at the structure...
Click to expand...
Click to collapse
Thanks.
I do this in first post...
I'm waiting for you...
putting them in /data/data in the zip should work...
try this
package_extract_dir("example", "/data/data");
and put the files in the zip in the map example
owain94 said:
putting them in /data/data in the zip should work...
try this
package_extract_dir("example", "/data/data");
and put the files in the zip in the map example
Click to expand...
Click to collapse
Did you see the attached zip?
I have already done as you say ..
thank you very much
erestor6 said:
Did you see the attached zip?
I have already done as you say ..
thank you very much
Click to expand...
Click to collapse
Yeah i saw it but try the second one
Make a folder like system and data give it a rondom name you like and tell the updater script to flash folder "x" to /data/data
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
package_extract_dir("x", "/data/data");
set_perm_recursive(x, x, x, x, "/data/data");
unmount("/data");
Sent from my Optimus 2X using xda premium
Code:
mount("MTD", "[B]userdata[/B]", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
unmount("/data");
NickHu said:
Code:
mount("MTD", "[B]userdata[/B]", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
unmount("/data");
Click to expand...
Click to collapse
Thanks but but I already tried this script.
My problem is in "data/data"
owain94 said:
Yeah i saw it but try the second one
Make a folder like system and data give it a rondom name you like and tell the updater script to flash folder "x" to /data/data
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
package_extract_dir("x", "/data/data");
set_perm_recursive(x, x, x, x, "/data/data");
unmount("/data");
Sent from my Optimus 2X using xda premium
Click to expand...
Click to collapse
What should the value of x?
Code:
mount("EXT3", "/dev/block/mmcblk0p8", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
unmount("/data");
Rusty! said:
Code:
mount("EXT3", "/dev/block/mmcblk0p8", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
unmount("/data");
Click to expand...
Click to collapse
Thanks but my problem is about "data/data" not "data/app"
erestor6 said:
What should the value of x?
Click to expand...
Click to collapse
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
package_extract_dir("data2", "/data/data");
set_perm_recursive(x, x, x, x, "/data/data");
unmount("/data");
now you need to make your zip like this
- system
- - app
- - bin
- - lib
- - etc
- - etc
- - etc
- data
- - app
- data2
FILES FOR DATA/DATA HERE!! NOT IN A SUB MAP
one dash for folder in root of the zip
double dash for a subfolder in the root folder
for the x just try 777 and see if it flash if it does it will just work with 777
so this line
set_perm_recursive(x, x, x, x, "/data/data");
should be
set_perm_recursive(0777, 0777, 0777, 0777, "/data/data");
just try it i don't know if it even works i hope so!
owain94 said:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
package_extract_dir("data2", "/data/data");
set_perm_recursive(x, x, x, x, "/data/data");
unmount("/data");
now you need to make your zip like this
- system
- - app
- - bin
- - lib
- - etc
- - etc
- - etc
- data
- - app
- data2
FILES FOR DATA/DATA HERE!! NOT IN A SUB MAP
one dash for folder in root of the zip
double dash for a subfolder in the root folder
for the x just try 777 and see if it flash if it does it will just work with 777
so this line
set_perm_recursive(x, x, x, x, "/data/data");
should be
set_perm_recursive(0777, 0777, 0777, 0777, "/data/data");
just try it i don't know if it even works i hope so!
Click to expand...
Click to collapse
I try also in this way but if I go (throught rootexplorer) in "data/data" there are only new files and not my files!
I tried to manually copy my configuration files in "data/data" folder and I immediately see my preferences working.
BUT WHEN I REBOOT THE PHONE I LOST MY PREFERENCES.
I noticed that the fonder that I manually copied in "data/data" had different permissions from the other folders in "data/data".
Other folders in in "data/data", all have the following code in permissions:
"rwxr-x--x"
in my opinion I have to set these permission in "data/data" but I don't know to which numbers correspond this code!
I have to set
set_perm_recursive(?, ?, ?, ?, "/data/data");
to obtain this code "rwxr-x--x"
Im having the same issue. Im trying to replace my libswypecore.so in data/data/com.swype.android.inputmethod ive tried manually doing it in root explorer with no prevail. I tried flashing and the file stays original. Any more ideas of what I can do?
Hunting for albino ducks in a snow storm.
1. get the recovery.log after you've flashed - that will tell you what the script is doing.
2. mount and look in /data/data in recovery before you reboot to tell you what the script left behind
3. log the first boot to see what Android does with /data/data upon boot
Self-help my friend using the tools you have.
Post all of those results if you have no success and we can take another look.
Bad script or bad permissions is my bet.
Probably wouldn't hurt to post up your updater-script for analysis either.
I ended up getting it to work but I think the permissions were screwing it up. At first I had "set_perm_recursive(0777, 0777, 0777, 0777, "/data/data")" and it actually turned my lib folder into some type of file (I don't know what as I have already deleted it). I deleted that line and it flashed. I had to manually edit the permission though. The file seems to be getting replaced from somewhere else tho upon reboot but thats a different thread. Anyone know how to set the "set_perm_recursive(xxxx, xxxx, xxxx, xxxx, "/data/data")" as to obtain permission of rwxr-x--x
smoochiezz24 said:
I ended up getting it to work but I think the permissions were screwing it up. At first I had "set_perm_recursive(0777, 0777, 0777, 0777, "/data/data")" and it actually turned my lib folder into some type of file (I don't know what as I have already deleted it). I deleted that line and it flashed. I had to manually edit the permission though. The file seems to be getting replaced from somewhere else tho upon reboot but thats a different thread. Anyone know how to set the "set_perm_recursive(xxxx, xxxx, xxxx, xxxx, "/data/data")" as to obtain permission of rwxr-x--x
Click to expand...
Click to collapse
That would be:
owner, group, dir, files
So if you want it owned by root (0):
Code:
0, 0, 0755, 0711
Or owned by system (1000)
Code:
1000, 1000, 0755, 0711
But I suspect these will be incorrect... they just don't look right (I'd try 0777, 0755) have a play around with chmod/chown in a recovery console first to see what they need to be.
Either way, 0777 will not work for the first two parameters, the only values you can reliably use here for system level files is 0 or 1000.
Indeed, if you use 0, 0, 0777, 0777 it's guaranteed to work, it's just a little less secure (not that it matters).
So, perhaps start with 1000, 1000, 0777, 0777 and then tighten down the last one to 0755 as necessary.
Hey guys I am from the MIUI Roadrunner Team and here is the code that will work. We use it for our own updater-script and it works perfect
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0771, "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/data");
package_extract_dir("sdcard", "/sdcard");
run_program("/sbin/busybox", "umount", "/data");
jackmu95 said:
Hey guys I am from the MIUI Roadrunner Team and here is the code that will work. We use it for our own updater-script and it works perfect
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0771, "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/data");
package_extract_dir("sdcard", "/sdcard");
run_program("/sbin/busybox", "umount", "/data");
Click to expand...
Click to collapse
It's true!
Thank you very very very much!!
Inviato dal mio LG-P990 usando Tapatalk

CWM code questions

I don't like flashing things without knowing what do they do.
So it helps that I'm a programmer by day, and I make it a point to look at the code of the scripts I'm CWM-flashing.
I downloaded a modem from Perka's stash and I'm not sure what I'm looking at with this one:
Code:
package_extract_dir("updates", "/tmp");
show_progress(0.100000, 10);
set_perm(0, 0, 0755, "/tmp/redbend_ua");
set_perm(0, 0, 0777, "/tmp/redbend_ua");
run_program("/tmp/redbend_ua", "restore", "/tmp/modem.bin", "/dev/block/bml12");
set_perm(0, 0, 0777, "/tmp/redbend_ua");
run_program("/tmp/redbend_ua", "restore", "/tmp/zImage", "/dev/block/bml7");
show_progress(1.000000, 0);
I'm unsure about a few things here:
1. Why is there a need to chmod redbend_ua twice, and then again after running it?
2. We've run the first run_program, and we have a modem. Lovely. Why is the script then messing with the kernel? Especially since there isn't a kernel in this package. I have a suspicion this is simply a sort of template package, and you can put in a kernel, modem or both and it will work, but I'm unsure about this. (Also, how would it react in the case of a file being missing?)
On the whole - What scripting language is this? Where can I find a proper documentation for it? How do I create one myself? I've googled it plenty and didn't seem to come to a proper conclusion..
Why dont you PM Perka himself/herself? she/he would be the best person to answer your questions!!!
Good Luck

[tutorial] creating simple update.zip

creating simple update.zip is very easy if you know all the basics
some basics are as follows
1. folder structure
*META-INF (compulsory)
*system
*data
many folders can be added but for simple update.zip these three are required.
Click to expand...
Click to collapse
2. META-INF folder structure
META-INF> com (certificates lies here)
META-INF> com> google
META-INF> com> google> android (updater-script and update-binary lies here)
Click to expand...
Click to collapse
3. update-binary:-
created in C language cannot be created by anyone, it handles every command which is written in updater-script and do everything from extraction to writing image files
Click to expand...
Click to collapse
4. updater-script:-
this file contains all the commands which are needed to do the work, basic commands are provided below
Click to expand...
Click to collapse
5. update-script common commands:-
Code:
ui_print("");
# put the lines in between "" what you want cwmr to show while flashing
e.g ui_print("text by DHLALIT11");
-------------------------
Code:
show_progress(0, 0);
# before comma is the number by which you want to increase the progress, 1 is complete 0.20 is 20%, after comma is the time until which progress bar will keep progressing when time will be completed progress bar will show 20%
e.g:- show_progress(.50, 5);
-------------------------
Code:
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
# command is used to mount system without mounting nothing can be copied to system (will not work on rfs file system
-------------------------
Code:
package_extract_dir("folder name", "/path");
# this command is used to extract the files which you have copied to system folder of the package to the system folder of the phone
(e.g:- package_extract_dir("system", "/system");
-------------------------
Code:
run_program("/sbin/busybox", "mount", "/dev/block/mmcblk0p2", "/data");
# command is used to mount data without mounting nothing can be copied to data (may not work on rfs file system )
-------------------------
Code:
package_extract_dir("data", "/data");
# this command is used to extract the files which you have copied to data folder of the package to the data folder of the phone
-------------------------
package_extract_file("path/to/file", "/path/to/extract");
# command is used to extract the script or any other file to temp folder.
e.g:-
Code:
package_extract_file("script/tool.sh", "/tmp/tool.sh");
-------------------------
Code:
delete_recursive("folder name");
# use to delete a complete folder that can be system, data, cache etc.
e.g:- delete_recursive("/system/media");
# will delete media folder from /system
-------------------------
Code:
delete("file with complete patch");
# use to delete a single file
e.g:- delete("/system/app/app.apk");
# app.apk will be deleted from /system/app
-------------------------
Code:
set_perm(0, 0, 06755, "/system/xbin/su");
# this command is used to give permission to a file, in this scenario we are giving permission to su file to make it work properly.
-------------------------
Code:
set_perm_recursive (1000, 1000, 0771, 0644, "data/app");
# this command is used to give permission to the whole folder, in this scenario we are giving permission to app folder to make it work properly.
Click to expand...
Click to collapse
6. ";" sign must be written after the completion of every command if a single one is missing package will not flash
Click to expand...
Click to collapse
7. adding "#" before any command will tell system not to read that line
Click to expand...
Click to collapse
8. /tmp folder:- a folder where all temporary files like boot.img, updater.sh, modem.bin are extracted
Click to expand...
Click to collapse
9. updater script is very sensitive about line break code if you edit the updater script with any windows editor without changing line break code it will give error so to edit updater script use jota text editor(android) or notepad++(windows)
Click to expand...
Click to collapse
------------------------------------
the file you want copy to system or data through update.zip must be placed in the system or data folder of update.zip along with the folder structure
suppose you want to install busybox then the file must be placed like this:- update.zip> system> xbin> busybox
want to install YouTube as system app then the app must be placed like this:- update.zip> system> app> YouTube.apk
want to install YouTube as data app then the app must be placed like this:- update.zip> data> app> YouTube.apk
Helpful tut !
Good tut but why not just install java and that batch file programme made buy someone here at xda..
freakyfriday said:
Good tut but why not just install java and that batch file programme made buy someone here at xda..
Click to expand...
Click to collapse
you must be talking about d4 update.zip maker
this tut is only to give info
and suppose you are not near to your PC and you want to make a cwm zip then if you know all this you can easily create the package with you android smartphone or tab
please guys reply if you like and if you get something from this tut
dhlalit11 said:
please guys reply if you like and if you get something from this tut
Click to expand...
Click to collapse
OK, Thank you very much for this quick tutorial. It's so useful for me
I think you should add it to your signature to point out it (I didn't notice it untill you had mentioned it in my topic).
I think also you may add some more commands for Updater-Script.
Q: Can I get input from user via CWM? ^_^
I don't like to update my sig with my mobile and am away from my computer from about 1 week don't know when I will update it
Nice.
It should give noobs a guide to modify roms to their liking instead of asking rom devs to remove this and add that,now they can edit the rom themselves and with rootexplorer do it all from your phone.
updated op, there was a mistake in show progress command please read it again
thank.. i found what i need
I finally found this tutorial, as I suspect, like copy-paste it in the same directory.
*sorry for my bad english*
what you want to copy and paste in the same directory
Very well written tutorial !!!. Was very easy to understand.
...
@dheeraj (dhlalit11)
This script is called "edify" script. This is just a suggestion because you have not mentioned it in your tutorial.
...
...
Is it possible to set properties of "build.prop" file from updater-script?. From terminal we can use "setprop" command, is there similar command that can be used in the updater-script. Or may be some busybox command i.e "run_program(...)" ???
you will need to create a script then create its flashable zip in updater-script first extract it to /tmp, make it executable then run it through run program command
awesome............
done editing
guys any fixing needed please reply
What is the difference between mount("yaffs2", "MTD", "system", "/system"); and run_program("/sbin/busybox", "mount", "/dev/block/mmcblk0p2", "/data"); ??
I am getting an error - mount() expects 3 args. got 4
Code:
assert(getprop("ro.product.device") == "beni" || getprop("ro.build.product") == "beni" || getprop("ro.product.board") == "beni" ||
getprop("ro.product.device") == "GT-S5670" || getprop("ro.build.product") == "GT-S5670" || getprop("ro.product.board") == "GT-S5670");
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
ui_print("Root for AOSP by harryhades");
ui_print("--------------------------------");
show_progress(0.100000, 0);
show_progress(0.500000, 0);
package_extract_dir("system", "/system");
set_perm(0, 0, 06755, "/system/xbin/sqlite3");
set_perm(0, 0, 06755, "/system/xbin/su-v1");
set_perm(0, 0, 06755, "/system/xbin/su-v2");
set_perm(0, 0, 06755, "/system/xbin/su-v3");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/sh");
set_perm(0, 0, 06755, "/system/xbin/busybox");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
#unmount("/system");
P.S: what permssion should be set for the superuser binaries?? i am confused between 06755 and 04755
Harryhades said:
What is the difference between mount("yaffs2", "MTD", "system", "/system"); and run_program("/sbin/busybox", "mount", "/dev/block/mmcblk0p2", "/data"); ??
I am getting an error - mount() expects 3 args. got 4
Code:
assert(getprop("ro.product.device") == "beni" || getprop("ro.build.product") == "beni" || getprop("ro.product.board") == "beni" ||
getprop("ro.product.device") == "GT-S5670" || getprop("ro.build.product") == "GT-S5670" || getprop("ro.product.board") == "GT-S5670");
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
ui_print("Root for AOSP by harryhades");
ui_print("--------------------------------");
show_progress(0.100000, 0);
show_progress(0.500000, 0);
package_extract_dir("system", "/system");
set_perm(0, 0, 06755, "/system/xbin/sqlite3");
set_perm(0, 0, 06755, "/system/xbin/su-v1");
set_perm(0, 0, 06755, "/system/xbin/su-v2");
set_perm(0, 0, 06755, "/system/xbin/su-v3");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/sh");
set_perm(0, 0, 06755, "/system/xbin/busybox");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
#unmount("/system");
P.S: what permssion should be set for the superuser binaries?? i am confused between 06755 and 04755
Click to expand...
Click to collapse
Just remove it n at last '#' is used for command line!!
from the first command remove the yaffs2
that busybox mount command will mount /data
the permission should be 06755
and also remove those getprop lines they are useless
Please tell permissions for frameworkres.apk
Sent from my GT-S5570 using xda premium

[help] apps extracted through recovery won't install

hey guys
I want to install all of my apps from a zip package through recovery (a lot faster than installing each via adb). It's fine, but I don't see the apps. I believe this is a permission issue and can't figure it out
the script :
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
unmount("/data");
is this wrong ?

[Fixed] Error Flashing two flashable zips I created

I created two flashable zips that I'd like to use after every rom flash:
One is all my Layers overlay apks and the other is all the font files I want to use.
Here is my updater-script that I use in both zips, the only difference being the ui_print and file names, of course:
Code:
ui_print(" Installing Layers overlays... ");
ui_print(" ");
show_progress(0.99, 30);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0644, "/system/vendor/overlay");
show_progress(1.0, 1);
unmount("/system");
ui_print("----------------------------------------------");
ui_print("| Done!!! |");
ui_print("----------------------------------------------");
ui_print(" ");
And here is the error I get in recovery when I flash either zip:
Code:
set_perm_recursive() expects 5+ args, got 4
E:Error executing updater binary in zip '/sdcard/Mods/Zips/Layers-Themes-signed.zip'
Error flashing zip '/sdcard/Mods/Zips/Layers-Themes-signed.zip'
Obviously, I did set
Code:
set_perm_recursive(0, 0, 0644, "/system/vendor/overlay");
to be the right permissions. I know that the contents of that directory, /system/vendor/overlay need to be 644 but I don't know the proper edify script syntax for
Code:
set_perm_recursive(0, 0, 0644, "/system/vendor/overlay");
Does anyone know what I need to do differently to make these zips flash properly?
EDIT: I found this post that said that the correct syntax should be: set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/overlay"); instead. Problem solved!!
I know you figured it out, but the set_perm_recursive needs 5 arguments (as stated in the error message you received). It would be for group:user ownership and then permissions for directories & files (in that order) followed by the directory that you're setting permissions in.
imnuts said:
I know you figured it out, but the set_perm_recursive needs 5 arguments (as stated in the error message you received). It would be for group:user ownership and then permissions for directories & files (in that order) followed by the directory that you're setting permissions in.
Click to expand...
Click to collapse
@imnuts, would it be this?
Code:
set_perm_recursive(0, 0, 0, 0755, 0644, "/system/vendor/overlay");

Categories

Resources