How to mount partition /system and /product by Edify Script - Samsung Galaxy A51 Questions & Answers

Hi friends,
I am currently running Android 11 firmware (A515FXXU5EUL3) on my phone. I want to make my own ZIP file to debloat some apps by using TWRP but I do not know to mount /system and /product partitions. In the my previous A50 phone, I used the commands in the updater-script
mount("ext4", "EMMC", "/dev/block/platform/13520000.ufs/by-name/system", "/system_root");
mount("ext4", "EMMC", "/dev/block/platform/13520000.ufs/by-name/product", "/product");
But for the A51 phone, they are not working. Please help me to modify the commands to make they work
Update: I have found out the solution, follow the topic to solve it
[MAGISK][TWRP][ARM32/64][A8+]Universal Read Only to Read Write for android (RO2RW) | Auto converting SUPER "system partitions" to read/write mode
Read Only to Read Write for android (RO2RW) Update 03.01.2023 : Stable Beta v 3.7.2.1 The first truly working script, original and unique in its logic for all devices with a SUPER partition Universal auto RO2RW | EROFS-2-RW | F2FS-2-RW by...
forum.xda-developers.com
Sorry for my English.
Thanks in advanced

Related

[MOD][One Click Root] Clockwork Mod version 3.0.0.5/6 - UPDATED FOR EB13!

Just finished porting the CWM 3.0.0.5/6 recovery.
Some notable changes are the following:
Auto EXT4 conversion system. If a partition is found to be RFS, but referenced in recovery.fstab as ext4, the system will AUTOMATICALLY convert the filesystem, backing up ALL data on the partition, and restoring it after. This may still have kinks, so if you run into any problems, simply flash your rom over it.
Removal of Amend script. This is a HUGE change for everyone using the update-script method to create flashable .zip files. ALL developers should begin using Edify scripts (updater-script and update-binary). I will post a few examples of common things below.
Color contrast changed from green on black to orange on black.
New mounting system. Partition types are no longer required to be compiled into CWM, and are instead detected from /config/recovery.fstab (Modified path to work with the redirector)
Notice: DO NOT INSTALL UNLESS YOU WANT EXT4!!!
[NEW] FOR EB13:
http://efragtv.com/android/OneClickRootCWM3-EB13.zip
NOTES FOR EB13: Auto conversion/restore seems to work 100% now. I converted and did NOT have to flash a rom over it. =]
[OLD] FOR DK28:
http://efragtv.com/android/OneClickRootCWM3.zip
INSTRUCTIONS:
1. Unzip to your desktop.
2. Go into your phone and Go to settings->Applications->Development and turn on USB Debugging.
3. Now double click run.bat in the folder you unzipped. (If you are on linux ./run.sh from the folder)
4. Wait for everything to happen.
5. Use the THREE BUTTON METHOD to get to CWM3.
6. Wait for the conversion operation to finish.
7. DO NOT REBOOT!!!!
8. IF YOU ARE ON AN ODEXED ROM (DEFAULT OTA) THEN YOU NEED TO REFLASH A ROM AFTER THE CONVERSION!!!!!!! ODEXED ROMS DO NOT GET RESTORED PROPERLY!
9. Flash the Default Stock Dual FS kernel For EB13: http://efragtv.com/android/EB13-DUALFS-KERNEL.zip
10. Enjoy CWM 3.0.0.5/6
See post #2 for Edify examples vs the old Amend style.
RESERVED for updater-script examples.
Syntax:
Code:
Amend Code
Edify Code
Copying a directory from the update package to the phone:
Code:
[COLOR=Red]Amend:[/COLOR] copy_dir PACKAGE:system SYSTEM:
[COLOR=SeaGreen]Edify:[/COLOR] package_extract_dir("system", "/system");
The first parameter is the direct location inside of the package.
The second location is the destination on the phone.
Mounting /data /system and /cache in Edify
Code:
run_program("/sbin/mount", "/dev/block/stl9", "/system");
run_program("/sbin/mount", "/dev/block/stl10", "/data");
run_program("/sbin/mount", "/dev/block/stl11", "/cache");
Printing a UI Message in Edify
Code:
ui_print("Some text here");
Create a symlink in Edify:
Code:
symlink("from","to");
Setting permissions in Edify:
Code:
Single file: set_perm(0, 0, 06755, "/system/xbin/su");
Recursive: set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
Run a program in Edify:
Code:
run_program("filetorun", "option1", "option 2", "option 3");
Delete a location recursively (like Amend's format):
Code:
delete_recursive("/path/to/delete");
Remember that script functions that take options (For example, run_program) must have each item that would require a space between it to be surrounded in double quotes, and followed by a comma. The last parameter must not have a comma afterwards.
Remember that ALL edify commands must end with a semi-colon.
Can't hardly wait! Am looking forward to learning about Edify scripts.
Will my download mode work after this?
:: rolls eyes ::
Sent from my SPH-D700 using XDA App
DevinXtreme said:
Will my download mode work after this?
:: rolls eyes ::
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
No. Your phone will be dead forever.
This sounds promising but I'm gonna need help on the home binary scripts
Sent from my SPH-D700 using Tapatalk
Well it looks like we will all be releasing ROM updates later this week.
Sweeeeeeet
Sent from my SPH-D700 using XDA App
Thanks for all your hard work Dameon, def one of the best devs we have for the Epic. Donation will be coming your way soon Looking forward to trying this out!
Looking forward to this as well. So for those of us who currently have 2.5.1.0 / .2 installed, what will happen as far as updating to the newer cwm?
Dameon .. Nice work .. really sweet !! I don't have any money for you but if you need some new sick clothes let me know =) I own a dope clothing company in SO CAL... just drop me a line of what you need. Im running cwm .2 would i want to upgrade to this or just keep .2 ?
What is likely to happen is that this new one will overwrite 2.5.1.0. The other one, 2.5.1.2, is only baked into the rom. As per the OP, this will convert to ext4 and should only be used if you want ext4. However, the OP also said that the recovery.fstab file determines the file system (being a file system table and all). Since 2.5.1.0 was useless to us once converting to ext4, and we are basically running a hack to gain access to a usable recovery, this will simplify things for us.
And thanks Dameon. You've been busy the past few days.
No, I was unaware of that. I have only been using android since October, but I have been using linux on and off for almost 10 years. I've been learning what I can, but haven't found good explanations on how everything is put together in android. I need to spend some time reading the developer's guide and finding more guides. Also, I've been meaning to set up a kitchen so I can dig into the source, but I need to backup and wipe my laptop first. Not to thread jack, but do you know of any good places to start?
One thing that I'm sure will come up that the Edify zips will need to be signed using the android sdk. The good thing is that it's not hard to do.
That is, unless Dameon87 did something to Clockworkmod so that signing isn't necessary.
Sent from my SPH-D700 using Tapatalk
Signing is not necessary =]
Updated, Link added:
http://efragtv.com/android/OneClickRootCWM3.zip
Follow instructions in OP.
Link fixed in OP.
so this recovery will change the file system to ext4? There are no previous steps?
Sent from my SPH-D700 using XDA App
That is correct. Just run it like you would the one click root/CWM redirector installer.
AWESOME
Sent from my SPH-D700 using XDA App

[FIX available] Expected Arguments help [SOLVED]

I keep running into this issue with a rom port. It keeps saying that it is expecting 3 arguments but got 2, as listed below in recovery.log:
The updater-script originally came with 3 arguments, but I can only allow 2, as if I used 3 like so: format("yaffs2", "MTD", "system", my hd2 would give 7 vibrations of death for some odd reason.
Code:
Opening update package...
Installing update...
script aborted: format() expects 3 args, got 2
Welcome to TW_FET_1.47.950.3 release
v0.1
format() expects 3 args, got 2
E:Error in /sdcard/TW_FET_12_43.zip
(Status 7)
How do I change the 'expected arguments' because in other roms, there are only 2 arguments for format.
Any help would be appreciated!
Finally found out what the problem was.. feel like an idiot right now haha
>>> ** For future reference, it is the update-binary causing problems! Replace it with a binary from another build that takes format and mounts commands in the correct amount of arguments. ** <<<
The binary from the Desire HD takes:
-3 arguments for format
EX: format("MTD", "yaffs2", "system");
- and 4 arguments for mount
EX: mount ("MTD", "yaffs2", "system", "/system");
meanwhile, in AOSP, the update-binary takes
-2 arguments for format
EX: format("MTD", "system");
- and 3 arguments for mount
EX: mount("MTD", "system", "/system");
This should solve the problem.. and it took me 2 days to figure this out..
THANK YOU! This helps a lot!
what do i do when i have no idea what any of you just said? :| ive never not been able to mod this phone but now all the suddent i cant install anything. its an e980 LG optimus G pro. great phone love it to death, replaced the digitizer and the charging port on it, still going strong. very great phone ! bt now every thing i try to install gets an errorexpects 5 args, got 3. e: erropr in data/media/touchrecovery_atrix_5.8.1.8.zip i can't seem to figuire out what to do now i wanna try a new rom bored with stock but now im stuck :\ flasing new tot files with LG flash tool doesnt change this either.
jianC said:
Finally found out what the problem was.. feel like an idiot right now haha
>>> ** For future reference, it is the update-binary causing problems! Replace it with a binary from another build that takes format and mounts commands in the correct amount of arguments. ** <<<
The binary from the Desire HD takes:
-3 arguments for format
EX: format("MTD", "yaffs2", "system");
- and 4 arguments for mount
EX: mount ("MTD", "yaffs2", "system", "/system");
meanwhile, in AOSP, the update-binary takes
-2 arguments for format
EX: format("MTD", "system");
- and 3 arguments for mount
EX: mount("MTD", "system", "/system");
This should solve the problem.. and it took me 2 days to figure this out..
Click to expand...
Click to collapse
That really helped, I was having problems for a few minutes until I found this post. Thanks alot:good:

[Q] [HELP] Running Debian on top and Android chrooted

Hello!
I'm trying to run debian on P500, but not chrooted below android. I want the reverse.
I followed this guide strictly:
http://whiteboard.ping.se/Android/Debian
Everything went well, no apparent errors. The only trouble is: the system doesn't boot I can't explain why. I'll write exactly what I did, so maybe you can help me to find what I'm doing wrong.
## Partitioning the SD card
I partitioned it in 4 partitions using fdisk, and created filesystems with mkfs:
sdb1 - ~2GB vfat (for android)
sdb2 - ~1GB ext4 (for /data - I'll mount /data here after everything is working)
sdb3 - ~12GB ext4 (for debian root filesystem)
sdb4 - ~1GB swap area
## Creating the new initramfs
I used cm-11-RC7 as base. I extracted the boot.img using unmkbootimg, a tool provided by the author of the guide, which gave me a initramfs.cpio.gz file and a zImage file.
I did exactly as described in the guide, but using busybox-armv6l (downloaded from http://busybox.net/downloads/binaries/latest/) and changing /dev/mmcblk1p2 to /dev/mmcblk0p3 (this is how my P500 called my sdb3 partition) in the /init file.
Everything went well, and I got a boot.img with busybox and the modified /init file.
## Creating the Debian filesystem
I did exactly as described in the guide, changing only the debian version (--foreign sid) and the mirror (from ftp.se to ftp.br).
Everything ok, I can use debian at this point, but chrooted below android.
## Creating the new Android root file system
I extracted the original initramfs to /android on debian filesystem and created the log/ subdirectory, as described in the guide.
## Finishing scripts
I removed the /etc/init/ folder and all files in /dev of the debian root filesystem; and created the files /etc/init, /etc/init.stage2 and /etc/rc.local as described in the guide.
## Installing the boot.img
Since I can't put my phone in fastboot mode (home+power has no effect, and I can't use LGMDP because I'm running linux) I tried two ways:
- Using the Flash Image GUI (http://forum.xda-developers.com/showthread.php?t=2086361)
This works, I got a "Success" output after flashing the modified boot.img.
- Changing the original boot.img file by the modified boot.img in the rom zip
This works, the rom is installed succesfully.
## Using it
That's where I can't explain. After flashing the modified boot.img (or modified zip rom) I reboot the phone, and got this bootloop:
LG screen > screen turns off > hardware buttons light turns off > LG screen
... and so on, forever.
What am I doing wrong?
Thanks a lot!
------------------------------------------
I could not make this work yet, but I would like to say thanks to:
Google (for android)
CyanogenMod (for the great system they provide)
AndroidARMv6 team and all developers of our beloved P500 (for making dreams possible )
Mikael Q Kuisma (for the great guide and tools - http://whiteboard.ping.se/Android/Debian)
joeykrim (for the Flash Image GUI - http://forum.xda-developers.com/showthread.php?t=2086361)
Possible problems
I think that the possible problems would be:
- Wrong busybox version
I tried with the busybox extarcted from the ROM (/system/xbin). Same result.
- ROM incompatibility
I tried the same procedure using as base CM11-RC7, Omni-4.4.3-NightlyBuild, CM10.2.0, CM10.1.6, CM9.2.3, AOKP-4.0-Beta6, CM7 and the original rom. Nothing.
I can't see the reason for this not to work...

Problem with port on Mediatek 6580 kernel 3.18.35

Yesterday I made a port to a Doogee Shoot 2 (Mediatek 6580 with Kernel 3.18.35) from this ROM http://techboxlab.com/a9-lite-rom-for... I was pretty happy about the possibility of flashing it. Was a success, everything was working except a little detail: the device was lock and I made a call to see how the screen and sound was...the result? the phone goes crazy...I was rebooting the device. Once was on again I go to Play Store to update the apps...the phone goes to rest and when I unlock it, again this that show you in the video. What can it be? I followed to guides to do it and both are the same result, mixing both equal...
I thought that can be the gapps (the rom comes with gapps) so I flash over newer version, was the same. I don't know if it helps but here are some things, the flash takes a while (more than 10 minutes), and when the flash is over and I can reboot I have this: after the Unmount system line I get: "unmount of /system failed: no such volume"
the mount section of my updater script is:
ui_print(" = >>>>> Mount System <<<<< = ");
mount("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/by-name/system", "/system", "max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc");
ui_print(" = >>>>> Stating Flash Rom <<<<< = ");
package_extract_dir("system", "/system");
And the unmount system
ui_print("**************************************************");
ui_print(" = >>>>> Unmount System <<<<< = ");
unmount("/system");
set_progress(1.000000);
My youtube video with the example https://www.youtube.com/watch?v=ysgOy50-2ao
help please?
anyone?
AgustinH said:
anyone?
Click to expand...
Click to collapse
Try this guide https://forum.xda-developers.com/android/general/guide-how-to-port-nougat-based-roms-t3679512
This guide (another one) got deleted in the FB group. So here it is again: https://forum.xda-developers.com/an...uide-minimal-porting-guide-mtk-64bit-t3772641
Give it a go and see if it helps in anything porting related. Regarding the updater script, download on of the custom roms for your device and try using one of those updater scripts.

How To Guide [GUIDE] Make your system and other partitions inside super read-writeable again.

Disclaimer: I'm not responsible for any result of these operations. Please be careful and well prepared. Always have your important data backed up safely on other place.
Hello everyone!
As far as 2022 and Xiaomi gets their new phones updated to MIUI13 and Android 12, they implement the new read-only filesystem "EROFS" on the logical partitions inside super partition. EROFS is a filesystem initial developed by Huawei and then Google select it as a new standard to use in read only logical partition inside super partition from Android 12. The "EROFS", is the short for "Extendable (or Enhanced?) Read-Only Filesystem", conveying that this filesystem is a one-time cooked filesystem and cannot be changed without extracting and re-cooking. With erofs we cannot modify the logical partition anymore so I found a new way to unlock these partitions.
I just faced and managed to solve the "lock" and I would like to share the solution, which may help more people.
My device: Xiaomi 12 (cupid).
System: Stock MIUI13 (Android 12).
Logical partitions with read-only lock inside super partition: system, vendor, product, system_ext, odm, vendor_dlkm. All of them are erofs filesystem.
Before we start: This guide is for power users that wish to make their read-only system/vendor.... partitions with EROFS filesystem inside super read-writeable again to remove the bloatware and do more customizations to their device.
Credits:
@Yuki1001 - EROFS Guide, research, new rw discoveries.
@lebigmac - a couple of rw slogans, some binaries, inspiration.
Requirements:
1. Your phone must be unlocked as you must flash your new super.img through fastboot command. Root is required to run any command in adb shell or a terminal.
2. 20GB+ free space on your phone and PC.
3. The toolkit needed.
4. A clever brain and courage.
Steps in short:
(1) Dump and extract your super image.
(2) Pull the folder with partition images extracted from super image to the PC.
(3) Convert these erofs images to ext4 images (Extract and Rebuild). These new images are in the same folder.
(4) Push the folder to the phone and fix any errors of new generated ext4 images.
(5) Merge them into a new single sparse super image and pull it to the PC.
(6) Flash the new image through fastboot command.
(7) Check the rw capability of the logical partitions and do anything you want!
View my full guide here: https://forum.xda-developers.com/t/...ons-inside-super-read-writable-again.4483933/
For mods: In theory, this method is universal over all new Android12+ phones shipped with partitions using erofs inside super. So I post the content in the general android software/hacking subforum. In this subforum I preserve a thread hoping more users can see it and be benefited.
Feedbacks are always welcome!
If you think it's useful, please click the "Like" button. Thanks!
Reserved floor #2.
Reserved floor #3.
Hi Yuki. You did some great erofs research there. Congratulations! Keep up the good work!
And thanks for adding me to your credits!
If you want to integrate your erofs discoveries into new version of my script please contact me! Thanks! Of course you would be properly credited
lebigmac said:
Hi Yuki. You did some great erofs research there. Congratulations! Keep up the good work!
And thanks for adding me to your credits!
If you want to integrate your erofs discoveries into new version of my script please contact me! Thanks! Of course you would be properly credited
Click to expand...
Click to collapse
You both can kill erofs

Categories

Resources