update script syntax error - Hero CDMA Q&A, Help & Troubleshooting

can someone tell me why the hell this:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
is giving me syntax errors?
I also tried:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.2 10
I'm about to pull my hair out.
these are the only lines in the script. nothing else. All I'm going si copying stuff to the /system/app directory. WTF????

tejasrichard said:
can someone tell me why the hell this:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
is giving me syntax errors?
I'm about to pull my hair out.
these are the only lines in the script. nothing else. All I'm going si copying stuff to the /system/app directory. WTF????
Click to expand...
Click to collapse
Do you have a /system folder in you zip? I know it's a dumb question, but.....I'm just asking...

lol, yeah! i know, check all the easy stuff, but this really should be working...
at first i was trying to so a /system/app and a /data/app, but that kept getting the syntax error. Then, I modified it to be just /system/app/, but it still won't work.

BUMP! for my 10chars

Related

A quick update-script question

Hi there,
I am building a .zip file that will install RTL support for some applications , and got stuck at the update-script part.
I have two files named CalendarFix.apk , and GalleryFix.apk , I would like to install them directly from the recovery.
Tried to put them both in system/app and data/app with :
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
But no luck , they wont install .
Is there a command that I need to use to install them ?
I thought to use run_program , though I did`nt see it in any rom update-script code.
I need to -
Extract CalendarFix.apk and GalleryFix.apk , delete the old once (Calendar.apk,Gallery.apk) and install the new once .
Any help would be appreciated,
Danny.
http://www.robmcghee.com/android/creating-an-android-update-zip-package/
Fantastic , I managed to work that out.
Thanks.

[Q] Syntax Error

I've searched, and searched, and searched some more.
I'm trying to create an update zip, but I keep getting this error:
E:Syntax error in update script
I'm trying to flash a com.htc.resources.apk that I modifies because I lose my ability to sign in gapps and I lose all my contacts when I push it. My update-script is in /META-INF/com/google/android. I edited it with notepad
THIS IS MY SCRIPT:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
What am I doing wrong?

[INFO] Edify scripts in CWM recovery

Hi, I haven't seen any good resources for how to edit edify scripts, so I thought I would create this thread so we can pool our knowledge on the subject.
Intro
Inside your typical CWM zip there is a folder called META-INF, inside that there is a folder called com and come CERT files, inside that com folder there is a google folder, inside that is an android folder containing an update-binary file and an updater-script. If you only see an update-script, that means you are back in the Android 1.5 era and need to move on.
The updater-script
The updater-script file is a text file, it is linux formatted with regard to end of line conventions. If you use Windows then you have to edit the file using a program that keeps line feeds the way they are and has options for doing the conversion from <CR><LF> to just <LF>.
Like lisp, the contents of the text file evaluate to one big expression, but it does have the ";" end of command convention to make things more familiar, it just means perform the action on the left. (ref. google source README) You can ignore that and just treat everything as a series of commands for all practical purposes. I mention it because you need not worry about having too large a procedural block or worry about having extra spaces or worry about ending on a line boundary. You could have your entire script on one giant line and it wouldn't matter.
There are around a dozen commands, it's not terribly difficult to learn.
The updater-binary
There are a lot of updater-binary files out there in the wild, each manufacturer basically compiles there own with every other OTA update. Success in flashing your CWM zip is determined by picking the right one that works with what you are trying to do. If your knowledge says mount needs 4 arguments and the binary only supports 3, then you need to change your script to use 3 and vice versa. If you are trying to flash a radio, the updater-binary might have been recompiled to allow for that specific functionality and you will get a status 6 error when trying to flash it unless you use that update-binary. You will see the write_raw_image() function not supporting "/dev/block/mmcblk0p8" but instead "logo.bin".
However, by and large, the generic functionality is the same across the board.
​Updater-script functions (In order of interest)​
ui_print(msg1, .. msgN); This is the means you have to display something on the screen in CWM, it takes a series of comma separated arguments, each comma needs to have a space after it, this applies to all commands.
Ex. ui_print("Your version is: ", file_getprop("/system/build.prop", "ro.build.id"));
show_progress(TOTALAMOUNT, TIMEINSEC); This command and the following command control what you see in the progress bar at the bottom. It is not necessary to use it, it's just another way to display information.TIMEINSEC refers to how long it will take for the progress bar to move to the AMOUNT specified. You would use this perhaps when something is taking a long time, you know approximately how long and want the screen to keep showing something while it is going on. If you use zero for TIME then nothing is done, you have just set the maximum amount for use with set_progress. The amount is a decimal number, 0.5 would be half the progress bar being filled.
Ex. show_progress("0.300000", 10);
set_progress(AMOUNT); This command sets the pointer or fill amount of the progress bar according to the last show_progress command. It should never be greater than the total of the show_progress amount.
Ex. show_progress("0.300000", 0);
set_progress("0.15");
mount(TYPE, DEV, PATH); This is one version of the mount command. The TYPE arg is usually "MTD", which refers to memory technology device. The DEV for a MTD would be something like "system", "userdata", "cache", and the PATH would be "/system", "/data", or "/cache". You will also see TYPE be "vfat".
mount(FSTYPE, TYPE, DEV, PATH); This seems to be the more current mount command. It adds in the file system type. Ex. "ext3", "yaffs". TYPE with this command can be "MTD" or "EMMC". You would use "EMMC" with "/dev/block/mmcblk0p8".
umount(PATH); This simply removes a previous mounted PATH from the system. Ex. umount("/system"); You'll notice the double quotes around command arguments, they are not strictly necessary. Unless it's a reserved word (if then else endif) then they can be anything. "consisting of only letters, numbers, colons, underscores, slashes, and periods". So if you just spend 10 minutes uploading your zip to your phone and notice that your unmount command is umount(/system);, it will work just fine.
sleep(SECS); Simply pauses for SECS seconds.
package_extract_file(FILE, FILEWITHPATH); This command extracts one of your files from the CWM zip package and save it to the phone.
Ex. package_extract_file("bootanimation.zip", "/system/media/bootanimation.zip");
package_extract_dir(ZIPPATH, PATH); This command extracts an entire folder in your CWM zip to a folder on your phone.
Ex. package_extract_dir("system", "/system"); *This is where having system mounted would be handy, without it being mounted, the files would be copied to the ramdisk /system.
write_raw_image(PATH, PARTITION); This is one of those tricky ones, the PATH is somewhere on your phone with the image to be flashed to a PARTITION on your phone. The trouble is, how do you specify what partition gets flashed? Is there any restriction on where the file has to be? If MTD conventions are used, you are looking for "system", "boot", "recovery", "logo.bin". (All this means that each partition has a name stored somewhere, and if you know it, you can write to it.) Maybe it will accept device references like /dev/block/mmcblk0p8. This depends on the update-binary file you are using.
Ex. write_raw_image("/tmp/logo.bin", "logo.bin");
Ex. write_raw_image("/tmp/logo.bin", "/dev/block/mmcblk0p8");
write_firmware_image(PATH, PARTITION); You would think it would be the same as write_raw_image. Not sure what the difference is.
run_program(PROG, ARG1, .., ARGN); Pretty self explanatory, This command allows you to execute a program or script on the phone. Instead of all the bits of the command being separated by spaces, commas are used. It returns an error code as a string.
Ex. run_command("ls", "-R", "/system");
Assert(condition); You'll see this one a lot in OTA updates, all it does is abort the script if something goes wrong. If condition is false, the script ends displaying a description on the phone of what command caused the exit. You can put in more than one statement here, separated by ";", if any one of them returns with an error, the script exits.
Ex. Assert(mount("ext3", "EMCC", "/dev/block/mmcblk0p12", "/system")); *If you can't mount /system and your CWM zip only writes to system, you might as well stop it before continuing on to write to the ramdisk.
ifelse(condition, true path, false path); This is your basic conditional statement, the tricky bit is to figure out what statements in edify can trigger a true of false condition. As for the rest of it, the commas separate the two blocks.
Ex. ifelse(file_getprop("/system/default.prop", "ro.build.id") == "OLYFR1.2.3.4", ui_print("yes"), ui_print("false"));
abort(); This stops the script, useful with ifelse.
file_getprop(PATH, VALUE); This command looks for a text file containing A=B pairs and returns B if it can find an A.
Ex. file bob.txt exists in /tmp, it contains cool=yes, and dorky=true123 each on separate lines.
file_getprop("/tmp/bob.txt", "cool") == "yes"
file_getprop("/tmp/bob.txt", "dorky") == "true123"
getprop(VALUE); Functions the same as file_getprop, without the file part. It looks through the system value pairs for a matching value.
Ex. getprop("ro.build.id") == "OLYEM1.2.3.4"
delete(PATH1, ...,PATHN); Nothing to see here, just a delete command, full path to the file(s) as argument(s).
delete_recursive(PATH1, ...,PATHN); It's a delete everything in a folder, including subfolders command. The folder itself is deleted as well.
set_perm(UID, GID, MODE, PATH1, ..., PATHN); Set the linux permissions on a file, ownership and flags at the same time. Equivalent to chown and chmod in the one command.
Ex. set_perm(0, 0, 06755, /system/bin/su, /system/bin/shsu); *0 stands for root, so it would be owned by root, of the group root, with suid bit set and standard executable bits set.
set_perm_recursive(UID, GID, DIRMODE, FILEMODE, PATH1, ...,PATHN); Same as above except with folders instead of files. Use the DIRMODE to set the permissions and ownership of the folders themselves, and FILEMODE to set the permissions of the files within them.
symlink(TARGET, LINK1, ...,LINKN); It's the equivalent to the linux ln -s command. For our purposes, it might as well be called busybox install.
Ex. symlink("/system/bin/busybox", "/system/bin/awk", "/system/bin/wget", "/system/bin/sed");
To Be Continued..
​
References
http://devphone.org/development/edify-script-syntax-explained/
http://www.synfulgeek.com/main/index.php/articles/76-scratchpad-documenting-edify-commands-for-android-updater-scritps-based-off-of-kernel-source-code
https://github.com/koush/android_bootable_recovery/blob/eclair/edify/README
http://tjworld.net/wiki/Android/UpdaterScriptEdifyFunctions​
Tips:
You can use the abort() command to step through your updater script, for instance if you wanted to check various combinations on syntax for write_raw_image();
In /tmp there is a text file called recovery.log, do a cat /tmp/recovery.log to see extra output of your script from failed commands.
NFHimself said:
The updater-script file is a text file, it is linux formatted with regard to end of line conventions. If you use Windows then you have to edit the file using a program that keeps line feeds the way they are and has options for doing the conversion from <CR><LF> to just <LF>.
Click to expand...
Click to collapse
If you are in windows, I have found that notepad++ does the job just fine.
http://notepad-plus-plus.org/
what about the FORMAT command?
actually i have error on a CM installation, its says
Code:
format() expects 3 args, got 2.
but my format command have 3 args:
Code:
format("ext4", "/dev/block/mmcblk0p10", "/system");
NFHimself said:
Hi, I haven't seen any good resources for how to edit edify scripts, so I thought I would create this thread so we can pool our knowledge on the subject.
Intro​
Click to expand...
Click to collapse
Thanks for this... but I do have a question....
I am attempting to see if busybox is installed on a device, and if not install it, or proceed
so, so far I have:
Code:
ifelse(
BUSYBOX DOESNT EXIST,
(
ui_print("* Did not find it. Installing...");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
symlink("/system/xbin/busybox", "/system/bin/busybox");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
),
(
ui_print("* Found it. Proceeding...");
)
);
You can see where I'm lost I was thinking of using assert to run_program("/system/xbin/busybox", "vi", "/system/xbin"); just as a simple check... but from what I can see, if the assertion fails it will stop the script, and print out the failure message, which of course is not what I am after here... or maybe I am, can it be used to do a check rather than stop the script?​
Just an idea (ie. untested):
Code:
ifelse(
run_program("/system/bin/sh", "-c", "test -e /system/xbin/busybox")
...
)
ravilov said:
Just an idea (ie. untested):
Code:
ifelse(
run_program("/system/bin/sh", "-c", "test -e /system/xbin/busybox")
...
)
Click to expand...
Click to collapse
trying to run that in adb sheel, and don't get a response, but it does seem like a good idea... I assume Edify would return a 1/0 or true/false string from it, and I can just check for that?
EDIT: Maybe I do get something back... after running that in adb shell my next line looks like the following:
Code:
1|[email protected]:/ #
Am I right in assuming that "1" is the output?
Yes. The command won't ever return any output, it only returns the exit status. Your shell is obviously set so it includes a non-zero exit status in the prompt. (Non-zero traditionally means error.)
ravilov said:
Yes. The command won't ever return any output, it only returns the exit status. Your shell is obviously set so it includes a non-zero exit status in the prompt. (Non-zero traditionally means error.)
Click to expand...
Click to collapse
that prompt means that the test failed, and I don't have busybox installed?
I'm just a tad confused... (this is my first full-on edify script), and I do have busybox installed
I appreciate the help, and once I get my tapatalk working right on my phone, I'll give ya all the "thanks" for the help with this
Eh... everything I 'test' returns the same thing
Code:
1|[email protected]:/ #
Hm, weird. It works for me...
Code:
# /system/bin/sh -c 'test -e /system/xbin/busybox'; echo $?
0 [color=silver]<-- no error - file exists[/color]
# /system/bin/sh -c 'test -e /system/xbin/busybox1'; echo $?
1 [color=silver]<-- error - file does not exist[/color]
I didn't try it in an edify script because I don't feel like rebooting my phone right now, but I don't see why it wouldn't work.
Try running the "sh -c test ..." command in adb shell while in recovery and see what happens.
Also, just a side note: backslash is NOT the same as slash. If you are going to write shell/edify scripts, you need to know at least that distinction. That is why your
Code:
tags are not working right.[/b][/i][/size]
ravilov said:
Hm, weird. It works for me...
Code:
# /system/bin/sh -c 'test -e /system/xbin/busybox'; echo $?
0 [color=silver]<-- no error - file exists[/color]
# /system/bin/sh -c 'test -e /system/xbin/busybox1'; echo $?
1 [color=silver]<-- error - file does not exist[/color]
I didn't try it in an edify script because I don't feel like rebooting my phone right now, but I don't see why it wouldn't work.
Try running the "sh -c test ..." command in adb shell while in recovery and see what happens.
Also, just a side note: backslash is NOT the same as slash. If you are going to write shell/edify scripts, you need to know at least that distinction. That is why your
Code:
tags are not working right.[/b][/i][/size][/QUOTE]
I see, I wasn't doing the echo, and what you posted shows exactly what you posted. DOH on the CODE :good:
So I have it on record (for my own personal reference)
[CODE]
ifelse(
((run_program("/system/bin/sh", "-c", "test -e /system/xbin/busybox; echo $?") == 1 ||
(run_program("/system/bin/sh", "-c", "test -e /system/bin/busybox; echo $?") == 1 ||
(run_program("/system/bin/sh", "-c", "test -e /system/xbin/busibox; echo $?") == 1 ||
(run_program("/system/bin/sh", "-c", "test -e /system/bin/busibox; echo $?") == 1),
(
ui_print("* Did not find it. Installing...");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
symlink("/system/xbin/busybox", "/system/bin/busybox");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
),
(
ui_print("* Found it. Proceeding...");
)
);
and yes, I meant the 'busibox' part, because I have seen that in some roms
Click to expand...
Click to collapse
You guys know way more about this stuff than I do... although i am a programmer
could I get some insight over here: http://forum.xda-developers.com/showthread.php?t=2796055
having an issue getting my shell scripts to actually run...
Rockin' it from my Smartly GoldenEye 35 NF1 (muchas gracias:* @iB4STiD @loganfarrell @muniz_ri @Venom0642 @ted77usa @rebel1699* @iB4STiD) ~ 20GB free cloud https://copy.com?r=vtiraF
Check me out online @ http://kevin.pirnie.us
note: the scripts do run in adb shell
published API docs
NFHimself said:
Hi, I haven't seen any good resources for how to edit edify scripts, so I thought I would create this thread so we can pool our knowledge on the subject.
Click to expand...
Click to collapse
I found some official documentation of the API on the Android Web site here:
https://source.android.com/devices/tech/ota/inside_packages.html
NFHimself said:
[*]write_raw_image(PATH, PARTITION); This is one of those tricky ones, the PATH is somewhere on your phone with the image to be flashed to a PARTITION on your phone. The trouble is, how do you specify what partition gets flashed? Is there any restriction on where the file has to be? If MTD conventions are used, you are looking for "system", "boot", "recovery", "logo.bin". (All this means that each partition has a name stored somewhere, and if you know it, you can write to it.) Maybe it will accept device references like /dev/block/mmcblk0p8. This depends on the update-binary file you are using.
Ex. write_raw_image("/tmp/logo.bin", "logo.bin");
Ex. write_raw_image("/tmp/logo.bin", "/dev/block/mmcblk0p8");
[*]write_firmware_image(PATH, PARTITION); You would think it would be the same as write_raw_image. Not sure what the difference is.
Click to expand...
Click to collapse
I didn't do a line by line comparison between your description and theirs, but I noticed this part because I was trying to find information about these functions. Only write_raw_image() is a published API function. This is the description:
write_raw_image(filename_or_blob, partition)
Writes the image in filename_or_blob to the MTD partition. filename_or_blob can be a string naming a local file or a blob-valued argument containing the data to write. To copy a file from the OTA package to a partition, use: write_raw_image(package_extract_file("zip_filename"), "partition_name");​
Probably write_firmware_image() is used internally. It could be removed at any time, or it even could be a stub - not a good idea to use it.

Flashable zip

Hi everyone,
I finally learnt something and started modding my phone.
I have a flashable zip with the folders of my systemUI.apk
And the META-INF folder with this script:
"
Show_progress 0. 1 0
Copy_dir PACKAGE:systen SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
Show_progress 0. 1 10
"
Does anyone know if this will flash properly?
Sent from my GT-I9070 using xda app-developers app

[SOLVED] Can't install the 1.1 update.zip - "Installation Aborted"

Okay guys I will come straight to the point... 5 days back I announced that I will release an update for Sami OS.. In fact I was uploading the zip file.. but while uploading the zip I decided to flash the zip and try it out by myself in my phone and IT DID NOT WORK!
This is exactly what CWM says:
Code:
Installing: /sdcard/SOS_UPDATE_1.1.zip
Finding update package...
Opening update package...
Installing update...
Installation aborted.
And this is what TWRP says:
Code:
Installing '/external_sd/SOS_UPDATE_1.1.zip'...
Checking for MD5 file...
I:Cannot find file /external_sd/SOS_UPDATE_1.1.zip.md5
Skipping MD5 check: no MD5 file found.
Error flashing zip '/external_sd/SOS_UPDATE_1.1.zip'
Updating partition details...
As you can see, I tried flashing my zip file in both recoveries.. TWRP says "Failed" in Red color and CWM says "Installation aborted"..
I've attached recovery.log file from both TWRP and CWM.. I've also uploaded the entire zip file (33 MB) and its updater-script... So can anyone please take a look at them and tell me what's wrong and is causing this issue... PS: I've tried all my modified apks and jars separately in my phone and they all worked without any errors...
LINKS:
- http://www.mediafire.com/view/ticvtrx7w81s58a/recovery_TWRP.log
- http://www.mediafire.com/view/ni778ths21indzw/recovery_cwm.log
- http://www.mediafire.com/download/scpk5z4cb1pu52y/updater-script
- http://www.mediafire.com/download/t73a89f92812j35/SOS_UPDATE_1.1.zip
Thanks in advance
META-NF?!
I would add a "I" (I'm gonna try in some seconds, but should be that)
(You wrote a lot in updater-script, many things are not necessary)
Sent from Italy using Tapatalk
Toni5830 said:
META-NF?!
I would add a "I" (I'm gonna try in some seconds, but should be that)
(You wrote a lot in updater-script, many things are not necessary)
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
HOLY SH*T!
LOL I DID NOT NOTICE THAT AT ALL!! Thanks man
Anyways what can I remove from my updater-script to trim or shorten it?
Sami Kabir said:
HOLY SH*T!
LOL I DID NOT NOTICE THAT AT ALL!! Thanks man
Anyways what can I remove from my updater-script to trim or shorten it?
Click to expand...
Click to collapse
LOL .
You don't need to delete every file you are updating as these will be overwritten (here my example https://www.dropbox.com/s/jm6u0istpqxvj5b/updater-script ) I also added a line to delete a lib file, polaris*something*.so (11mb), you won't need it if you delete polaris viewer
I could not test because editing updater-script whit phone caused a different error: status 6, I'm redownloading it, having a shower and then I'll try
(I flashed your rom this afternoon, I see you've worked a lot on it to change graphic and modding apk (wait me, I'll pm you when I'll need to disable animation from toggles ))
Sent from Italy using Tapatalk
iiD4x said:
LOL .
Click to expand...
Click to collapse
I'm a human.. and humans do make mistakes :silly:
Toni5830 said:
You don't need to delete every file you are updating as these will be overwritten (here my example https://www.dropbox.com/s/jm6u0istpqxvj5b/updater-script ) I also added a line to delete a lib file, polaris*something*.so (11mb), you won't need it if you delete polaris viewer
I could not test because editing updater-script whit phone caused a different error: status 6, I'm redownloading it, having a shower and then I'll try
(I flashed your rom this afternoon, I see you've worked a lot on it to change graphic and modding apk (wait me, I'll pm you when I'll need to disable animation from toggles ))
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
Thanks man! I'll look into it asap
Status 6 error
Worked with:
Code:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "umount", "/system");
You just need to add "delete" line
Sent from Italy using Tapatalk
I got some free time to work on my ROM"s zip file.. I solved the problems I had earlier but now new problems came up
Now when I flash my zip file, TWRP says "error executing update-binary".. I've tried replacing it with many other update-binary files BUT none of them work! I took a look at recovery.log file and it says this at the end:
Code:
Installing '/external_sd/SOS_UPDATE_1.1.zip'...
Checking for MD5 file...
I:Cannot find file /external_sd/SOS_UPDATE_1.1.zip.md5
Skipping MD5 check: no MD5 file found.
I:Zip does not contain SELinux file_contexts file in its root.
[B]line 40 col 9: syntax error, unexpected STRING, expecting $end[/B]
1 parse errors
E:Error executing updater binary in zip '/external_sd/SOS_UPDATE_1.1.zip'
Error flashing zip '/external_sd/SOS_UPDATE_1.1.zip'
Updating partition details...
I looked at line 40 in my updater-script and it looks fine to me.. line 40 is this only:
Code:
ui_print(" ");
Now I don't know what to do.. so @Toni5830 and @mr.harsh, can you guys help me solve this problem..
I've attached my new recovery.log file and my updater-script below..
Sami Kabir said:
I got some free time to work on my ROM"s zip file.. I solved the problems I had earlier but now new problems came up
Now when I flash my zip file, TWRP says "error executing update-binary".. I've tried replacing it with many other update-binary files BUT none of them work! I took a look at recovery.log file and it says this at the end:
Code:
Installing '/external_sd/SOS_UPDATE_1.1.zip'...
Checking for MD5 file...
I:Cannot find file /external_sd/SOS_UPDATE_1.1.zip.md5
Skipping MD5 check: no MD5 file found.
I:Zip does not contain SELinux file_contexts file in its root.
[B]line 40 col 9: syntax error, unexpected STRING, expecting $end[/B]
1 parse errors
E:Error executing updater binary in zip '/external_sd/SOS_UPDATE_1.1.zip'
Error flashing zip '/external_sd/SOS_UPDATE_1.1.zip'
Updating partition details...
I looked at line 40 in my updater-script and it looks fine to me.. line 40 is this only:
Code:
ui_print(" ");
Now I don't know what to do.. so @Toni5830 and @mr.harsh, can you guys help me solve this problem..
I've attached my new recovery.log file and my updater-script below..
Click to expand...
Click to collapse
add ";" at the end of 39th line.
mr.harsh said:
add ";" at the end of 39th line.
Click to expand...
Click to collapse
Thanks for your reply mate, but I have already figured it out.. I didn't have the time to reply or edit my first post earlier - sorry for that.. Anyways I think this issue was caused because TWRP starts counting lines from 0 onward whereas Notepad++ starts counting them from 1 onward...
Anyways now I have another problem.. The installation of my ROM now aborts in the middle.. While setting default permission, the installation aborts and this is what I found in recovery.log:
Code:
set_perm: chown of 0644 to 0 0 failed: No such file or directory
set_perm: chmod of 0644 to 755 failed: No such file or directory
script aborted: set_perm: some changes failed
set_perm: some changes failed
E:Error executing updater binary in zip '/external_sd/SOS_UPDATE_1.1.zip'
Error flashing zip '/external_sd/SOS_UPDATE_1.1.zip'
Updating partition details...
I honestly have no idea what the first 4 lines mean.. But as far as I know that update-binary file is totally compatible with SGSA..
Sami Kabir said:
Thanks for your reply mate, but I have already figured it out.. I didn't have the time to reply or edit my first post earlier - sorry for that.. Anyways I think this issue was caused because TWRP starts counting lines from 0 onward whereas Notepad++ starts counting them from 1 onward...
Anyways now I have another problem.. The installation of my ROM now aborts in the middle.. While setting default permission, the installation aborts and this is what I found in recovery.log:
Code:
set_perm: chown of 0644 to 0 0 failed: No such file or directory
set_perm: chmod of 0644 to 755 failed: No such file or directory
script aborted: set_perm: some changes failed
set_perm: some changes failed
E:Error executing updater binary in zip '/external_sd/SOS_UPDATE_1.1.zip'
Error flashing zip '/external_sd/SOS_UPDATE_1.1.zip'
Updating partition details...
I honestly have no idea what the first 4 lines mean.. But as far as I know that update-binary file is totally compatible with SGSA..
Click to expand...
Click to collapse
Probably you are doing chmod on a file or folder that is not in your ROM.
Hmmm, but all are there. Try to remove those chmod parts, and see if installation is ok without it.
Problem should be this line
Code:
set_perm(0, 0, 0755, 0644, "/system/etc/hosts");
I think it should be
Code:
set_perm(0, 0, 0644, "/system/etc/hosts");
(Or, as shut_down said, remove that line if it still gives errors, it's not necessary)
Sent from Italy using Tapatalk
@shut_down and @Toni5830,
As you guys said, I've corrected the Permission problems in my updater-script.. and now the finally zip flashes.. but now my phone won't boot to system.. it just boots to Recovery [TWRP]..
I wonder what went wrong this time... Should I pull a logcat or something? But I don't know if it will work or not because the phone directly boots to Recovery mode after the Samsung splash screen
EDIT: I tried wiping Cache and Dalvik, still no help...
Sami Kabir said:
@shut_down and @Toni5830,
As you guys said, I've corrected the Permission problems in my updater-script.. and now the finally zip flashes.. but now my phone won't boot to system.. it just boots to Recovery [TWRP]..
I wonder what went wrong this time... Should I pull a logcat or something? But I don't know if it will work or not because the phone directly boots to Recovery mode after the Samsung splash screen
EDIT: I tried wiping Cache and Dalvik, still no help...
Click to expand...
Click to collapse
This is what happens when you delete googleserviceframework.apk
Sent from Italy using Tapatalk
Sami Kabir said:
@shut_down and @Toni5830,
As you guys said, I've corrected the Permission problems in my updater-script.. and now the finally zip flashes.. but now my phone won't boot to system.. it just boots to Recovery [TWRP]..
I wonder what went wrong this time... Should I pull a logcat or something? But I don't know if it will work or not because the phone directly boots to Recovery mode after the Samsung splash screen
EDIT: I tried wiping Cache and Dalvik, still no help...
Click to expand...
Click to collapse
Code:
delete("/system/app/SystemUI.apk","/system/app/SecSettings.apk","/system/app/PolarisViewer.apk","/system/app/MtpApplication.apk","/system/app/Disable_service.apk","/system/app/SyncmlDM.apk");
delete("/system/framework/android.policy.jar","/system/framework/core.jar","/system/framework/framework2.jar","/system/framework/framework-res.apk","/system/framework/services.jar","/system/framework/twframework.jar");
delete("/system/etc/hosts","/system/etc/init.d/01_zipalign","/system/etc/init.d/02_sqlite_optimize","/system/etc/init.d/03_tweaks","/system/etc/init.d/06_MramLlag","/system/build.prop");
Remove the delete commands. When you flash the files will be automatically replaced. Only delete the files which are not going to be replaced
And instead of
Code:
package_extract_dir("system/app", "/system/app");
package_extract_dir("system/etc", "/system/etc");
package_extract_dir("system/framework", "/system/framework");
package_extract_dir("system/build.prop", "/system/build.prop");
Code:
package_extract_dir("system", "/system");
this will be enough
and as toni said above change the permission of /system/app and /system/framework and /system/etc to 755.
You can also use fix permission from CWM recovery to set permission right.
Dont use twrp.
anantttt said:
Code:
delete("/system/app/SystemUI.apk","/system/app/SecSettings.apk","/system/app/PolarisViewer.apk","/system/app/MtpApplication.apk","/system/app/Disable_service.apk","/system/app/SyncmlDM.apk");
delete("/system/framework/android.policy.jar","/system/framework/core.jar","/system/framework/framework2.jar","/system/framework/framework-res.apk","/system/framework/services.jar","/system/framework/twframework.jar");
delete("/system/etc/hosts","/system/etc/init.d/01_zipalign","/system/etc/init.d/02_sqlite_optimize","/system/etc/init.d/03_tweaks","/system/etc/init.d/06_MramLlag","/system/build.prop");
Remove the delete commands. When you flash the files will be automatically replaced. Only delete the files which are not going to be replaced
And instead of
Code:
package_extract_dir("system/app", "/system/app");
package_extract_dir("system/etc", "/system/etc");
package_extract_dir("system/framework", "/system/framework");
package_extract_dir("system/build.prop", "/system/build.prop");
Code:
package_extract_dir("system", "/system");
this will be enough
and as toni said above change the permission of /system/app and /system/framework and /system/etc to 644.
You can also use fix permission from CWM recovery to set permission right.
Dont use twrp.
Click to expand...
Click to collapse
Are you sure that those files will be replaced automatically?
And what code do you think I should use to set the permission to 644, should it be this one?
PHP:
set_perm_recursive(0, 0, 0755, 0644, "/system");
Sami Kabir said:
Are you sure that those files will be replaced automatically?
And what code do you think I should use to set the permission to 644, should it be this one?
PHP:
set_perm_recursive(0, 0, 0755, 0644, "/system");
Click to expand...
Click to collapse
Yup,it'll replace/append files.It'll set permission of all sub folders to 755 and all files to 644.But be careful because init.d script requires 777 permission (depends on ramdisk).And it is better to set 777 permission to /system/bin and /system/xbin.And yeah su binary wants 06755 permission else it won't work.
Sami Kabir said:
Are you sure that those files will be replaced automatically?
And what code do you think I should use to set the permission to 644, should it be this one?
PHP:
set_perm_recursive(0, 0, 0755, 0644, "/system");
Click to expand...
Click to collapse
Late to reply. Yes it would replace the files.
Edit: In detail, see the above post.
mr.harsh said:
Yup,it'll replace/append files.It'll set permission of all sub folders to 755 and all files to 644.But be careful because init.d script requires 777 permission (depends on ramdisk).And it is better to set 777 permission to /system/bin and /system/xbin.And yeah su binary wants 06755 permission else it won't work.
Click to expand...
Click to collapse
Um, I was just going through my ROM's original updater-script (the one in SOS 1.0).. in there I used 755 permission in "/system/bin" and in "/system/xbin".. It was like this:
Code:
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
And my ROM worked with no problems.. so should I use that or should I set it as 777 as you said above?
Sami Kabir said:
Um, I was just going through my ROM's original updater-script (the one in SOS 1.0).. in there I used 755 permission in "/system/bin" and in "/system/xbin".. It was like this:
Code:
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
And my ROM worked with no problems.. so should I use that or should I set it as 777 as you said above?
Click to expand...
Click to collapse
@Sami
Buddy if you need any help with testing let me know...
I have been using and doing roms for more than a year....[currently modifying Omni for myself]
Anyways thanks for the rom.....

Categories

Resources