[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] MotoX4:
I think post #1 should be revised. It does go about assuming you know how to do everything, without explaining how to do anything if you have no prior knowledge (not exactly clear for a newbie). Here are my revised instructions and I hope they are helpful to some folks. :angel:

How to install Lineage OS 15.1

Download the latest Official TWRP https://dl.twrp.me/payton/. You want the .img file (and the .zip file as well for my recomendation to follow below).

Restart your phone to your bootloader (press and hold both power and the lower volume key at the same time). From your Windows Command Prompt (as administrator) or from your Linux Terminal (as root) run the following command.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Be sure to use your path on where you have the file on your computer. Be sure to replace and use the correct file name for your file (Do not just copy and paste example posted here). Finally also sure to run fastboot as administrator if using windows or as root if using Linux ( sudo fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img' ).

1st if coming from stock, wipe your device, reboot to bootloader and reuse the previous fastboot command listed above.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Next format your DATA and again reboot to bootloader and reuse the previous fastboot command listed above.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Next reboot your device to bootloader and reuse the previous fastboot command listed above.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Now upload "Copy Partitions Zip" to your phone using "ADB Push" command to /sdcard/ (run as admin if on windows or as root if on Linux). For example.

adb push copy-partitions-payton.zip /sdcard/

Now INSTALL "Copy Partitions Zip" (click on Install and select the zip). https://xdaforums.com/showpost.php?p=77490529&postcount=2

From there reboot to your bootloader and use the firmware download (extracted on your computer) https://xdaforums.com/showpost.php?p=77490529&postcount=2 and run flash_all.bat (windows as administrator) or ./flash_all.sh (Linux run as root).

If coming from the previous unofficial Lineage, I found flashing everything worked best as I had repeat issues (9x) when trying to upgrade (usually apps would crash). Upgrading the official Lineage Rom should not be a problem and this issue likely only impacts the unofficial (In other words, treat this the same way you would, coming from a different ROM) -- IF your phone is encrypted, you will need to format DATA. -- Once done, reboot back to bootloader and once again use TWRP to boot your phone.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Download and upload to your phone the following:

You will upload these files to your phone using the "ADB PUSH" command to your /sdcard/ directory (as admin in windows or root in Linux). For example:

adb push lineage-16.0-20180921-UNOFFICIAL-payton.zip /sdcard/

Official Lineage 15.1 https://download.lineageos.org/payton

* MindTheGApps (Google Apps) https://androidfilehost.com/?flid=170282&w=files OR + Open Gapps https://opengapps.org/

* Lineage OS SU Addon (Root) https://mirrorbits.lineageos.org/su/addonsu-15.1-arm64-signed.zip OR + Magisk https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

+ Official TWRP zip file https://dl.twrp.me/payton/

* Notes that these are technically optional but do make for a better experience. MindTheGApps will install the supported minimal install of Google system apps to allow you to download and install apps from Google Play Store. Lineage OS SU Addon is the official add-on which will grant you root level access to your phone. You can perfectly have the full basic functionality of your phone without either as they are optional, but you will gain a better experience (in my opinion) by adding them.

+ Notes as my personal opinion and self-experience, I would recommend you skip the supported Lineage OS SU Addon in favor of Magisk https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 as Magisk will work with apps such as Google Pay, while Lineage OS SU Addon will not. I would recommend you upload and use The Official TWRP zip as Lineage OS Recovery does not work once your device is encrypted. I would also recommend Open Grapps as opposed to MindTheGApps as I found Google Play Store worked better.

Install your Rom zip first.

Reboot back to bootloader and reuse the previous fastboot command above.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Install your next zip, MindTheGApp OR Open Gapps (not both).

Reboot back to bootloader and reuse the previous fastboot command above.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Choose Lineage OS SU Addon -- OR -- Install Magisk (not both).

If you picked, Lineage OS SU Addon, TWRP will not install Lineage OS SU Addon. TWRP will spit out a code 7 error informing you that it encountered too many symbolic links (symlinks) and cannot proceed with the install. You'll need to use Lineage's Official Recovery to proceed.

Reboot into recovery and use Lineage's Official Recovery.

Select Apply Update

Select the zip for Lineage OS SU Addon (the install will happen so quickly it will seem as if the screen only blinked - Don't worry, that's a good thing. :good: )

If you picked Magisk, reboot back to bootloader and use reuse the previous fastboot command above.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Install TWRP using their official zip file

Reboot to TWRP recovery and install Magisk

Optional - If you wish to delete the many zips you just finished using and uploaded to your phone they can be found at /data/media/

If you installed Lineage OS SU Addon

Go to Settings

Go to System

Go to About Phone

Scroll down to Build Number

Tap Build Number 7x real fast -- This will enable developer options

Go back 1 menu and you will now see Developer Options (Settings > System > Developer Options)

Scroll down to Root Access and enable (I, personally enable both, Apps and ABD).

If you install Magisk navigate to the official thread and download and install Magisk Manager https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445. As a bonus, you can also enable developer options if you wish (you'll just manage your root using the Magisk Manager).

Congratulations! You're done! :cool:

The future problem -- Lineage OS Recovery does not have an option to decrypt your phone. Which means I have no working solution at this time should you set up your phone with a lock option (as most folks will). :eek: TWRP will correctly decrypt your phone and that is why I recommend it over Lineage's default recovery (and another reason why I recommend Magisk). :angel:

Upgrade | Side Note: If in the future you upgrade Lineage OS (either manually or using the upgrade tool) and you were using TWRP and Magisk, will need to manually reinstall TWRP and Magisk. The good news is you do not need to start from the beginning. :good:

Once you are done upgrading Lineage OS, reboot back to bootloader and once again use TWRP to boot your phone.

fastboot boot '/your_path_here/twrp-X.X.X-X-payton.img'

Install TWRP

Reboot to recovery (TWRP)

Install Magisk -- And you're done. :)