Flah modem via twrp - X Play Q&A, Help & Troubleshooting

Hi all! I'm doing some experiment, but before try to flash it on my Moto X Play I need to know if What I'm doing is correctly or no.
Basically I'm trying to do a porting on rom made by @spetrum, but I don't want to have dualsim settings and some other Things I've found unnecessary. I don't want to flash modem via Fastboot but directly from TWRP. Now my questions are two:
1) Are that codes correctly?
Code:
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/modem", "/modem");
package_extract_file("modem.bin", "/dev/block/bootdevice/by-name/modem");
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/fsg", "/fsg");
package_extract_file("fsg.mbn", "/dev/block/bootdevice/by-name/fsg");
2) How I can delete modemst1 and modemst2? Could I do that? Are these codes correctly?
Code:
format("ext4", "EMMC", "/dev/block/bootdevice/by-name/modemst1", "0", "/modemst1");
format("ext4", "EMMC", "/dev/block/bootdevice/by-name/modemst2", "0", "/modemst2")
Please if you know the answer tell me,
ScardracS

EDIT
I'm watching ond diskinfo and I've found something interesting.
Before partition for modem is called modem but it mounted as /firmware. But If I call it /by-name/modem is correct?
modemst1 and modemst2 doesn't present a format, so what's their?

Related

update.zip: how to mount /data for G3?

hi,
i've been trying and searching for several hours to change some things within the /data partition. but it seems that i even didn't succeed in mounting the partition correctly. commands i've tried (for new edify updater-script):
Code:
run_program("/sbin/mount", "-o", "rw", "/dev/block/stl7", "/data");
run_program("/system/bin/mount", "-o", "rw", "/dev/block/stl7", "/data");
mount("MTD", "userdata", "/data");
mount("MTD", "data", "/data");
mount("BML", "data", "/data");
mount("rfs", "/dev/block/stl7", "/data");
run_program("mount", "rfs", "/dev/block/stl7", "/data");
nothing seems to work on my galaxy3 v2.1. in order to write stuff to /data i've tried package_extract_dir("data", "/data"); and also run_program("echo", "123", ">", "/data/sometestfile");
mounting /system and extracting files to /system works but i'm not able to access or write to /data
thanks for any input.

[WIP] How to Write an Updater-Script with Edify Code

First and foremost I take no credit for the majority of this thread. I am merely posting this here as a reference for you all. I had to dig around a lot for this information and piece it together from several different threads as well as pull examples from updater-scripts in several different roms/theme/etc. Everyone else put in the work, I am just trying to make it easier for the rest of us .
Mounting Partitions:
MTD:
Code:
mount("MTD", "system", "/system");
mount("MTD", "userdata", "/data");
mount("MTD", "cache", "/cache");
mount("MTD", "sdcard", "/sdcard");
EMMC with EXT3 and EXT4 file systems:
Code:
mount("ext4", "EMMC", "/dev/block/mountpoint", "/system");
mount("ext4", "EMMC", "/dev/block/mountpoint", "/data");
mount("ext4", "EMMC", "/dev/block/mountpoint", "/cache");
Code:
mount("ext3", "EMMC", "/dev/block/mountpoint", "/system");
mount("ext3", "EMMC", "/dev/block/mountpoint", "/data");
mount("ext3", "EMMC", "/dev/block/mountpoint", "/cache");
“mountpoint” will vary from device to device. Decide what partition you want to mount, find where it mounts (there will be resources in the second post, and paste it in place of “mountpoint” in your script.
Mounting system, data, and cache on the EVO 3D
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/cache");
Amend
Code:
[I][COLOR="Gray"]none[/COLOR][/I]
Unmounting Partitions:
MTD and EMMC:
Code:
unmount("/system");
unmount("/data"); [COLOR="Red"]OR[/COLOR] unmount("/userdata");
unmount("/cache");
unmount("/sdcard");
Amend
Code:
[I][COLOR="Gray"]none[/COLOR][/I]
Format Partitions:
MTD:
Code:
format("MTD", "system");
format("MTD", "cache");
format("MTD", "data");
format("MTD", "boot");
EMMC EXT3/4:
Code:
format("ext4", "EMMC", "/dev/block/mountpoint");
Code:
format("ext3", "EMMC", "/dev/block/mountpoint");
Formatting system, data, cache, and boot on EVO 3D.
Code:
format("ext4", "EMMC", "/dev/block/mmcblk0p23");
format("ext4", "EMMC", "/dev/block/mmcblk0p24");
format("ext4", "EMMC", "/dev/block/mmcblk0p25");
format("ext4", "EMMC", "/dev/block/mmcblk0p22");
Amend:
Code:
[I][COLOR="Gray"]format SYSTEM:
format DATA:
format BOOT:
format CACHE:[/COLOR][/I]
Copy files from .zip file to phone partition or sd card:
Code:
package_extract_dir("Source", "Destination");
“Source” = folder in .zip file. "Destination" = partition to copy to,
Code:
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
package_extract_dir("sdcard", "/sdcard");
Amend:
Code:
[I][COLOR="Gray"]copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
copy_dir PACKAGE:sdcard SDCARD:
[/COLOR][/I]
Write an .img file:
MTD:
Code:
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
EMMC:
Code:
package_extract_file("boot.img", "/dev/block/mountpoint");
Amend
Code:
[I][COLOR="Gray"]write_raw_image PACKAGE:boot.img BOOT:[/COLOR][/I]
Output a line of text:
MTD/EMMC:
Code:
ui_print("Text Here");
Amend
Code:
[I][COLOR="Gray"]none[/COLOR][/I]
Delete a file:
Use delete for a single file. Use delete recursive for an entire folder.
Code:
delete_recursive("file/path");
Code:
delete("/path/to/file");
Amend
Code:
[I][COLOR="Gray"]delete_recursive PARTITION:path/to/file[/COLOR][/I]
Code:
[I][COLOR="Gray"]delete PARTITION:path/to/file[/COLOR][/I]
Set ownership and permissions for folder:
Code:
set_perm_recursive(uid, gid, dmode, fmode, “/path/to/folder”);
Amend
Code:
[COLOR="Gray"]set_perm_recursive uid gid dmode fmode PARTITION:path[/COLOR]
Set ownership and permissions for a file:
Code:
set_perm(uid, gid, mode, “/path/to/file”);
Amend
Code:
[COLOR="Gray"]set_perm uid gid mode PARTITION:file[/COLOR]
Run a program:
Code:
run_program("programtorun");
Amend
Code:
[I][COLOR="gray"]run_program PACKAGE:programtorun[/COLOR][/I]
Creating symlinks:
Code:
symlink("/path/to/file", "/path/tofile");
Amend
Code:
[COLOR="gray"][I]symlink /path/to/file PARTITION:path/to/file[/I][/COLOR]
Progress bar:
Code:
show_progress(fraction, duration);
Amend
Code:
[COLOR="gray"][I]show_progress fraction, duration[/I][/COLOR]
Mount points for selected devices:
Evo 3D
Code:
mmcblk0p21 /boot
mmcblk0p23 /system
mmcblk0p24 /data
mmcblk0p25 /cache
Evo Shift 4G
Code:
mmcblk0p22 /boot
mmcblk0p26 /system
mmcblk0p27 /data
mmcblk0p28 /cache
Nexus S
Code:
mtdblock4 /cache
platform/s3c-sdhci.0/by-name /system
platform/s3c-sdhci.0/by-name /userdata
reserved for more info at a later date
excellent tutorial. answered a lot of questions i had
w00t w00t! thanks for this, dude!
http://forum.xda-developers.com/showthread.php?t=936175
A lot of information in there that I have bookmarked and used without problems.
raiden89 said:
http://forum.xda-developers.com/showthread.php?t=936175
A lot of information in there that I have bookmarked and used without problems.
Click to expand...
Click to collapse
Thanks. Will update. Just wanted to post something for the EVO users so we have our own thread to reference.
EDIT: Also, looks like he might be missing a few commands. Not a big deal. Any and all help is appreciated.
Oh yeah. Of course. I know some stuff is missing, but I also like the color coding of it and showing what the Amend syntax is compared to the Edify. So, I thought I would post it. It's been useful to me.
thank you so much for making this. now people will stop bothering me and tiffany about our fantastic zips not working in cwm 3.+
Some more resources for you all...
Here and here (source code is included if you would like to see the conversions being done).
=]
Is there any way to change the color of text output in ui_print?
droidzone said:
Is there any way to change the color of text output in ui_print?
Click to expand...
Click to collapse
I believe that is dependent on how your recovery is built.
Sent from my PC36100 using XDA Premium App
droidzone said:
Is there any way to change the color of text output in ui_print?
Click to expand...
Click to collapse
Karadorde said:
I believe that is dependent on how your recovery is built.
Click to expand...
Click to collapse
If you rebuild the recovery it can be changed, but there are no options built in that will allow you to change the colors.
I'm of course referring to ClockworkMod recovery, since Amon_RA's github is outdated, I haven't really looked through his code.
=]
Anyone know the arguments/parameters to format boot to ext4?
The Desire S is Ext4 by default but i keep getting a status 1 error code when using Ext4, however Ext3 works fine.
Ive tried mounting and unmounting prior to format but no luck what so ever
You can find the partition information for the DS here:
http://forum.xda-developers.com/showthread.php?t=1057342
Thanks for the guide. This will help a lot in the future
Sent from my xEVO using XDA premium app
ooh i see you've updated for the evo 3d
One trick I used in creating the superuser and gapps ZIPs:
Code:
run_program("/sbin/busybox", "mount", "/system");
It runs just fine on both eMMC and MTD devices, and the only prerequisites are that the recovery has busybox, and already knows the mount points (which any good recovery should). Been working on Amon_RA, ClockworkMod 2-4, and TWRP.
Great tutorial!
Just one question, the # symbol preceeding a line is used for comments, right?
Thanks!!
splattx_x said:
Just one question, the # symbol preceeding a line is used for comments, right?
Click to expand...
Click to collapse
Yes, if the 1st char in the line is '#' that line is a comment.
=]
nubecoder said:
Yes, if the 1st char in the line is '#' that line is a comment.
=]
Click to expand...
Click to collapse
Awesome! Thanks. Now I have to figure out why I can't flash any zip in my phone with CWM.
This guide is very helpful. Any chance anyone knows where to get the update-binary? I know I can get it from a ROM but I'd like to learn so I can cook my own ROM from scratch.

Any tool or program to check the syntex of an update-script?

The title says it all. Im just wondering if theres a program or plugin or anything to let me check the update script without the hassle of putting it on the phone and trying to install it.
Thanks in advance
EDIT for MOAR info.
I just make simple boot animations. I pulled this script from a theme install, and it worked fine.
ui_print("YOU ARE INSTALLING A BIGDX SERENITY THEME");
mount("MTD", "system", "/system");
show_progress(0.500000, 40);
package_extract_dir("system", "/system");
show_progress(0.100000, 10);
mount("MTD", "sdcard", "/sdcard");
package_extract_dir("sdcard", "/sdcard");
unmount("/sdcard");
unmount("/system");
ui_print("INSTALL OF BIGDX THEME COMPLETE!");
I tried to change it to this
ui_print("YOU ARE INSTALLING A BOOT ANIMATION");
mount("MTD", "system", "/system");
show_progress(0.500000, 40);
package_extract_dir("system", "/system");
show_progress(0.100000, 10);
unmount("/system");
ui_print("INSTALL OF BOOT ANIMATION COMPLETE!")
And im not sure why but its giving me hell, and I just want a way to trial/error without having to zip it all back up and install it.
Also, do I have to include the updater-binary? Thaat came in the original theme install

[Q] Change bootlogo&bootanimation

I really need someone that point me in the right way!
I found that script some weeks ago, it wasn't for our Defy's, and i don't find the source back, that i can ask the dev that programmed it.
Code:
assert(package_extract_file("logo.bin", "/tmp/logo.bin "),
write_raw_image("/tmp/logo.bin ", "/dev/block/mmcblk1p10"),
delete("/tmp/logo.bin "));
run_program("/sbin/busybox", "mount", "/system");
delete("/system/media/bootanimation.zip");
package_extract_dir("system", "/system");
set_perm (0, 0, 0755, "system/media/bootanimation.zip");
run_program("/sbin/busybox", "umount", "/system");
I changed the partition of the bootlogo in the script&file format from image. I want to use a raw image what fit the defy dimensions. Also set the permissions of the bootanimation, think that is needed to boot up... or not
I can't test it cause I'm not able to flash a sbf at the moment ... that's why i ask all of you guys.
I don't think that I made a mistake, but i scared if the mmcblk1p10 is destroyed with a wrong command, that i cant boot up AROMA Filemanager, to recover my device without PC.
Please Help
Yes, this should work, but mount and unmount no neeed there.
Quarx said:
Yes, this should work, but mount and unmount no neeed there.
Click to expand...
Click to collapse
thanks
Jelly powered.Defy

Update Script Zenfone Selfie

Hi,
I try to create a way to flash the rom stock of ZD551KL , creating an update script modified with system.img and boot.img when flashing TWRP with the zip file , recording occurs normally, but when I restart the device does not enter the system , what can this happening already are several unsuccessful attempts ....
the steps that follow:
-Reboot to TWRP
-Full Wipe (Dalvik/system/cache/data)
My script update:
ui_print("--> ZD551KL Z00T-WW-1.15.40.1238");
ui_print("--> ****************************");
ui_print("--> Mounting system");
set_progress(0.02);
unmount("/system");
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system");
ui_print("--> Formating system");
delete_recursive("/system");
ui_print("--> Install New System...");
package_extract_file("system.img", "/dev/block/bootdevice/by-name/system");
ui_print("--> Flashing kernel...");
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
unmount("/system");
ui_print(" ");
ui_print("Finished");
ui_print(" ");
Hi,
You should extract system.img so, it would have folders and files like these before zipped:
META-INF
data (optional)
system
boot.img
ifwi.zip
Just copying system.img won't work, because firmware isn't same like kernel (you need to extract everything out).
Sent from my ASUS_Z00AD
krasCGQ said:
Hi,
You should extract system.img so, it would have folders and files like these before zipped:
META-INF
data (optional)
system
boot.img
ifwi.zip
Just copying system.img won't work, because firmware isn't same like kernel (you need to extract everything out).
Sent from my ASUS_Z00AD
Click to expand...
Click to collapse
This example is for the Zenfone 2, the ROM of the structure of Zenfone selfie is different , to use the system decompressed already have to create the symlink / set_metadata , that part I do not have much experience

Categories

Resources