Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,730,761 Members 41,921 Now Online
XDA Developers Android and Mobile Development Forum

Updater-script problems

Tip us?
 
Joeyxc
Old
#1  
Joeyxc's Avatar
Senior Member - OP
Thanks Meter 154
Posts: 354
Join Date: Mar 2013
Location: St. Louis

 
DONATE TO ME
Default Updater-script problems

hello all ive been working on my rom but i cant get it working in recovery it says the binary couldnt be read correctly, attached is my working folder zip from kitchen please help look into it i cant figure it out
Attached Files
File Type: zip META-INF.zip - [Click for QR Code] (169.0 KB, 66 views)
Remember to say Thanks!

Samsung Galaxy S4-Committed to whatever I'm working on development!

Xperia play R800i(R800at) 4.0.4 thanks to kks11muskanjainxx@gmail.comHe's the best for everything xperia from fixing hard bricks to unlocking bootloaders!
 
Rahulrulez
Old
#2  
Rahulrulez's Avatar
Senior Member
Thanks Meter 1444
Posts: 1,633
Join Date: Oct 2010
Location: India

 
DONATE TO ME
Rename update-binary.orig to update-binary. That might be the issue mate!
Follow me on Twitter for daily Android related (and some personal) updates @rahulzeven

 
ww2916269
Old
#3  
Member
Thanks Meter 15
Posts: 62
Join Date: Feb 2011
Location: Beijing
Could you help me to check this problem? Thank you very much!
http://forum.xda-developers.com/show....php?t=2390510

Quote:
Originally Posted by Rahulrulez View Post
Rename update-binary.orig to update-binary. That might be the issue mate!
 
MaKTaiL
Old
#4  
MaKTaiL's Avatar
Senior Member
Thanks Meter 1130
Posts: 2,691
Join Date: Oct 2011
Location: Brasília
Hi, I know this has nothing to do with what the OP asked on the thread, but it's related to Updater-Script so here goes:

I've notice a lot of people have been using delete_recursive instead of format command to wipe system.
Why is that? Is it safer to use delete_recursive? Because I'm using Android Kitchen and it creates an Updater-Script with format command.
It's the first time I'm using Android Kitchen though so I'm afraid of testing the zip I made before I'm sure it's safe to use format. Can somebody help me?

PS.: I didn't want to create another thread to ask this so I apologize in advance.
 
agat63
Old
#5  
agat63's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 7930
Posts: 3,977
Join Date: Sep 2010
Location: Las Vegas, NV

 
DONATE TO ME
Quote:
Originally Posted by MaKTaiL View Post
Hi, I know this has nothing to do with what the OP asked on the thread, but it's related to Updater-Script so here goes:

I've notice a lot of people have been using delete_recursive instead of format command to wipe system.
Why is that? Is it safer to use delete_recursive? Because I'm using Android Kitchen and it creates an Updater-Script with format command.
It's the first time I'm using Android Kitchen though so I'm afraid of testing the zip I made before I'm sure it's safe to use format. Can somebody help me?

PS.: I didn't want to create another thread to ask this so I apologize in advance.
It all started with mmc bug that has been presented by ICS source for GS2.
format() command was triggering hard brick.
You can find very good and full explanation of the bug in GS2 section of the forum but here is very short and simple explanation of the bug.
The MMC_CAP_ERASE command (part of format) was writing bunch of zeros in MMC killing the phone.
After kernel source was released we were able to disable that command and it became safer but some devs still use delete_recursive instead of format.
Both command do same and have pretty much same affect but delete_recursive might be few milliseconds slower than format()
Format command is formatting the partition where delete_recursive is deleting everything from partition (folders, subfolders, files etc) and then goes over the partition again to make sure nothing left behind (thus "recursive").
For new install format() command is cleaner, I think.
But if dev has modified his script at some point it will just keep using it till new modification is required. So there may be no need for delete_recursive any more but since it's in script and script is working no one is really looking into it.
Hope this make sense.
My work can be found here:

http://d-h.st/users/agat/?fld_id=0#files

If you like my work and want to help
Donate Here
The Following 3 Users Say Thank You to agat63 For This Useful Post: [ Click to Expand ]
 
MaKTaiL
Old
#6  
MaKTaiL's Avatar
Senior Member
Thanks Meter 1130
Posts: 2,691
Join Date: Oct 2011
Location: Brasília
Quote:
Originally Posted by agat63 View Post
It all started with mmc bug that has been presented by ICS source for GS2.
format() command was triggering hard brick.

You can find very good and full explanation of the bug in GS2 section of the forum but here is very short and simple explanation of the bug.
The MMC_CAP_ERASE command (part of format) was writing bunch of zeros in MMC killing the phone.
After kernel source was released we were able to disable that command and it became safer but some devs still use delete_recursive instead of format.
Both command do same and have pretty much same affect but delete_recursive might be few milliseconds slower than format()
Format command is formatting the partition where delete_recursive is deleting everything from partition (folders, subfolders, files etc) and then goes over the partition again to make sure nothing left behind (thus "recursive").
For new install format() command is cleaner, I think.
But if dev has modified his script at some point it will just keep using it till new modification is required. So there may be no need for delete_recursive any more but since it's in script and script is working no one is really looking into it.
Hope this make sense.
Thanks for reserving your time to answer me. Really appreciate it.
I came from a Galaxy S2 before the S4 and I'm aware of the MMC_CAP_ERASE problems.
I just didn't know it was caused by the format command. Thanks for explaining it to me.
I'll keep using delete_recursive from now on.
 
Joeyxc
Old
#7  
Joeyxc's Avatar
Senior Member - OP
Thanks Meter 154
Posts: 354
Join Date: Mar 2013
Location: St. Louis

 
DONATE TO ME
Here's my log...
Installing '/sdcard/GEM4.3_By:Joeyxc.zip'...
Checking for MD5 file...
I:Cannot find file /sdcard/GEM4.3_By:Joeyxc.zip.md5
Skipping MD5 check: no MD5 file found.
line 4 col 17: syntax error, unexpected STRING, expecting $end
line 5 col 19: syntax error, unexpected STRING, expecting ',' or ')'
2 parse errors
E:Error executing updater binary in zip '/sdcard/GEM4.3_By:Joeyxc.zip'
Error flashing zip '/sdcard/GEM4.3_By:Joeyxc.zip'
Updating partition details...

Please help

Sent from my SGH-I337 using Tapatalk 2
Remember to say Thanks!

Samsung Galaxy S4-Committed to whatever I'm working on development!

Xperia play R800i(R800at) 4.0.4 thanks to kks11muskanjainxx@gmail.comHe's the best for everything xperia from fixing hard bricks to unlocking bootloaders!
 
Surge1223
Old
(Last edited by Surge1223; 7th October 2013 at 10:39 AM.)
#8  
Surge1223's Avatar
Recognized Contributor
Thanks Meter 3366
Posts: 1,644
Join Date: Nov 2012
Location: Iowa

 
DONATE TO ME
Quote:
Originally Posted by Joeyxc View Post
hello all ive been working on my rom but i cant get it working in recovery it says the binary couldnt be read correctly, attached is my working folder zip from kitchen please help look into it i cant figure it out
The issue is the format the text is in. Also in addition to renaming update-binary.orig to update-binary, rename update-script to updater-script. Open the updater-script.orig with a text editor and look at the format and compare it to the text you have in 'update-script'. Change the format of the text in 'update-script' to match the format of 'updater-script.orig'. You should be able to notice right away that you will need to add parenthesis', semi-colons, and apostrophes as you are missing all of them. If you need more help let me know, I can look over/help you edit it.

Edit: Come to think about it, you just needed to convert update script to updater-script using kitchen.
 
hawkerpaul
Old
(Last edited by hawkerpaul; 31st October 2013 at 03:50 PM.)
#9  
hawkerpaul's Avatar
Recognized Contributor
Thanks Meter 5292
Posts: 2,337
Join Date: Sep 2011
Location: UK

 
DONATE TO ME
Can I ask an updater-script related problem here please.

I write a few CWM utils (see my thread)
Some of these scripts perform a factory reset (wipe /data essentially)

On the GS2, this used to work great, but on the GS4, doing this also wipes the entire internal SD card!
I think this happening because there is a link to sd card in /data/media/0 perhaps.

My question is, how can I perform such a wipe of /data in the updater-script and keep internal SD Card in tact?

I've tried delete_recursive and format
But always, the script ends up wiping the entire SD card along with /data

example of commands I've been using in the updater-script are:
format("ext4", "EMMC", "/dev/block/mmcblk0p29", "0");

mount("ext4", "EMMC", "/dev/block/mmcblk0p29", "/data");
delete_recursive("/data");



I've also tried unmounting /sdcard before attempting one of the above commands:
unmount("/sdcard");
run_program("/sbin/umount", "/sdcard");

(also tried both of these with /data/media/0)
both actually unmounted /sdcard (as I could no longer access it in recovery) but both the format and the delete_recursive command still managed to wipe the entire internal SD card.

If unmounted, I am then unable to get recovery to see the sdcard until the device is rebooted.
I've tried to remount the sdcard to get it back online for the current recovery session in the updater-script using:
mount("vfat", "EMMC", "/dev/block/mmcblk0p1", "/sdcard");
but this doesn't seem to work.

Any pointers or advice would be greatly appreciated as this has been driving me nuts!
Device: Samsung GT-I9505
My Scripts
My Web Site
 
Surge1223
Old
#10  
Surge1223's Avatar
Recognized Contributor
Thanks Meter 3366
Posts: 1,644
Join Date: Nov 2012
Location: Iowa

 
DONATE TO ME
FWIW, I had issues with data too, I was unable to restore shealth2 since it is preinstalled in /data/app and I would soft-brick everytime I tried flashing it until I finally used the script below with success.

unmount("/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p29", "/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p16", "/system");

package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
run_program("adb", "install", "-r", "added_files/system/app/HealthContentProvider.apk");
run_program("adb", "install", "-r", "added_files/system/app/SensorService.apk");

package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
run_program("adb", "install", "-r", "added_files/data/app/SHealth2.apk");

unmount("/system");
unmount("/data");

Sent from my TouchPad using xda app-developers app

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...