yashsingh1/xdaforums huggingface dataset:
[Android General] pizzaboy192:
Hi,

I have an unofficial TWRP For my phone (Moto G5s+) but it's broken (It mounts system partitions even in read-only mode breaking things, and the current TWRP devs for the devices won't fix it). If I follow your guide and unpack one of these TWRP, I should be able to edit it to leave certain partitions Read Only, right?
[Android General] Augustoandro:
You have to edit the fstab files for that, look for them in ramdisk/etc folder when you unpack the recovery.

HIT THANKS IF FOUND USEFUL
[Android General] Leone_1:
thanks for reply.

must be in the fstab TWRP/Stock the identical partitions?

or this only in TWRP.fstab?
[Android General] Augustoandro:
What are you trying to ask?

HIT THANKS IF FOUND USEFUL
[Android General] Leone_1:
must be in the fstab TWRP/Stock the identical partitions?

or this

"/external_sd vfat /dev/block/mmcblk1p1 flags=removable;storage;display="SDCARD"

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

only in TWRP.fstab?
[Android General] pizzaboy192:
Found exactly what I needed. Thanks! I've passed this info up to the other devs too since they didn't feel like digging into it.
[Android General] Augustoandro:
twrp.fstab and recovery.fstab should be identical, so all you have to do is copy and paste the contents of one into the other after rectifying whatever is wrong with them.

HIT THANKS IF FOUND USEFUL
[Android General] alecxs:
to all people who experience boot loop on TWRP splash screen:

adb shell
df

you will figure out which mount point is crashing. fix it in fstab. you may have a look in /cache/recovery/last_log too

for me the reason was vold mounts, i simply deleted two lines (yes, its /devices instead of /sys/devices i don't know if it is a bug, its from stock boot.img)

/devices/mtk-msdc.0/11120000.msdc0* auto vfat defaults voldmanaged=sdcard0:auto
/devices/mtk-msdc.0/11130000.msdc1* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata

if touch screen is not working, you can still use touch screen when booted from fastboot (unfortunately no fix, yet):

fastboot boot <twrp.img>
[Android General] Augustoandro:
I tried porting using kernel sources for one of my devices but ended up bricking it.

I don't have anymore devices to test, so there won't be a guide for a while.
[Android General] rohitrss:
I tried porting using Samsung Auto TWRP recovery porter by Team Hovatek but it failed. Now, will try your way.
[Android General] rohitrss:
@Augustoandro Instead of using motorolanexus6 as base TWRP

can we use TWRP of a device which is very similar to ours? In Galaxy M40's (1080 x 2340p resolution) case it would be Redmi Note 7 Pro.
[Android General] Suji2k:
I have vivo y15s and unlocked bootloader but after unlock it goes to stock recovery and wipes data itself without prompting. But wiping data fails and it does not boot system because after vivo logo it reverts back to stock recovery and fails to wipe data.

I used twrp build by auto porting by hovatek, but it didn't boot. I have a stock recovery and all firmware dump. Will the problem solved using twrp? Can you please build a Twrp?

This problem cannot be solved even I flash full firmware using sp flast tool(mtk6580), only restoring dump backup solves the problem.

firmware version: PD1304DW_EX_A_1.70.5

Stock Recovery Link(bin format): https://drive.google.com/file/d/18f6ithUDCr1NSkxzcZoUpol_OzCJ8UKf/view?usp=sharing

boot.bin: https://drive.google.com/file/d/1VC6Rg40fVb2a-iMmvwhmze8mpZjUC_wl/view?usp=sharing

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

Available version firmware in google: PD1304DE_EX_A_1.10.5

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

Tried patched boot image but all goes to wipe data failed and in fastboot mode to remote failed.
[Android General] Augustoandro:
Yes, you can. The TWRPs I suggested in the guide are most editable. And have had the most success according to my experience.

If you find better editable ones, you are free to use them.

HIT THANKS IF FOUND USEFUL
[Android General] Augustoandro:
Feel free to use this guide for porting a TWRP of your own.

I have stopped porting TWRP for others since I don't have that much time anymore.
[Android General] Suji2k:
Okay sir, I ported twrp successfully and luck is that it has zero bug. So thanks to you also. Now issue is of stock rom, need custom rom for rooting, so stepping forward to it. If anybody want twrp, I may just port it but I cant say it always work. Thank you sir.
[Android General] Augustoandro:
Just flash Magisk. You don't need a custom ROM for rooting. Flashing Magisk zip will do the trick.

HIT THANKS IF FOUND USEFUL
[Android General] Suji2k:
This is a diffrent systrm, Cant root even though if super su or magisk flashed. Supersu acts as a system app, but no root previliges. And magisk causes continuous boot,
[Android General] Fury_Phoenix:
Erm.... I understand how to do it, but I don't know how to pull recovery.img and there isn't any image on the internet. It's for a SGH-T959P, Canadian variant. I know I should be probably quitting trying to port TWRP to it though. The closest thing I have is /recovery which is a file...
[Android General] Lefteris Fragiadakis (Frago):
Hey, I just found you! Hi from greece! trying for days to twrp for sda-8tab pioneer but no luck, if you can help me I will will buy you a drink! Maybe Raki like we have here in crete here is the files, is allwinner a50 cpu

1280x720 resolution, you are my last hope, please help me out, I have taken the files from emmc dump I did using easyjtag
[Android General] jnvl_wolf:
Does this tutorial still work? I would like to create a twrp.img for the Samsung M62. Can anybody help me? I followed the entire procedure. Can I post here what I did for you to check if it's correct?
[Android General] Augustoandro:
Feel free to ask for any help you need.

HIT THANKS IF FOUND USEFUL
[Android General] ravijol1:
Can't find fstab.devicename in stock ramdisk folder. btw phone is samsung a41 (sm-a415f) @Augustoandro
[Android General] Augustoandro:
This happens sometimes. Some devices directly reference the recovery.fstab file instead of fstab.devicename.

Edit the rest of the files and proceed further.

HIT THANKS IF FOUND USEFUL
[Android General] tek3195:
I'm curious about fs_flags to twrp_flags in fstab. biggest question is first_stage_mount and how does it fit in with twrp ? Is first_stage_mount used as a flag or do we only include partitions with first_stage_mount in fstab and leave the others out ?
[Android General] tocylia3:
Hi,This procedure is not clear.

What should I do at this step?

Could you show me some concrete sample to do?
[Android General] tek3195:
just download an official TWRP image for a device close to yours and open it up to get twrp.fstab that is more current. Use it as an example and edit yours to look like it. It should be of same format but with your device specific info.
[Android General] ravijol1:
I have a ZTE phone but unpacked image had ramdisk folder empty. i found recovery.img.ramdisk.cpio.gz file in split_img and some other files that as i know, aren't the right ones. i remember i also found a recovery.img-origsize file and some other weird files that include names like ramdisk and recovery. what to do now @Augustoandro?
[Android General] AddictedA1:
HELP im on a bootloop samsung galaxy a7 lite , cant turn it off nor go to download mode its shows bootloader unlocked msg then a small white flash then restarts

EDIT: Turnedoff Download mode doesnt coming up

EDIT :Fixed
[Android General] ulissesemuman:
@Augustoandro, I managed to port TWRP successfully on Aidan's ROM, thank you very much!​

​

But but the letters are all scrambled and the colors are strange, please see my video:​

​

I can still use the mouse and enter the options, but when I try to restore a backup, an error occurs in the partitions, but I can't see which partitions are in error because I can't read the text.​

​

Can you please help me to fix the text display? So I could see the errors and change the fstab correctly.​
[Android General] ravijol1:
[DELETED]
[Android General] Augustoandro:
I will edit the guide ASAP in a day or two and make the necessary changes that will clear your doubts.

Keep your eyes on the guide.
[Android General] Augustoandro:
There seems to be some incompatibility issue among the files you imported in the TWRP and the rest of the recovery.

Try porting with some other recovery, preferably one that has the closest or the same chipset as your target device.
[Android General] Augustoandro:
Your img seems to have some issues, the ramdisk can never be empty.

Find a new img.

And about the files like ramdisk.cpio.gz which are part of split_img. DO NOT TOUCH THEM, EVER.
[Android General] Augustoandro:
What are you hinting at?
[Android General] Cruel5anity:
There is no fstab.devicename or chipset... Any ideas if I can fabricate an fstab?

Skipped the fstab.device/chipset it booted to system but bootlooped when trying to boot to recovery... Might just send a copy of my recovery.img to your request thread...
[Android General] ravijol1:
Never mind
[Android General] ravijol1:
@Augustoandro now the problem is with default.prop. it contains this: 㰡祳汭湩㹫prop.default this is on both stock and twrp recovery. why is this and what to do?
[Android General] Augustoandro:
There must be a recovery.fstab in your recovery. You can rename a copy of it as fstab.devicename.
[Android General] Augustoandro:
Don't touch split_img folder. It contains kernel related files.
[Android General] Augustoandro:
I have no idea about how to deal with chinese recovery.

Your best bet would be to only copy the partitions part from the stock recovery into the TWRP.
[Android General] ravijol1:
@Augustoandro i found the config of default.prop. include in guide, that there is a prop.default file that contains the configs of default.prop if it's chinese in default.prop
[Android General] ulissesemuman:
It's not a chinese file, it's a symlink. Open in Notepad++ to see in correct code page.
[Android General] blaze2051:
@Augustoandro

Is it possible to use a ported twrp.recovery.img from a different unisoc device and use it to modify the oem boot.img AB dynamic on different unisoc device,? so ported iplay40 twrp recovery to stock boot.img on T803 ?

iplay40 has a recovery partition but the T803 does not have recovery partition only has boot partition. I trying to inject or patch the boot.img I cant used the fastboot boot twrp.img command on the unisoc it wont boot. so I have to patch the boot.img some how.

If i could use the fastboot method i could then use the feature install to ramdisk once i temporarily booted to twrp but that doesnt seems like its possbile i read somewhere unisoc and mediatek devices have this issue of termoprarily booting twrp.img from fastboot. google devices like ex. pixel 4 do not seem to have this issue.

i have managed to patch boot.img with magisk 23, but thats all iv done with the stock boot.img
[Android General] gentle_giant:
@Augustoandro

what exactly do you mean with: "19. Edit the twrp.fstab file according to the newly pasted recovery.fstab.

Simply delete all the lines in the twrp.fstab and replace them with all the lines from recovery.fstab?

Also, would the official TWRP for the HTC U12+ be a good starting point? I got hold of a very newish HTC U11+ for a very good price.

They both started with Oreo and got an upgrade to Pie and they have the same screen resolution (1440x2880)

Sorry for the noob questions..

Edit: spelling and added a question.
[Android General] NextB:
View attachment 5572911

help cant use ./unpackimg.sh
[Android General] ravijol1:
install git and run it by double-clicking
[Android General] NextB:
thanks it worked ^^
[Android General] chen939:
Why can't the repackaged twrp be flashed into the machine?
[Android General] Lucas VT:
Hello,

I hope someone can lend me a hand.

I'm trying to port TWRP to Red Magic 7 Pro (NX709J).

I extracted the recovery.img and everything from the official rom provided on their website and i'm using the nexus6 twrp image.

I'm following all the steps but the recovery never works, the phone boots stright to the system.

The fstabs are in a completely different format and most of the paths are dependant on symlinks on the folders inside the ramdisk, i tried at first just following the steps and also I tried adding all the folders with symlinks to the ramdisk, but does not seem to make any difference.

On step 19 and 20 i dont think i really understand the objective.

-Should i modify the "twrp.fstab" paths to match the ones in the "recovery.fstab" and leave the ones that dont exist in this file alone?

-Should i replace everything by the paths on the "recovery.fstab"?

-Should i modify "/sdcard" and "/usb" on both "recovery.fstab" and "twrp.fstab"?

I see that the examples on the steps show a lot of files with the device name on them, in the official recovery the device name cannot be found once on any file name, so i dont know what should i name those files, i tried using ".recovery" and other names.

Also on the original ramdisk path there is no "ueventd.rc" but it can be found on "ramdisk/etc", I tried to put it in the twrp etc folder, in the ramdisk folder and on both, nothing works.

I also noticed that the magisk patched "boot.img" does not work when i use the failed twrp recovery, the magisk app does not detect the patch, but works flawlessly with the default recovery, i dont know if this can give any clue on what is happening.
[Android General] Prowindows62:
Thank you, I ported CWM recovery to old turkish phone :D
[Android General] doc.K:
Stucked on default.prop edited.

File is not opening and it's 0kb

Any idea?
[Android General] tek3195:
Bad file. It must have been more than 0kb before you edited it, try again with different editor. 0kb means there is nothing there, blank file.
[Android General] alecxs:
use prop.default
[Android General] Skorpion96:
I can't add

ro.secure=0

ro.adb.secure=0

security.perf_harden=0

ro.debuggable=1

persist.sys.usb.config=adb ,mtp

Because the file is a symlink what I have to do?
[Android General] alecxs:
edit the target of the symlink
[Android General] shaman79:
Hello, I went through the process and successfully created TWRP image for latest 7.1.2 Nougat firmware for Minix NEO-U9H. I was also able to install Magisk root.

For anyone looking to root your NEO-U9H Minix:

- Download recovery.img from this link: https://mega.nz/file/TbAgiLbI#j0tCGZkmaX0f7xBz1XGtHViUtAxyqU2yDdKgka2C4q4

- Download Magisk: https://mega.nz/file/baYHFAyS#dPYwIflz9ADmuhPcXS7VKOcTBtdBZhnSDYzbG3bYhSc

- Place both files to root of your SD card

- Unplug power cable from Minix

- Hold Power On button and plug in power cable

- Wait for TWRT logo to appear

- Install Magisk from the zipfile

- Reboot and enjoy

Thanks to OP for providing the guide.

Edit: fixed the links
[Android General] xinulhacker:
Now a symlink to prop.default.
[Android General] xinulhacker:
You need to modify the twrp.fstab to match the mount points in your stock boot image fstab.

You don't need ueventd.rc from your stock boot image.
[Android General] xinulhacker:
Links broken 😢
[Android General] shaman79:
Links fixed :)
[Android General] Skorpion96:
Someone ported twrp to my device
[Android General] naeembabakheil:
Your tutorial is good but if you Use Word Stock and Twrp instaed of split and new spliit it will not give confussion to follow..i have ported Twrp recovery 4 years ago fo Kitkat now same recovery not work for Lolipop so i want to port recovery for Lolipop .. plz tell me in simple which files should i replace from stock with Ported Twrp file so it work .Thanks
[Android General] VTRF8FF.TMP:
View attachment 5704309

Hello, does anyone know why swiping doesnt work? it gets stuck on where i leave my finger
[Android General] jvasanth1984:
I'm unable to extract system.img, boot.img, etc from this latest firmware file (Android TV). Can someone help
[Android General] Augustoandro:
Try to get the stock firmware. Extracting from bin is often complicated and prone to errors.
[Android General] R41N MuTT:
Edit: guide completed. Working on porting twrp now. Thank you for this guide!
[Android General] EgeYnl:
Hello, I have Vestel Venus 5.0V (VSP250g). My screen resolution is 540x960 and I can't find TWRP image that supported 540x960. Can you help?
[Android General] R41N MuTT:
https://xdaforums.com/t/twrp-recovery-themes-540x960.2712071/

This should do the trick. And if you use his stuff tell him thanks. A lot of effort goes into this stuff.
[Android General] EgeYnl:
Thanks for replying. Btw, which TWRP image should install on my device? I mean, does it need to use the same SoC? Thanks.

My SoC is MSM8212.
[Android General] R41N MuTT:
EDIT: I found a guide for installing TWRP on the Qualcomm MSM8212. The process could brick your phone, BUT, they have a TWRP image for your SoC. I might try it, me personally, but I brick devices regularly. It's for the Micromax A121 Canvas Elanza 2 and has a Qualcomm MSM8212 SoC

MSM8212 twrp

I don't believe this method is device specific. To be certain, I posted an inquiry for you. Watch this thread

TWRP inquiry

Between these two threads you should be good to go. Please report successes and failures. Maybe consider starting a thread detailing the method for this device, even referencing all this. That'd be totally cool of you.
[Android General] EgeYnl:
Thanks for helping dude.

I ported the TWRP file of Huawei Ascend G630 to VSP250g but when I try to flash that image it gives an error.

Warning: skip copying recovery image avb footer (recovery partition size: 0, recovery image size: 13344768).
Sending 'recovery' (13032 KB) OKAY [ 0.431s]
Writing 'recovery' FAILED (remote: 'size too large')
fastboot: error: Command failed
[Android General] R41N MuTT:
I'm no expert, but it looks to me like the write failed. Most likely it's the wrong file. Follow this guide using the two files I linked you and try and port TWRP yourself. That's where I'd go from here. Maybe a dev, the OP or somebody will get back to you and walk you through it. Or Google it if you get stuck. If TWRP exists for that SoC for a different phone, perhaps following a guide on how to port TWRP on that device, but using your device firmware instead seems like it would produce results. Like if it's the same SoC it just make sense it's the same files with different names, essentially. I'm just guessing at this point
[Android General] alecxs:
huawei devices don't have boot or recovery partition namely.
[Android General] EgeYnl:
What about LG L Fino?
[Android General] alecxs:
very old device.. sure it has recovery partition. you can check yourself from adb shell or terminal.

adb shell
ls -d /dev/block/*/*/*/by-name/*
ls -d /dev/block/*/*/by-name/*

Magisk requires Android 5+ but TWRP is available here. you can root with SuperSU instead.

https://xdaforums.com/t/recovery-tw...1-0-0-for-lg-l-fino-bootloader-unlock.3308436
[Android General] EgeYnl:
I got this. Seems like there is an recovery partition.

shell@VSP250g:/ $ ls -d /dev/block/*/*/*/by-name/*
/dev/block/*/*/*/by-name/*: No such file or directory
1|shell@VSP250g:/ $ ls -d /dev/block/*/*/by-name/*
/dev/block/platform/msm_sdcc.1/by-name/DDR
/dev/block/platform/msm_sdcc.1/by-name/aboot
/dev/block/platform/msm_sdcc.1/by-name/boot
/dev/block/platform/msm_sdcc.1/by-name/cache
/dev/block/platform/msm_sdcc.1/by-name/fota
/dev/block/platform/msm_sdcc.1/by-name/fsc
/dev/block/platform/msm_sdcc.1/by-name/fsg
/dev/block/platform/msm_sdcc.1/by-name/misc
/dev/block/platform/msm_sdcc.1/by-name/modem
/dev/block/platform/msm_sdcc.1/by-name/modemst1
/dev/block/platform/msm_sdcc.1/by-name/modemst2
/dev/block/platform/msm_sdcc.1/by-name/pad
/dev/block/platform/msm_sdcc.1/by-name/persist
/dev/block/platform/msm_sdcc.1/by-name/recovery
/dev/block/platform/msm_sdcc.1/by-name/rpm
/dev/block/platform/msm_sdcc.1/by-name/sbl1
/dev/block/platform/msm_sdcc.1/by-name/sdi
/dev/block/platform/msm_sdcc.1/by-name/splash
/dev/block/platform/msm_sdcc.1/by-name/ssd
/dev/block/platform/msm_sdcc.1/by-name/system
/dev/block/platform/msm_sdcc.1/by-name/tz
/dev/block/platform/msm_sdcc.1/by-name/userdata
[Android General] EgeYnl:
Update: I ported LG L Fino's TWRP image for my own device but the result is the same.

fastboot flash recovery twrp.img
Warning: skip copying recovery image avb footer (recovery partition size: 0, recovery image size: 11819008).
Sending 'recovery' (11542 KB) OKAY [ 0.369s]
Writing 'recovery' FAILED (remote: 'size too large')
fastboot: error: Command failed

fastboot boot twrp.img
Sending 'boot.img' (11542 KB) OKAY [ 0.366s]
Booting FAILED (remote: 'dtb not found')
fastboot: error: Command failed
[Android General] alecxs:
recovery partition size: 0 = no partition with name 'recovery' exist

dtb not found = need to append dtb to kernel
[Android General] EgeYnl:
How can I fix that?
[Android General] alecxs:
extract boot.img with AIK and try to make recovery of it (usually dtb is attached)

if you download Magisk-v21.4.zip and extract x86/magiskboot binary you can view it on linux pc

https://topjohnwu.github.io/Magisk/tools.html#magiskboot

./magiskboot dtb boot.img print
[Android General] Maxophonyx:
if my device's screen resolution is more than 1920x1080, what should I do?
[Android General] AltFantasy:
my screen resolution is 1080x2400... how do I get a recovery image for that screen size? I suspect that I'll have to find the recovery image of a device with a 1080x2400 screen
[Android General] apipChan:
when i type this to cmd, it show like this, anyone can help?View attachment 5930379
[Android General] ravijol1:
su is a linux command. you are trying to run a linux command on windows. you dont need su on windows, just download the windows version of Android Image Kitchen and use the scripts in there.
[Android General] gnufirmlink067:
I know this is a old thread but can you port a recovery twrp for me and I couldn't find the link to requests so yea and BTW the etc folder in ramdisk is located in /system/etc

Make sure to extract the tar.gz

Download recovery= https://drive.google.com/file/d/10SogRIJgkufWh-cY6avpQfTmaiBZDirR/view?usp=drivesdk
[Android General] gnufirmlink067:
You could try installing wsl ubuntu from. Microsoft store and using android_boot_image_editor

It's kinda hard to setup but when setuped it's very nice link to download

GitHub - cfig/Android_boot_image_editor: Parsing and re-packing Android boot.img/vbmeta.img/payload.bin, supporting Android 15

Parsing and re-packing Android boot.img/vbmeta.img/payload.bin, supporting Android 15 - cfig/Android_boot_image_editor

github.com
[Android General] gnufirmlink067:
Just use the 1080 x 1920p it will look weird in twrp but will work
[Android General] Alixbot:
I too have the same issue on my revvl v (Newcastle) I tried pulling apart the twrp.img for the revvl v 5g+ but still no progress. Did you figure it out?
[Android General] Alixbot:
I dont understand how to do this the fstab looks like really different and I have no idea what mount points are which
[Android General] gnufirmlink067:
Try unpacking and packing the stock recovery.img if the phone boots to a normal stock recovery i don't know maybe try searching for similar issues but if you can't or it stuck on something or doesn't work or anything similar it means the boot image editor your using doesn't support your phone I recommend the android boot image editor link below

GitHub - cfig/Android_boot_image_editor: Parsing and re-packing Android boot.img/vbmeta.img/payload.bin, supporting Android 15

Parsing and re-packing Android boot.img/vbmeta.img/payload.bin, supporting Android 15 - cfig/Android_boot_image_editor

github.com
[Android General] Alixbot:
My device uses super.img and A/B boot. I think I have to find the recovery in my super? I gotta find the time to find a way to parse the super. It's all new stuff to me, I started rooting when ICS was around and life got me tied up around lollipop.
[Android General] gnufirmlink067:
That's not how super images work the recovery and super image are different what is you phone like samsung LG etc if it's samsung Extract the AP and you should find recovery.img.iz4 or just recovery.img