yashsingh1/xdaforums huggingface dataset:
[Android General] tek3195:
Hi [MENTION=8355838]Augustoandro[/MENTION], is there anything specific about the twrp.img's you have linked in OP that makes them more usable than others ? I'm asking because I need to find an img that has FBE support. The forced encryption disabler is not disabling file based encryption,at least not for me anyway. Device is a Huawei MediaPad T3 8 KOB-W09, any suggestions on working with FBE while porting ?
[Android General] Augustoandro:
The devices in the OP are Nexus device TWRPs which give the least number of errors while porting, according to my experience.

There is only forced encryption disabler zip in my knowledge so I can't provide you with any other way.

Also, the Nexus device TWRPs are able to remove forced encryption by using the forced encryption disabler zip, it never failed in my case.

HIT THANKS IF FOUND USEFUL
[Android General] tek3195:
Thanks, what I'm running into is an issue with FBE that keeps coming back. File-Based-Encryption is becoming harder for me to stop than Full-Disk-Encryption was. It's only /userdata that is encrypted so I was thinking /etc/fstab but it's not there. Guessing it has to be in one of the defaults that recovery calls for or possibly an init file. Looks like I've got some studying to do.
[Android General] Garlayn toji:
TWRP - j5xnlte - TWRP not working

Hi, I have a big problem. I ported TWRP for j5xnlte. I know there is an official TWRP recovery for this phone, but I wanted to port TWRP for Port training.

Now, none of the TWRP functionalities. I can't select USB OTG or external SD when I can, as the Install, Backup or Restore function. I can't boot into system, I can boot only in recovery and Bootloader. However, Bootloader doesn't work. Using Odin is not possible to flash another recovery, because Odin doesn't see my phone when connected to my computer. When I launch ADB Sideload, I return in the TWRP main menu. Terminal is useless.

I'm out of ideas. My phone is currently out of service. Please help me. There is a photo of the logs when I click on the bottom right button.

Edit : If you can't see the picture, contact me on Discord (Garlayn toji#7270). To prevent flood, I will not post my e-mail adress here.

Edit 2 : Here are the logs :

Can not create '/usb-otg' folder (Permission denied)

Can not create '/external_sd' folder (Permission denied)

Can not create '/efs' folder (Permission denied)

Can not create '/persdata' folder (Permission denied)

Can not create '/preload' folder (Permission denied)

E: Error creating fstab

Updating partition details...

Error opening: '/data' (Permission denied)

Failed to mount '/efs' (No such file or directory)

Failed to mount '/preload' (No such file or directory)

...done

E: Error creating fstab

E: uevent not root

Full SELinux support is present.

E:

MTP Enabled

Edit 3 : My bootloader wasn't broken. So I flashed Samsung official firmware and flashed the official TWRP for the j5xnlte.
[Android General] Augustoandro:
Post a copy of your recovery.fstab and twrp.fstab
[Android General] AmoKun:
( the other thread is closed so I'll just ask here )

So , firstly thanks for the thread.

But I still can't resolve my problem. I can boot the TWRP properly , but when I want to flash a .zip ( I tried with SuperSU ) it show me multiple errors for Mount on every partition.

I can read the SD Card but nothing else.

When I built the IMG I got two issues , first , I don't know if it matter but the default.prop from the unpacking only have one line and wrote in Chinese , so I just copied the default.prop from my phone "/default.prop".

Secondly my recovery.fstab has a lot of line but not all match with the twrp.fstab , I mean some partition mentioned in twrp.fstab are not available in the Recovery.

I just want to know how you used DiskInfo and the explorer to resolve this problem.
[Android General] alecxs:
it's not chinese, its a symlink to prop.default ;) ... that's why we should not use windows for messing around with android linux files

recovery.fstab is replaced by twrp.fstab on runtime, you don't need both, and you don't want to have all partitions in twrp (can be dangerous on wrong usage)

the missing r/w access is probably related to selinux enforcing kernel, you can't just use the stock kernel you have to compile from source (or use the existing official twrp as base)
[Android General] AmoKun:
But how it really works the fstab files ? Not just a mapping for the partitions ?

I just need TWRP to flash SuperSu , and I think it only need the System partition. But I still don't understand why it won't mount

Does it mean that it's just impossible to port ?

And I want to know how to use the /Dev/blocks files, even if it doesn't work
[Android General] alecxs:
SuperSU or Magisk won't install into system but into boot and data

in TWRP you have a terminal. type

ls -ld $(find /dev/block -name by-name)/*

you can manually mount, all you need is a folder as mount point

mkdir /system_root
mount /dev/block/bootdevice/by-name/system /system_root
mount
[Android General] nelikp:
Work on samsung note 10 lite?

Samsung A30S

Samsung A30

Please
[Android General] AmoKun:
I was able to finally mount all the partitions I need , I got some troubles but it's nothing for now , I still can't mount Data once the System booted once after the Format , but it works

Btf , DiskInfo won't show the partitions name , so I just ran mount on Terminal to get the correct mount point adresses of /System ; /Vendor ; /Cache

I thought the Data won't mount cuz of the encryption but still can't be mounted after i removed it with the magisk.zip flash.

I also tried some zips that edit .fstab files but nothing seem to work.
[Android General] stefano91av:
Hi, can anybody port twrp for me? I've tried it but without success.

From this recovery https://file.io/hu06Vg (3.0.2) to this https://file.io/Zcd2Jg (3.3.1).

My smartphone is Elephon P8000 Mtk 6753 (twrp 3.0.2)

Twrp to port is from a Xiaomi Redmi note 4 Mtk (3.3.1).
[Android General] Augustoandro:
This is a thread to be used as a guide for porting TWRP. Please don't request here and port one yourself.

If you encounter any issues during porting, you can post your questions here.

HIT THANKS IF FOUND USEFUL
[Android General] Xing-Xong:
[HELP PLEASE] I have ported TWRP recovery for my device but the /Data partition is not mounting and other partitions like /System is mounting and is accessible. Can anyone help me with this ? :confused: .. And also my TWRP theme is inverted upside/down .. But the touch is okay .. Just the theme got rotated 180° .. :confused:

DEVICE : MICROMAX CANVAS MUSIC M1

MODEL : Q4261

CHIPSET : MT6737M

OS : STOCK (ROOTED WITH MAGISK)

HELP PLEASE !!:angel:

---------- Post added at 06:26 AM ---------- Previous post was at 06:20 AM ----------

Download TWRP recovery for same CHIPSET as yours .. Unpack it and compare your recovery fstab with recovery.fstab/twrp.fstab from the downloaded TWRP recovery . :o
[Android General] Mahdi0047:
Can you give me your telegram id for support. I want to port twrp for my snapdragon425
[Android General] Augustoandro:
Support is only provided via this thread. Feel free to post your doubts and questions.

I will answer them ASAP.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
I really apologize for the delay in replying.

Check the point number 3 in TROUBLESHOOTING INSTRUCTIONS section in the guide.

I have just added the instructions to the guide for everyone.

Thank you for bringing this to my attention, I had forgotten to add these instructions in the guide.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
[MENTION=516493]JLowe[/MENTION]

I apologize for the delay in replying.

1. The topmost part

#<src> <mnt_point> <type> <mnt_flags>

has already been commented out by "#", so leave it as it is.

2. For listing the system partition in fstab files, always use "/system".

3. Always include all entries from the stock recovery.fstab in your TWRP recovery.fstab and edit your twrp.fstab in accordance with it.

4. Whatever partititon is not available in your stock, never include it in your TWRP fstab (applies to both recovery.fstab and twrp.fstab). If you can't find a partition neither in your stock fstab nor via DiskInfo , it just means those partitions don't exist on your device.

5. Never include files not available in your stock recovery to your TWRP.

HIT THANKS IF FOUND USEFUL
[Android General] JLowe:
Thank you for the hints! I edited the fstab and included every partition from stock.

concerning data partition "encryptable"

in fstab.qcom it's "encryptable=/dev/block/platform/msm_sdcc.1/by-name/extra"

dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,barrier=0 wait,encryptable=/dev/block/platform/msm_sdcc.1/by-name/extra

stock has "encryptable=footer"

/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,encryptable=footer

So I take "encryptable=footer"?

In etc there's also a twrp.stab which I edited.

What about the other files in the ramdisk directory which not mentioned in the guide, but are different from stock:

If they are both in twrp and stock I replace them with stock?

I go through every directory and replace the files with stock files i.e. directory files from "res", "sbin"

ramdisk root folder: i.e. init, init.rc, sepolicy

If there are other files which aren't in twrp available I add them?

i.e. tfupdate_ini.rc, vendor_file_contexts,...

Or just leave everything else like it is?
[Android General] Augustoandro:
Use the stock one, that is, the one with "encryptable=footer".

Only copy the files mentioned in the guide, don't copy any other file that is not mentioned in the guide.

Don't edit files other than those mentioned in the guide.

HIT THANKS IF FOUND USEFUL
[Android General] JLowe:
Dear Augusto,

thank you for your quick response and your help. I'll build the recovery.img and will check it once my bootloader is unlocked and report back!
[Android General] Rex350:
My Tablet stuck on boot

Hello! I did all the steps but when I flashed it and open the recovery mode, it just stucks on the logo.

Model: MyPhone myT5 DTV

Processor: MT6580

Resolution: 1280x800

Can you tell me what part of the code is wrong, the twrp.fstab? Ask me for some information so it is much easier to solve the problem. I hope you will answer :) Thanks!
[Android General] Augustoandro:
Did you properly copy, paste the files in split_img folder after extracting the recovery.img files ?
[Android General] Rex350:
Yes I deleted all files from TWRP split_img then copy and paste all files from STOCK split_img to TWRP split_img. I think the error is I used Windows because you said I can get problems when I used Windows.
[Android General] Tianhe:
[MENTION=8355838]Augustoandro[/MENTION] - I intend to use your guide for porting TWRP to a device running on Snapdragon 429 on MSM8937 platform. Apparently, there is no TWRP for any such device. Now which chipset should I use ? The nearest I could find was SD 410 MSM8916 with same resolution on TWRP 3.1.1-1
[Android General] Augustoandro:
Generally, there aren't any problems if you use the proper tools, for example, notepad++ instead of notepad for editing files.

But you can try porting again on Linux, that would be better.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
The TWRPs mentioned in the guide have been mentioned so that one doesn't need to worry about resolution.

In addition, those TWRP images are for Nexus devices which have a generic architecture.

I would recommend using one of the mentioned TWRP images which is nearest to your device resolution.

HIT THANKS IF FOUND USEFUL
[Android General] Rex350:
I used notepad ++ and I don't have Linux.

When the recovery doesn't boot I'm so sad but I remembered that there's a request thread so I checked it but it is closed now so I disappointed that I need to solve it myself. Can you help me to fix it please, I always repeat the copy, paste of split_img and It still doesn't work :(
[Android General] Tianhe:
Step 16 - fstab.devicename is not available in stock recovery. In fact the only fstab file available in stock recovery is recovery.fstab in /ramdisk/etc folder of stock recovery. Now what to do ?
[Android General] Augustoandro:
If there's no fstab.devicename file, the recovery will use recovery.fstab file by default for identifying partitions, no need to worry.

You can port a TWRP recovery without fstab.devicename if it is not available in the stock recovery.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
Use some other TWRP recovery for porting that is closest to your device chipset and resolution.

HIT THANKS IF FOUND USEFUL
[Android General] Rex350:
I luckily found a TWRP with the same chipset and resolution with version 3.3.1 that is just uploaded this May and I was so happy because I'm sure that It will work.

But it still stuck on boot, I tried to flash the stock recovery and it works so that means

the error is in my custom recovery.

So the answer is: I tried to port it with the closest TWRP but it is still not working.

I think I did something wrong, ask me some question please so we can solve it.
[Android General] Augustoandro:
List all the files that you copied from ramdisk folder.

Also list all the files and folders present in ramdisk folders of both the stock and the TWRP you used for porting.

Screenshots will also be okay.
[Android General] Rex350:
My Device Information

Device: MyPhone myT5 DTV

Android: Nougat 7.0

Chipset: Mediatek MT6580

Resolution: 800x1280

Files I copied from Stock Ramdisk folder

recovery.fstab in ramdisk/etc

default.prop (I edited it when pasted)

fstab.mt6580

selinux_version (I saw its content that it uses the fingerprint of a device)

ueventd.rc

ueventd.mt6580.rc

Screenshots of Ramdisk Folders

Stock Ramdisk (It is MyPhone myT5 DTV)

TWRP Ramdisk (I used Galaxy S9 S9 Plus Clone because it has the same chipset and resolution)
[Android General] Augustoandro:
1. Delete fstab.goldfish , fstab.ranchu, ueventd.goldfish.rc, ueventd.ranchu.rc and ueventd.rc in TWRP

2. Transfer from Stock to TWRP following files:

fstab.mt6580, default.prop, ueventd.mt6580.rc and ueventd.rc

3. Leave the selinux_version in TWRP as it is, do not copy from stock

Also, try changing the permissions of the files, ramdisk and split_img folders before transferring them to 777.

HIT THANKS IF FOUND USEFUL
[Android General] Rex350:
What is 777? I am using Windows because I don't have Linux sorry.

Is 777 are the Android Image Kitchen or the permission. In Windows I am just going to change the permission to full control then repack?
[Android General] Augustoandro:
Allow all permissions for all users on the folders and files mentioned in my previous post.

That's what I meant.

HIT THANKS IF FOUND USEFUL
[Android General] Rex350:
It is still not working :( It is still stuck on boot. But the method of changing the split_img of a TWRP recovery works but it is not fully ported. Can you port the TWRP for me, please. It is ok for me if you don't accept, I will just discontinue to port TWRP.

Thank you!
[Android General] Augustoandro:
I apologize, I have stopped porting for a while because of my busy schedule.

Hope you understand.
[Android General] Rex350:
It's ok, thank you for answering!
[Android General] Mahdi0047:
I have installed a twrp for my phone (I have not ported it and just downloaded it) but I have a problem with not displaying internal memory and SD card. Please help me solve this
[Android General] Augustoandro:
Look at step 21 of the guide for SD Card.

For internal memory, take a look at SPECIAL INSTRUCTIONS FOR MEDIATEK DEVICES section and make the changes in the *.fstab files accordingly.

HIT THANKS IF FOUND USEFUL
[Android General] Mahdi0047:
I want to install custom Rom And that's why I want you to have a TWRP
[Android General] Mahdi0047:
Special instructions for mediatek devices but I have snapdragon. Can you give a guide to fixing memory problems in Snapdragon phones?
[Android General] Augustoandro:
If you have Snapdragon, then the procedure is much easier.

Just unpack the TWRP and replace the recovery.fstab file from the TWRP with the ones from your stock recovery.

Edit the twrp.fstab in the TWRP in accordance with it.

HIT THANKS IF FOUND USEFUL
[Android General] Reick7:
hello [MENTION=8355838]Augustoandro[/MENTION], I'm trying on my Samsung Tab A8 T290, but it just won't start, I made the ports, I used your tips, so far so good, but the first time I installed it was replaced by the factory recovery, or even let me start it, the other times it was accusing custom_binary, and crashed the entire tablet lol, I wonder if you have any tips for this device?

thank you for everything!
[Android General] Augustoandro:
Please elaborate on the error. What did it say exactly?
[Android General] Reick7:
sorry for the bad english kkk the problem is that TWRP does not start, I also do not find defaut.prop and recovery.fstab, it simply does not exist, because of that, I believe that the port does not work. I used your tips but still didn't find the files :(
[Android General] Augustoandro:
Try creating them then by referring some other default.prop and recovery.fstab from another device of same chipset.

HIT THANKS IF FOUND USEFUL
[Android General] Reick7:
I’ve tried, two others besides those indicated on the poster, and just give up, one thing I don’t understand is why he goes back to recovery stock, and fixes it on stutus as "custom" on Odin.
[Android General] Augustoandro:
Let's try to fix the default.prop issue first.

Try to extract your build.prop file from your stock system.img file.

You can use dsixda's Android Kitchen or SuperR's Android Kitchen for the extraction.

In this file, you will find the following sections:

# ADDITIONAL_DEFAULT_PROPERTIES

# BUILD_BOOTIMAGE_PROPERTIES

Copy the above mentioned sections from build.prop to a text editor and name the new file default.prop

For the *.fstab files, find out the paths of partitions using DiskInfo and prepare the *.fstab files appropriately in the proper format.

I assume you have understood the format of *.fstab files.

Ask for help if you get stuck somewhere.

HIT THANKS IF FOUND USEFUL
[Android General] alecxs:
That's normal behavior of stock ROM, stock recovery is restored on each boot (otherwise it would deny boot because of modified recovery).

once in TWRP you should rename /system/recovery-from-boot.p (which is usually be done automatically with TWRP initial setup screen when you swipe to allow modifications of System) and disable dm-verity by flashing modified boot.img (patched with Magisk Manager) or by installing a zip (Magisk.zip, no-verity-opt-encrypt.zip or similar)
[Android General] dhaern:
I followed your guide trying port new Mi 9T Pro official TWRP 3.4.0 released 2-3 days ago to K30 Pro/Poco F2 Pro but no luck, stuck in TWRP logo after I did all steps right and resolution is the same for both devices. I hope you can help me because the only K30 Pro TWRP available now is a chinese bugged version and it cant mount partitions. I used:

https://androidfilehost.com/?fid=4349826312261761273 as stock recovery (chinese bugged version).

https://twrp.me/xiaomi/xiaomimi9tpro.html as target recovery and new version to port.
[Android General] Reick7:
right, not now because of the time, but thank you, I will try as soon as possible, and about the fstab I did not understand well how it works
[Android General] Augustoandro:
Use your own stock recovery instead of the chinese bugged version.

Contact me here if you get stuck on some step.

If even then you get stuck on boot logo, give the recommended TWRPs in the guide a try, whichever is nearest to your resolution.

HIT THANKS IF FOUND USEFUL
[Android General] dhaern:
Problem is only available version now is the unoficial chinese one. And I would like port the oficial version recently released from k20 Pro to k30 pro, so I only can use the chinese version as base stock to start.

Here is the oficial K30 Pro source code:

https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/lmi-q-oss
[Android General] Rex350:
Can I change the default language of my TWRP rather than changing it in settings? Because the TWRP I ported is russian.
[Android General] Mahdi0047:
I repacked twrp with 7zip in tar format but when I tried to flash it with odin , Odin write unassigned file and show fail.What should I do?
[Android General] Surya1408:
I have two stock recovery files in my firmware

1.recovery.IMG

2.recovery verified.IMG

Which one should I use to port twrp
[Android General] charan66:
Missing files

Line 15

B. fstab.devicename_or_chipsetname

{I have fstab.grouped}

Line 16

copy fstab.devicename from stock recovery

{Only fstab.devicename file is not present in stock Ramdisk}

Line 19

19. Edit the twrp.fstab file according to the newly pasted recovery.fstab

{1. I didn't understand what does it mean,

2. recovery.fstab file is already present in that folder(18. Paste the recovery.fstab file in new ramdisk/etc folde) so I

replaced it}

20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".

21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.

/external_sd vfat /dev/block/mmcblk1p1 flags=removable;storage;display="SDCARD"
/usb-otg auto /dev/block/sda1 flags=removable;storage;display="USB-OTG"

{I don't have files/folders named 'sdcard' in any folder}

---------- Post added at 07:22 AM ---------- Previous post was at 07:19 AM ----------

Line 15

B. fstab.devicename_or_chipsetname

{I have fstab.grouped}

Line 16

copy fstab.devicename from stock recovery

{Only fstab.devicename file is not present in stock Ramdisk}

Line 19

19. Edit the twrp.fstab file according to the newly pasted recovery.fstab

{1. I didn't understand what does it mean,

2. recovery.fstab file is already present in that folder(18. Paste the recovery.fstab file in new ramdisk/etc folde) so I

replaced it}

20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".

21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.

/external_sd vfat /dev/block/mmcblk1p1 flags=removable;storage;display="SDCARD"
/usb-otg auto /dev/block/sda1 flags=removable;storage;display="USB-OTG"

{I don't have files/folders named 'sdcard' in any folder}

what shall i do

Im using

Samsung Galaxy J7 Duo (SM-J720F) runing android 10

I have recovery.img
[Android General] Augustoandro:
Use recovery-verified.img

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
With the method of porting in this guide, I don't think its possible.

Just use a English TWRP to port for your device.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
Add your TWRP.img to official ROM of your device by extracting and repacking.

Then flash this new ROM to your device.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
Please mention me instead of quoting the entire post. Please edit your post, remove the quoted post and replace it with [MENTION=8355838]Augustoandro[/MENTION]

If you have recovery.img, you can use it straightaway to port your TWRP, just use the path for the SDCard that is used in the recovery.img

HIT THANKS IF FOUND USEFUL
[Android General] charan66:
@Augustoandro port twrp

[MENTION=8355838]Augustoandro[/MENTION]

I'm using Samsung Galaxy J7 Duo(SM-J720F)

1280X720

Here it's stock recovery.img

https://drive.google.com/file/d/1CHnxtOIBAJLtY0dh7iQ0B2WOXe5R7GZF/view?usp=sharing

Will you port TWRP.tar for my device
[Android General] alecxs:
https://www.androidinfotech.com/root-samsung-galaxy-j7-duo-sm-j720f-m-oreo

https://xdaforums.com/galaxy-j7/development/twrp-root-galaxy-j7-refine-8-0-boost-t3916575
[Android General] Augustoandro:
I have been busy and can't manage both porting and work. I would be happy to guide you in case something doesn't work though.

HIT THANKS IF FOUND USEFUL
[Android General] tdukazudon:
Porting TWRP for Galaxy A7,(SM-A750C)Japan model

[MENTION=8355838]Augustoandro[/MENTION] I’m trying to boot TWRP for SM-A750C,but some errors happened.

I think this problem is in fstab, but what about? I have attached a screenshot