Related
Hi there,
I just found catherall's thread on [how to boot CM 7.1 from the external SD card][0] on a Desire Z/G2 with the infamously fried eMMC.
I used his instructions to boot CM 7.2 (the last stable version for the Vision); since the above thread ends with a dangling question on how to update the system to be booted, I thought I'd document my efforts.
anonymousthing said:
anybody know what system.img format he is using?
Click to expand...
Click to collapse
It's just an ext4 file system:
Code:
$ file system.img
system.img: Linux rev 1.0 ext4 filesystem data, UUID=b4db3ed8-7d52-46a0-85fb-46fb67c5e837 (needs journal recovery) (extents) (huge files)
$ adb shell
~ # mount | grep system
/dev/block/loop0 on /tmp/boot.img-ramdisk/system type ext4 (rw,nodev,noatime,nodiratime,nouser_xattr,commit=19,barrier=0,data=ordered)
Disclaimer: On the original image, `file` actually identifies the FS as a `mounted or unclean` ext2; it's definitely an ext4 with journaling, though. Accordingly a `mount -t ext2` will fail with a `wrong fs type`.
You can create a new one with
Code:
$ dd if=/dev/zero of=system.img bs=4k count=64000
$ /sbin/mkfs.ext4 system.img
# mount -o loop -t ext4 system.img /media/new_sys
anonymousthing said:
I have tried making my own system.img from the rom but it does not work
Click to expand...
Click to collapse
This is potentially due to missing binaries:
Code:
$ diff -r /media/orig_sys update-cm-7.1.0-vision-signed/system | head -n 5
Only in /media/orig_sys/bin: cat
Only in /media/orig_sys/bin: cmp
Only in /media/orig_sys/bin: date
Only in /media/orig_sys/bin: dd
Only in /media/orig_sys/bin: dmesg
If you download a version of CM, at least the `toolbox` and the `busybox` binaries will be missing from the `system/bin` and `system/xbin` directories respectively. I couldn't be bothered to check for up-to-date versions but just copied the ones provided by catherall before copying over the new CM version:
Code:
# cp -r /media/orig_sys/bin /media/orig_sys/xbin /media/new_sys
# cp -r cm-7.2.0-vision/system/* /media/new_sys
This will obviously update all the files that come with CM 7.2 and just keep what's not included in the box.
While you're at it, you might want to add up-to-date gapps:
Code:
# cp -r gapps-gb-20131214-signed/system/* /media/new_sys
This gives you a booting CM 7.2. Just replace the `system.img` that comes with catherall's `.zip` with the one you just created and off you go
Unpleasant issue: Booting from SD seems to require a specifically prepared kernel, so the `boot.img` that comes with a different ROM/CM version won't work. So until someone finds out how to prepare a kernel for booting from SD, you will have to continue to boot the one provided by catherall. However, the WIFI driver has not been compiled into the kernel but lives in a separate kernel module in `/system/lib/modules/bcm4329.ko`. Which we (by copying over the `/system` dir from the CM 7.2 build) replaced with a version incompatible with the old kernel we have to boot. So if you intend to boot through `fastboot` and use WIFI (and why wouldn't you? ;P), we will have to put the old kernel module back:
Code:
# cp /media/orig_sys/lib/modules/bcm4329.ko /media/new_sys/lib/modules/
Weirdly enough, in the CM 7.2 version I downloaded, the permissions for the `dhcpd-run-hooks` script were broken, so I at least needed to fix those too:
Code:
# chmod 550 /media/new_sys/etc/dhcpd/dhcpd-run-hooks
So, `umount` your pristine new `system.img`, move it to your SD card and boot into CM 7.2.
HTH
D.
PS I naively tried to create a larger 1 GB `data.img`, copying over the content from the existing one, but the phone didn't boot with that one. I might have made a mistake (was rather late at that point -.- and I didn't investigate any further), but it seems like the size of the partitions may be hardcoded somewhere. If someone has any additional information, please let me know Thx!
PPS If anyone ([MENTION]@catherall[/MENTION]? ;P) knows anything about the kernel issue, I'd be highly interested
PPPS After creating this account (to be fair, I've been profiting from this community since the old Windows Mobile days), I was informed that as an account noob, I obviously didn't have anything to contribute to this community and was ordered to place my undoubtedly profane question (which certainly had been answered may times before, I was only too lazy/dumb to search) outside the elite developer forums [/rage]. Maybe one of the Mods can stitch the [original thread][0] and this st0pid workaround back together again? :/ Thanks!
[0]: http://forum.xda-developers.com/showthread.php?t=1572924
Download or cook the PRE-ROOTED firmware for ATV580 (Mygica/Geniatech) Rockchip RK3188 ARM Cortex A9 x 4 CPU.
DOWNLOAD ROM - [ROOTED & CLEAN]
Mygica ATV580 Tazpown Firmware (Build 20131213.20140309):
- Download: ATV580.Tazpown.Firmware.Build-20131213.20140309.zip -
Build Information:
Android 4.2.2 Quad Core Enjoy TV Box
Build Number: 20131213.20140309
Release Date: 2014-03-09
Based Mygica Official Build 20131213.102000
Click to expand...
Click to collapse
Change log:
1.) Based on Mygica Official Build 20131213 Android 4.2.2 (Quad Core Enjoy TV Box)
2.) Removed most Chinese and unnecessary or obsolete applications.
3.) Added su (SuperSU v1.93 06.02.2014) and busybox (Busybox defconfig build for 1.21.1 armv71) Android Rooting Utilities.
4.) Switched External SDCard (up to 32GB) with Internal Flash (only 2GB) Memory. Tested: moving apps to SDCard OK!. You should have an micro SD card inserted on your device.
5.) Fixed Black Screen when playing video with Youtube App.
Click to expand...
Click to collapse
Installation Tips:
For a complete information about how install this rom image, scroll down to the bottom of the post.
COOK YOUR OWN CUSTOM FIRMWARE FOR MYGICA ATV580 - DIY!
You can watch the full tutorial process on this video (this video is a little help, the complete steps its only here in this post).
https://www.dropbox.com/s/88330vv1q3p1pzu/Mygica580-custom-firmware.mov
Original Non-Rooted Mygica Latest ATV580 Stock Firmware (official):
http://www.mygicausa.com/boards/search?searchterms=atv580
Based Mygica Official Build 20131012 Android 4.2.2: https://www.dropbox.com/s/kopamtzdr7gv63d/update20131012.img
Based Mygica Official Build 20131213 Android 4.2.2: https://www.dropbox.com/s/36rkjlf98k47uyc/update20131213.img
1. [ON WINDOWS] Extract Rocket Firmware with imgRePackerRK 1.04
imgRePackerRK RockChip's firmware images (*.img) unpacker/packer. Version 1.04 Windows & Linux
http://forum.xda-developers.com/showthread.php?t=2257331&page=2.
How to unpack a firmware IMG (Windows):
1. Obtain firmware IMG [update.img] and imgRePackerRk [above]
2. Extract imgRePackerRk
3. Open command prompt in directory containing imgRePackerRk.exe [hold shift, right click > "open command window here"]
4. Type "imgRePackerRk.exe {IMG_name}.img" [e.g. "imgRePackerRk.exe update.img"]
5. A new directory called "{IMG_name}.img.dump" [e.g. "update.img.dump"] will be created, containing individual IMGs (system.img)
2. [ON UBUNTU] Mount system.img on Ubuntu and mofify!
Code:
sudo mount -t ext4 system.img system-folder -o loop
2.1. [ON UBUNTU] Rooted Android Firmware.
We use SuperSU. You can get SU and BUSYBOX commands from another Android Distribution compatible with RK3188 devices.
In this case we obtained root commands bin/su bin/busybox and xbin/su Rocket 3188 firmware root tools:
RK3066/RK3188 Development Kitchen/Tool by Rockchipfirmware.com/TNT/FMA
You can also get su and busy box commands from:
Minix Neo X7 Custom Firmware
Code:
[email protected]:~/atv/rk3XXX_mod_tool/ref/bin# cp su ~/atv/system-folder/bin/
[email protected]:~/atv/rk3XXX_mod_tool/ref/bin# cp busybox ~/atv/system-folder/bin/
[email protected]:~/atv/rk3XXX_mod_tool/ref/xbin# cp su ~/atv/system-folder/xbin
Code:
#!/bin/bash
#add needed files
sudo cp -fap ~/atv/rk3XXX_mod_tool/ref/bin/su system-folder/bin/su
sudo cp -fap ~/atv/rk3XXX_mod_tool/ref/xbin/su system-folder/xbin/su
sudo cp -fap ~/atv/rk3XXX_mod_tool/ref/bin/busybox system-folder/bin/busybox
#set permissions
sudo chown root:root bin/su
sudo chmod 6755 bin/su
sudo chown root:root bin/busybox
sudo chmod 6755 bin/busybox
sudo chown root:root xbin/su
sudo chmod 6755 xbin/su
This is everything you need for rooting the system. Later you can download SuperSu from Android Play Store Official.
2.2.- [ON UBUNTU] Removed most Chinese and unnecessary or obsolete applications.]
Code:
system-folder/app/
Code:
rm -rf com.waxrain.airplayer-1.apk
rm -rf eHomeMediaCenter_box.apk
rm -rf Facebook_299369.apk
rm -rf flashplayer
rm -rf Music.apk
rm -rf QuickSearchBox.apk
rm -rf RkApkinstaller.apk
rm -rf RkExplorer.apk
rm -rf RKGameControlSettingV1.0.1.apk
rm -rf RkVideoPlayer.apk
rm -rf WifiDisplay.apk
rm -rf youtube_5.0.21.apk
If you really need some of these apps, I packet them into a zip file so you can install them easily as you need:
Download: Official Mygica Firmware Deleted Apps
2.3. [ON UBUNTU] Modify vold.fstab to mount external_sd to REAL sdcard, so you can get more space for your Apps.
VERY CAREFUL WITH THIS!! Just locate duplicate, comments old lines (for security) and modify:
Code:
/etc# vi /etc/vold.fstab
Code:
#dev_mount flash /mnt/sdcard auto /dev/block/mtd/by-name/user
#dev_mount sdcard /mnt/external_sd auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0
dev_mount flash /mnt/sdcard auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0
dev_mount sdcard /mnt/external_sd auto /devices/virtual/mtd/mtd9/mtdblock9
To make the externalised writable, you must edit "platform.xml", from "/etc/permissions" adding in "android.permission.WRITE_EXTERNAL_STORAGE" this: <group gid="media_rw" /> Like this:
Code:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>
2.4. [ON UBUNTU] FIX Youtube black screen (only audio) on build update.img (UPDATE 20131213)
Edit build.prop file, in order to fix Youtube black screen when playing videos:
Code:
sys.browser.use.overlay = 1
2.5. [ON UBUNTU] Umount Custom System folder (system.img) and copy again to Windows.
Umount system image (system.img) and copy back to windows machine, to repack with imgRePackerPk utility:
Code:
umount system-folder/
3. [ON WINDOWS] Build again the new custom firmware
How to repack a firmware IMG (Windows) [Assuming you have followed above to unpack]
1. Open command window in directory containing imgRePackerRk.exe and *.dump directory
2. Type "imgRePackerRk.exe {dump_name}.dump" [e.g. "imgRePackerRk.exe update.img.dump"]
3. New firmware IMG will be created [name will be name of .dump directory without .dump extension]
4. INSTALL ROM ON DEVICE (update.img)
Put the cooked update.img on USB or SDCard, and insert it on Mygica ATV580, then you can apply the update automatically. Your device will reboot and the firmware update will start. The Mygica Bootloader will search for a file called update.img automatically on external_sd micro sdcard. So you should have an micro sdcard inserted on the device.
IMPORTANT: If the Mygica Bootloader show an error like update.img not found when it try to start update process. Probably is because of switched external_sd with internal flash sdcard, probably the updater bootloader won't find the update.img firmware when reboot. This has a simple solution, just manually copy update.img to both, external_sd and sdcard directory. You should need an good tool like Solid Explorer (available en Android Play Store).
IMPORTANT: If the previous method doesn't help you to install the update.img. You can use an editor to switch back to the original mount external_sd and flash sdcard points in /etc/vold.fstab. You should revert the changes on this file. You should need an good tool like Solid Explorer (available en Android Play Store).
IMPORTANT: Before Install this Rooted Original Firmware, remember it is better to RESET DEVICE, so you can make a brand new install cleaning all data files from the previous firmware.
IN CASE OF EMERGENCY (ALTERNATIVES TO SAVE A BRICKED ATV580)!
In case of you brick your ATV580, there is a way to recover it from the dead... Using Android Recovery System. I don't have the full firmware ready for this, but I made some research about how create FLASEABLE ZIP IMAGES for Android Recovery System. So the trick is create a Flashable Zip with our native update.img firmware inside.
To start Android Recovery System, boot ATV580 use a simple clip putting it on a small hole button located an the bottom of the device and connect power supply at the same time during about 5 seconds. Then you can get into this mode, you can use your remote to navigate the menu. In this mode you can load Flasheable Zip loading this files from Computer to SDCARD reader and then to your device.
- Tools and Samples to Build a Flasheable Zip for Android Recovery System (Save your ATV580) rksigner_tazpown-20140324.zip -
This packet include a sample of flasheable zip for Mygica ATV580 that restore build.prop file from a damaged one, which causes the system boot loop and bricked.Just copy the signed Flasheable Zip and use System Recovery System to load it. This flasheable zip fix the system. If you know the problem or you have enough experience to put a right copy of update.img on Flasheable Zip, you can save any bricked or boot loop device, with this tools. You have more docs and information inside of this package.
Screenshots during the flashing process for the sample flashing included in the tools:
- Android Recovery System
- Android Recovery System Flashing my own Flasheable ZIP
Thanks! Dont Forget To PRESS THANKS Button :good:
If you like my work, please consider to invite me a cup of coffee here!
Hi! You really cool! Thanks a lot!
One question - do you fix it for supporting native 1080p resolution?
jalcot said:
Hi,
finally you can download or cook the PRE-ROOTED firmware for ATV580 (Mygica/Geniatech) Rockchip RK3188 ARM Cortex A9 x 4 CPU.
Thanks!
Click to expand...
Click to collapse
Many thanks for all the work!
I need rooted IMG file.. Somebody help me.. I don't have a PC to cook rom..thanks a lottt
Sent from my rk31sdk using Tapatalk
timothypham said:
I need rooted IMG file.. Somebody help me.. I don't have a PC to cook rom..thanks a lottt
Sent from my rk31sdk using Tapatalk
Click to expand...
Click to collapse
Be parient. I fixed the problem when swap sdcard and flash make it writable. but now I have another problem. When I move apps to SDcard these apps dissapear. I am working arround the solution.
I will get the ROM perfect very very soon.
jalcot said:
Be parient. I fixed the problem when swap sdcard and flash make it writable. but now I have another problem. When I move apps to SDcard these apps dissapear. I am working arround the solution.
I will get the ROM perfect very very soon.
Click to expand...
Click to collapse
Thanks for hard working jalcot. I'm waiting your room with root. I buy ATV580 3 months ago, and can't root it...wait your room.. Thanks again.
Sent from my rk31sdk using Tapatalk
jalcot said:
Be parient. I fixed the problem when swap sdcard and flash make it writable. but now I have another problem. When I move apps to SDcard these apps dissapear. I am working arround the solution.
I will get the ROM perfect very very soon.
Click to expand...
Click to collapse
Thanks for keeping working on it!
Jalcot...where are you... I still waiting you...
Sent from my rk31sdk using Tapatalk
timothypham said:
Jalcot...where are you... I still waiting you...
Sent from my rk31sdk using Tapatalk
Click to expand...
Click to collapse
Yes, thank you for your patient... I've worked hard to cook a perfect clean ROM...
pokatusher said:
Hi! You really cool! Thanks a lot!
One question - do you fix it for supporting native 1080p resolution?
Click to expand...
Click to collapse
Yes! With the new XBMC Gotham Beta I was watching MKV 1080p Movies on my home streaming.
Jalcot...love you so much..you save my Atv... i hate Android no root... i will download rom tonight... thanks your hard work...thank Jalcot again....
Sent from my HTC Sensation using Tapatalk
Great rom Jalcot...thanks so muchhhhhh
Sent from my rk31sdk using Tapatalk
---------- Post added at 12:23 PM ---------- Previous post was at 12:04 PM ----------
I can't use Phone Remote Control Service .. Are you remove it, Jalcot
Sent from my rk31sdk using Tapatalk
timothypham said:
Great rom Jalcot...thanks so muchhhhhh
Sent from my rk31sdk using Tapatalk
---------- Post added at 12:23 PM ---------- Previous post was at 12:04 PM ----------
I can't use Phone Remote Control Service .. Are you remove it, Jalcot
Sent from my rk31sdk using Tapatalk
Click to expand...
Click to collapse
I think so... It is RKGameControlSettingV1.0.1.apk or maybe eHomeMediaCenter_box.apk?
Don't worry, I packed all deleted official apps from the Original Firmware so you can install them easily as you need... You can download them.
Thank so much.. Jalcot..
Sent from my rk31sdk using Tapatalk
I need CWM to install some MOD... Where got it, Jaclcot
Sent from my rk31sdk using Tapatalk
jalcot said:
Yes! With the new XBMC Gotham Beta I was watching MKV 1080p Movies on my home streaming.
Click to expand...
Click to collapse
Launch Antutu and see in System Information real resolution of output, please.Or install small ultility like this and send screenshot
Help me..
Jalcot... can you help me.. plz reup stock firmware for me..
I install PurePerfomes and big bug.. No wifi, no Ethernet detected.. I rollback to your rom but it still bug.. no wifi, no Ethernet... i can't do anything... i hope instal stock firmware will save me...
I can't reinstall your ROM.. I restore factory but it nothing fix.. WiFi and Ethernet is gone... With with me hixhix
Sent from my HTC Sensation using Tapatalk
Everything I have... Not file browser... My ATV is die...
Sent from my HTC Sensation using Tapatalk
Love the clean rooted Rom, many thanks!
Also great job on the internal/external card swap
Gotham latest nightly is still choppy with 1080p content I have but Beyond xbmc 3.3 works great
Thanks Jalcot!
I didn't see anything about how to convert to f2fs for the nexus 6 so I thought i'd write something up as somebody requested me to do this.
What are the benefits of using f2fs over ext4?
I could list pros and cons, but I strongly encourage you to do your own research on the matter.
Should I do this
If you want to at your own risk
Pre-requisites
You need a recovery that supports f2fs in kernel and has the f2fs tools. Dhacker20 has provided one (TWRP 2.8.5.0) here: https://twitter.com/dhacker29/status/568070387306766336
You will need a kernel that supports f2fs for /cache and /data (Obviously I recommend Zen Kernel, but there are some others. Zen has the newest f2fs from upstream, while others may not)
ONLY YOU ARE RESPONSIBLE FOR YOUR DATA. IT IS YOUR RESPONSIBILITY TO UNDERSTAND THE RISKS AND YOUR RESPONSIBILITY TO BACKUP YOUR DATA
How-To
1.) Back up everything you care about to your PC (everything will be erased, including sdcard)
2.) Install a kernel that supports f2fs. Get the boot.img and do "fastboot flash boot boot.img" in bootloader (Like Zen)
3.) Install the recovery with f2fs support (fastboot flash recovery twrp-recvery-f2fs.img)
4.) In TWRP, go to Wipe
5.) Do a full wipe by swiping right
6.) Go to Wipe -> Advanced Wipe
7.) Choose /cache
8.) Choose "Change Filesystem"
9.) Pick f2fs, proceed
10.) Do the same thing for /data
11.) While still in recovery, plug phone into PC and do this:
Code:
# adb shell
# mount -o rw /system
# cp /sbin/fsck.f2fs /system/bin/
# cp /sbin/mkfs.f2fs /system/bin/
# chmod a+x /system/bin/*f2fs*
12.) Reboot and you are done.
Reserved
Is adb shell in terminal app
jiv101 said:
Is adb shell in terminal app
Click to expand...
Click to collapse
No adb is part of the android SDK platform-tools
I did this a while ago (except for step 12), and I remember something happening, which caused my data partition to become corrupted. I tried to format the partition again using ext3 or whatever the default is and that ended up giving me a soft brick. I had to restore the factory software. I have read things of where it does improve R/W speeds but I don't know if it's worth the hassle of possibly losing everything at the drop of a hat if you flash ROMs often.
RSVP..
Thanks for the information on F2FS well needed..!
brando56894 said:
I did this a while ago (except for step 12), and I remember something happening, which caused my data partition to become corrupted. I tried to format the partition again using ext3 or whatever the default is and that ended up giving me a soft brick. I had to restore the factory software. I have read things of where it does improve R/W speeds but I don't know if it's worth the hassle of possibly losing everything at the drop of a hat if you flash ROMs often.
Click to expand...
Click to collapse
The last step is a huge component of the whole process. If the rom doesn't have f2fs-tools in by default (most don't have fsck.f2fs/mkfs.f2fs) you will not have standard integrity checking every time you boot like you do on ext4. If you do the last step you will get integrity checking every time you bootup.
Also, since f2fs is a relatively young file system it can do harm to revert to older versions of the file system. For example, zen kernel has the newest f2fs which was updated last about 2 days ago. If you go on stock kernel you will find an f2fs that is 1+ year old. There may be a compatibility issue between these two where if you flash different roms (which almost always bundle a kernel)/kernels you will almost certainly have an issue.
But that's all part of the risk with using a relatively young file system. I do not understate the risks of data corruption in doing something like this - but anybody who is doing this and has significant worry should take precautions is backing up all their important files.
bbedward said:
The last step is a huge component of the whole process. If the rom doesn't have f2fs-tools in by default (most don't have fsck.f2fs/mkfs.f2fs) you will not have standard integrity checking every time you boot like you do on ext4. If you do the last step you will get integrity checking every time you bootup.
Also, since f2fs is a relatively young file system it can do harm to revert to older versions of the file system. For example, zen kernel has the newest f2fs which was updated last about 2 days ago. If you go on stock kernel you will find an f2fs that is 1+ year old. There may be a compatibility issue between these two where if you flash different roms (which almost always bundle a kernel)/kernels you will almost certainly have an issue.
But that's all part of the risk with using a relatively young file system. I do not understate the risks of data corruption in doing something like this - but anybody who is doing this and has significant worry should take precautions is backing up all their important files.
Click to expand...
Click to collapse
Is there any sort of confirmations when you are doing the last steps? I see this when I do them and I'm not sure if it has actually done the last steps.
C:\Development\platform-tools>adb shell
~ # ←[6nmount -o rw /system
mount -o rw /system
~ # ←[6ncp /sbin/fsck.f2fs /system/bin/
cp /sbin/fsck.f2fs /system/bin/
~ # ←[6ncp /sbin/mkfs.f2fs /system/bin/
cp /sbin/mkfs.f2fs /system/bin/
~ # ←[6nchmod a+x /system/bin/*f2fs*
chmod a+x /system/bin/*f2fs*
~ # ←[6n
C:\Development\platform-tools>
lobrau said:
Is there any sort of confirmations when you are doing the last steps? I see this when I do them and I'm not sure if it has actually done the last steps.
C:\Development\platform-tools>adb shell
~ # ←[6nmount -o rw /system
mount -o rw /system
~ # ←[6ncp /sbin/fsck.f2fs /system/bin/
cp /sbin/fsck.f2fs /system/bin/
~ # ←[6ncp /sbin/mkfs.f2fs /system/bin/
cp /sbin/mkfs.f2fs /system/bin/
~ # ←[6nchmod a+x /system/bin/*f2fs*
chmod a+x /system/bin/*f2fs*
~ # ←[6n
C:\Development\platform-tools>
Click to expand...
Click to collapse
That's about it, you can type exit to get out of adb shell or just close it.
On your device you can make sure f2fs took by simply typing "mount" in terminal emulator. You should see you data and cache reads f2fs now.
lobrau said:
Is there any sort of confirmations when you are doing the last steps? I see this when I do them and I'm not sure if it has actually done the last steps.
C:\Development\platform-tools>adb shell
~ # ←[6nmount -o rw /system
mount -o rw /system
~ # ←[6ncp /sbin/fsck.f2fs /system/bin/
cp /sbin/fsck.f2fs /system/bin/
~ # ←[6ncp /sbin/mkfs.f2fs /system/bin/
cp /sbin/mkfs.f2fs /system/bin/
~ # ←[6nchmod a+x /system/bin/*f2fs*
chmod a+x /system/bin/*f2fs*
~ # ←[6n
C:\Development\platform-tools>
Click to expand...
Click to collapse
Nope, it will only inform you if something went wrong (like file not found) of it all went through with no error it worked.
After you bootup you can verify it worked by typing "mount" in adb shell or terminal emulator. It should say f2fs on /data and /cache. Also in something like root Explorer if you navigate to /system/bin you should see the files you copied (fsck.f2fs and mkfs.f2fs)
bbedward said:
Nope, it will only inform you if something went wrong (like file not found) of it all went through with no error it worked.
After you bootup you can verify it worked by typing "mount" in adb shell or terminal emulator. It should say f2fs on /data and /cache. Also in something like root Explorer if you navigate to /system/bin you should see the files you copied (fsck.f2fs and mkfs.f2fs)
Click to expand...
Click to collapse
Perfect thanks for the quick response looked like it worked. Just out of curiosity is there any reason to format system to f2fs or does it end up causing issues, or just no changes in use?
lobrau said:
Perfect thanks for the quick response looked like it worked. Just out of curiosity is there any reason to format system to f2fs or does it end up causing issues, or just no changes in use?
Click to expand...
Click to collapse
I've tested it partly in testing the newest f2fs Zen merges as well as just general f2fs testing before.
It seems like writes are a bit faster, especially sql stuff. I've seen some grossly huge benchmark differences on other devices - on the n6 I've seen improvements but nothing astronomical like those benchmarks portrayed (I presume the 200% increase in write performance they showed is not accurate regardless) .
Recovery
So currently I'm on a 5.1 stock based rom (sinless) and TWRP 2.8.6
HAve Downloaded the latest Zen Kernel, and am downloading the latest 5.1 Benzo Rom.
Am I going to have issues rolling back to a 2.8.5 recovery - does 2.8.5 support 5.1 based roms?
shaitan667 said:
So currently I'm on a 5.1 stock based rom (sinless) and TWRP 2.8.6
HAve Downloaded the latest Zen Kernel, and am downloading the latest 5.1 Benzo Rom.
Am I going to have issues rolling back to a 2.8.5 recovery - does 2.8.5 support 5.1 based roms?
Click to expand...
Click to collapse
Yea it's compatible. There isn't a 2.8.6 with f2fs support yet that I know if and I haven't had the time to make one myself, but the 2.8.5 one works just fine.
@bbedward
I didn’t know any about the part 11 (I mean I convert mine to F2FS before I read this) so I’m wondering I’m gonna face any problem or not?
And also if have to do it, can I do it now or I have to wipe everything and then do it (cause changing partition to F2FS will clean everything)
Also I’m on your kernel.
dany20mh said:
@bbedward
I didn’t know any about the part 11 (I mean I convert mine to F2FS before I read this) so I’m wondering I’m gonna face any problem or not?
And also if have to do it, can I do it now or I have to wipe everything and then do it (cause changing partition to F2FS will clean everything)
Also I’m on your kernel.
Click to expand...
Click to collapse
Every time you boot your phone, it automatically runs fsck (for ext4 on stock). Essentially it's an automatic integrity check and repair.
So if it finds issues at boot up in the file system, it will tend to fix them automatically. If you look at boot up logs currently you will probably see something like "/system/bin/fsck.f2fs not found skipping integrity check"
You don't have to wipe everything though, you can just install the tools now.
I'm almost happy I posted this now hopefully it saves a few filesystems for folks who didn't do it completely.
---
When you see a kernel say f2fs compatible it means:
- f2fs is built into the kernel or a module is provided
- It's ramdisk's fstab allows for mounting of partitions as f2fs. On zen - it supports /data and /cache
When you see a rom say f2fs compatible it means:
- They have an f2fs-compatible kernel included
- They have the f2fs tools in the rom (As step 11 does)
This is why I say in the title this is "Any Rom" compatible as it will work on any rom, while on other devices you may see "Rom x, rom y, and rom z are the only known roms to be fully compatible." If you just do it this way it doesn't matter because it'll make any rom compatible with f2fs.
@bbedward this worked perfectly! But I just want to confirm that it switches back to ext4 after flashing a new ROM? After wiping and doing a clean flash it seems I'm not booting in f2fs anymore.
Am I doing something wrong or will I have to do this every time I clean flash?
Thanks again for the tutorial!
philsfan said:
@bbedward this worked perfectly! But I just want to confirm that it switches back to ext4 after flashing a new ROM? After wiping and doing a clean flash it seems I'm not booting in f2fs anymore.
Am I doing something wrong or will I have to do this every time I clean flash?
Thanks again for the tutorial!
Click to expand...
Click to collapse
I think most likely when you flashed a rom it overwrote your f2fs kernel, which caused it to reformat to ext4 when you booted it up.
Whenever you flash a rom you will need to flash f2fs-kernel right afterwards, and re-copy the tools (step 11) if the rom doesnt have them already in order to keep f2fs.
bbedward said:
I think most likely when you flashed a rom it overwrote your f2fs kernel, which caused it to reformat to ext4 when you booted it up.
Whenever you flash a rom you will need to flash f2fs-kernel right afterwards, and re-copy the tools (step 11) if the rom doesnt have them already in order to keep f2fs.
Click to expand...
Click to collapse
Thanks for responding so soon!
So I did flash zen9 (so good BTW) immediately after but I didn't repeat step 11 again. So that means Chroma doesn't have the necessary files for f2fs, good to know!
Edit: @bbedward does that mean I don't have to reformat again? Just do step 11?
Edit 2: entered step 11 in recovery and now i'm back to f2fs thanks again!
bbedward said:
The last step is a huge component of the whole process. If the rom doesn't have f2fs-tools in by default (most don't have fsck.f2fs/mkfs.f2fs) you will not have standard integrity checking every time you boot like you do on ext4. If you do the last step you will get integrity checking every time you bootup.
Also, since f2fs is a relatively young file system it can do harm to revert to older versions of the file system. For example, zen kernel has the newest f2fs which was updated last about 2 days ago. If you go on stock kernel you will find an f2fs that is 1+ year old. There may be a compatibility issue between these two where if you flash different roms (which almost always bundle a kernel)/kernels you will almost certainly have an issue.
But that's all part of the risk with using a relatively young file system. I do not understate the risks of data corruption in doing something like this - but anybody who is doing this and has significant worry should take precautions is backing up all their important files.
Click to expand...
Click to collapse
That was probably it! It was just a pain because this is the first phone that I've had in a while that doesn't have an SD card, I had a nandroid, but it doesn't do any good if you can't access your data partition Hahaha I have now taken to uploading my nandroids to Google Drive or putting them on my pc just in case that happens.
For those with an A/B device, it can be frustrating to wait for GSI maintainers to build A/B variants. Don't worry, it's not too complicated to port A-only system images to A/B.
The difference that matters is that on A-only images, everything in / such as init.rc is in the ramdisk, which is in the boot partition. On A/B devices, the ramdisk is used for recovery instead, so all those files go on the system partition. This partition is actually mounted at / instead of /system. It functions as both the ramdisk and the system partition. This can actually lead to faster boots.
A/B devices also have a different Chrome OS derived updater that supports seamless OTAs to the other slot, but we won't worry about that.
First of all, you will need Linux. This is because Windows just can't handle the extra data we need to preserve, such as POSIX permissions and SELinux contexts.
You are expected to have experience with command-line tools. This is NOT for newbies. You may need to compile a tool.
Steps:
Download an A/B GSI with the same Android version. We will use this image for the root files. (I was able to use an 8.1 base for a 9.0 system with some patches, but YMMV)
Use the simg2img tool to convert the sparse A/B image to a raw one: simg2img system_arm64_ab.img base_ab_raw.img
Use the same tool to convert the A-only image to raw: simg2img system_arm64_a.img system_a_raw.img
Enter a root shell. This is to avoid any problems with permissions. sudo -s
Create the directories to mount the images on: mkdir /mnt/ab; mkdir /mnt/a
Mount the A/B image with flags rw,noatime: mount -o rw,noatime base_ab_raw.img /mnt/ab
Mount the A-only with flags rw,noatime: mount -o rw,noatime system_a_raw.img /mnt/a
Create a system folder in the A-only image: mkdir /mnt/a/system
Set the SELinux context for the system folder: setfattr -n security.selinux -v ubject_r:system_file:s0 /mnt/a/system
Set permissions for the system folder just in case: chmod 755 /mnt/a/system
Delete the system folder in the A/B image: rm -fr /mnt/ab/system
Copy all the root files from A/B to the A-only image. These exact arguments are important to preserve everything. cp -Raf /mnt/ab/* /mnt/a/
Unmount the A/B image: umount /mnt/ab
Unmount the newly transformed A/B image: umount /mnt/a
Convert the new A/B image to sparse format with img2simg: img2simg system_a_raw.img system_arm64_ab_new.img
Flash and enjoy!
If you encounter any errors, the resulting image will most likely not work.
If you have a device with a small system partition that cannot fit the original A-only image you are trying to convert, it will be necessary to create a new, smaller image for the purpose. To create that new image, follow these steps after the ones above:
Create the new raw sparse image: fallocate -l 2G system_ab_raw_small.img
Create an ext4 filesystem on the new image: mkfs.ext4 system_ab_raw_small.img
Mount the new image: mount -o rw,noatime system_ab_raw_small.img /mnt/ab
Mount the old converted A/B image: mount -o ro system_a_raw.img /mnt/a
Copy all the files: cp -Raf /mnt/a/* /mnt/ab/
Unmount the new image: umount /mnt/ab
Unmount the old image: umount /mnt/a
Convert the new image to sparse: img2simg system_ab_raw_small.img system_arm64_ab_new_small.img
Flash and enjoy!
If there's enough demand, I might make a tool to automate this. Let me know what you think.
kdragon said:
For those with an A/B device, it can be frustrating to wait for GSI maintainers to build A/B variants. Don't worry, it's not too complicated to port A-only system images to A/B.
The difference that matters is that on A-only images, everything in / such as init.rc is in the ramdisk, which is in the boot partition. On A/B devices, the ramdisk is used for recovery instead, so all those files go on the system partition. This partition is actually mounted at / instead of /system. It functions as both the ramdisk and the system partition. This can actually lead to faster boots.
A/B devices also have a different Chrome OS derived updater that supports seamless OTAs to the other slot, but we won't worry about that.
First of all, you will need Linux. This is because Windows just can't handle the extra data we need to preserve, such as POSIX permissions and SELinux contexts.
You are expected to have experience with command-line tools. This is NOT for newbies. You will need to compile a few tools.
Steps:
Download an A/B GSI with the same Android version. We will use this image for the root files. (I was able to use an 8.1 base for a 9.0 system with some patches, but YMMV)
Use the same tool to convert the A-only image to raw: simg2img system_arm64_a.img system_a_raw.img
Create the directories to mount the images on: mkdir /mnt/ab; mkdir /mnt/a
Mount the A-only with flags rw,noatime: mount -o rw,noatime system_a_raw.img /mnt/a
Set the SELinux context for the system folder: setfattr -n security.selinux -v ubject_r:system_file:s0 /mnt/a/system
Delete the system folder in the A/B image: rm -fr /mnt/ab/system
Unmount the A/B image: umount /mnt/ab
Convert the new A/B image to sparse format with img2simg: img2simg system_a_raw.img system_arm64_ab_new.img
Create the new raw sparse image: fallocate -l 2G system_ab_raw_small.img
Mount the new image: mount -o rw,noatime system_ab_raw_small.img /mnt/ab
Copy all the files: cp -Raf /mnt/a/* /mnt/ab/
Unmount the old image: umount /mnt/a
Flash and enjoy!
If there's enough demand, I might make a tool to automate this. Let me know what you think.
Click to expand...
Click to collapse
Ab partition of the device can not install Android p, ask God to make a direct brush into the system. Img
yuzui said:
Ab partition of the device can not install Android p, ask God to make a direct brush into the system. Img
Click to expand...
Click to collapse
I am running the Pie PR1 semi-GSI on my A/B device, tissot, right now. If you mean an AOSP GSI, it's available. https://drive.google.com/open?id=1bY5OIbBcy5OyAGlJ45yQ3MhSa8Bjgwg1
If anyone is interested in a root app to convert images, please vote on the poll.
What about A/B to A ? I want to try CosmicDan's MIUI Treble port on my Redmi Note 4
i have sucessfully converted A TO A/B...but when i flash it ..it doesnt boot just stuck at logo..my device in mi A1...can you please tell me that i need to port this file???
hamzaag49 said:
i have sucessfully converted A TO A/B...but when i flash it ..it doesnt boot just stuck at logo..my device in mi A1...can you please tell me that i need to port this file???
Click to expand...
Click to collapse
What ROM is it? I can try to port it.
Most likely your problem is either SELinux being on Enforcing (change it to Permissive in TWRP -> Advanced -> Tissot Manager) or wrong permissions in the image caused by missing a step.
kdrag0n said:
What ROM is it? I can try to port it.
Most likely your problem is either SELinux being on Enforcing (change it to Permissive in TWRP -> Advanced -> Tissot Manager) or wrong permissions in the image caused by missing a step.
Click to expand...
Click to collapse
I'm porting PPP2 SYSTEM.IMG FROM PIXEL XL
Selinux is permissive
hamzaag49 said:
I'm porting PPP2 SYSTEM.IMG FROM PIXEL XL
Selinux is permissive
Click to expand...
Click to collapse
PPP2? That's the old DP2, I think you mean PPR2 (release 2).
It's already been ported by d0gey, download here: https://space-doge.firebaseapp.com/devices/tissot/firmwares/d142afbd-ee0b-486f-8bf7-ac47abd96090
A plain ported Pixel image without patches wouldn't work is because there's a lot of Pixel specific stuff that needs to be patched to work with other devices' vendors.
This would mean the world for a lot of people, if you really going to automate this
Jordan~Kurniawan said:
This would mean the world for a lot of people, if you really going to automate this
Click to expand...
Click to collapse
If I have some free time I'll take a shot at it.
kdrag0n said:
If I have some free time I'll take a shot at it.
Click to expand...
Click to collapse
thanks a lot.
I'm using a macbook, and I really like to try to convert the MIUI rom (https://forum.xda-developers.com/pr...-only-roms/8-1-miui10-project-treble-t3840198) to an A/B rom for my Oneplus6 (Treble, of course). basically I have 2 questions;
- You mention that you NEED linux, is it linux, or is it actually UNIX? (a.k.a. also do-able with MacOS)
- Given the ROM I want to port is using a backup restore method, is one still able to port it to an AB rom?
Even if my goal is not achievable, thank you for creating a guide on how to port. Sharing dev knowledge is the foundation of what drives people to create custom roms!
Skorm92 said:
I'm using a macbook, and I really like to try to convert the MIUI rom (https://forum.xda-developers.com/pr...only-roms/8-1-miui10-project-treble-t3840198) to an A/B rom for my Oneplus6 (Treble, of course). basically I have 2 questions;
- You mention that you NEED linux, is it linux, or is it actually UNIX? (a.k.a. also do-able with MacOS)
- Given the ROM I want to port is using a backup restore method, is one still able to port it to an AB rom?
Even if my goal is not achievable, thank you for creating a guide on how to port. Sharing dev knowledge is the foundation of what drives people to create custom roms!
Click to expand...
Click to collapse
You really NEED Linux. macOS doesn't support ext4, and any third-party driver won't be able to preserve the SELinux xattrs properly.
In that case it's much harder. I'd suggest you try the port on-device in TWRP. Push the reference A/B image to the device and mount it in /mnt, then perform the operations in /system instead of the ROM image mountpoint. You also won't need to create the image at the end. This won't need Linux on your computer because it's all done on the phone.
I used this method to port an A-only OnePlus 6 OxygenOS port to my Mi A1. It booted but not very far because of issues with the port.
kdrag0n said:
You really NEED Linux. macOS doesn't support ext4, and any third-party driver won't be able to preserve the SELinux xattrs properly.
In that case it's much harder. I'd suggest you try the port on-device in TWRP. Push the reference A/B image to the device and mount it in /mnt, then perform the operations in /system instead of the ROM image mountpoint. You also won't need to create the image at the end. This won't need Linux on your computer because it's all done on the phone.
I used this method to port an A-only OnePlus 6 OxygenOS port to my Mi A1. It booted but not very far because of issues with the port.
Click to expand...
Click to collapse
Clear, thanks for the response.
I will try your suggestion, if it boots but fails at certain point, I will find a way to debug it.
The problem primarily on my OP6 is whenever I boot into a treble rom that has issue's, My OP6 is triggerhappy on sending a qualcom kernel panic crash.
Skorm92 said:
Clear, thanks for the response.
I will try your suggestion, if it boots but fails at certain point, I will find a way to debug it.
The problem primarily on my OP6 is whenever I boot into a treble rom that has issue's, My OP6 is triggerhappy on sending a qualcom kernel panic crash.
Click to expand...
Click to collapse
A kernel patch should be able to prevent that, check the custom kernels available.
kdrag0n said:
You really NEED Linux. macOS doesn't support ext4, and any third-party driver won't be able to preserve the SELinux xattrs properly.
In that case it's much harder. I'd suggest you try the port on-device in TWRP. Push the reference A/B image to the device and mount it in /mnt, then perform the operations in /system instead of the ROM image mountpoint. You also won't need to create the image at the end. This won't need Linux on your computer because it's all done on the phone.
I used this method to port an A-only OnePlus 6 OxygenOS port to my Mi A1. It booted but not very far because of issues with the port.
Click to expand...
Click to collapse
You can always give it a shot by creating an ubuntu or alpine container on Docker.
ereneren564 said:
You can always give it a shot by creating an ubuntu or alpine container on Docker.
Click to expand...
Click to collapse
You can't natively have a Docker container on macOS. If you did it'd be inside a Linux VirtualBox VM anyway. I don't think you'd be able to passthrough USB to the container for ADB.
kdrag0n said:
You can't natively have a Docker container on macOS. If you did it'd be inside a Linux VirtualBox VM anyway. I don't think you'd be able to passthrough USB to the container for ADB.
Click to expand...
Click to collapse
As you can copy files to container, you can also copy files from container to host. So your argument is invalid.
docker cp <containerId>:/file/path/within/container /host/path/target
could u make a guide to convert a/b img to a only? thanks
Backup/restore apps and respective data, SSAIDs, runtime permissions, generic system settings, Magisk modules, and more.
Works in recovery mode as well.
Refer to the upstream repository to get started.
I would like to be the first to thank you for this solution, i have one question how to make a full backup all accounts and data i saw in the guide tarb -badsm10 . but im not sure if its full backup or no
yassine2217 said:
I would like to be the first to thank you for this solution, i have one question how to make a full backup all accounts and data i saw in the guide tarb -badsm10 . but im not sure if its full backup or no
Click to expand...
Click to collapse
tarb -badsm10 . would backup the following:
a) All user and updated system APKs;
d) Data of those apps (also includes device-encrypted data (user_de), which can be excluded with D);
s) Generic system settings (quick toggles, sounds, display, etc.);
m) Magisk data (everything from /data/adb/, except magisk/ and magisk.db);
10) This instructs tarb to use 10 as the zstd compression level (default is 1);
This is a complete backup, except if you also want external data. If so, you would add the e flag.
External data includes /sdcard/Android/data/, /sdcard/Android/media/ (can be excluded with M), and /sdcard/Android/obb (can be excluded with O).
Note: backing up Google accounts on recent Android versions is just not a thing. You could try, but there's no guarantee that the restore will work. It may even cause problems. The target data keeps changing with new Android releases, and those changes are fairly unpredictable -- all thanks to Google, yay!
Cool, so this will replace Migrator right
VR25 said:
tarb -badsm10 . would backup the following:
a) All user and updated system APKs;
d) Data of those apps (also includes device-encrypted data (user_de), which can be excluded with D);
s) Generic system settings (quick toggles, sounds, display, etc.);
m) Magisk data (everything from /data/adb/, except magisk/ and magisk.db);
10) This instructs tarb to use 10 as the zstd compression level (default is 1);
This is a complete backup, except if you also want external data. If so, you would add the e flag.
External data includes /sdcard/Android/data/, /sdcard/Android/media/ (can be excluded with M), and /sdcard/Android/obb (can be excluded with O).
Note: backing up Google accounts on recent Android versions is just not a thing. You could try, but there's no guarantee that the restore will work. It may even cause problems. The target data keeps changing with new Android releases, and those changes are fairly unpredictable -- all thanks to Google, yay!
Click to expand...
Click to collapse
Thank you for the clear explaination
v2022.5.12 202205120
- C flag: exclude all *[cC]ache* files/directories globally (alternative to -X '*[cC]ache*');
- Do not backup/restore SSAIDs if /data/system/users/0/settings_ssaid.xml is encrypted;
- Updated info and support texts.
Try upgrading with tarb -u.
v2022.5.15 202205150
- Fixed -rnx ['regex'];
- -r shall have no fallback regex, just like -b;
- Skip GMS data backup/restore.
Try upgrading with tarb -u (interactive) or tarb -uu (no prompts).
v2022.5.16 202205160
- Fixed "backup/restore stops right after gms";
- Remind user to disable/remove Magisk modules that may cause bootloop;
- Updated Telegram group link.
v2022.5.25 202205250
- Architecture-aware self-backup
- Build script gets version from changelog
- Fixed `-rnx ['regex']`
- Fixed settings backup output inconsistencies
v2022.6.4
- cf899cd Remove debugging line, and reword a comment
- f8fdb0f Update help text
- bae6a39 C == "-X [Cc]ache" (non-greedy)
- 9a9138e Always exclude external cache
- 6d29dd6 Only restore SSAIDs and runtime perms after successful data restore
- fb0d1e9 Fix build/VERSION
Hello, I tried using this and I'm not having success. I installed as a Magisk Module with the -m flag and rebooted afterwards. Installed the arm64 as I have the SD855.
When I run the command tarb -badsm10 I get the following:
settings global
settings secure
settings system
/data/adb
Click to expand...
Click to collapse
And on the tarb folder I get a file with 30MB, that's all.
Thanks!
jakito said:
Hello, I tried using this and I'm not having success. I installed as a Magisk Module with the -m flag and rebooted afterwards. Installed the arm64 as I have the SD855.
When I run the command tarb -badsm10 I get the following:
And on the tarb folder I get a file with 30MB, that's all.
Thanks!
Click to expand...
Click to collapse
Perhaps the period is missing at the end of command line. Write command as follows:
tarb -badsm10 .
cave.man1908 said:
Perhaps the period is missing at the end of command line. Write command as follows:
tarb -badsm10 .
Click to expand...
Click to collapse
Yes, that worked. My bad!
Thank you
Edit: fixed
How do you use this in recovery? This works for a12 and a12 recoveries?
parag0n1986 said:
How do you use this in recovery? This works for a12 and a12 recoveries?
Click to expand...
Click to collapse
Only custom recoveries that can decrypt data are supported.
If you've installed tarb as a Magisk module (-m), /data/t is available for use in recovery.
Run /data/t -badems ..
It'll backup (-b):
* All user and updated system apps (a) with respective data (d) and external data (e), excluding cache;
* Magisk modules (m);
* Generic system settings (s).
If you haven't installed it, assuming it's located in /sdcard/Download, run sh /sdcard/Download/tarb-arm64 -badems ...
Use adb shell or recovery's own terminal.
v2022.6.25
ece9f5c Add Zelle donation info
e667f34 Add support for -bnx 'regex'
b1d3484 Remove obsolete lines
2e50b94 Fix: incomplete apk backup
5b268d9 Flag D implies d; M/O imply e
d898768 Make "o" flag work with "-b" as well
9715bbb Update usage examples
ff40224 Exclude internal cache by default
VR25 said:
Only custom recoveries that can decrypt data are supported.
If you've installed tarb as a Magisk module (-m), /data/t is available for use in recovery.
Run /data/t -badems ..
It'll backup (-b):
* All user and updated system apps (a) with respective data (d) and external data (e), excluding cache;
* Magisk modules (m);
* Generic system settings (s).
If you haven't installed it, assuming it's located in /sdcard/Download, run sh /sdcard/Download/tarb-arm64 -badems ...
Use adb shell or recovery's own terminal.
Click to expand...
Click to collapse
So if I'm on an a12 custom ROM, I would have to flash DFE so I am unencrypted and this should work? I've tried DFE on a couple of the 12.1 ROMs and it doesn't work any ideas to get it unencrypted on all these new rooms? I'm assuming I have to use TWRP I didn't know if any of these a12s have a terminal yet
parag0n1986 said:
So if I'm on an a12 custom ROM, I would have to flash DFE so I am unencrypted and this should work? I've tried DFE on a couple of the 12.1 ROMs and it doesn't work any ideas to get it unencrypted on all these new rooms? I'm assuming I have to use TWRP I didn't know if any of these a12s have a terminal yet
Click to expand...
Click to collapse
Android ROMs almost never ship with a terminal emulator. You can always install one or just use adb shell.
Modern custom recoveries (TWRP and derivatives) all have a built-in terminal.
Some recoveries can decrypt data.
When this is not the case, one must disable forced encryption to be able to read /data from recovery (mandatory for tarb to work there).
If Magisk cannot disable encryption, you have to patch /vendor/etc/fstab* file(s). This is usually just a matter of replacing "fileencryption=" with "encryptable=", rebooting, and formatting (not just wiping) the userdata partition.
VR25 said:
Android ROMs almost never ship with a terminal emulator. You can always install one or just use adb shell.
Modern custom recoveries (TWRP and derivatives) all have a built-in terminal.
Some recoveries can decrypt data.
When this is not the case, one must disable forced encryption to be able to read /data from recovery (mandatory for tarb to work there).
If Magisk cannot disable encryption, you have to patch /vendor/etc/fstab* file(s). This is usually just a matter of replacing "fileencryption=" with "encryptable=", rebooting, and formatting (not just wiping) the userdata partition.
Click to expand...
Click to collapse
So basically, using ADB shell while you're in nameless or Evo X recovery, for example, is just like using the built-in TWRP terminal? Just need ADB enabled in recovery mode?
How do I have magisk disable encryption? I've noticed when you flash magisk, It usually shows keep verity and force encryption = true. How do you make magisk disable them when you first flash magisk?
Sorry about all the questions, just really want to learn this stuff more, and you're amazing for explaining this stuff! I miss being able to backup/restore data nandroid style!
One last question. You said manually patch /vendor/etc/fstab.qcom? Do you replace anything that says file encryption with encryptable, or only in the /userdata area in the fstab? Here is what mine says. Would love to know what change in there and put it back and reformat and be unencrypted on a12!
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,metadata_encryption=aes-256-xts:wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,quota,reservedsize=512M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs
That's line #45 in my fstab.qcom file. So from that, my current ROM is FBEv2? And f2fs format for data?