change to f2fs woth lineage os - OnePlus 2 Q&A, Help & Troubleshooting

I don't know if is the correct section
But im searching a guide to change filesystem ti f2fs with lineage os

See here:
https://forum.xda-developers.com/oneplus-2/general/guide-f2fs-file-best-performance-t3362982

Any issues with encryption in t813?
It wont start

Related

[PARTITIONS] F2FS Support for Moto E

F2FS (born Flash-Friendly File System) - file system
F2FS (Flash-Friendly File System) is a flash file system initially developed by Samsung Electronics for the Linux kernel.[2]
The motive for F2FS was to build a file system that from the start, takes into account the characteristics of NAND flash memory-based storage devices (such as solid-state disks, eMMC, and SD cards), which are widely used in computer systems ranging from mobile devices to servers.
F2FS was designed on a basis of a log-structured file system approach, which it adapted to newer forms of storage. Jaegeuk Kim, the principal F2FS author, has stated that it remedies some known issues[3] of the older log structured file systems, such as the snowball effect of wandering trees and high cleaning overhead. In addition, since a NAND-based storage device shows different characteristics according to its internal geometry or flash memory management scheme (such as the Flash Translation Layer or FTL), it supports various parameters not only for configuring on-disk layout, but also for selecting allocation and cleaning algorithms.
Hello, in my kernel i already add support for this... Only we nees a dev to buil rom with mi vendor files
VENDOR FILES: GITHUB
And we need custom recovery with this... to format in f2fs ...
PM IF YOU NEED HELP FOR THIS...
@xperiafan13 can u submit this to CyanogenMod Gerrit ?
great work xperiafan .cannot wait to use f2fs .hope someone would recompile twrp to support f2fs .and we also need the ROM for that .
Actually, @#buzz 's version of TWRP 2.8.5.0 supports formatting in F2FS
Regarding Kernel Support on F2FS
xperiafan13 said:
F2FS (born Flash-Friendly File System) - file system
Click to expand...
Click to collapse
I guess you must have noticed, that Motorola Mobility LLC has been working on the kernel to support F2FS.
Here's the link to the repository: https://github.com/MotorolaMobilityLLC/motorola-kernel
Also Motorola has provided a tool to deal with F2FS (Different from the one used by custom ROMs). Here's the link to the corresponding repository: https://github.com/MotorolaMobilityLLC/motorola-external-f2fs-tools
I hope everything above stated is useful to you in some way. or maybe not, if you have already seen and worked on these tools.
P.S. [OT] I have hardbricked my Motorola Moto E while dealing with bootloader partitions but the code I was working on still works https://github.com/ramsudharsan/motoxtract. Check that if you guys have time. I am not into this device's development anymore. I don't think it will make any difference whether I am here or not here. After all, there are many great and potential devs and andoid enthusiasts here to support this device in the long run.
P.P.S. Have a great day!

[Q] - Kernel - Adding ExFat support not working

Hi Everyone,
Hoping someone can help or point me in the right direction please. I have been searching google and xda like crazy but cant find answers or info that could help me clue on to my issue.
I just bought a nexus player. I flashed the factory image of the new 7.0 nougat. I then downloaded the x86_64 fugu kernel source code and toolchain. I have added exfat-nofuse to the fs folder of the kernel source, modified the fs/Kconfig and fs/makefile as instructed and in the kernel config I have added the ExfAt support as module (also tried adding as not module). Source and instructions from here. I have then unpacked the boot.img from the factory image and replaced the kernel with mine and repacked the boot.img and loaded it on my Nexus Player. In the about screen I can see my customer build name so I know the boot.img / kernel is in use. The problem is Android still does not detect drives where I have formatted as ExFat and android just asks if I want to use and format which will be Fat32.
Does anyone know if there are further modifications I need to make to the kernel source to get the ExFat support working? I assume teh kernel should / would auto mount but it seems to not even detect ExFat. I am currently trying to get adb terminal access to run commands and see if the ExFat module is there and loadable or anythign to give me an indication of what my issues are.
Any help greatly appreciated. Thanks in advance,
Paul.
Oh and the kernel is v3.10.20. Looking at the different sources it seems the Nexus Player started with and still is only kernel v3.10.20.
I would love to have ExFAT support on nougat, that's the only thing keeping me from updating my Nexus Player. If you figure it out please let me know. Now I did look at the link you provided about the instructions and what not, and was wondering if that github was for ARM devices only. At the top I believe it mentions android ARM. Not sure if that makes a difference or not

[HOW-TO] Convert to F2FS on Nexus 6 (ALMOST - Any Rom)

BE WARNED - THIS WILL ERASE EVERYTHING ON YOUR PHONE. DO NOT ATTEMPT THIS IF YOU HAVE NOT MADE A BACKUP AND/OR ARE NOT READY TO REINSTALL EVERYTHING ON YOUR PHONE FROM SCRATCH.
Credit goes to bbedward for his initial thread regarding this concept.
STATUS:
2017/01/08 - Not liking the performance of my Galaxy S3, so I've ordered a new phone (Huawei P8 Lite) for $58 from eBay! Supposedly brand new. I figured I'd have to give it a try just to see. Once I set this phone up I'll start tinkering with my Nexus 6 again. Phone should arrive around 17 Jan!
FOCUS:
Getting F2FS on ANY ROM, but for my purposes, I'm focused on getting F2FS with Flash Kernel to work on Nitrogen OS (if this can be done, then it can be done with any ROM!)
BASICS:
- Need recovery & kernel that support f2fs (tools + kernel driver version must match or be compatible - not sure what the specifics are yet)
Latest New Info:
- The Flash has said that his kernel and crDroid work with F2FS (I haven't tested it myself yet - this version of crDroid actually specifies F2FS support)
2017/01/08
- Found this thread by NABENDU1. It's for Nexus 4, but it gives some good insight on how F2FS works.
- @vprasad1 found another working combination (post #15) - franco.Kernel - r60 Anykernel 7.1.1 with Danvdh's Stock Lite N6F26Q 7.1.1
Explaining a few details:
The issue here is that the exact version of F2FS tools included in most modded recoveries isn't actually specified (that I have found) and the version of tools that end up in the ROM (/system/bin/), which come from the recovery unless built into the ROM, must be compatible. One of the following is true (not sure which one yet):
- the F2FS tools version must be the same or greater than the kernel driver support version
- the F2FS tools version must be the same or less than the kernel driver support version
- the F2FS tools version must match the kernel driver support version
Given that The Flash is consistently including the latest F2FS support in his kernel, and since I've had the most trouble getting F2FS support to work with his kernel and other ROMs that technically don't support F2FS (using bbedward's method mentioned above - link to thread included) I'm inclined to think that the F2FS tools must be the same or greater version compared to the kernel driver support, though I have no way of confirming this yet. Hopefully I'll have different luck with Flash Kernel v1.7!
========
I used:
- Nexus Root Toolkit v2.1.9
- Nitrogen OS 2016-11-19
- MagiKernel v1.1 Stable-1023
- TWRP 3.0.2-0 (modded by xanaxdroid - thread is here)
(TWRP v3.0.2-0 by xanaxdroid mirror) - the original link is down.
I'll take these down if xanaxdroid asks. I have yet to hear from him...
Steps for clean install (and initial install of F2FS recovery / conversion to F2FS):
1) revert to stock (Nexus Root Toolkit)
2) flash recovery with f2fs support (Nexus Root Toolkit)
3) boot into recovery on device
4) full wipe device (normal wipe)
5) convert /cache & /data to f2fs
6) copy over desired kernel and rom to /sdcard
7) install rom & then kernel
8) run adb commands:
# adb shell
# mount -o rw /system
# cp /sbin/fsck.f2fs /system/bin/
# cp /sbin/mkfs.f2fs /system/bin/
# chmod a+x /system/bin/*f2fs*
9) reboot
========
When changing ROMs/kernel (F2FS recovery already installed):
1) boot into recovery
2) do full wipe (f2fs should have stayed from the first time)
3) install rom & then kernel
4) run adb commands:
# adb shell
# mount -o rw /system
# cp /sbin/fsck.f2fs /system/bin/
# cp /sbin/mkfs.f2fs /system/bin/
# chmod a+x /system/bin/*f2fs*
5) reboot
========
More semi-lengthy explanation about fstab:
bbedward suggests a difference in the fstab as being the primary suspect causing the difference in compatibility. Here's the only difference I could find that seemed to be relevant:
- the fstab that worked (MagiKernel + TWRP v3.0.2-0 (by xanaxdroid) + Nitro OS)
/devices/*/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto
- the fstab that didn't work (Flash Kernel + TWRP v3.0.2-0 (by xanaxdroid) + Nitro OS)
*block/sda* auto auto defaults voldmanaged=usbdisk:auto,noemulatedsd
Both fstab files did clearly have the lines needed to mount /data and /cache as f2fs, but they were identical.
NOTE: I also tried TWRP v3.0.0-0 (by xanaxdroid) with Flash Kernel and still no dice. I'm a fan of Flash Kernel since it's my first custom kernel I've played with. I hope to be able to use it some day with Nitrogen OS! Until then, thanks MagiKernel! (maybe I'll convert??? ) <- MagiKernel development has halted for now
========
What I've tried before:
All of the following implies that I've used the previously mentioned adb commands to copy over the f2fs tools and set the proper permissions.
In my experience, it seems that f2fs requires just the right combination of kernel + recovery. For example I used Nitrogen OS (2016-11-19) + Flash Kernel + mod TWRP 3.0.2-0 and it hasn't worked for me, but Nitrogen OS + MagiKernel + mod TWRP v3.0.2-0 did work. The failure for f2fs to work with Nitro OS + Flash Kernel is very reproducible, as is the success with Nitro OS + MagiKernel. (Again using TWRP v3.0.2-0 modded by xanaxdroid).
Keep in mind that the developer of Flash Kernel (developed by The Flash) has tested his kernel with crDroid (a CyanogenMod base ROM) and it worked for him, but I don't know what version of modded TWRP he was using and what version of f2fs tools were in that recovery. From what I've noticed, there seems to be a fundamental difference with CyanogenMod based ROMs when it comes to f2fs support, either that or there's just a version mismatch of f2fs tools between certain recovery + kernel combos. I don't know enough to understand the difference yet, but it is clear that just because a kernel claims to support f2fs doesn't mean that it will work with any ROM, even if you follow bbedward's tutorial mentioned at the top of this post.
The kernel and the recovery must work together (as in what version of mkfs.f2fs / fsck.f2fs supported by kernel & recovery must match (i think - thanks to bbedward again for this info)). The main issue here is that most modded recovery zips/imgs (that I have found) don't list the version of f2fs tools they have. On the other hand usually you can see this info on the main page of any given kernel developer.
I haven't found any specific rhyme or reason yet, but for those looking for Nitrogen OS (2016-11-19 - Android 7.1 - Nougat) + f2fs, this will help you.
NOTE: I'm a clean-freak, so I enjoy clean flashes, so my instructions are geared toward clean flashes, not dirty flashes. Having said that, doing this with a dirty flash is possible, but it will depend on the ROM/kernel you choose as to the details in how you upgrade/switch the ROM/kernel. Done properly, you should only have to switch file systems once and forego any future wiping of your /sdcard or internal storage.
========
NOTE : You'll know your recovery + kernel combo isn't working right when it takes longer than usual to get off the bootloader screen and start with your ROM's animation boot screen. If it's taking too long, you're probably having everything converted back to ext4.
*** WARNING *** WARNING *** WARNING *** WARNING ***
DO NOT INTERRUPT THIS PROCESS DURING BOOT. If you do then you'll render your /data partition inaccessible. It's still fixable with Nexus Root Toolkit > revert to stock, but that's a pain and it takes a while.
This OP will be updated as new info is uncovered!
Thank you for the updated tutorial and information! Been reading up on the benefits and side effects of f2fs. But wasn't sure on whether to do it. Like you I am on nitrogen ROM, 12.4.26. and am a fan of flash kernel. Il will definitely look into this. Also I notice that the link you posted for magikernel isn't working. Either way huge thank you.
Edit - Just read the original thread. Want to thank you again for hoe you asked for his approval first before making a new thread. Very respectful. Not to say people don't respect devs or users in general. Just wanted to add I appreciate you taking the time to reach out him first prior to making this thread.
Thank you again.
Sent from my Nexus 6 using XDA-Developers mobile app
ozzmanj1 said:
Thank you for the updated tutorial and information! Been reading up on the benefits and side effects of f2fs. But wasn't sure on whether to do it. Like you I am on nitrogen ROM, 12.4.26. and am a fan of flash kernel. Il will definitely look into this. Also I notice that the link you posted for magikernel isn't working. Either way huge thank you.
Edit - Just read the original thread. Want to thank you again for hoe you asked for his approval first before making a new thread. Very respectful. Not to say people don't respect devs or users in general. Just wanted to add I appreciate you taking the time to reach out him first prior to making this thread.
Thank you again.
Click to expand...
Click to collapse
Thanks for the feedback!
I'm still researching a way to get Flash Kernel with Nitro OS + f2fs. I have some ideas. I'll update the first post with any new findings.
Edit: unfortunately MagiKernel is dead. So ill be hot on another trail soon. Also MagiKernel isnt as good as Flash out-of-the-box in my experience so far.
ozzmanj1 said:
Also I notice that the link you posted for magikernel isn't working. Either way huge thank you.
Click to expand...
Click to collapse
I actually just tested the link to MagiKernel on my PC and my phone (on XDA Labs) and it worked fine. Are you using another (older) version of XDA forum viewer?
EDIT: OP updated. The "issues" we all run into is a version mismatch between RECOVERY & KERNEL mostly. As long as RECOVERY & KERNEL f2fs tools match, then you can copy over (mkfs.f2fs & fsck.f2fs) from /sbin/ to /system/bin/ and get any ROM to be compatible with F2FS.
EDIT: modified links and removed "" in URL tags. The quotes were necessary for proper display in the XDA Labs app, but not compatible with XDA Legacy app. I've switched to use XDA legacy!
Will this fix low battery throttling and video recording
PunishedSnake said:
Will this fix low battery throttling and video recording
Click to expand...
Click to collapse
LOL, no.
This won't "fix".... ANYTHING.
In fact, this will very likely BREAK things.
Lol how so
No not breaking things here ... Not any more than usual tinkering under the hood... I'm just trying to flush out bbedward's old thread with some more info...
PunishedSnake said:
Will this fix low battery throttling and video recording
Click to expand...
Click to collapse
To give you an answer, no it won't. This info will only "possibly" help you get a ROM to run on f2fs that was not initially designed to do so.
@ozzmanj1
Well the Nitrogen OS ROM developer just let me know he has no plan to include F2FS tools. Looks like we gotta go with plan B...
TheArkive said:
@ozzmanj1
Well the Nitrogen OS ROM developer just let me know he has no plan to include F2FS tools. Looks like we gotta go with plan B...
Click to expand...
Click to collapse
That is a darn shame. Looking at the comparisons of Ext4 and F2FS and it makes me wonder why it has gone more popular. I appreciate your time and work looking into this. Sadly with my schedule I do not have to do a lot of digging with wife, and kids and works....blah blah....lol. Anyways, thank you for letting me know about Nitro.
Side note, any suggestions on another ROM that you are aware of that supports F2FS?
ozzmanj1 said:
That is a darn shame. Looking at the comparisons of Ext4 and F2FS and it makes me wonder why it has gone more popular. I appreciate your time and work looking into this. Sadly with my schedule I do not have to do a lot of digging with wife, and kids and works....blah blah....lol. Anyways, thank you for letting me know about Nitro.
Side note, any suggestions on another ROM that you are aware of that supports F2FS?
Click to expand...
Click to collapse
The Flash said that latest crDroid worked fine. I haven't been able to confirm yet. I have a new smartphone on the way to setup as my primary phone while I experiment on my Nexus 6. Won't get here until Jan 23rd
TheArkive said:
The Flash said that latest crDroid worked fine. I haven't been able to confirm yet. I have a new smartphone on the way to setup as my primary phone while I experiment on my Nexus 6. Won't get here until Jan 23rd
Click to expand...
Click to collapse
Just came across this new kernel that has f2fs support. Based on flash kernel and afew other kernels.
http://forum.xda-developers.com/showthread.php?t=3526034
Going to look into it as flash kernel may drop nexus 6 support soon due to school obligations
Sent from my Nexus 6 using XDA-Developers mobile app
ozzmanj1 said:
Just came across this new kernel that has f2fs support. Based on flash kernel and afew other kernels.
http://forum.xda-developers.com/showthread.php?t=3526034
Going to look into it as flash kernel may drop nexus 6 support soon due to school obligations
Sent from my Nexus 6 using XDA-Developers mobile app
Click to expand...
Click to collapse
Thanks for the news! I'll be checking that out as well.
FYI this works using franco.Kernel - r60 Anykernel 7.1.1 with Danvdh's Stock Lite N6F26Q 7.1.1
Code:
mount | grep f2fs
/dev/block/platform/msm_sdcc.1/by-name/userdata on /data type f2fs (rw,seclabel,nosuid,nodev,noatime,nodiratime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6)
/dev/block/platform/msm_sdcc.1/by-name/cache on /cache type f2fs (rw,seclabel,nosuid,nodev,noatime,nodiratime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6)
I tried Aero 1.0 Linaro kernel with Danvdh's Stock Lite N6F26Q 7.1.1 but it kept forcing /cache and /data to return to ext4.
Could also be that the rom is coded not to allow it as it is not really stable enough. Main reason it is not implemented in Android.
zelendel said:
Could also be that the rom is coded not to allow it as it is not really stable enough. Main reason it is not implemented in Android.
Click to expand...
Click to collapse
Was that in response to my post???
Sent from my SM-N910T using Tapatalk
vprasad1 said:
FYI this works using franco.Kernel - r60 Anykernel 7.1.1 with Danvdh's Stock Lite N6F26Q 7.1.1
I tried Aero 1.0 Linaro kernel with Danvdh's Stock Lite N6F26Q 7.1.1 but it kept forcing /cache and /data to return to ext4.
Click to expand...
Click to collapse
Many thanks for the info! I'm definitely trying to find combinations that in fact do work, and hopefully derive a method for getting it to work on other combinations as well (hopefully).
Thanks again for the help!
TheArkive said:
Many thanks for the info! I'm definitely trying to find combinations that in fact do work, and hopefully derive a method for getting it to work on other combinations as well (hopefully).
Thanks again for the help!
Click to expand...
Click to collapse
Just a quick link I came across. Not sure if it's useful but as it pertains to f2fs I thought I'd share.
https://www.xda-developers.com/xda-...upersu-has-trouble-with-f2fs-data-partitions/
Sent from my Nexus 6 using XDA-Developers Legacy app
What is F2FS
Can Ya Here Me Now

[Discussion & Guide] OnePlus 5/5T now have unofficial Project Treble by MoKee

(My English isn't very practice. If you have any question reading this post, please feel free to ask. I'll try my best to express.)
## 0. Update: 2018/04/16
Some information I got today:
1. OnePlus is doing a repartition in OP5 Open Beta 8 / OP5T Open Beta 6 (or earlier, who knows). It'll split the 1.5GB "last_parti" partition into a 1.0GB "vendor" and a ~500MB "reserve3" partition while booting the system.
2. Yes, the repartition process was done in system, not during OTA in recovery.
3. The official vendor partition is still unused (not formatted). OnePlus will fill it in a future OTA, said their engineer.
4. I think it won't be conflicted with our "homemade" unofficial Treble. I just tested that the stock H2OS/OxygenOS can run on our homemade partition table.
5. It's very easy to undo the unofficial treble. I'll make an undo flashable zip later (through it's unnecessary in this time).
6. Of course, MoKee now (since 20180417) can run on the official partition table too.
==========
The MoKee ROM is now shipping unofficial Treble update for OnePlus 5/5T since 20180411. As the maintainer, I would like to share some information here.
## 1. How is this possible for OP5/5T?
Project Treble requires 2 keys: a standalone /vendor partition, and fully binderized HALs.
In fact, OnePlus have a 1.4GB unused, unformatted partition "sdf6" on OnePlus 3, 3T, 5 and 5T. This partition was possibly left by the ODM company, OPPO. OPPO R11/R11s series have a simular partition layout with OnePlus, and OPPO really did release an OTA update to enable Project Treble for their products.
The other key is binerized HALs. More specifically, the Camera HAL. The good news is, OnePlus recently released OP5 Open Beta 6 and OP5T Open Beta 4, with all fully binerized HALs, including the Camera HAL.
So as these 2 majar problems were solved. Project Treble is possible.
## 2. How did this come true?
To make Project Treble come true for OnePlus 5/5T, these should be done:
1. All vender-specific blobs should be moved to /vendor
2. Some blobs load config files from /system/etc. Just hex-edit them to load from /vendor/etc instead
3. Label and format that unused sdf6 partition as /vendor - this should be automatically done with an OTA script
4. The kernel should mount sdf6 as /vendor as well
## For users - How to enable Treble for OP5/5T?
The most easy way now is, flash the latest MoKee MK81.0 nightly build with latest TWRP (OP5: http://rom.mk/?device=cheeseburger, OP5T: http://rom.mk/?device=dumpling). The updater script will do the job automatically for you.
It's possible to make a flashable zip contains only the kernel and vendor image, without the MoKee system. But I'm busying on some other features. I'll do it later.
Tested fully works with Phh-treble system image, including:
- Audio
- Camera
- Phone & data
- Bluetooth & Wi-Fi
- Fingerprint
## For developers - How to ship Treblize update with my ROM?
(I'm organizing the patch list, I'll updte this section later)
## Can I flash non-Treble ROMs? How to "undo" this change?
You don't need to undo it, I think. For those non-Treble ROMs, including H2OS and OxygenOS, the /vendor partition is invisible. So you can flash back to any other ROMs at any time you want.
This is good news for us, thank you for your hard working!
So, once we flash the Mokee ROM, will we then be able to flash the other treble ROMs like RR and Lineage?
Skeptico said:
So, once we flash the Mokee ROM, will we then be able to flash the other treble ROMs like RR and Lineage?
Click to expand...
Click to collapse
Of course.
Great job!
Any specific instructions to install this or like a normal install ???
Amanpreetsingh said:
Any specific instructions to install this or like a normal install ???
Click to expand...
Click to collapse
Please, read OP message fully
you are awesome, big thank you from every OP5/5t owner
Damn, Oppo enabled Treble but 1+ didn't
What a shame...
Does this mean that the camera quality will be as good as stock on a custom room?
@chenxingyu If we flash Oxygen OS again on the treblized 5/5T, won't it again repartion the device again and create the sdf6 partition again? Just a doubt.
hemant_jeengar said:
@chenxingyu If we flash Oxygen OS again on the treblized 5/5T, won't it again repartion the device again and create the sdf6 partition again? Just a doubt.
Click to expand...
Click to collapse
No, as the normal update packages don't touch that partition. On the other hand, there's no repartitioning involved - the type, filesystem and mount point of /sdf6 are changed.
hemant_jeengar said:
@chenxingyu If we flash Oxygen OS again on the treblized 5/5T, won't it again repartion the device again and create the sdf6 partition again? Just a doubt.
Click to expand...
Click to collapse
No, Oxygen OS doesn't know there's a partition named sdf6.
First of all appreciate your effort for bringing treble support for op5t.. am currently running xxx ROM and decrypted..questions I have is does blu_spark or codeworkx twrp support flashing system image..also if I flash mokee latest update then will it wipe all my internal storage data..also I read no_verity zip doesn't work so when we go back to other non-treble roms then format data is mandatory..am I right..
Can someone who has already installed a treble gsi try and install oneplus camera apk and see what's happens? Or maybe even gcam? Thanks
Jamie_oppo said:
Can someone who has already installed a treble gsi try and install oneplus camera apk and see what's happens? Or maybe even gcam? Thanks
Click to expand...
Click to collapse
Gcam is crashing..tested and confirmed by a user in the group.. thanks
Can someone post a mirror link. For some reason I cant download from the main site, the countdown disappears at 56 seconds.
This is all I see
cubandanger05 said:
Can someone post a mirror link. For some reason I cant download from the main site, the countdown disappears at 56 seconds.
Click to expand...
Click to collapse
Had the same issue, downloading work on internet explorer on PC so maybe Safari on Mac? Give that a shot
BenisMusical said:
Had the same issue, downloading work on internet explorer on PC so maybe Safari on Mac? Give that a shot
Click to expand...
Click to collapse
Tried bunch of different browsers on my phone, desktop mode and all, but nothing, I'm going to have to try on my laptop tonight. Unless someone posts a mirror link.
Not working on the computer at work ?, getting frustrated ?.

Android S GSI (System-As-Root) on on Smart Tab M10 (TB-X605F)

Preface: After trail and error on installing Android GSI ROMs to my TB-X605F, I successfully made it after reading this thread written by @Yahoo Mike, which is also of great significance for my research. Generalizing it to the newer version Android-Installing and the other partition architectures, I finally drew a conclusion on how to install Android S GSI (System-As-Root) on on Smart Tab M10 (TB-X605F).
Credits:
    @AndyYan, builder of the GSI images which was used in this project.
    @erfanoabdi, developer of MakeMeSar patch.
    @phhusson, developer of phh project treble ROMs.
    @Yahoo Mike, illuminator of installing GSI on this device.
(Sorted alphabetically)
  In this article, I'll introduce the way to install Android S GSI ROMs on the Lenovo Smart Tab M10 (I've only tested it on TB-X605F since I got one at hand. Theoretically, the other tablets in this series, such as TB-X605L should also work). Broadly speaking, this is a generalized method to install all System-As-Root GSI ROMs on this device, but I haven't tested it with the other kinds of ROMs. So, before we start, make a full backup of your device, which'll prevent you from lose all your important data after formatting your device. Also, you'd better to get knowledge of what you're doing and what you're going to do. This project is currently experimental, which means you may brick your device at any time, which is at your own risk.
  Here are the steps.
1. Restoring Stock Android Pie Firmware with EDL.
  1.1. Download the stock pie firmware from https://mirrors.lolinet.com/firmware/lenovo/Tab_M10/TB-X605F/.
  1.2. Assume that you've backed your device up, if not, do it now. Then, reboot it into EDL mode. There're many ways to do it, power it off and press Vol+ and Vol-, connect it with the PC at the same time. If you have TWRP installed in it, you can also get your device into TWRP and press "Reboot->EDL". Or you can reboot it into fastboot mode and use this command:
fastboot reboot edl
Click to expand...
Click to collapse
If your device is unfortunately in "brick" status or your system cannot do such operations for certain reasons, you can open the back case, short these two test points shown in the picture. and connect it with your PC.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
  1.3. Flash the firmware into your device via QPST or QComDLoader.
2. Installing TWRP.
  2.1. Download the TWRP from https://twrp.me/lenovo/lenovo_X605F.html. Currently, I'm using ver 3.6.0.
  2.2. Unlock the bootloader.
  2.3. Reboot your device into fastboot, and
fastboot flash recovery path/to/twrp/img
Click to expand...
Click to collapse
  2.4. Reboot into TWRP by pressing Vol+, Vol- and Power.
3. Getting Files Prepared.
  3.1. We aim to install Android S GSIs on this device, @phhusson's GSIs are a good choice, you can find them at Project Treble GSI images. Currently, I use the LineageOS 19.0 built by @AndyYan as example. I got it here: https://sourceforge.net/projects/andyyan-gsi/files/lineage-19.x/.
    IMPORTANT: As we all know, this device use A-only partition architecture and no System-As-Root support, which is originally not supported by Android S. As a result, we're going to patch it to run Android S. As a consequence, when you're chose ROMs, download the ROMs which're ARM64 A/B Vndklite (arm64_bvS-vndklite) to match the patched device.
  3.2. Download the System-As-Root patch which makes the device support System-As-Root. This patch called MakeMeSar, made by @erfanoabdi. You can find it here: https://androidfilehost.com/?fid=4349826312261728344. This patch will rewrite your boot partition to support System-As-Root, as a result, all the changes you've applied to the boot partition (such as magisk root or supersu root) will be gone.
  3.3. Download the Disable_Dm-Verity. This is a patch to get rid of dm-verity and to disable the Verified Boot, which'll disable force encrypt of userdata partition and prevent the TWRP from being raplaced with the stock recovery. Get it here: https://zackptg5.com/android.php#disverfe.
  3.4. Download the modify_phh_gsi.sh made by @Yahoo Mike. On conscious that it has trouble in mounting system when the device was patched to support System-As-Root, I modified the script to support (only) System-As-Root. Get it here: https://github.com/JunASAKA/modify_phh_gsi_sar.
4. Flashing
  4.1. Boot into TWRP.
  4.2. Format userdata partition and transfer all related files into your device.
  4.3. Flash MakeMeSar patch.
  4.4. Flash Dm-Verity patch.
  4.5. Flash Android GSI ROMs. You can also do this in fastboot mode:
fastboot flash system path/to/gsi/img
Click to expand...
Click to collapse
  4.6. Reboot into TWRP again (Simply press Reboot->Recovery in TWRP).
  4.7. Resize2fs system and run the modify_phh_gsi_sar.sh in terminal. Firstly, press "Wipe->Advanced Wipe->Select system->Repair or Change File System->Resize File System" in twrp before using the script. Tnen, in the terminal:
sh path/to/modify_phh_gsi_sar.sh
Click to expand...
Click to collapse
  4.8. Format userdata partition again to clean up (You can skip this step if you commit no change to userdata partition).
  4.9. Reboot to system (In TWRP, press Reboot->System).
5. Your device will boot into the System you flashed if everything goes well. Enjoy !
fin. Here are the screenshots of Lineage OS 19.0 installed.
ps. Known Issues.
  1. The system may mistake the tablet for "emulated device".
  2. Cannot decrypt userdata even if the Dm-Verity was installed.
Further research is on going.
  For other things regarding the GSI ROMs, such as GAPPS and Magisk root, it's strongly recommend to read this thread written by @Yahoo Mike.
浅香ジュン said:
ps. Known Issues.
  1. /system_root cannot be mount in TWRP.
  2. Cannot decrypt userdata even if the Dm-Verity was installed.
Click to expand...
Click to collapse
Sounds like TWRP will need to be modified for SAR devices.
My first guess is that the fstab needs to be updated to add a mount for /system_root. And the BoardConfig.mk needs some extra entries for the A12 keymaster to work (PLATFORM_VERSION and PLATFORM_VERSION_LAST_STABLE).
If you DM me the fstab from your patched boot.img, I'll build you a modified twrp on the weekend.
Hopefully, we can use the same TWRP for SAR and non-SAR tablets.
After modifing to SAR, any problems using LMSA to restore the tablet back to stock ?
Yahoo Mike said:
Sounds like TWRP will need to be modified for SAR devices.
My first guess is that the fstab needs to be updated to add a mount for /system_root. And the BoardConfig.mk needs some extra entries for the A12 keymaster to work (PLATFORM_VERSION and PLATFORM_VERSION_LAST_STABLE).
If you DM me the fstab from your patched boot.img, I'll build you a modified twrp on the weekend.
Hopefully, we can use the same TWRP for SAR and non-SAR tablets.
Click to expand...
Click to collapse
Well, I think I found the solution to system-mounting. After flashing the system.img, before executing the modify_phh.sh, Go to ”Wipe->Advanced Wipe->Select system->Repair or Change File System->Resize File System”. And then execute the modify_phh.sh. This way, the system can be successfully mount. Just press “mount” in twrp and select system, the /system_root and /system will be mount automatically. Consequently, I think the fstab of TWRP version 3.6.0 is all set and needn’t to be modified, it can automatically detect whether the device is SAR or not.
Yahoo Mike said:
After modifing to SAR, any problems using LMSA to restore the tablet back to stock ?
Click to expand...
Click to collapse
As to restoration, I haven’t try LMSA yet, I always use EDL mode for restoration. But since the MakeMeSAR patch will only make differences to boot partition, I think LMSA should also work, but I haven’t tested it yet.
Additionally, there is another problem that there is “About Emulated Device“ shown in settings main page instead of “About Tablet”. I am wondering why the ROM mistake my tablet for a emulated device? I tried to add
ro.build.characteristics=tablet
Click to expand...
Click to collapse
to build.prop both in vendor and system partition, but it seems to be of no avail.
I am making further researches on that and data partition decryption.
Thanks for your help, I’ll update my post later.
浅香ジュン said:
Well, I think I found the solution to system-mounting. After flashing the system.img, before executing the modify_phh.sh, Go to ”Wipe->Advanced Wipe->Select system->Repair or Change File System->Resize File System”. And then execute the modify_phh.sh. This way, the system can be successfully mount.
Click to expand...
Click to collapse
Resizing in TWRP just runs resize2fs. The script does that. Maybe it's the order the commands are run in? Or maybe the command needs to be run against a different partition for SAR? The script currently only checks for /system.
浅香ジュン said:
Additionally, there is another problem that there is “About Emulated Device“ shown in settings main page instead of “About Tablet”. I am wondering why the ROM mistake my tablet for a emulated device?
Click to expand...
Click to collapse
Is that how MakeMeSAR works? I couldn't find any documentation about it. Unpacking the RAM cpio in MakeMeSAR might hold the answer.
You might also find a hint in the phh GSI or AOSP code. There will be a test that results in "Emulated Device". Whatever the conditions of that test are, they will point you in the right direction.
Yahoo Mike said:
Resizing in TWRP just runs resize2fs. The script does that. Maybe it's the order the commands are run in? Or maybe the command needs to be run against a different partition for SAR? The script currently only checks for /system.
Is that how MakeMeSAR works? I couldn't find any documentation about it. Unpacking the RAM cpio in MakeMeSAR might hold the answer.
You might also find a hint in the phh GSI or AOSP code. There will be a test that results in "Emulated Device". Whatever the conditions of that test are, they will point you in the right direction.
Click to expand...
Click to collapse
Yes, that may helpful to find out more information about SAR in this device, I’ll test the Phh GSI today.
Hi really impressed by the work being done here,always wanted to try out a12 doing it now btw can i use any pixel gsi with this or maybe anyway that the new android 12L gsi works on this tab as it is optimized for large screen devices
FrontMan69 said:
Hi really impressed by the work being done here,always wanted to try out a12 doing it now btw can i use any pixel gsi with this or maybe anyway that the new android 12L gsi works on this tab as it is optimized for large screen devices
Click to expand...
Click to collapse
I think most of the phh-gsi based ROMs, Pixel Experience included, should work fine. As to Android 12L, it’s worth a try!
浅香ジュン said:
I think most of the phh-gsi based ROMs, Pixel Experience included, should work fine. As to Android 12L, it’s worth a try!
Click to expand...
Click to collapse
Thanks! keep up the good work
浅香ジュン said:
I think most of the phh-gsi based ROMs, Pixel Experience included, should work fine. As to Android 12L, it’s worth a try!
Click to expand...
Click to collapse
hi tried the pixelexperience gsis they seem to not flash show not enough storage available
maybe its a device specific restriction
FrontMan69 said:
hi tried the pixelexperience gsis they seem to not flash show not enough storage available
maybe its a device specific restriction
Click to expand...
Click to collapse
Well, that’s because the system partition is not big enough to install pixel experience. But you could try to re-partition the tablet with the “parted”. Just delete the original system partition and create a new one bigger, I used to re-partition my Huawei mobile when installing custom GSIs.
浅香ジュン said:
Well, that’s because the system partition is not big enough to install pixel experience. But you could try to re-partition the tablet with the “parted”. Just delete the original system partition and create a new one bigger, I used to re-partition my Huawei mobile when installing custom GSIs.
Click to expand...
Click to collapse
hi sorry for the ping but i cannot install gapps with los nikgapps installs but play store doesnt show up and bitgapps doesnt install
Update: So far tried Pixel Experience , Octavi,ArrowOS and phh gsis out of all only lineage works no success at install gapps on lineage so far
FrontMan69 said:
Update: So far tried Pixel Experience , Octavi,ArrowOS and phh gsis out of all only lineage works no success at install gapps on lineage so far
Click to expand...
Click to collapse
I'm sorry for hearing that. And according to my experience installing gapps, that's may on account that there is no enough space left in system partition. The best way to solve it is to re-partition the device, which is testing by me. Btw, is there no original gapps installed in Pixel Experience?
浅香ジュン said:
I'm sorry for hearing that. And according to my experience installing gapps, that's may on account that there is no enough space left in system partition. The best way to solve it is to re-partition the device, which is testing by me. Btw, is there no original gapps installed in Pixel Experience?
Click to expand...
Click to collapse
pixel experience doesnt flash saying that there isnt any more storage left in the partition with octavi and arrow i get error 4 in twrp aosp cannot be resized and with los as i said gapps cannot be flashed
I followed the instructions and got vanilla A12 AOSP (squeak) loading.
After boot, is anyone else getting the error message: Android System: there's an internal problem with your device. Contact your manufacturer for details. ?
credstore crashes during init. So that might be causing the error message (?)
As for TWRP, keymaster is crashing. That's why there's no decryption. I'll strace it tomorrow to see if we can get around it.
And I can confirm LMSA restores stock ROM fine after using MakeMeSAR. (BTW, LMSA now uses QFil rather than QComDLoader.)
Yahoo Mike said:
I followed the instructions and got vanilla A12 AOSP (squeak) loading.
After boot, is anyone else getting the error message: Android System: there's an internal problem with your device. Contact your manufacturer for details. ?
credstore crashes during init. So that might be causing the error message (?)
As for TWRP, keymaster is crashing. That's why there's no decryption. I'll strace it tomorrow to see if we can get around it.
And I can confirm LMSA restores stock ROM fine after using MakeMeSAR. (BTW, LMSA now uses QFil rather than QComDLoader.)
Click to expand...
Click to collapse
i tried squeak with go gapps didnt flash also btw big fan mike any working a11 gsis ? also how can i repartition my tablet
Bad news on the TWRP front. There are two issues.
First, the Keymaster key data structure was changed in A12. I can patch TWRP to fix that. Easy!
But the second issue is massive. Keymaster is crashing with "Configure failed" after a KM_ERROR_INVALID_ARGUMENT (-38) error. This is pointing to a version mismatch.
There have been extensive modifications to the TWRP A11 git branch to patch that error. Those modifications have not been made in the A9 branch. Probably because not many people are putting A12 on devices originally released with A8.
We are stuck with stock keymaster blobs from A9. For compatibility reasons, I need to compile TWRP from the A9 branch. It might be possible to use keymaster blobs from a similar A10 device - assuming the kernel needs no modifications. If someone wants to put in the time to get this working, I'm happy to offer you some hints to get you started. You can PR the updates to my github repo. If it works, I'll push them to TWRP gerrit.
Yahoo Mike said:
Bad news on the TWRP front. There are two issues.
First, the Keymaster key data structure was changed in A12. I can patch TWRP to fix that. Easy!
But the second issue is massive. Keymaster is crashing with "Configure failed" after a KM_ERROR_INVALID_ARGUMENT (-38) error. This is pointing to a version mismatch.
There have been extensive modifications to the TWRP A11 git branch to patch that error. Those modifications have not been made in the A9 branch. Probably because not many people are putting A12 on devices originally released with A8.
We are stuck with stock keymaster blobs from A9. For compatibility reasons, I need to compile TWRP from the A9 branch. It might be possible to use keymaster blobs from a similar A10 device - assuming the kernel needs no modifications. If someone wants to put in the time to get this working, I'm happy to offer you some hints to get you started. You can PR the updates to my github repo. If it works, I'll push them to TWRP gerrit.
Click to expand...
Click to collapse
OK, I’ll check it. But I think it seems impossible for me to do that. Anyway, I’ll try my best.
Why can't I use the camera? The camera App stops running when it opens.

Categories

Resources