Skip to content

Instantly share code, notes, and snippets.

@lezsakdomi
Last active September 15, 2018 07:41
Show Gist options
  • Save lezsakdomi/ed0455dc00e1922d2656573a774d7edc to your computer and use it in GitHub Desktop.
Save lezsakdomi/ed0455dc00e1922d2656573a774d7edc to your computer and use it in GitHub Desktop.
Installing ROMs on LG Nexus 5X
<title>N5X PieX & P2R install guide</title>

Status: Complete draft

How to install argraur’s Pie ROMs on Nexus 5X

In very short, DO NOT CLEAN FLASH

In short

  1. Get TWRP
  2. Flash stock oreo
  3. Flash ROM
  4. Reboot
  5. Send logcats to @argraur or in Nexus 5X Global telegram channel

Detailed instructions for beginners

Get TWRP

First of all, you need to either get root on your phone or adb and fastboot installed. Either is a possible way.

Flash TWRP without PC

If you your phone is rooted, but you don’t have a custom recovery installed for some reason, don’t panic - you easily can get on. If you didn’t root your phone yet, skip this section and read later if you are interested.

As of writing, I can suggest you three ways to do it: Two apps ([Flashify] and [Flashfire]) and a linuxy-hacky way.

Flashify

This is a really cool app (downloadable from play: eu.chainfire.flash), but unfortunately the developer stopped supporting the free version while didn’t left a way to buy pro. But there’s a trick to come over this situation: Set phone date to somewhere in 2013, and the app would open.

Then

Flashify

The other option is Flashify.
Flash the download twrp-bullhead.img to the recovery partition.

dd

If you know linux, flash using dd on your own responsibility :P

Install TWRP (regular way)

You need a working ADB and fastboot tool on your PC/laptop. I’m describing here a way which works with devices without RPMB.

Install ADB and fastboot

They always come together, but they are different:

  • fastboot is for devices without a working system on them
  • ADB is for debugging running systems
    There’s a great description about their usage on Android Developer Portal: ADB, fastboot.

On XDA there’s a great tutorial on how to install ADB. It should install fastboot, or do similarly. But seriously just google for it.

Enter bootloader

Regularly ADB can be used, except fastboot in bootloader. To get into bootloader, you have two options:

The lazy way

Open a console (Windows+R → cmd) and enter the following:

adb reboot bootloader

The phone should reboot and present you following hacky screen:
Bootloader

The always-working way

Hold the volume down and power button long, until you see the hacky screen above

Flash TWRP

In this step you really have to connect your phone to your PC.
First of all, download TWRP from here.
Then on the PC issue the fastboot devices command to check whether everything is working. You should see one line, which is your device.
If everything works fine, issue the following commands (don’t enter the lines starting with # on windows):

# First you need to unlock your device. This is a security enhancement, and ties to warranty. More complicated on few devices.
fastboot oem unlock

# Now you can finally flash it fastboot flash recovery twrp-x.x.x-bullhead.img

Few devices (no RPMB) reboot here. If so, get into bootloader again as quickly as possible (hold power & volume). If you are lucky, the adb method works too (issue adb reboot recovery after phone is started, and skip the next step completly)

Reboot into recovery

Now you should have TWRP in your recovery. If you are still in recovery first relock it to chase the red warning away:

fastboot oem lock

Then cross your fingers and reboot into recovery:

fastboot reboot recovery

If everythng’s good, you should be presented with TWRP rather than stock recovery:
TWRP

On the first screen, swipe to allow modifications, but it mostly doesn’t matter.

Flash ROM

Now you need to transfer the needed files to your phone. Your data partition is probably encrypted, so press cancel when TWRP asks for password, and select Wipe, then swipe to do a simple wipe. Go to Mount, and ensure if Data is checked.

File transfer

The Windows Way

Go to Mount, then enable MTP. Now you can copy and paste files over USB just like you are used to. I recommend putting things to /sdcard.

The Linux Way

Issue adb push <local/file/path> /sdcard (/sdcard could be subsitued of course).

Clean up

The PieX and Pixel2ROM builds are to be flashed over a recent ROM. If you had stock Oreo, you can skip this.

First download the latest stock factory Oreo image from Google, extract it, and inside it extract the smaller archive too. You will get a system.img. Keep it and copy over the phone.
Now go to Install, click on Install image on the bottom, select the transported system.img and flash it. Make sure, that you are flashing system.img to the system partition.

Both clean and dirthy flash is discorugated. Go to Wipe, and pull to do a factory reset. You will lose your data, but you will lose incompatible apps too.

Lazy way

Just flash the factory zip as intended (from fastboot or from recovery), then flash TWRP to recovery.

Flash ROM

Warning! Don’t reboot to system at this part! Doing to will result in your phone being encrypted, or even worse, recovery overwritten.
First flash this costum ROM. It will prevent the data loss in the future.

Go to Install, make sure you are seeing ZIPs (click on Install ZIP on the bottom if not), select the new ROM zip.

Congratulations! Now you have the best system possible on your phone. You can go to Reboot and reboot to system to try out your shiny-new refreshed device.

Things to do before reboot

Fix BLOD

  1. Install PieX
  2. Flash N5X-6P_BLOD_Workaround_Injector_Addon-AK2-signed.zip
  3. Backup boot
  4. Install Pixel2ROM
  5. Reboot

Install GApps

Install GApps only if you are using PieX! P2R already includes google applications.

Download from here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment