[Motorola Edge 40 Pro  / Moto X40 (China)] MAS:
Hello rtwo users, after being asked several times on telegram. Here is the step by step guide to flash Lineage OS or any other custom ROM on rtwo. Follow the guide after making necessary backup.
​

Step--1=Download:

Download all the images (5) and rom package zip. here is the link>>> 1) crDroid ROM ZIP and required partition images 2) Lineageos-for-rtwo-and-other-partition-images​

Now download platform tools aka adb-fastboot tools. link>>> SDK Platform-Tools for Windows

For other OS users>> platform-tools-latest-Mac & platform-tools-latest-linux

and download copy partitions zip to even both slots with latest firmware changes. lin>>> copy-partitions.zip

Step--2=Prepare your Phone:

Now unlock bootloader and enable developer option along the way you'll have moto usb drivers installed. Bootloader unlock guide here>>>https://en-gb.support.motorola.com/app/standalone/bootloader/unlock-your-device-a ​

Step--3=Commands to play with:

Now move all the downloaded files to platform tools folder and open cmd or command line tools respective to the host machine OS from that folder.

View attachment 5964959

Connect your phone to PC with cable and check if it's detected and all the required drivers are installed.

To check that just enter the command adb devices if you've enabled devloper option and moto drivers are installed you'll see a pop up on your phone, allow it and you'll see your device ID as connected device on the cmd window.

Now use command adb reboot bootloader and wait for a few seconds.

When your device enters bootloader mode aka fastboot check again if fastboot devices are installed correctly with fastboot devices command.

If all's well, you're ready to flash downloaded images. Now flash images one by one with the following commands fastboot flash boot boot.img then fastboot flash dtbo dtbo.img then fastboot flash init_boot init_boot.img then fastboot flash vendor_boot vendor_boot.img then finally flash the recovery using fastboot flash recovery recovery.img

Now enter recovery mode with command fastboot reboot recovery wait for a while as it takes some time to boot to recovery.

Now format data from recovery menu and sideload copy partions.zip. To do that select apply update from recovery menu and on the host machine's cmd window type this command adb sideload zip-name.zip and enter. So the command should look like this adb sideload copy-partitions-20220613-signed.zip after the command is completed reboot to recovery from the advanced recovery menu as flashing changes slot.

Now do a format again from recovery menu then sideload the ROM. Click apply update and sideload using the procedure as before. The command should look like this adb sideload lineage-20.0-20230727-UNOFFICIAL-rtwo.zip

After sideloading the ROM again do format data (this is important).

View attachment 5964965

Now if you want you can flash gapps or enjoy google free vanilla experience.

To flash gapps first reboot to recovery from advanced recovery menu and follow the same sideloading procedure. Gapps link >>> NikGapps-T download the gapps variant you like and move it to platform tools folder, I use the minimal core variant. Now click apply update from recovery and The host machine's command should look like this adb sideload NikGapps-core-arm64-13-20230418-signed.zip

Finally do a format data to be in the safe side and click reboot.

Now Enjoy Your Newly Flashed Lineage OS. :cool:

PS: Feel free to comment if you don't understand any part of the guide or face any kind of problem.

Credits: Big thanks to SGCMarkus, ThE_MarD and mxz55 for bringing Los project to Life for rtwo. Can't thank enough to these guys. :love::love::love:

copy partition zip and gapps credit to Los team and nikhilmenghani