TWRP error :6 - Android Q&A, Help & Troubleshooting

Hello xda
So today i just wanted to make a flashable update zip
And now, when i flash the zip in twrp, i'm getting:
Updater process ended with ERROR: 6
My update-script looks like this:
HTML Code:
(!less_than_int(1492929452, getprop("ro.build.date.utc"))) || abort("E3003: Can't install this package (Sun Apr 23 06:37:32 UTC 2017) over newer build (" + getprop("ro.build.date") + ").");
this device is " + getprop("ro.product.device") + ".");
ui_print("Target: xiaomi/mido/mido:7.0/NRD90M/7.2.9:user/release-keys");
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/userdata", "/data", "");
package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
show_progress(0.200000, 10);
set_progress(1.000000);
Click to expand...
Click to collapse
The only thing what i wanna do is that the /system gets mounted, then, the system should install, and then, /system should be unmounted.
Can someone help me? I have a Redmi Note 4X and TWRP 3.1.0.0. Thanks.

Related

[Q] RTL script fix

i have a problem with RTL script under CWM.
if some can help me to fix the script for CWM it will be great.
here is the script for stock recovery:
assert(getprop("ro.product.device") == "GT-S5830" ||
getprop("ro.build.product") == "GT-S5830" ||
getprop("ro.product.device") == "GT-S5570" ||
getprop("ro.build.product") == "GT-S5570" ||
getprop("ro.product.device") == "GT-S5670" ||
getprop("ro.product.product") == "GT-S5670"||
getprop("ro.product.device") == "GT-B7510" ||
getprop("ro.product.product") == "GT-B7510"
);
show_progress(0.100000, 0);
show_progress(0.500000, 0);
# format("MTD", "system");
#mount("MTD", "system", "/system");
ui_print(" - deleting old system files...");
delete_recursive("/system/app");
delete_recursive("/system/fonts");
delete_recursive("/system/framework");
delete_recursive("/system/lib");
delete_recursive("/system/xbin");
ui_print(" - unpacking system files...");
package_extract_dir("system", "/system");
ui_print(" - settin files permissions...");
set_perm(0, 0, 04755, "/system/xbin/sqlite3");
set_perm(0, 0, 04755, "/system/xbin/su-v1");
set_perm(0, 0, 04755, "/system/xbin/su-v2");
set_perm(0, 0, 04755, "/system/xbin/su-v3");
set_perm(0, 0, 04755, "/system/xbin/su");
set_perm(0, 0, 04755, "/system/xbin/sh");
set_perm(0, 0, 04755, "/system/xbin/busybox");
ui_print("Install complete, reboot...");
#unmount("/system");
izador said:
i have a problem with RTL script under CWM.
if some can help me to fix the script for CWM it will be great.
here is the script for stock recovery:
Code:
assert(getprop("ro.product.device") == "GT-S5830" ||
getprop("ro.build.product") == "GT-S5830" ||
getprop("ro.product.device") == "GT-S5570" ||
getprop("ro.build.product") == "GT-S5570" ||
getprop("ro.product.device") == "GT-S5670" ||
getprop("ro.product.product") == "GT-S5670"||
getprop("ro.product.device") == "GT-B7510" ||
getprop("ro.product.product") == "GT-B7510"
);
show_progress(0.100000, 0);
show_progress(0.500000, 0);
# format("MTD", "system");
#mount("MTD", "system", "/system");
ui_print(" - deleting old system files...");
delete_recursive("/system/app");
delete_recursive("/system/fonts");
delete_recursive("/system/framework");
delete_recursive("/system/lib");
delete_recursive("/system/xbin");
ui_print(" - unpacking system files...");
package_extract_dir("system", "/system");
ui_print(" - settin files permissions...");
set_perm(0, 0, 04755, "/system/xbin/sqlite3");
set_perm(0, 0, 04755, "/system/xbin/su-v1");
set_perm(0, 0, 04755, "/system/xbin/su-v2");
set_perm(0, 0, 04755, "/system/xbin/su-v3");
set_perm(0, 0, 04755, "/system/xbin/su");
set_perm(0, 0, 04755, "/system/xbin/sh");
set_perm(0, 0, 04755, "/system/xbin/busybox");
ui_print("Install complete, reboot...");
#unmount("/system");
Click to expand...
Click to collapse
Look here. You need to add into your script commands to mount and umount system, so replace
Code:
#mount("MTD", "system", "/system");
with
Code:
run_program("/sbin/busybox", "mount", "/system");
and
Code:
#unmount("/system");
with
Code:
run_program("/sbin/busybox", "umount", "/system");
and it should work (not tested).
PabloPL said:
Look here. You need to add into your script commands to mount and umount system, so replace
Code:
#mount("MTD", "system", "/system");
with
Code:
run_program("/sbin/busybox", "mount", "/system");
and
Code:
#unmount("/system");
with
Code:
run_program("/sbin/busybox", "umount", "/system");
and it should work (not tested).
Click to expand...
Click to collapse
still dont work, any ideas ?
OK, found the prob now its work.
thanks.
izador said:
still dont work, any ideas ?
OK, found the prob now its work.
thanks.
Click to expand...
Click to collapse
If you found the problem, please tell what the problem was so other people can learn from that
ui_print("RTL-FIX");
show_progress(0.100000, 0);
show_progress(0.500000, 0);
# format("MTD", "system");
run_program("/sbin/busybox", "mount", "/system");
ui_print(" - deleting old system files...");
delete_recursive("/system/app");
delete_recursive("/system/fonts");
delete_recursive("/system/framework");
delete_recursive("/system/lib");
delete_recursive("/system/xbin");
ui_print(" - unpacking system files...");
package_extract_dir("system", "/system");
ui_print(" - settin files permissions...");
set_perm(0, 0, 04755, "/system/xbin/sqlite3");
set_perm(0, 0, 04755, "/system/xbin/su-v1");
set_perm(0, 0, 04755, "/system/xbin/su-v2");
set_perm(0, 0, 04755, "/system/xbin/su-v3");
set_perm(0, 0, 04755, "/system/xbin/su");
set_perm(0, 0, 04755, "/system/xbin/sh");
set_perm(0, 0, 04755, "/system/xbin/busybox");
ui_print("Install complete, reboot...");
run_program("/sbin/busybox", "umount", "/system");
every one can change the folders that he need to update.
red color is for root permissions
blue color r for the folders that u want to replace

Porting rom updater script help

So, i was looking for cyanogenmod 12.1 for mt6582 and i saw this CM 12.1 for sprout 8
my device is an oem with a specs of:
mt6582
8gb internal
1gb ram
I changed the updater script like this:
assert(getprop("ro.product.device") == "sprout" || getprop("ro.build.product") == "sprout" || getprop("ro.product.device") == "Flare S3" || getprop("ro.build.product") == "sprout8" || abort("This package is for device: sprout,sprout8; this device is " + getprop("ro.product.device") + ".");
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
show_progress(.3, 0);
ui_print(" - Mounting /system...");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
show_progress(.3, 0);
ui_print(" - Mounting /data...");
mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/data");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/mmcblk0p5", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
show_progress(0.020000, 10);
show_progress(.3, 0);
ui_print(" - Mounting /system...");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/mmcblk0p5");
show_progress(0.200000, 10);
Click to expand...
Click to collapse
I'm having blkdiscard error. Im using TWRP. Any help?
Bump, anyone?

hello I want some help with modifying rom cm 13

I have researched how to modify rom cm 13 to be installed on any device
And having applied all the instructions meticulously :fingers-crossed:
What I still have an error in the installation of recovery
I suspect that the error in updater-script file
This is the file that you've modified it
Code:
assert(getprop("ro.product.device") == "j1pop3g" || getprop("ro.build.product") == "j1pop3g" || abort("This package is for device: j1pop3g; this device is " + getprop("ro.product.device") + "."););
ui_print("Target: samsung/j1pop3gjv/j1pop3g:4.4.4/KTU84P/J110HXXU0APD3:user/release-keys");
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("f2fs", "EMMC", "/dev/block/mmcblk0p26", "/data", "");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/mmcblk0p24", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/mmcblk0p24", "34,0,32770,32841,32843,33310,65535,65536,65538,98304,98306,98377,98379,98846,131071,131072,131074,163840,163842,163913,163915,164382,196607,196608,196610,229376,229378,229449,229451,229918,242027,262144,262146,262613,268543") == "78bc7cc69b723be97505fae5a10f33da9e2d457f" then
if range_sha1("/dev/block/mmcblk0p24", "42,32770,32841,32843,33310,65535,65536,65538,66050,97792,98304,98306,98377,98379,98846,131071,131072,131074,131586,163328,163840,163842,163913,163915,164382,196607,196608,196610,197122,228864,229376,229378,229449,229451,229918,242027,242539,261632,262144,262146,262613,268543,268544") == "8a123b7047923c07b2557d9e700ace3006757cca" then
ui_print("Verified the updated system image.");
else
abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
abort("system partition has unexpected contents after OTA update");
endif;
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/mmcblk0p2");
show_progress(0.200000, 10);
Note:
I modified it to a phone
samsung j1 j110h
:silly::silly::silly::silly::silly:
Try ro compile pac rom for the device from
https://forum.xda-developers.com/showthread.php?t=2662325&page=36
Goode luck??

set_perm give me ERROR 6

I'm running a zip flashable file in twrp in my Galaxy 8s, for some reason the set_perm line give me ERROR6, what's worng?
Code:
if is_mounted("/system") then
unmount("/system");
endif;
mount("ext4", "EMMC", "/dev/block/platform/11120000.ufs/by-name/SYSTEM", "/system", "");
package_extract_dir("script", "/system");
[B]set_perm(0, 0, 0000, "/system/app/Chrome/Chrome.apk");[/B]
unmount("/system");
show_progress(0.050000, 5);
ui_print("Success!");
anyone

cm11 updater script otasigcheck checks release key

Hi I am porting cm11 rom for my spare device. The updater-script will perform "otasigcheck" after mounting /data partition. Here is what it says:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_file("system/bin/otasigcheck.sh", "/tmp/otasigcheck.sh");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
set_metadata("/tmp/otasigcheck.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/otasigcheck.sh");
sha1_check(read_file("/tmp/releasekey"),"7241e92725436afc79389d4fc2333a2aa8c20230") && abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
Can anyone tell what is the use of the "otasigcheck" codes? How to determine whether the device has incompatible data? Thanks!

Categories

Resources