[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] munchy_cool:
Credits

Moto X4 is getting some custom rom love, because [MENTION=6298645]erfanoabdi[/MENTION] worked in BEAST mode and created the trees for this device, even though he does not own the device.

Obligatory Warning: This guide and ROM assumes you know the fundamentals of fastboot, flashing TWRP, and running a flash all. Your warranty is voided because of the unlocked bootloader. This is a Third Party ROM. Things may not work as expected compared to stock (for better or for worse).

Warning 2: If you can't do fastboot commands, do a flash all, root your device or flash TWRP/ROM, please do not ask for help here. If you cannot flash all back to stock, please stay stock for everyone's sake.

Warning 3: if you don't flash the firmware zip so both slots have the firmware, when you boot after flashing, you WILL have a bootloop or even a brick.

Warning 4 : This is an Engineering build, which means it's pre rooted and all apps have access to root. Only the SU binary is missing.

Warning 5 : Kernel is permissive.

This is an initial release and it WILL have bugs. If your phone is a daily, and you cannot afford downtime or random reboots then please do not flash.

I am new to this, DO NOT expect fixes on the fly. Post logcats and I will see what I can do.

/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/

​

About Carbon ROM :

CarbonROM is an aftermarket firmware based on the Android Open Source Project. We are dedicated to fast, stable, and feature-filled roms, honesty and communication with our users, and openness with our code. We like frequent builds, with the very latest and greatest hardware support and fixes. We strive to not only provide you with the best rom we can build, but also to give back to the Android community and our fellow developers. For us, this is about creating something we can be proud of and hope you will enjoy.

Not Working :

[*] Engineering Build - you will get a strict mode red-rectangle flash.

no moto onenav gestuers

You tell me

How to Boot into fastboot/bootloader mode

1. Reboot phone, and keep volume down pressed while device is rebooting until you see bootloader mode screen.

2. While phone is off, press volume down and then press power button. Keep holding both until you see bootloader mode screen.

How to Install

Video is for LineageOS, but process is same for Carbon ROM as well.

Video

[YOUTUBE]2-Kcwjyk_Ls[/YOUTUBE]

Moto X4 A/B Slots Explained

[youtube]zVwYxp30dps[/youtube]

Steps

1. Download the ROM, TWRP (zip and Image), Gapps (optional) from Downloads section. Place TWRP image zip in same folder as where you have fastboot.

2. Prepare your phone for AOSP style ROMs. (download one of the firmwares depending on your model). Boot into bootloader mode.

Flash the firmware with the flash_all.bat (Windows) file or the flash_all.sh (Linux & Mac) (See links on Post #2).

Windows

flash_all.bat

Mac/Linux

./flash_all.sh

Tested only on XT1900-1 on Android 8.0 model for now. Feel free to try on other models. Check for any errors in the process, DO NOT proceed if you have any errors. Once flashed successfully, reboot into Android to make sure all is well.

Windows

fastboot reboot

Mac/Linux

./fastboot reboot

3. Wipe internal data. Reboot back into bootloader mode and run the command "fastboot -w" (this will erase EVERYTHING from your phone, even internal SD, but is needed to have these ROMs work). Make sure to remove your external sdcard before doing this. Once done, REBOOT into Android to make sure all is well. Skip all the setups.

Windows

fastboot -w

Mac/Linux

./fastboot -w

4. Transfer ROM zip and TWRP zip to internal memory of device. Reboot device into bootloader mode.

5. Boot to TWRP using fastboot. Using command prompt/terminal navigate to folder where fastboot is.

Windows

fastboot boot twrp-3.2.1-1-payton.img

Mac/Linux

./fastboot boot twrp-3.2.1-1-payton.img

5. Once booted into TWRP, click on Install - and select TWRP zip transferred in Step 1. Once done, Reboot back into system to check all is well.

6. Boot into TWRP again (reboot device, keep volume down pressed while device is rebooting. When you see bootloader mode, let go of volume down. Press volume up until you see recovery mode, press power button to select. Now you will boot into TWRP recovery).

8. Once in TWRP. Go to Wipe and swipe to factory reset. Go back, select Install and select Linage OS Rom zip, also add the TWRP zip file and click on install. Once done, wipe cache/dalvik.

Do note, recovery is built into kernel with our device so flashing any rom or kernel will result in TWRP being overwritten. DO NOT flash Magisk (any root package) or Gapps. Once ROM (and optional TWRP) have flash successfully, go to main menu :-

Now you have two options. If you WANT gapps do step 9. else go to 10. If you install gapps after booting into rom, gapps will crash. So, make your choice now.

9. Go back to TWRP main menu. Click on reboot, note down the slot you are on and select recovery.

You will now boot back into TWRP recovery. Click on reboot, and you should be on the other slot. Go back to main menu, transfer the gapps package to internal memory and install gapps.

10. Go back to TWRP main menu. click on reboot and select bootloader.

11. Once in bootloader mode. issue below command.

Windows

fastboot -w

Mac/Linux

./fastboot -w

Once done, reboot.

Windows

fastboot reboot

Mac/Linux

./fastboot reboot

11. To ROOT, booting into Android once is necessary whether you want gapps or not. After booting into Android once reboot back into TWRP, and then flash your root package zip, reboot and enjoy.

How to Update

Transfer rom, gapps and twrp zip to internal storage.

Boot to TWRP.

flash Rom + TWRP zip

Boot back to TWRP recovery

Flash GApps

Wipe Cache + Dalvik

Reboot to System

Coming from Another custom ROM, have already flashed firmware zip

Transfer rom, gapps and twrp zip to internal storage.

Boot to TWRP.

Wipe -> Swipe to factory reset

flash Rom + TWRP zip

Boot back to TWRP recovery

Flash GApps

Wipe Cache + Dalvik

Reboot to System

How to go back to stock

[youtube]8tLFnkJrJ40[/youtube]

Support :

1) Search. Search, search, search. If you make the effort of reading atleast 5 pages back, most if not all your questions will be answered. I personally, will ignore any questions, if I know they have been answered in the last 5 pages. Not being rude, but please read.

2) If you can't find answers in last 5 pages, ask here, be respectful and have a good time.

Downloads :

TWRP (Zip + Image, Download 3.2.1-1): TWRP for Payton

ROM : Unofficial Carbon ROM (payton)

Gapps : OpenGapps

Magisk : Stable Magisk

Notes :

Only Clean Installation Please

Bug Report Without logs means nothing

3rd PARTY ADDONS/MODS :

While we have no issues with people using supersu/magisk/xposed/custom kernels/etc, we can't provide support for users who have them installed.

This thread is not the right place to discuss about mods/addons.

Reporting Bugs :

DO NOT Report bugs if you installed Xposed.

DO NOT Report bugs about Magisk Modules.

Grab a logcat right after the problem has occurred. (Please include at least a few pages of the log, not just the last few lines, unless you know what you're doing.)

If it is a random reboot, grab /sys/fs/pstore/console-ramoops and /sys/fs/pstore/dmesg-ramoops-0. (Do not bother getting a logcat unless you can get it just before the reboot. A logcat after a reboot is useless)

Remember to provide as much info as possible. The more info you provide, the more likely that the bug will be solved. Please also do not report known issues. Any bug not reported in the bug report format above may be ignored.

Sources :

Carbon ROM

Device tree :

moto-sdm660-common

payton

Kernel :

moto-msm8998

Vendor tree :

moto-sdm660-common

payton

XDA:DevDB Information

Unofficial Carbon ROM cr-6.1 for Payton, ROM for the Moto X4

Contributors

erfanoabdi, mightysween, gee one, Lineage Team, Carbon Team

Donations

Donate to Carbon ROM

Buy me Coffee.

ROM OS Version: 8.1.x Oreo

ROM Kernel: Linux 4.x

ROM Firmware Required: No Requirements

Based On: AOSP

Version Information

Status: Testing

Created 2018-06-13

Last Updated 2018-06-17