Keep getting error 0 when flashing android kitchen stock rom. - Android Q&A, Help & Troubleshooting

Hi all, my first post here, I hope its not in the wrong section
I know this will probably be a very noob question, but I have been trying to create a .zip file with my stock rom I downloaded from a site, (I have a HTM-H9500 [MTK 6582]), I was creating the zip in android kitchen, but whatever i do i always get Error: status 0 in CWM, I read that this would probably because of update-binary or updater-script, I have tried creating update-script (without the r) and CWM directly says that its very old and that i should create updateR-script, however when i do all the process again with updater-script I get this annoying status 0 error.
What can i do? I searched this topic in the net and all the sugestions people had said havent worked for me.
Thanks in advance and sorry for my bad english.

Replace the update-binary file from an existing custom ROM of your device with the ROM you made using kitchen that should do the job.
Also while adding the file to zip make sure you set the compression to store
Hit thanks if I helped.
Sent from my C5302 using XDA Free mobile app

Tech N You said:
Replace the update-binary file from an existing custom ROM of your device with the ROM you made using kitchen that should do the job.
Also while adding the file to zip make sure you set the compression to store
Hit thanks if I helped.
Sent from my C5302 using XDA Free mobile app
Click to expand...
Click to collapse
Hi! Thanks for the quick answer, the thing is because my phone is not very popular i havent found any other custom rom other than the stock specifically for my phone (thats why i was trying to port from another device that is very similar, but first i tried to do this process with my stock rom) so i dont have any other update-binary file other than this one.
About the other thing, how can i change the compression rate in android kitchen ?
Again, thanks a lot and sorry for my english

AlpinoSoyYo said:
Hi! Thanks for the quick answer, the thing is because my phone is not very popular i havent found any other custom rom other than the stock specifically for my phone (thats why i was trying to port from another device that is very similar, but first i tried to do this process with my stock rom) so i dont have any other update-binary file other than this one.
About the other thing, how can i change the compression rate in android kitchen ?
Again, thanks a lot and sorry for my english
Click to expand...
Click to collapse
Go to play store and download zipme app.
Create any flashable app using zip me and then copy it to PC. Open the META-INF Folder then com->android ->Google then open it and you'll see a update-binary file. That is your stock binary
Open the final zip after creating the ROM. If om Windows open the zip (ROM) created and open the zip created using zipme.
Copy the update-binary from zipme ZIP to kitchen created zip and when you'll do this you will see a menu that will ask that are you sure about adding this file, search around a bit and you'll see the compression option

Tech N You said:
Go to play store and download zipme app.
Create any flashable app using zip me and then copy it to PC. Open the META-INF Folder then com->android ->Google then open it and you'll see a update-binary file. That is your stock binary
Open the final zip after creating the ROM. If om Windows open the zip (ROM) created and open the zip created using zipme.
Copy the update-binary from zipme ZIP to kitchen created zip and when you'll do this you will see a menu that will ask that are you sure about adding this file, search around a bit and you'll see the compression option
Click to expand...
Click to collapse
Seriously, thanks lot, means a lot to me, im not used to get much help in forums haha, what you said worked flawlessly, now i get status 7 error, but this means where going somewhere, il keep digging to fix this.
Thanks again

AlpinoSoyYo said:
Seriously, thanks lot, means a lot to me, im not used to get much help in forums haha, what you said worked flawlessly, now i get status 7 error, but this means where going somewhere, il keep digging to fix this.
Thanks again
Click to expand...
Click to collapse
Glad to help friend
Status 7 is error with your mount points.
In your updater-script when you'll open it (open using NOTEPAD++ ONLY, don't use notepad or wordpad) you will see two lines as
Format ("MTD", "SYSTEM"); and other would be mount.
Check these two lines and replace them with your device mount paths
You'll be having no problem.!

Tech N You said:
Glad to help friend
Status 7 is error with your mount points.
In your updater-script when you'll open it (open using NOTEPAD++ ONLY, don't use notepad or wordpad) you will see two lines as
Format ("MTD", "SYSTEM"); and other would be mount.
Check these two lines and replace them with your device mount paths
You'll be having no problem.!
Click to expand...
Click to collapse
Thanks !
In my updater-script I have this two lines
format("MTD", "system");
mount("MTD", "system", "/system");
I know i should know this by now but what are you refering to with 'your device mount paths'?
Thanks a lot, trying to learn here

AlpinoSoyYo said:
Thanks !
In my updater-script I have this two lines
format("MTD", "system");
mount("MTD", "system", "/system");
I know i should know this by now but what are you refering to with 'your device mount paths'?
Thanks a lot, trying to learn here
Click to expand...
Click to collapse
Do you have a recovery.img for your device?
Extract it using kernel kitchen and then after extracting it you' ll get a folder named ramdisk.
Open it go to etc and then recovery.fstab.
Open it with notepad++ and see the mount paths for your device just copy and replace it.
Mount path is the line that tell CWM where to install the particular files. If you face any problems then attach your recovery.img and updater-script and I'll have look at it

Tech N You said:
Do you have a recovery.img for your device?
Extract it using kernel kitchen and then after extracting it you' ll get a folder named ramdisk.
Open it go to etc and then recovery.fstab.
Open it with notepad++ and see the mount paths for your device just copy and replace it.
Mount path is the line that tell CWM where to install the particular files. If you face any problems then attach your recovery.img and updater-script and I'll have look at it
Click to expand...
Click to collapse
Well i didnt had kernel kitchen so after downloading it and runing it i only found those 5 options:
1 work with boot.img files
2 work with kernel.sin and ftf files
3 work wih kernel.elf files
4 work with init ramdisk
5 editing bootsplash image
But nothing to extract recovery.img, i suposed that i should just change recovery.img name to boot.img and do the process but i get an empty folder in the output folder, what should I do?
Thanks thanks thanks again

Google this tool "std unpack" open to first link and download that tool.
Drag your recovery.img to STD unpack and you'll get your files.
Alternatively you can also use kitchen to unpack the recovery.img
Just go to advanced options then go to boot unpacking tools and follow steps as suggested
Sent from my C5302 using XDA Free mobile app

Tech N You said:
Google this tool "std unpack" open to first link and download that tool.
Drag your recovery.img to STD unpack and you'll get your files.
Alternatively you can also use kitchen to unpack the recovery.img
Just go to advanced options then go to boot unpacking tools and follow steps as suggested
Sent from my C5302 using XDA Free mobile app
Click to expand...
Click to collapse
Seriously, sorry to be this stupid, but i cant find anything googling "std unpack" "std unpack tool" or "std unpack download" just a bunch of c++ questions..
Thanks again..
EDIT: nevermind i did it with kitchen like you said in advanced options, this is what I have in recovery.fstab
# mount point fstype device [device2]
/misc emmc /dev/misc
/data ext4 /dev/block/mmcblk0p7
/system ext4 /dev/block/mmcblk0p5
/cache ext4 /dev/block/mmcblk0p6
/boot emmc /dev/bootimg
/recovery emmc /dev/recovery
/emmc vfat /dev/block/mmcblk0p8
/sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
/sd-ext auto /dev/block/mmcblk1p2
How should i change the lines: format("MTD", "system"); and mount("MTD", "system", "/system"); according to that?
Again, thanks for the extensive help

AlpinoSoyYo said:
Seriously, sorry to be this stupid, but i cant find anything googling "std unpack" "std unpack tool" or "std unpack download" just a bunch of c++ questions..
Thanks again..
EDIT: nevermind i did it with kitchen like you said in advanced options, this is what I have in recovery.fstab
# mount point fstype device [device2]
/misc emmc /dev/misc
/data ext4 /dev/block/mmcblk0p7
/system ext4 /dev/block/mmcblk0p5
/cache ext4 /dev/block/mmcblk0p6
/boot emmc /dev/bootimg
/recovery emmc /dev/recovery
/emmc vfat /dev/block/mmcblk0p8
/sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
/sd-ext auto /dev/block/mmcblk1p2
How should i change the lines: format("MTD", "system"); and mount("MTD", "system", "/system"); according to that?
Again, thanks for the extensive help
Click to expand...
Click to collapse
Ready to help always
Use this command for format.
format("ext4", "EMMC", "/dev/block/mmcblk0p5", "system") ;
For mount statement just replace format with mount and keep rest same.

Tech N You said:
Ready to help always
Use this command for format.
format("ext4", "EMMC", "/dev/block/mmcblk0p5", "system") ;
For mount statement just replace format with mount and keep rest same.
Click to expand...
Click to collapse
Thanks again man...
Im still getting status 7 error but now it says format() expects 3 args, got 4

AlpinoSoyYo said:
Thanks again man...
Im still getting status 7 error but now it says format() expects 3 args, got 4
Click to expand...
Click to collapse
Update-binary error only. Try to get a update-binary for your mobile model this is only the problem rest everything is ok.
Also keep a nandroid backup ready if anything goes wrong just explore your device. If it is a Mediatek6557 (just a example) device then search for the any handset running the board of mtk 6557 and download it's custom ROM and replace update-binary and it will work. Download CPU-Z for your phone from play store to get detailed information of your device and board.

Tech N You said:
Update-binary error only. Try to get a update-binary for your mobile model this is only the problem rest everything is ok.
Also keep a nandroid backup ready if anything goes wrong just explore your device. If it is a Mediatek6557 (just a example) device then search for the any handset running the board of mtk 6557 and download it's custom ROM and replace update-binary and it will work. Download CPU-Z for your phone from play store to get detailed information of your device and board.
Click to expand...
Click to collapse
Well thanks, i'll kep searching, one last thing, why would my update-binary wont work? i mean, im using stock rom and trying to flash stock rom again, why would i need a different one?

AlpinoSoyYo said:
Well thanks, i'll kep searching, one last thing, why would my update-binary wont work? i mean, im using stock rom and trying to flash stock rom again, why would i need a different one?
Click to expand...
Click to collapse
You using stock ROM but according to device it doesn't know stock or custom for it everything we flash is just a external source which is implemented in it.

Tech N You said:
You using stock ROM but according to device it doesn't know stock or custom for it everything we flash is just a external source which is implemented in it.
Click to expand...
Click to collapse
Well like you said i kept searching and found an update binary that did the trick and everything flashed just fine, however, even though i didnt get a bootloop, when i turn on the phone it shows the brand logo as always and then its just a black screen.
Any ideas? Thanks !!

Check the permissions in updater-script to and hope you can boot into recovery, restore the phone to old state and then using kitchen convert your updater-script (edify) to update-script (amend) and check for errors. Ignore error with the format and mount command
Sent from my C5302 using XDA Free mobile app

Tech N You said:
Check the permissions in updater-script to and hope you can boot into recovery, restore the phone to old state and then using kitchen convert your updater-script (edify) to update-script (amend) and check for errors. Ignore error with the format and mount command
Sent from my C5302 using XDA Free mobile app
Click to expand...
Click to collapse
Thanks again, what should i look for in permissions in updater-script?
and update-script (without r) gives me problems when i try to flash in cwm

Update-script is old format and isn't used much more. New devices use updater-script for flashing
Sent from my C5302 using XDA Free mobile app

Related

[Q] Recovery script for removing system apps

I've been running CM nightlies as long as they've been available for my device (Samsung Captivate). After each flash though, I have to go in through Titanium Backup and uninstall a number of system apps (mail, exchange services, music, DSP manager, news & weather, dev tools) that I do not use for various reasons. I know the ROM runs fine without these elements, as I've been removing them for years now. Manually removing them wasn't such an issue until my phone received a TWRP recovery, which effectively gets me much closer to a "one-click" nightly update making the manual cleanup more of a burden to my lazy lifestyle.
My question is, I'd like to create a CWM flashable zip that contains only an update script that removes the system apk's that I specify. Using TWRP I'd like to be able to flash the update, the kernel, and my custom "cleanup" zip in that order. I know the path to all the subject apks, but I know little about scripting or creating CWM zips. Can anyone point me in the right direction to do so? I know my way around a bash script, but I'm not even sure if that's relevant.
Why not open the zip on you pc with, for example Winrar, and remove the apk files from system\app ?
Much easier!
airtower said:
I've been running CM nightlies as long as they've been available for my device (Samsung Captivate). After each flash though, I have to go in through Titanium Backup and uninstall a number of system apps (mail, exchange services, music, DSP manager, news & weather, dev tools) that I do not use for various reasons. I know the ROM runs fine without these elements, as I've been removing them for years now. Manually removing them wasn't such an issue until my phone received a TWRP recovery, which effectively gets me much closer to a "one-click" nightly update making the manual cleanup more of a burden to my lazy lifestyle.
My question is, I'd like to create a CWM flashable zip that contains only an update script that removes the system apk's that I specify. Using TWRP I'd like to be able to flash the update, the kernel, and my custom "cleanup" zip in that order. I know the path to all the subject apks, but I know little about scripting or creating CWM zips. Can anyone point me in the right direction to do so? I know my way around a bash script, but I'm not even sure if that's relevant.
Click to expand...
Click to collapse
Good source is here: http://forum.xda-developers.com/showthread.php?p=17684719
To remove files you'll want:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
delete("/system/app/blah.apk");
unmount("/system");
Your mount command will probably be different, so check the CM update-script for the equivalent one
RoadXY said:
Why not open the zip on you pc with, for example Winrar, and remove the apk files from system\app ?
Much easier!
Click to expand...
Click to collapse
I rarely use my own PC in the flashing process. Grandfathered in on an unlimited data plan, and I usually flash at work and connecting my phone to my work PC is verboten. Plus it takes about as much time to just uninstall them from TiBu.
Atarii said:
Good source is here: http://forum.xda-developers.com/showthread.php?p=17684719
To remove files you'll want:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
delete("/system/app/blah.apk");
unmount("/system");
Your mount command will probably be different, so check the CM update-script for the equivalent one
Click to expand...
Click to collapse
That's exactly what I need! Thanks a ton!!
Posted in that other thread linked here but going to ask here as well:
Quick question, for a delete command can you use a wildcard?
Like this:
delete("/system/app/SamsungHub.*");
I only ask because some roms have .apk and some are .odex (for example). Looking to make one script work for any stock rom on my phone.
Also, according to my TWRP log I'm able to mount /system but /data threw an error:
mount: failed to mount /dev/block/mmcblk0p29 at /data: Device or resource busy
Looks right in the partition area:
Symlink_Path: /data/media/0
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/mmcblk0p29
Any thoughts why?
script file
airtower said:
I rarely use my own PC in the flashing process. Grandfathered in on an unlimited data plan, and I usually flash at work and connecting my phone to my work PC is verboten. Plus it takes about as much time to just uninstall them from TiBu.
That's exactly what I need! Thanks a ton!!
Click to expand...
Click to collapse
Hello, I'm also looking for same. can you share your remove/delete apk script file. I'll make the necessary changes myself.
Thankyou
jd2050 said:
Hello, I'm also looking for same. can you share your remove/delete apk script file. I'll make the necessary changes myself.
Thankyou
Click to expand...
Click to collapse
I'm not using one anymore. This thread is nearly 5 years old.

[INFO] File system change

Hi guys as you know our Xperia 2011 use yaffs2 for the mtd partitions, but it doesn't have too.
I bit the bullet, formated system, cache and data as ext4 from updater-script, knowing that alliance (nightelf) kernels had support for this.
It boots and runs lovely
Sent from my MT11i using XDA
mpiekp said:
Hi guys as you know our Xperia 2011 use yaffs2 for the mtd partitions, but it doesn't have too.
I bit the bullet, formated system, cache and data as ext4 from updater-script, knowing that alliance (nightelf) kernels had support for this.
It boots and runs lovely
Click to expand...
Click to collapse
Any noticeably difference? Run any benchmarks? I never understood why SE used yaffs2 for phones, same as why ext4 isn't supported by default, but that's other story
Anw, I guess now you can only install rom via .zip from CWM? Or maybe even flashtool wouldn't complain, but I guess PCC would complain for sure
p.s. respect for trying that
report pros and cons
Lol to revert just flash s zip that formats as yaffs, will try flashtool, although don't expect an issue as it basically raw writes the sin, which are complete img files including filesystem.
Benchmarks would be pointless, due to running experimental build anyway so nothing to compare to, but things like file manger appear more responsive.
All I can say is try it, make sure the updater-binary you use can accept 4 arguments for format and mount (hint the one in codename can), place that into any Rom zip and edit the updater-script.
So the format line is like this
format("ext4", "MTD", "system", "0");
Sent from my MT11i using XDA
Wonderful and brave find!! ext4 are supposed to be safer (journalism), but can have some overhead.
I have seen a script that even converts live yaffs2 to ext4 in some other forum, so that formatting is not required.
Otherwise, after format, you can restore the backups!
I am really interested to know if the partitions can be resized, so that we can have more space for /data (instead of 100 mb /cache and such a large /system)
Actually having checked how its mounted, it appears to have ignored the fs type
Still I'm going to persue this, what are the default part sizes? Esp part mtd1 where vendor gets mounted as on gb vendor is empty
Sent from my MT11i using XDA
mpiekp said:
Actually having checked how its mounted, it appears to have ignored the fs type
Still I'm going to persue this, what are the default part sizes? Esp part mtd1 where vendor gets mounted as on gb vendor is empty
Sent from my MT11i using XDA
Click to expand...
Click to collapse
Maybe those links help you understand :
http://forum.xda-developers.com/showthread.php?t=1566846
http://forum.xda-developers.com/showthread.php?t=1449917
how can we check the type of our partitions?
I'm researching a bit, and people say that yaffs2 is better than ext4 for NAND memory.
I need to research a bit more on this matter.
I am here to learn.Thanks for sharing.
termagazis said:
how can we check the type of our partitions?
Click to expand...
Click to collapse
FOUND IT! :D
Install Terminal emulator
AND TYPE THIS:
su
Click to expand...
Click to collapse
df
Click to expand...
Click to collapse
It gives you all the info you need. If you won't type su, it would not give you MTD partitions' info.
Searched this http://www.computerhope.com/unix/udf.htm according to the image shown here http://forum.xda-developers.com/showthread.php?t=1566846 did I realised that.
400 for system is excessive, should be safe to bring down to 300, forget vendor 6m is not worth worrying.
With /cache that could be another 200mb for data.
Also boot is a worry, formatting the blocks of mtd doesn't appear to work, could rewrite the array, but may kill boot, which would be a hard brick.....
Sent from my MT11i using XDA
Yaffs designed for nand flash based embedded systems
Ext4 is not for that
Sent from my MT11i using XDA
leajian said:
FOUND IT! :D
Install Terminal emulator
AND TYPE THIS:
It gives you all the info you need. If you won't type su, it would not give you MTD partitions' info.
Searched this http://www.computerhope.com/unix/udf.htm according to the image shown here http://forum.xda-developers.com/showthread.php?t=1566846 did I realised that.
Click to expand...
Click to collapse
in the image you gave it doesnt say in what format is every partition.(yaffs or ext3,ext4)
termagazis said:
in the image you gave it doesnt say in what format is every partition.(yaffs or ext3,ext4)
Click to expand...
Click to collapse
In that case, just time
mount
Click to expand...
Click to collapse
in Terminal Emulator and see that every partition is reported on what filesystem it is.
More info @ http://www.cyberciti.biz/faq/linux-how-to-determine-find-out-file-system-type/
Or run it as root
Sent from my MT11i using XDA
yacloo said:
Yaffs designed for nand flash based embedded systems
Ext4 is not for that
Sent from my MT11i using XDA
Click to expand...
Click to collapse
Before you will notice any degradation of NAND, you will sell this phone and forget about it, so...
I made ​​a mess
do I change file system? dont i change it? good or bad?
Actually, it is that easy.
However, all the kernels are set to mount as yaffs, so you also need to unpack and edit the config files in the kernel too.
Sent from my MT11i using XDA

[Q] Android L custom ROM symlinks & permissions

Hey!
I have some questions. With Android L arrived the custom ROMs with files packed into image files (like system.img). And I saw that cm12(just an example) doesn't need anymore to set permissions and create symlinks because they are already stored inside the image file.
And my question is: how can I store the system files into a image file with all symlinks created and permissions set? And also which files require symlinks and what permission should be set for folders/files ?..and into a image files, where are stored the symlinks?
I'm using Windows 7 and I want to make a custom ROM based on stock LG G2 firmware.
I have other ROM's as reference(with system packed into an image file, and with system unpacked) and I can look inside them to see which files needs symlinks..but my main question is, why these files need symlinks?
Thanks!
My two cents :
Cmd to find symlinks (in term emulator, you can remove the end of the cmd if you just want to see the result in the terminal instead of creating a file fic.txt)
ls -lR /system | grep ^l | grep " -> " > fic.txt
Note : in cloudyfa's rom you can see symlinks in updater script (same as stock + busybox)
6ril1 said:
My two cents :
Cmd to find symlinks (in term emulator, you can remove the end of the cmd if you just want to see the result in the terminal instead of creating a file fic.txt)
ls -lR /system | grep ^l | grep " -> " > fic.txt
Note : in cloudyfa's rom you can see symlinks in updater script (same as stock + busybox)
Click to expand...
Click to collapse
Thanks for help ..I understand better now..I searched more and the system.img is the stock image from kdz(I think).. and it contains the necessary symlinks and permissions.
raulx222 said:
Thanks for help ..I understand better now..I searched more and the system.img is the stock image from kdz(I think).. and it contains the necessary symlinks and permissions.
Click to expand...
Click to collapse
Can you help me,how do you get the symlinks and permissions from the system.img;
Thank you very much,I searched this issue long time
austinycl said:
Can you help me,how do you get the symlinks and permissions from the system.img;
Thank you very much,I searched this issue long time
Click to expand...
Click to collapse
Try running that command and see the output. It's been a long time, I don't quite remember right now. Try looking into cloudyfa's ROM zip, it might help
raulx222 said:
Try running that command and see the output. It's been a long time, I don't quite remember right now. Try looking into cloudyfa's ROM zip, it might help
Click to expand...
Click to collapse
Thank you very much,I will try it!
U can use SuperR kitchen

[DUAL_BOOT]Dual booting an android phone with an extrrnal SD card

So here you come. To read and perform this tutorial, you obviously need a first hand experience on flashing a ROM and/or kernels. Otherwise this tutorial and my efforts to get you a device with two OSes running might end up giving you a bricked device. So, if you're hearing the terms "flashing" or 'kernels' for the first time and thinking it's kinda good food, then bro, just go and taste those first.
Something's to remind before we gonna dig deep into this tutorial->
1> Noone but you will be responsible for what you end up with.
2> The warranty of your device will be voided after this if it isn't already after rooting. For MI users, the good news is that you can reclaim it by just flashing the fastboot ROM for your device.
Enough lectures. Bro let's get to work.
This you'll be needing =>
1> One working Windows PC(because I doesn't know any replacement of bootimg.exe on any other OS. If you know, then let me).
2> A class 10 memory card ( I recommend 32GB for the spaces)
3> A custom ROM and kernel for your phone(the second os)
4> Any custom CWM based recovery installed.(since TWRP is most popular, I will demonstrate using it. You can use any other you want overall process will be the same)
5> ADB, fastboot and the device drivers (easily found in XDA)
PART 1: MODIFYING THE BOOT
At first, how does your device boots up? What are the partitions called /data and /system? The answer is quite simple. It's your kernel that points out the location from where the OS should be picked up. So for booting into the second OS we need some modifications to it at first.
Search and download bootimg.exe on XDA, I'll post a link later. Create two folders. Name them "Internal OS" and "External OS" respectively. Put the zip file of the OS you're currently using to the first one and the OS you're gonna use on the external storage to the second one. Rename the second OS to originalExternalOS.zip. Extract originalExternalOS.zip. Pick the boot.img file from the root of the extracted folder and move it to a new folder named "boot2". Extract the IMG using bootimg.exe. Navigate to the initrd folder and you will get a file named 'fstab".
Basically it's the file that tells the kernel which partition does the OS resides in.
Open the file in your favourite text editor.
Replace every instance of the first line with the second one:
/dev/block/bootdevice/by-name/system => /dev/block/mmcblk1p2
/dev/block/bootdevice/by-name/userdata => /dev/block/mmcblk1p3
/dev/block/bootdevice/by-name/cache => /dev/block/mmcblk1p4
Save the file without giving any extension to it. Repack it using the same tool. You'll have boot-new.img and boot-old.img. Rename boot-new.img to boot.img and replace the one in the root folder with this. Basically what we're doing here is replacing the old boot.img with the modified one.
For your knowledge, blocks are the partitions of any storage you have on your device. For example, your internal storage is partitioned to near about 30 different blocks each starting with prefix "mmcblk0p". We here just told the kernel to load the OS from the blocks mentioned. We'll be creating these blocks in the external SD card next.
PART 2: PARTITIONING THE SD CARD
Connect your device with the memory card inserted to your PC. If you haven't installed fastboot, ADB, and the drivers, do it now.
READ THE FOLLOWING CAREFULLY
Reboot the device to recovery mode. Type the commands in cmd:
Code:
adb shell
parted
unit MB
print
quit
umount external_sd
Read and store the minimum and maximum capacity of your card. Since different cards will have different capacities I will point it as variable MIN_SIZE and MAX_SIZE. You'll need to calculate and put the values in the commands. Now type the following commands on cmd:
Code:
parted /dev/block/mmcblk1
rm 1
//START_BLOCK = MAX_SIZE - 5000
mkpartfs primary fat32 MIN_SIZE START_BLOCK
//SYS_START = START_BLOCK+1
//SYS_END = SYS_START + 1200
mkpartfs primary ext2 SYS_START SYS_END
//DATA_START = SYS_END+1
//DATA_END = DATA_START + 3500
mkpartfs primary ext2 DATA_START DATA_END
//CACHE_START = DATA_END + 1
mkpartfs primary ext2 CACHE_START MAX_SIZE
//We have partitioned the memory card. Let's format them. Ignore all "Do you wish to continue" question in the next commands as we're already mentioning yes.
mkfs yes 1 fat32
mkfs yes 2 ext2
mkfs yes 3 ext2
mkfs yes 4 ext2
quit
//Now they are almost ready. Just make the newly created blocks readable by the OS.
make_ext4fs /dev/block/mmcblk1p2
make_ext4fs /dev/block/mmcblk1p3
make_ext4fs /dev/block/mmcblk1p4
//Now you get where does the blocks come in the kernel right?
exit
//You've covered up the hardest part. Let's get some coffee and cheeerssss.
PART 3: MODIFYING THE NEW OS
You've left the OS extracted in the "External OS" folder right? It's time to do some magic in it. We're gonna tell the OS to be installed in the blocks we created just like the kernel. But wait, where does the OS know before installing where it should get installed? Well, the answer hides in the updater-script in the folder META-INF > com > google > android. Navigate yourself in it. Open the updater-script file in your favourite editor ( I use notepad++ ) and modify it in the same way as the kernel.
Replace every instance of the first line with the second one:
/dev/block/bootdevice/by-name/system => /dev/block/mmcblk1p2
/dev/block/bootdevice/by-name/userdata => /dev/block/mmcblk1p3
Leave the /dev/block/bootdevice/by-name/boot as it's the fundamental block and we can't replicate it. Don't think for the /cache partition as we've already done that in the boot.img file. Now navigate to the root of the folder where you extracted the External OS. Select all files, add them to a zip file using WinRAR. Name the file to newOS.zip. Open newOs.zip and originalExternalOS.zip with WinRAR and compare them if you find any change in the folder tree. They must and they should be exactly the same. You're 80% done.
PART 4: MODIFYING THE RECOVERY
We often flash many zips including very popular Xposed and other mods to our OS right? They also look for the /system partition. So what are we gonna do? Modifying each of them? Nah. Let's modify where they get which one the /system is. The recovery. Extract the img of the recovery you're using with the same bootimg.exe. Modify exactly the same things. I.e.
Replace every instance of the first line with the second one:
/dev/block/bootdevice/by-name/system => /dev/block/mmcblk1p2
/dev/block/bootdevice/by-name/userdata => /dev/block/mmcblk1p3
/dev/block/bootdevice/by-name/cache => /dev/block/mmcblk1p4
in the following files : initrd/fstab.qcom
initrd/etc/recovery.fstab
initrd/etc/twrp.fstab(For TWRP only)
Save them. Repack. And you got your recovery-new.img and recovery-old.img. Put recovery-new.img and newOS.zip in the same folder. Now wake up, it's time for some action.
PART 5 : INSTALLING THE OS
Open cmd in the folder where newOS.zip resides. Reboot the devixe in fastboot mode. Type the following commands:
Code:
adb push newOS.zip external_sd
fastboot flash recovery recovery-new.img
fastboot boot recovery
Now your device should boot up in recovery mode. To check if everything has gone fine mount system using TWRP. Use twrp's built in file manager and navigate to system folder. It's empty? Yup. You've done a great job. Now flash the newOS.zip using TWRP and your device should boot up in the new OS. To cross check again remove the SD card and try to boot. If you're headed towards recovery or bootloop after that then it's a win. Put the SD card back again and watch the new OS to boot.
PART 6: SWITCHING BETWEEN THE TWO
Extract the boot.img from the "Internal OS" zip file and put it together with recovery-old.img. To check if your old system is untouched type the following commands in fastboot mode:
Code:
fastboot flash recovery recovery-old.img
fastboot flash boot boot.img
fastboot boot system
Your device should take you back to the old one. Surprised? Now let's make a switch between the two. There are two methods.
METHOD 1: USING FLASHIFY
Create two folders in your SD card. Put boot.img and recovery-old.img to one and boot-new.img and recovery-new.img to the other. To switch to the external OS, just flash boot-new.img as boot and recovery-new.img using flashify. Ignore reboot now dialog and reboot directly to the system. To go back, first install flashify in the new OS and flash boot.img and recovery-old.img. Easy right?
METHOD 2: USING ZIPS
I'm gonna tell you that tomorrow as I can write no more today.
More to come....
CREDITS:
justzzshadz from MIUI forum for this revolutionary concept. @iamsubhranil for adding TWRP support and rewriting the tutorial.
Unnecessary
Continuation2
........
reserved
For future posts.
reserved
For future posts
"External" is spelled wrong in the title.
God of War™ said:
"External" is spelled wrong in the title.
Click to expand...
Click to collapse
If you read the whole tutorial, then that just doesn't matter
God of War™ said:
"External" is spelled wrong in the title.
Click to expand...
Click to collapse
Have you tried it?
bootimg.exe
"bootimg.exe on any other OS. If you know, then let me)."
please, send bootimg.exe
tim241 said:
Thanks!!
Click to expand...
Click to collapse
Why you quoted the whole post only to say thanks? That thank you button under the post isn't enough?
tim241 said:
Thanks!!
Click to expand...
Click to collapse
Tried?
fstab not found there is a file named fstab.qcom??????
keerten said:
fstab not found there is a file named fstab.qcom??????
Click to expand...
Click to collapse
Try MultiROM man
iamsubhranil said:
Try MultiROM man
Click to expand...
Click to collapse
Ok Bro
iamsubhranil said:
Try MultiROM man
Click to expand...
Click to collapse
Bro, you are working on EFIDROID. Can you give us update that project
abhianand123 said:
Bro, you are working on EFIDROID. Can you give us update that project
Click to expand...
Click to collapse
I've already told it to some people. The project is currently stun for some complications. Will resume.
Pretty useful. Thanks a lot.
Am I right, that when the memory chip on the motheboard holding /system and /userdata partitions died, I can boot the phone from sdcard using this method? I have HM2014813 variant of Redmi 2.
EDIT: I tried this method but I need to use fastboot boot modified.img to boot my phone. Any ideas how to avoid this step?
tulen_kobi said:
Am I right, that when the memory chip on the motheboard holding /system and /userdata partitions died, I can boot the phone from sdcard using this method? I have HM2014813 variant of Redmi 2.
EDIT: I tried this method but I need to use fastboot boot modified.img to boot my phone. Any ideas how to avoid this step?
Click to expand...
Click to collapse
I too have same problem 0 mb internal stoarage
/sbin/sh: parted: not found
---------- Post added at 03:49 PM ---------- Previous post was at 03:43 PM ----------
warrenlobo said:
I too have same problem 0 mb internal stoarage
/sbin/sh: parted: not found
Click to expand...
Click to collapse
they are missing i guess
warrenlobo said:
I too have same problem 0 mb internal stoarage
/sbin/sh: parted: not found
---------- Post added at 03:49 PM ---------- Previous post was at 03:43 PM ----------
they are missing i guess
Click to expand...
Click to collapse
There is no parted on the device anymore, you need to preparation your sdcard on your computer. Do you use Windows or Linux on your pc?
If Windows try to use: FWUL to partition your sdcard.

Emui 9.1. The system partition does not go in rw

Hello. I installed emui 9.1 on my mate20pro with the dload method. I unlocked the bootloader again and rooted the system with patched recovery. The phone is rooted, but the system partition remains in ro. I have tried various apps to mount the system in rw, but without success. I have also tried some commands found on the net both through adb and emulator, but nothing to do. I have also tried using rootexplorer which has been granted root permissions, but fails to modify anything, nor to insert or delete files within the system folders. What can be done?
ernia66 said:
Hello. I installed emui 9.1 on my mate20pro with the dload method. I unlocked the bootloader again and rooted the system with patched recovery. The phone is rooted, but the system partition remains in ro. I have tried various apps to mount the system in rw, but without success. I have also tried some commands found on the net both through adb and emulator, but nothing to do. I have also tried using rootexplorer which has been granted root permissions, but fails to modify anything, nor to insert or delete files within the system folders. What can be done?
Click to expand...
Click to collapse
it's the new filesystem called erofs (Extendable Read-Only File System)
So there's nothing to do?
Sorry OP if this is off topic , but its about magisk and root in 9.1
I have the "system partition remains in ro" issue too , its annoying yes , but I have a bigger problem
When "rooted" , the phone app ( dialer ), and the contacts app both get broken and crash .. So I have to fastbootflash twrp and lose root to make those apps to work normally again
Anyone with the same problem ?
I need root so I can change and use the font ( I like ) with a magisk module
ernia66 said:
So there's nothing to do?
Click to expand...
Click to collapse
Magisk can already 'replace on the fly' file from /system systemless-y.
It dies already support erofs.
Check Magisk documentations.
There is also a way to mount custom erofs partition....
which is?
ernia66 said:
which is?
Click to expand...
Click to collapse
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
oslo83 said:
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
Click to expand...
Click to collapse
Unfortunately I am not able to do it
:crying:
pvillasuso said:
Sorry OP if this is off topic , but its about magisk and root in 9.1
I have the "system partition remains in ro" issue too , its annoying yes , but I have a bigger problem
When "rooted" , the phone app ( dialer ), and the contacts app both get broken and crash .. So I have to fastbootflash twrp and lose root to make those apps to work normally again
Anyone with the same problem ?
I need root so I can change and use the font ( I like ) with a magisk module
Click to expand...
Click to collapse
use search button pls, you will find the solution already posted
ilos said:
use search button pls, you will find the solution already posted
Click to expand...
Click to collapse
Shhh
Here Rootexplorer paying app does not help writing on erofs partitions...
- Or did you meant something else ?
Magisk Doc. :
https://topjohnwu.github.io/Magisk/
So far, out-of-the-box, Magisk is already ready to replace systemless-ly files and paths on /system easily when used with modules.
-Module just need a a small tweak to add Magisk systemless-ly compatibility to other erofs partitions like /cust
Another way would be to bind or mount...
ilos said:
use search button pls, you will find the solution already posted
Click to expand...
Click to collapse
Wow , what , where ???
I did search but maybe I didnt use the right keywords for such an specific issue
Any extra help , would be very appreciated !
oslo83 said:
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
Click to expand...
Click to collapse
I'd like to create my own partition but I don't know how to do it. Is there any online guide for beginners that I can try?
oslo83 said:
Shhh
Here Rootexplorer paying app does not help writing on erofs partitions...
- Or did you meant something else ?
Click to expand...
Click to collapse
my reply was not for you but for the off topic before my reply: contact, ph app and message force close after root.
as I said, there is already a solution about force close.
Anyway I can only write in /system/etc and some over folders
oslo83 said:
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
Click to expand...
Click to collapse
Hi, I saw that you managed to get a custom erofs partition mounted using magisk. I was wondering if the same could be done for the/product folder because that would allow me to fix the DPI scaling issues found on EMUI 9.0-9.1. Would it be possible to see the code for your magisk module?
Ok, So.
After having a look at what I did with this WorkInProgress...
So far there is 2 main way I thought about and played with:
Method A
A1/
Using the mkfs.erofs tool to make your custom erofs partition and mount it over the original one. (mayne umount it before)
Thanks @ph03n!x for his work on mkfs.erofs.
Thanks @ante0 for his android arm build.
A2/
I did not yet tryed to flash via fastboot or adb these modded erofs images.
Method B
What I'm actually doing is just mounting systemless-y with a magisk module whole folders over erofs one ;
In post-fs-data.sh, I'm doing:
mount -o bind $MODDIR/cust /cust
mount -o bind $MODDIR/version /version
With a ~150MB custom /cust it is working ; It should be tryed/perfected for bigger folders.
Another way, to not replace/spoof the whole folders could be to mount the whole list of custom files at their respective path (-to be tested)
PS: I'm not sure if update-binary module's file should be modded with some:
mount /cust 2>/dev/null
@ line 42
Sources:
https://forum.xda-developers.com/huawei-p30-pro/how-to/erofs-mounting-accessing-img-t3944193
oslo83 said:
Ok, So.
After having a look at what I did with this WorkInProgress...
So far there is 2 main way I thought about and played with:
Method A
A1/
Using the mkfs.erofs tool to make your custom erofs partition and mount it over the original one. (mayne umount it before)
Thanks @ph03n!x for his work on mkfs.erofs.
Thanks @ante0 for his android arm build.
A2/
I did not yet tryed to flash via fastboot or adb these modded erofs images.
Method B
What I'm actually doing is just mounting systemless-y with a magisk module whole folders over erofs one ;
In post-fs-data.sh, I'm doing:
mount -o bind $MODDIR/cust /cust
mount -o bind $MODDIR/version /version
With a ~150MB custom /cust it is working ; It should be tryed/perfected for bigger folders.
Another way, to not replace/spoof the whole folders could be to mount the whole list of custom files at their respective path (-to be tested)
PS: I'm not sure if update-binary module's file should be modded with some:
mount /cust 2>/dev/null
@ line 42
Sources:
https://forum.xda-developers.com/huawei-p30-pro/how-to/erofs-mounting-accessing-img-t3944193
Click to expand...
Click to collapse
I'm rather new to this trying to do something similar on my EMUI9.1 using Magisk, I'm having a problem that i can replace anything in most other folders without much problem like /etc/ for example, but when i try to substitute /vendor/, whatever i put it the folder does not only fail to get substituted, it even disappears from the $MODDIR/system/vendor folder upon restart!
I.e. let's say I create a new file in $MODDIR/system/etc. Upon restart i'm successfully seeing that same file appear /etc.
However when I create a new file under $MODDIR/system/vendor, Upon restart i'm not seeing that under /vendor. ALSO the file is gone from $MODDIR/system/vendor like it was never there.
Any idea what is happening? I've also tried manually mounting in the post-fs-data.sh, where i put the following:
mount -o bind $MODDIR/system/vendor /vendor
That actually caused my system to freeze on the loading screen. I had to reset magisk to non-modded settings in order to get it to run again.
Any help's appreciated.
pvillasuso said:
Sorry OP if this is off topic , but its about magisk and root in 9.1
I have the "system partition remains in ro" issue too , its annoying yes , but I have a bigger problem
When "rooted" , the phone app ( dialer ), and the contacts app both get broken and crash .. So I have to fastbootflash twrp and lose root to make those apps to work normally again
Anyone with the same problem ?
I need root so I can change and use the font ( I like ) with a magisk module
Click to expand...
Click to collapse
i got the solution of above problem from this https://forum.xda-developers.com/huawei-p30-pro/how-to/guide-magisk-root-p30-pro-bl-code-t3938285
Hi I have almost the same issue after updating to EMUI 9.1 the phone hardbricked. It only shows as fastboot on my PC I tried flashing but not sending the img files please help

Categories

Resources