How to Flash the Stock Boot.img Kernel on the OnePlus 5

OnePlus 5 Stock Kernel

If you have modified your kernel, or installed a custom kernel, then you can follow these steps to revert back to the stock OnePlus 5 boot.img kernel.

A number of modifications and customizations for the OnePlus 5 require that you modify your the boot.img kernel of the device. The thing is, once that is modified then you can no longer accept OTA updates directly from OnePlus. I have detailed how to install a OTA update on the OnePlus 5 while you’re rooted, but that’s not what everyone wants to do. There are some cases when someone simply needs to revert back to the stock boot image kernel.

For example, if you have installed a custom kernel on the OnePlus 5, then you may not like the results from it. So from there, your choices are to either install another custom kernel through TWRP, or use this method to flash the stock kernel again. Other times you may want to get rid of TWRP altogether and doing this requires you to revert back to the stock OnePlus 5 kernel because it needs to be modified in order to keep TWRP installed.

I do want to note though, when you boot back into Android after flashing a stock OnePlus 5 kernel, you will lose your TWRP install. So if you want to keep TWRP with a modified version of the stock kernel (which will prevent you from accepting an OTA update from OnePlus) then follow this guide after you have restored the stock kernel.

In order to complete the tutorial below, you're going to need some things setup ahead of time. Please follow the how to install ADB and Fastboot tools guide if you haven't done so already. You're also going to need to start the ADB service by executing the "adb devices" command (no quotes) in the Command Prompt. Lastly, you'll need to follow the how to enable Developer Mode guide, as well as the how to enable USB Debugging Mode guide, and make sure to grant USB Debugging access from the PC to your device.

OnePlus 5 Stock Recovery

  1. Download the version of OxygenOS you’re currently on
  2. Extract the contents of the ZIP file from Step 1
  3. Copy/move the boot.img file to the same directory as your ADB/Fastboot tools
  4. Launch a Command Prompt, Terminal or PowerShell in that directory
  5. Boot the OnePlus 5 into Fastboot Mode
  6. Connect the OnePlus 5 to the PC with a USB cable
  7. Type the following into the Command Prompt, Terminal or PowerShell. . .
  8. fastboot flash boot boot.img
  9. . . .then press Enter on the keyboard
  10. Wait for the boot IMG file to be sent and written
  11. Then press the Power button on the OnePlus 5 to reboot back into Android

Explanation

Many Android modifications these days require you to modify the kernel boot.img file in some sort of way. Whether this is for Magisk, TWRP or even just a custom kernel, there are plenty of ways to transition away from the stock kernel that OnePlus uses. The bad part is, that once the kernel gets modified, you can no longer accept an OTA update from OnePlus. So we’re going to be going through the process of getting your phone back on the stock kernel.

To do that, we first need to visit the OnePlus downloads page for the OnePlus 5. Go through this list and find the exact version of OxygenOS you’re currently using. You can actually pick any version of OxygenOS as long as it’s based on the same version of Android (7.0, 7.1, 8.0, etc.). Once the firmware has been downloaded, you’ll then want to extract the contents into a convenient folder on your computer. Look through these files and pick out the boot.img file that was inside it.

OnePlus 5 Stock Kernel Command

Make sure you get two OKAY responses when flashing the stock OnePlus 5 kernel.

We then need to move or copy that boot.img file to the same folder that you have your ADB and Fastboot tools installed to. You will then need to launch either a Command Prompt, PowerShell or Terminal from this location so we can execute the following command after we boot the device into Fastboot mode – fastboot flash boot boot.img. What we’re doing here is telling the computer to send the boot.img file to the OnePlus 5 and then write (flash) its contents on the boot partition.

As I demonstrate in the video above, the process should only take a few seconds to complete. We just need to look for two OKAY messages here to know that the process completed properly. Once that is done, you can pick the phone back up and then press the Power button to select the Start option from within Fastboot Mode. This will restart the OnePlus 5 and then boot us back up into the regular OxygenOS software where it will be using the stock kernel again.

If this tutorial helped you in any way, please consider donating at Patreon or PayPal. If you can't afford to donate then sharing this on social networks such as Facebook, Twitter, etc. will also help a lot.

 

About the author

Doug

I’m working to create an organized and easy to follow central repository of Android tips, tutorials, guides and everything you need to know. With a focus on device specific tutorials now, my goal is to branch out and do more universal tips and tricks that will work on all Android devices.