[TUTORIAL] Create Flashable Zip From CWM/TWRP Backup (MTK)

Search This thread

5weet5

Senior Member
Oct 18, 2014
51
4
47
Edmonton
Google Pixel 8 Pro
Awesome I will be eager to check your progress it the only reason I haven't discarded my clone it looks exactly like lark phanlet 6.0 but I got it off amszon from lightahead I got recovery on it backed it up and it bricked upon reboot. I managed to port a workin miui rom but it kept rebooting so I went to flash backup now I'm stuck In preloader mode, but alas all is not lost you shall be the savior of my device...lol good lock and great work your doing here thank you
 

HypoTurtle

Senior Member
May 5, 2011
1,970
1,257
I'm trying to do one for my nexus 6 and I followed every step in this guide to the t.

Windows 8 computer
7zip
Also tried winrar
I don't know how to upload the meta here on the app
Sent from my Nexus 6 using XDA Free mobile app

---------- Post added at 05:22 AM ---------- Previous post was at 05:01 AM ----------



http://www.mediafire.com/download/cwnzs8sgnb82w12/META-INF.zip

This updater-script looks completely wrong for this, what you need is the basic:
write_raw_image boot.img, mount /system, package_extract_dir("system", "/system") and set_metadata(*) stuff.
 

Slipknot8Wwe

Senior Member
Sep 28, 2015
962
633
35
Moto G Power (2021)
Awesome I will be eager to check your progress it the only reason I haven't discarded my clone it looks exactly like lark phanlet 6.0 but I got it off amszon from lightahead I got recovery on it backed it up and it bricked upon reboot. I managed to port a workin miui rom but it kept rebooting so I went to flash backup now I'm stuck In preloader mode, but alas all is not lost you shall be the savior of my device...lol good lock and great work your doing here thank you
Why not just flash a backup? Or a new ROM?

Sent from my Nexus 6 using Tapatalk

---------- Post added at 04:35 PM ---------- Previous post was at 04:35 PM ----------

This updater-script looks completely wrong for this, what you need is the basic:
write_raw_image boot.img, mount /system, package_extract_dir("system", "/system") and set_metadata(*) stuff.
Unfortunetly I am fairly new at this and am trying to learn it. I can't figure out how to get a good working meta-inf file

Sent from my Nexus 6 using Tapatalk
 

HypoTurtle

Senior Member
May 5, 2011
1,970
1,257
Why not just flash a backup? Or a new ROM?

Sent from my Nexus 6 using Tapatalk

---------- Post added at 04:35 PM ---------- Previous post was at 04:35 PM ----------


Unfortunetly I am fairly new at this and am trying to learn it. I can't figure out how to get a good working meta-inf file

Sent from my Nexus 6 using Tapatalk
From #1 the meta-inf needs to be from a custom rom -- or to be exact you need a updater-binary that you know works for your device and a updater-script that does the rom installing; I'm sure someone can send you a proper updater-script to use...
 

HypoTurtle

Senior Member
May 5, 2011
1,970
1,257
I've actually tried a couple only to know avail

Sent from my Nexus 6 using Tapatalk

Can you attach a few to a post; just rename updater-script to updater-script.txt and attach; what you should be looking for is simply something like:
Code:
format("ext4", "EMMC", "/dev/block/platform/***/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/***/by-name/system", "/system");
package_extract_dir("system", "/system");
set_metadata(***);
******
******
assert(package_extract_file("boot.img", "/tmp/boot.img"),
       write_raw_image("/tmp/boot.img", "bootimg"),
       delete("/tmp/boot.img"));
 

Slipknot8Wwe

Senior Member
Sep 28, 2015
962
633
35
Moto G Power (2021)
Can you attach a few to a post; just rename updater-script to updater-script.txt and attach; what you should be looking for is simply something like:
Code:
format("ext4", "EMMC", "/dev/block/platform/***/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/***/by-name/system", "/system");
package_extract_dir("system", "/system");
set_metadata(***);
assert(package_extract_file("boot.img", "/tmp/boot.img"),
       write_raw_image("/tmp/boot.img", "bootimg"),
       delete("/tmp/boot.img"));
Yes I can do that for you. I really appreciate the help. As soon as I get home I'll do that.

Sent from my Nexus 6 using Tapatalk
 

Slipknot8Wwe

Senior Member
Sep 28, 2015
962
633
35
Moto G Power (2021)
Can you attach a few to a post; just rename updater-script to updater-script.txt and attach; what you should be looking for is simply something like:
Code:
format("ext4", "EMMC", "/dev/block/platform/***/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/***/by-name/system", "/system");
package_extract_dir("system", "/system");
set_metadata(***);
******
******
assert(package_extract_file("boot.img", "/tmp/boot.img"),
       write_raw_image("/tmp/boot.img", "bootimg"),
       delete("/tmp/boot.img"));
Here they are. You can also hangouts me if its easier joshhadlnewbeginning@gmail.com

http://www.mediafire.com/view/pk02s348n5bdfjo/updater-script.txt


http://www.mediafire.com/view/7vo7t4tb6nvvwr7/updater-script(2).txt

These are ones that I just extracted from other ROMs as I don't know how to make them yet. I am very willing to learn though. I have a windows computer and I just installed Linux on one of my other computers as well.


Sent from my Nexus 6 using Tapatalk
 

HypoTurtle

Senior Member
May 5, 2011
1,970
1,257
Here they are. You can also hangouts me if its easier joshhadlnewbeginning@gmail.com

http://www.mediafire.com/view/pk02s348n5bdfjo/updater-script.txt


http://www.mediafire.com/view/7vo7t4tb6nvvwr7/updater-script(2).txt

These are ones that I just extracted from other ROMs as I don't know how to make them yet. I am very willing to learn though. I have a windows computer and I just installed Linux on one of my other computers as well.


Sent from my Nexus 6 using Tapatalk
Yea those both look like there from ota.zip and not a full custom rom.zip: here's a full copy of a updater-script from a custom rom for my device (a 64bit MTK device).
Code:
show_progress(1, 60);
ui_print("   Formating system");
format("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/by-name/system", "/system");
run_program("/sbin/mount", "-t", "auto", "/data");
ui_print("   Installing system");
ui_print("   Just a moment, please....");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("   Creating symlinks");
symlink("/system/lib/libbluetooth_jni.so", "/system/app/Bluetooth/lib/arm/libbluetooth_jni.so");
symlink("/system/lib/liba3m.so", "/system/app/Gallery2/lib/arm/liba3m.so");
symlink("/system/lib/libja3m.so", "/system/app/Gallery2/lib/arm/libja3m.so");
symlink("/system/lib64/libjni_latinime.so", "/system/app/LatinIME/lib/arm64/libjni_latinime.so");
symlink("/system/lib64/libjni_pacprocessor.so", "/system/app/PacProcessor/lib/arm64/libjni_pacprocessor.so");
symlink("/system/lib64/libttscompat.so", "/system/app/PicoTts/lib/arm64/libttscompat.so");
symlink("/system/lib64/libttspico.so", "/system/app/PicoTts/lib/arm64/libttspico.so");
symlink("/system/lib64/libprintspooler_jni.so", "/system/app/PrintSpooler/lib/arm64/libprintspooler_jni.so");
symlink("/system/lib/libvoicerecognition_jni.so", "/system/app/VoiceCommand/lib/arm/libvoicerecognition_jni.so");
symlink("/system/lib/libvie_jni.so", "/system/app/VoiceExtension/lib/arm/libvie_jni.so");
symlink("/system/lib/libwebviewchromium.so", "/system/app/webview/lib/arm/libwebviewchromium.so");
symlink("/system/lib64/libwebviewchromium.so", "/system/app/webview/lib/arm64/libwebviewchromium.so");
symlink("/system/lib64/libdefcontainer_jni.so", "/system/priv-app/DefaultContainerService/lib/arm64/libdefcontainer_jni.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/FmRadio/lib/arm64/libfmjni.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/MMITestCn/lib/arm64/libfmjni.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/uniLauncher/lib/arm/libcoo.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/uniLauncher/lib/arm/libcoogl20.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/uniLauncher/lib/arm/libcut.so");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("app_process64", "/system/bin/app_process");
symlink("dalvikvm64", "/system/bin/dalvikvm");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so",
        "/system/lib64/libGLESv3.so");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon", "/system/bin/chmod", "/system/bin/chown",
		"/system/bin/clear", "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
		"/system/bin/dd", "/system/bin/df", "/system/bin/dmesg", "/system/bin/du",
		"/system/bin/getenforce", "/system/bin/getevent", "/system/bin/getprop", "/system/bin/getsebool",
		"/system/bin/grep", "/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
		"/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
		"/system/bin/kill", "/system/bin/ln", "/system/bin/load_policy", "/system/bin/log",
		"/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
		"/system/bin/mkdir", "/system/bin/mknod", "/system/bin/mkswap", "/system/bin/mount", "/system/bin/mv",
		"/system/bin/nandread", "/system/bin/netstat", "/system/bin/newfs_msdos", "/system/bin/nohup", "/system/bin/notify",
		"/system/bin/printenv", "/system/bin/ps", "/system/bin/readlink", "/system/bin/renice",
		"/system/bin/restorecon", "/system/bin/rm", "/system/bin/rmdir", "/system/bin/rmmod",
		"/system/bin/route", "/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
		"/system/bin/setconsole", "/system/bin/setenforce", "/system/bin/setprop", "/system/bin/setsebool",
		"/system/bin/sleep", "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
		"/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync", "/system/bin/top",
		"/system/bin/touch", "/system/bin/umount", "/system/bin/uptime", "/system/bin/vmstat",
		"/system/bin/watchprops", "/system/bin/wipe");
ui_print("   Setting permissions");
set_metadata_recursive("/system", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/6620_launcher", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtk_6620_launcher_exec:s0");
set_metadata("/system/bin/aal", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:aal:s0");
set_metadata("/system/bin/aee_core_forwarder", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:aee_core_forwarder_exec:s0");
set_metadata("/system/bin/afm_server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:afm_server_exec:s0");
set_metadata("/system/bin/akmd09911", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:akmd09911_exec:s0");
set_metadata("/system/bin/akmd8963", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:akmd8963_exec:s0");
set_metadata("/system/bin/akmd8975", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:akmd8975_exec:s0");
set_metadata("/system/bin/ami304d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ami304d_exec:s0");
set_metadata("/system/bin/app_process32", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/app_process64", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/atci_service", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:atci_service_exec:s0");
set_metadata("/system/bin/atcid", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:atcid_exec:s0");
set_metadata("/system/bin/audiocmdservice_atci", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:audiocmdservice_atci_exec:s0");
set_metadata("/system/bin/autokd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:autokd_exec:s0");
set_metadata("/system/bin/batterywarning", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:batterywarning_exec:s0");
set_metadata("/system/bin/bmm050d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:bmm050d_exec:s0");
set_metadata("/system/bin/boot_logo_updater", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:boot_logo_updater_exec:s0");
set_metadata("/system/bin/bootanimation", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:bootanim_exec:s0");
set_metadata("/system/bin/ccci_fsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ccci_fsd_exec:s0");
set_metadata("/system/bin/ccci_mdinit", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ccci_mdinit_exec:s0");
set_metadata("/system/bin/clatd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:clatd_exec:s0");
set_metadata("/system/bin/debuggerd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/bin/debuggerd64", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/bin/dhcp6c", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dhcp6c_exec:s0");
set_metadata("/system/bin/dhcpcd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dhcp_exec:s0");
set_metadata("/system/bin/dmlog", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dmlog_exec:s0");
set_metadata("/system/bin/dnsmasq", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dnsmasq_exec:s0");
set_metadata("/system/bin/drmserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:drmserver_exec:s0");
set_metadata("/system/bin/dualmdlogger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dualmdlogger_exec:s0");
set_metadata("/system/bin/dumpstate", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dumpstate_exec:s0");
set_metadata("/system/bin/em_svr", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:em_svr_exec:s0");
set_metadata("/system/bin/emdlogger1", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:emdlogger_exec:s0");
set_metadata("/system/bin/factory", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:factory_exec:s0");
set_metadata("/system/bin/geomagneticd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:geomagneticd_exec:s0");
set_metadata("/system/bin/gsm0710muxd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gsm0710muxd_exec:s0");
set_metadata("/system/bin/gsm0710muxdmd2", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gsm0710muxdmd2_exec:s0");
set_metadata("/system/bin/guiext-server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:guiext-server_exec:s0");
set_metadata("/system/bin/hostapd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:hostapd_exec:s0");
set_metadata("/system/bin/installd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:installd_exec:s0");
set_metadata("/system/bin/ipod", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ipod_exec:s0");
set_metadata("/system/bin/keystore", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:keystore_exec:s0");
set_metadata("/system/bin/lmkd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:lmkd_exec:s0");
set_metadata("/system/bin/logd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:logd_exec:s0");
set_metadata("/system/bin/matv", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:matv_exec:s0");
set_metadata("/system/bin/mc6420d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mc6420d_exec:s0");
set_metadata("/system/bin/md_ctrl", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:md_ctrl_exec:s0");
set_metadata("/system/bin/mdlogger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdlogger_exec:s0");
set_metadata("/system/bin/mdnsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdnsd_exec:s0");
set_metadata("/system/bin/mediaserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mediaserver_exec:s0");
set_metadata("/system/bin/memsicd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:memsicd_exec:s0");
set_metadata("/system/bin/memsicd3416x", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:memsicd3416x_exec:s0");
set_metadata("/system/bin/meta_tst", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:meta_tst_exec:s0");
set_metadata("/system/bin/mmp", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mmp_exec:s0");
set_metadata("/system/bin/mobile_log_d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mobile_log_d_exec:s0");
set_metadata("/system/bin/msensord", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:msensord_exec:s0");
set_metadata("/system/bin/mtk_agpsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtk_agpsd_exec:s0");
set_metadata("/system/bin/mtkbt", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtkbt_exec:s0");
set_metadata("/system/bin/MtkCodecService", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:MtkCodecService_exec:s0");
set_metadata("/system/bin/mtkrild", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtkrild_exec:s0");
set_metadata("/system/bin/mtkrildmd2", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtkrildmd2_exec:s0");
set_metadata("/system/bin/mtpd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtp_exec:s0");
set_metadata("/system/bin/muxreport", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:muxreport_exec:s0");
set_metadata("/system/bin/nac_server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:nac_server_exec:s0");
set_metadata("/system/bin/netd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netd_exec:s0");
set_metadata("/system/bin/netdiag", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netdiag_exec:s0");
set_metadata("/system/bin/netcfg", "uid", 0, "gid", 3003, "mode", 02750, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/nvram_agent_binder", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:nvram_agent_binder_exec:s0");
set_metadata("/system/bin/nvram_daemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:nvram_daemon_exec:s0");
set_metadata("/system/bin/orientationd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:orientationd_exec:s0");
set_metadata("/system/bin/permission_check", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:permission_check_exec:s0");
set_metadata("/system/bin/ppl_agent", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ppl_agent_exec:s0");
set_metadata("/system/bin/pppd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ppp_exec:s0");
set_metadata("/system/bin/pppd_dt", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:pppd_dt_exec:s0");
set_metadata("/system/bin/pq", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:pq_exec:s0");
set_metadata("/system/bin/racoon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:racoon_exec:s0");
set_metadata("/system/bin/run-as", "uid", 0, "gid", 2000, "mode", 0750, "capabilities", 0xc0, "selabel", "u:object_r:runas_exec:s0");
set_metadata("/system/bin/s62xd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:s62xd_exec:s0");
set_metadata("/system/bin/sdcard", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sdcardd_exec:s0");
set_metadata("/system/bin/servicemanager", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:servicemanager_exec:s0");
set_metadata("/system/bin/sn", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sn_exec:s0");
set_metadata("/system/bin/surfaceflinger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:surfaceflinger_exec:s0");
set_metadata("/system/bin/terservice", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:terservice_exec:s0");
set_metadata("/system/bin/tertestclient", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tertestclient_exec:s0");
set_metadata("/system/bin/testmode", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:testmode_exec:s0");
set_metadata("/system/bin/thermal", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermal_exec:s0");
set_metadata("/system/bin/thermal_manager", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermal_manager_exec:s0");
set_metadata("/system/bin/thermald", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermald_exec:s0");
set_metadata("/system/bin/tiny_mkswap", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tiny_mkswap_exec:s0");
set_metadata("/system/bin/tiny_swapon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tiny_swapon_exec:s0");
set_metadata("/system/bin/uncrypt", "uid", 0, "gid", 0, "mode", 0750, "capabilities", 0x0, "selabel", "u:object_r:uncrypt_exec:s0");
set_metadata("/system/bin/vdc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vdc_exec:s0");
set_metadata("/system/bin/vold", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vold_exec:s0");
set_metadata("/system/bin/wifi2agps", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wifi2agps_exec:s0");
set_metadata("/system/bin/wmt_loader", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wmt_loader_exec:s0");
set_metadata("/system/bin/wpa_supplicant", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wpa_exec:s0");
set_metadata("/system/bin/xlog", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:xlog_exec:s0");
set_metadata("/system/etc/dhcpcd/dhcpcd-run-hooks", "uid", 1014, "gid", 2000, "mode", 0550, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/ppp", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0555, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/wide-dhcpv6/dhcp6c.script", "uid", 1014, "gid", 2000, "mode", 0550, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/drm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/drm/libdrmwvmplugin.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/hw", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/mediadrm", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib64", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib64/mediadrm", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib64/mediadrm", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/operator", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/xbin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/BGW", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:BGW_exec:s0");
set_metadata("/system/xbin/librank", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/mnld", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mnld_exec:s0");
set_metadata("/system/xbin/procmem", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/procrank", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 04750, "capabilities", 0x0, "selabel", "u:object_r:su_exec:s0");
set_metadata("/system/xbin/tcpdump", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
show_progress(0.1, 0);
ui_print("   Flash kernel");
assert(package_extract_file("boot.img", "/tmp/boot.img"),
       write_raw_image("/tmp/boot.img", "bootimg"),
       delete("/tmp/boot.img"));
assert(run_program("/system/bin/dd", "if=/dev/zero", "of=/proc/driver/mtd_writeable", "bs=3", "count=1"));
ui_print(" ==> Unmounting /data");
ui_print(" ==> Unmounting /system");
unmount("/data");
unmount("/system");
ui_print("Successfully Please restart your phone manually!")
Most of it is fairly self explanitory - the boot.img bit is essentially the same as in the uodater-scripts you posted, and the rest is copying the system files and 'fixing' them; i.e. creating symlinks and fixing the permissions (set_metadata).
 

Slipknot8Wwe

Senior Member
Sep 28, 2015
962
633
35
Moto G Power (2021)
Yea those both look like there from ota.zip and not a full custom rom.zip: here's a full copy of a updater-script from a custom rom for my device (a 64bit MTK device).
Code:
show_progress(1, 60);
ui_print("   Formating system");
format("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/by-name/system", "/system");
run_program("/sbin/mount", "-t", "auto", "/data");
ui_print("   Installing system");
ui_print("   Just a moment, please....");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("   Creating symlinks");
symlink("/system/lib/libbluetooth_jni.so", "/system/app/Bluetooth/lib/arm/libbluetooth_jni.so");
symlink("/system/lib/liba3m.so", "/system/app/Gallery2/lib/arm/liba3m.so");
symlink("/system/lib/libja3m.so", "/system/app/Gallery2/lib/arm/libja3m.so");
symlink("/system/lib64/libjni_latinime.so", "/system/app/LatinIME/lib/arm64/libjni_latinime.so");
symlink("/system/lib64/libjni_pacprocessor.so", "/system/app/PacProcessor/lib/arm64/libjni_pacprocessor.so");
symlink("/system/lib64/libttscompat.so", "/system/app/PicoTts/lib/arm64/libttscompat.so");
symlink("/system/lib64/libttspico.so", "/system/app/PicoTts/lib/arm64/libttspico.so");
symlink("/system/lib64/libprintspooler_jni.so", "/system/app/PrintSpooler/lib/arm64/libprintspooler_jni.so");
symlink("/system/lib/libvoicerecognition_jni.so", "/system/app/VoiceCommand/lib/arm/libvoicerecognition_jni.so");
symlink("/system/lib/libvie_jni.so", "/system/app/VoiceExtension/lib/arm/libvie_jni.so");
symlink("/system/lib/libwebviewchromium.so", "/system/app/webview/lib/arm/libwebviewchromium.so");
symlink("/system/lib64/libwebviewchromium.so", "/system/app/webview/lib/arm64/libwebviewchromium.so");
symlink("/system/lib64/libdefcontainer_jni.so", "/system/priv-app/DefaultContainerService/lib/arm64/libdefcontainer_jni.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/FmRadio/lib/arm64/libfmjni.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/MMITestCn/lib/arm64/libfmjni.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/uniLauncher/lib/arm/libcoo.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/uniLauncher/lib/arm/libcoogl20.so");
symlink("/system/lib64/libfmjni.so", "/system/priv-app/uniLauncher/lib/arm/libcut.so");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("app_process64", "/system/bin/app_process");
symlink("dalvikvm64", "/system/bin/dalvikvm");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so",
        "/system/lib64/libGLESv3.so");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon", "/system/bin/chmod", "/system/bin/chown",
"/system/bin/clear", "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
"/system/bin/dd", "/system/bin/df", "/system/bin/dmesg", "/system/bin/du",
"/system/bin/getenforce", "/system/bin/getevent", "/system/bin/getprop", "/system/bin/getsebool",
"/system/bin/grep", "/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
"/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
"/system/bin/kill", "/system/bin/ln", "/system/bin/load_policy", "/system/bin/log",
"/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
"/system/bin/mkdir", "/system/bin/mknod", "/system/bin/mkswap", "/system/bin/mount", "/system/bin/mv",
"/system/bin/nandread", "/system/bin/netstat", "/system/bin/newfs_msdos", "/system/bin/nohup", "/system/bin/notify",
"/system/bin/printenv", "/system/bin/ps", "/system/bin/readlink", "/system/bin/renice",
"/system/bin/restorecon", "/system/bin/rm", "/system/bin/rmdir", "/system/bin/rmmod",
"/system/bin/route", "/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
"/system/bin/setconsole", "/system/bin/setenforce", "/system/bin/setprop", "/system/bin/setsebool",
"/system/bin/sleep", "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
"/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync", "/system/bin/top",
"/system/bin/touch", "/system/bin/umount", "/system/bin/uptime", "/system/bin/vmstat",
"/system/bin/watchprops", "/system/bin/wipe");
ui_print("   Setting permissions");
set_metadata_recursive("/system", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/6620_launcher", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtk_6620_launcher_exec:s0");
set_metadata("/system/bin/aal", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:aal:s0");
set_metadata("/system/bin/aee_core_forwarder", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:aee_core_forwarder_exec:s0");
set_metadata("/system/bin/afm_server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:afm_server_exec:s0");
set_metadata("/system/bin/akmd09911", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:akmd09911_exec:s0");
set_metadata("/system/bin/akmd8963", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:akmd8963_exec:s0");
set_metadata("/system/bin/akmd8975", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:akmd8975_exec:s0");
set_metadata("/system/bin/ami304d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ami304d_exec:s0");
set_metadata("/system/bin/app_process32", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/app_process64", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/atci_service", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:atci_service_exec:s0");
set_metadata("/system/bin/atcid", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:atcid_exec:s0");
set_metadata("/system/bin/audiocmdservice_atci", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:audiocmdservice_atci_exec:s0");
set_metadata("/system/bin/autokd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:autokd_exec:s0");
set_metadata("/system/bin/batterywarning", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:batterywarning_exec:s0");
set_metadata("/system/bin/bmm050d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:bmm050d_exec:s0");
set_metadata("/system/bin/boot_logo_updater", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:boot_logo_updater_exec:s0");
set_metadata("/system/bin/bootanimation", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:bootanim_exec:s0");
set_metadata("/system/bin/ccci_fsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ccci_fsd_exec:s0");
set_metadata("/system/bin/ccci_mdinit", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ccci_mdinit_exec:s0");
set_metadata("/system/bin/clatd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:clatd_exec:s0");
set_metadata("/system/bin/debuggerd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/bin/debuggerd64", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/bin/dhcp6c", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dhcp6c_exec:s0");
set_metadata("/system/bin/dhcpcd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dhcp_exec:s0");
set_metadata("/system/bin/dmlog", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dmlog_exec:s0");
set_metadata("/system/bin/dnsmasq", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dnsmasq_exec:s0");
set_metadata("/system/bin/drmserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:drmserver_exec:s0");
set_metadata("/system/bin/dualmdlogger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dualmdlogger_exec:s0");
set_metadata("/system/bin/dumpstate", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dumpstate_exec:s0");
set_metadata("/system/bin/em_svr", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:em_svr_exec:s0");
set_metadata("/system/bin/emdlogger1", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:emdlogger_exec:s0");
set_metadata("/system/bin/factory", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:factory_exec:s0");
set_metadata("/system/bin/geomagneticd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:geomagneticd_exec:s0");
set_metadata("/system/bin/gsm0710muxd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gsm0710muxd_exec:s0");
set_metadata("/system/bin/gsm0710muxdmd2", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gsm0710muxdmd2_exec:s0");
set_metadata("/system/bin/guiext-server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:guiext-server_exec:s0");
set_metadata("/system/bin/hostapd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:hostapd_exec:s0");
set_metadata("/system/bin/installd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:installd_exec:s0");
set_metadata("/system/bin/ipod", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ipod_exec:s0");
set_metadata("/system/bin/keystore", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:keystore_exec:s0");
set_metadata("/system/bin/lmkd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:lmkd_exec:s0");
set_metadata("/system/bin/logd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:logd_exec:s0");
set_metadata("/system/bin/matv", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:matv_exec:s0");
set_metadata("/system/bin/mc6420d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mc6420d_exec:s0");
set_metadata("/system/bin/md_ctrl", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:md_ctrl_exec:s0");
set_metadata("/system/bin/mdlogger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdlogger_exec:s0");
set_metadata("/system/bin/mdnsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdnsd_exec:s0");
set_metadata("/system/bin/mediaserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mediaserver_exec:s0");
set_metadata("/system/bin/memsicd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:memsicd_exec:s0");
set_metadata("/system/bin/memsicd3416x", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:memsicd3416x_exec:s0");
set_metadata("/system/bin/meta_tst", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:meta_tst_exec:s0");
set_metadata("/system/bin/mmp", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mmp_exec:s0");
set_metadata("/system/bin/mobile_log_d", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mobile_log_d_exec:s0");
set_metadata("/system/bin/msensord", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:msensord_exec:s0");
set_metadata("/system/bin/mtk_agpsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtk_agpsd_exec:s0");
set_metadata("/system/bin/mtkbt", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtkbt_exec:s0");
set_metadata("/system/bin/MtkCodecService", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:MtkCodecService_exec:s0");
set_metadata("/system/bin/mtkrild", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtkrild_exec:s0");
set_metadata("/system/bin/mtkrildmd2", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtkrildmd2_exec:s0");
set_metadata("/system/bin/mtpd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtp_exec:s0");
set_metadata("/system/bin/muxreport", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:muxreport_exec:s0");
set_metadata("/system/bin/nac_server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:nac_server_exec:s0");
set_metadata("/system/bin/netd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netd_exec:s0");
set_metadata("/system/bin/netdiag", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netdiag_exec:s0");
set_metadata("/system/bin/netcfg", "uid", 0, "gid", 3003, "mode", 02750, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/nvram_agent_binder", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:nvram_agent_binder_exec:s0");
set_metadata("/system/bin/nvram_daemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:nvram_daemon_exec:s0");
set_metadata("/system/bin/orientationd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:orientationd_exec:s0");
set_metadata("/system/bin/permission_check", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r[emoji14]ermission_check_exec:s0");
set_metadata("/system/bin/ppl_agent", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r[emoji14]pl_agent_exec:s0");
set_metadata("/system/bin/pppd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r[emoji14]pp_exec:s0");
set_metadata("/system/bin/pppd_dt", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r[emoji14]ppd_dt_exec:s0");
set_metadata("/system/bin/pq", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r[emoji14]q_exec:s0");
set_metadata("/system/bin/racoon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:racoon_exec:s0");
set_metadata("/system/bin/run-as", "uid", 0, "gid", 2000, "mode", 0750, "capabilities", 0xc0, "selabel", "u:object_r:runas_exec:s0");
set_metadata("/system/bin/s62xd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:s62xd_exec:s0");
set_metadata("/system/bin/sdcard", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sdcardd_exec:s0");
set_metadata("/system/bin/servicemanager", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:servicemanager_exec:s0");
set_metadata("/system/bin/sn", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sn_exec:s0");
set_metadata("/system/bin/surfaceflinger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:surfaceflinger_exec:s0");
set_metadata("/system/bin/terservice", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:terservice_exec:s0");
set_metadata("/system/bin/tertestclient", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tertestclient_exec:s0");
set_metadata("/system/bin/testmode", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:testmode_exec:s0");
set_metadata("/system/bin/thermal", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermal_exec:s0");
set_metadata("/system/bin/thermal_manager", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermal_manager_exec:s0");
set_metadata("/system/bin/thermald", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermald_exec:s0");
set_metadata("/system/bin/tiny_mkswap", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tiny_mkswap_exec:s0");
set_metadata("/system/bin/tiny_swapon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tiny_swapon_exec:s0");
set_metadata("/system/bin/uncrypt", "uid", 0, "gid", 0, "mode", 0750, "capabilities", 0x0, "selabel", "u:object_r:uncrypt_exec:s0");
set_metadata("/system/bin/vdc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vdc_exec:s0");
set_metadata("/system/bin/vold", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vold_exec:s0");
set_metadata("/system/bin/wifi2agps", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wifi2agps_exec:s0");
set_metadata("/system/bin/wmt_loader", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wmt_loader_exec:s0");
set_metadata("/system/bin/wpa_supplicant", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wpa_exec:s0");
set_metadata("/system/bin/xlog", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:xlog_exec:s0");
set_metadata("/system/etc/dhcpcd/dhcpcd-run-hooks", "uid", 1014, "gid", 2000, "mode", 0550, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/ppp", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0555, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/wide-dhcpv6/dhcp6c.script", "uid", 1014, "gid", 2000, "mode", 0550, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/drm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/drm/libdrmwvmplugin.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/hw", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/mediadrm", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib64", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib64/mediadrm", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib64/mediadrm", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/operator", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/xbin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/BGW", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:BGW_exec:s0");
set_metadata("/system/xbin/librank", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/mnld", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mnld_exec:s0");
set_metadata("/system/xbin/procmem", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/procrank", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 04750, "capabilities", 0x0, "selabel", "u:object_r:su_exec:s0");
set_metadata("/system/xbin/tcpdump", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
show_progress(0.1, 0);
ui_print("   Flash kernel");
assert(package_extract_file("boot.img", "/tmp/boot.img"),
       write_raw_image("/tmp/boot.img", "bootimg"),
       delete("/tmp/boot.img"));
assert(run_program("/system/bin/dd", "if=/dev/zero", "of=/proc/driver/mtd_writeable", "bs=3", "count=1"));
ui_print(" ==> Unmounting /data");
ui_print(" ==> Unmounting /system");
unmount("/data");
unmount("/system");
ui_print("Successfully Please restart your phone manually!")
Most of it is fairly self explanitory - the boot.img bit is essentially the same as in the uodater-scripts you posted, and the rest is copying the system files and 'fixing' them; i.e. creating symlinks and fixing the permissions (set_metadata).
So I need to grab one from a ROM not an ota? I'm trying to learn but its very complicated as it should be lol. I recently am trying to figure out how to use Linux.

Sent from my Nexus 6 using Tapatalk
 

f1ux

Senior Member
Jan 2, 2011
615
103
Is there a more detailed guide on making an updater-script?

I got a stock rom and made a few edits, plus edited its updater-script which then let it install the rom using TWRP.
It installs and boots fine.

But then I made a TWRP backup, extracted the system, used the same updater-script and it gets stuck at bootlogo.

I just want to basically make a zip of the same rom but with updated google services and other google apps that were updated from the market.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 143
    Hi,
    today I'm going to show how to create a flashable
    zip from a CWM/TWRP Backup. This is specially for MTK
    device(you can try in other device,may work). Here is
    my step by step tutorial...

    Requirements:

    * PC
    * CWM/TWRP Backup
    * Winrar
    * Brain


    you need META-INF,system & boot.img for making a
    flashble zip rom, so you have to collect these from
    your backup


    *CWM method:

    1. Copy the CWM backup from Phone to PC

    2. Extract system.ext4.tar file with winrar, you
    will get the system folder

    3. Collect the boot.img from the backup

    4. Now collect a META-INF folder from any custom
    rom which is made for your device

    5. Now select META-INF,system & boot.img, click
    right button of your mouse and select 'Add to archive'
    now select archive format 'ZIP' and press ok

    6. Your flasable zip rom is ready. Just copy it
    to your sd card and flash with CWM or TWRP

    7. Done.



    TWRP method:

    1. Copy the TWRP backup from Phone to PC

    2. Collect the file 'system.ext4.win' rename it
    to 'system.ext4.tar'

    3. Extract the system.ext4.tar. Now in case if your
    TWRP backup is not in compression method, you will
    directly get the system folder. Or if your TWRP
    backup is in compression method, you will get a
    file named 'system.ext4', don't worry just again
    rename it to 'system.ext4.tar' and extract to get
    the 'system' folder

    4. Collect the 'boot.emmc.win' file and rename it
    to boot.img, now ypu manage the boot.img also

    5. Now collect a META-INF folder from any custom
    rom which is made for your device

    6. Now select META-INF,system & boot.img, click
    right button of your mouse and select 'Add to archive'
    now select archive format 'ZIP' and press ok

    7. Your flasable zip rom is ready. Just copy it
    to your sd card and flash with CWM or TWRP

    8. Done.
    15
    Hi,
    today I'm going to show how to create a flashable
    zip from a CWM/TWRP Backup. This is specially for MTK
    device(you can try in other device,may work). Here is
    my step by step tutorial...

    Requirements:

    * PC
    * CWM/TWRP Backup
    * Winrar
    * Brain


    you need META-INF,system & boot.img for making a
    flashble zip rom, so you have to collect these from
    your backup


    *CWM method:

    1. Copy the CWM backup from Phone to PC

    2. Extract system.ext4.tar file with winrar, you
    will get the system folder

    3. Collect the boot.img from the backup

    4. Now collect a META-INF folder from any custom
    rom which is made for your device

    5. Now select META-INF,system & boot.img, click
    right button of your mouse and select 'Add to archive'
    now select archive format 'ZIP' and press ok

    6. Your flasable zip rom is ready. Just copy it
    to your sd card and flash with CWM or TWRP

    7. Done.



    TWRP method:

    1. Copy the TWRP backup from Phone to PC

    2. Collect the file 'system.ext4.win' rename it
    to 'system.ext4.tar'

    3. Extract the system.ext4.tar. Now in case if your
    TWRP backup is not in compression method, you will
    directly get the system folder. Or if your TWRP
    backup is in compression method, you will get a
    file named 'system.ext4', don't worry just again
    rename it to 'system.ext4.tar' and extract to get
    the 'system' folder

    4. Collect the 'boot.emmc.win' file and rename it
    to boot.img, now ypu manage the boot.img also

    5. Now collect a META-INF folder from any custom
    rom which is made for your device

    6. Now select META-INF,system & boot.img, click
    right button of your mouse and select 'Add to archive'
    now select archive format 'ZIP' and press ok

    7. Your flasable zip rom is ready. Just copy it
    to your sd card and flash with CWM or TWRP

    8. Done.

    where is thanks button
    6
    CYGWIN Unpacking TWRP Backup Files

    What if my TWRP backup folder got 2 system.ext4.win files?
    system.ext4.win000
    system.ext4.win001

    What should i do to combine these 2 files into single .tar ?

    This is for Latest TWRP used with safestrap (my phone is AT&T Note 3)

    rename them both seperatly

    system.ext4.win000.tar
    system.ext4.win001.tar

    winrar and 7-zip failed for me

    I used CYGWIN

    CYGWIN Unpacking TWRP Backup Files
    5
    I want to make KK Stock ROM for iBall Slide 3G 7271 HD70

    Hi,

    Regarding the 4th step, Their are no ROM available for this device so I don't have the files.
    I have the block MAP for the device,
    So could u plz guide me to make the meta files?

    "4. Now collect a META-INF folder from any custom rom which is made for your device"
    2
    QUESTIONS
    ---------------------------
    1. On STEP 3 I did the following:
    Extract the system.ext4.tar.
    If your TWRP backup is in compression method, you will get a file named 'system.ext4',
    Rename it to 'system.ext4.tar'

    Next part, " Extract to get the 'system' folder", does not work. What do I do here?

    2. Doing #1 in Linux or does this need to be done win Windows?

    3. META-INF - My HTC ONE X+ (code name evitare UL) does not have any custom ROMs I can find. What other sources of META-INF are there?

    Please notify me at rick2210@gmail.com when you post answers. Thanks

    Rom List
    You can get your META-INF from one of them


    Extract to get the system folder:

    CYGWIN Unpacking TWRP Backup Files

    Download CYGWIN http://cygwin.com/

    rename:
    data.ext4.win to data.ext4.win.tar
    system.ext4.win000 system.ext4.win000.tar
    system.ext4.win001 to system.ext4.win001.tar

    Make a directory in your CYGWIN Home [Username]folder
    Example: untar

    Use Windows File Explorer go to your CYGWING Home
    C:\cygwin\home\carl (your user name will be here)
    make any folder you choose
    Example:
    C:\cygwin\home\carl\untar
    and C:\cygwin\home\carl\untar\data ( for data files)

    put your renamed data files in a folder named data
    C:\cygwin\home\carl\untar\data (this is to keep files separate when unpacked)

    While in Explorer put your renamed system files in untar folder

    start CYGWIN ( Use the Cygwin Terminal and then you can copy and paste these commands)
    cd to untar folder
    example:
    cd\untar
    do these commands one at a time, it will extract to a folder named system

    tar -xvf system.ext4.win000.tar
    tar -xvf system.ext4.win001.tar

    cd to data

    do this command
    tar -xvf data.ext4.win.tar
    tar -xvf data.ext4.win000.tar
    tar -xvf data.ext4.win001.tar
    all your data files will extract