With the introduction of the dual partition system, restoring the boot image (aka the kernel) isn’t as straightforward as it used to be. Still, the process isn’t very difficult once you know what to do so this tutorial will show you how to flash the original boot.img back on your Pixel 2 smartphone.
The dual partition system that Google (and few other OEMs) have been using on their Android smartphone has created a hurdle for not only community developers, but also enthusiasts who want to tinker with their device. Before, if we wanted to restore the stock kernel we just need to execute one command and that was it. Now that we have two different boot partitions though, we have to do a second one to make sure both partitions have the same stock boot.img contents.
This is useful if you have installed a custom kernel, or a mod (such as Magisk) which modifies the kernel file so that it will work. Naturally, modifying the kernel file prevents you from accepting an OTA update so if these are the only modifications you’ve made to the Android system then you can restore the Pixel 2 stock kernel. This will then allow you to download and install that official OTA update pushed from Google so that you can keep all of your data.
In order to complete the tutorial below, you're going to need some things set up ahead of time. Please follow the how to install ADB and Fastboot tools guide if you haven't done so already. Then you will need to follow the how to enable Developer Mode guide, as well as the tutorial that shows you how to enable USB Debugging Mode.
You will then need to open a command prompt within the within the same folder as your ADB and Fastboot tools and execute the "adb devices" command (without quotes) to start the ADB service. Then connect the device to the PC with a USB cable and you should see the prompt to grant USB Debugging Mode access from the PC the phone is connected to.
Once granted, you can then test this by running the command "adb devices" again (without quotes) in a command prompt or PowerShell to make sure the computer recognizes the device.
Pixel 2 Restore Stock Kernel
- Download the same version of Android you have from Google
- Extract the contents of that ZIP file
- Go into the folder that it extracts and then extract the contents of the second ZIP file
- You should see a boot.img extracted from that second ZIP file
- Copy/move the boot.img file to the same folder as your ADB and Fastboot tools are in
- Launch a Command Prompt (or Windows Powershell) from that folder
- Boot the Pixel 2 into Fastboot Mode
- Connect a USB cable from the Pixel 2 to the PC
- Type the following command. . .
- fastboot flash boot_a boot.img
- And press Enter on the keyboard
- Wait a few seconds for it to complete
- Then type out this second command. . .
- fastboot flash boot_b boot.img
- And again, press Enter on the keyboard.
- Now reboot back into Android and you will be using the stock kernel file
This step by step tutorial is a detailed explanation of a topic I covered on my Pixel 2 Tips and Tricks article. I recommend you read through that if you're curious about learning the ins and outs of the Pixel 2 or Pixel 2 XL.
Because of how secure Android has been getting these days, a lot of major modifications require that a modification be made to the boot image. Off the top of my head, I know that TWRP, Magisk, SuperSU and likely Xposed Framework all made modifications to the kernel. The results are the same if you’re using a custom kernel too. Custom kernels can add extra performance or extra battery life to a device but they prevent you from accepting an official OTA update.
With this guide above, you can get rid of any changes made to your kernel and switch back to the stock Pixel 2 boot.img so you can accept an OTA update. I will say that you may have installed other mods that have changed the Android system and will prevent an OTA update. So be aware that restoring back to the stock Pixel 2 kernel isn’t a one trick solution. If you’ve installed other mods (especially Xposed Modules) then they could have also made changes that will prevent you from accepting that OTA update.
So to begin, we need to visit the website linked in Step 1 of the guide above. From here, you will need to find your device and then match up the build/firmware versions so you can download the sama version of Android you’re currently running. Extract this ZIP file and then extract the second ZIP to find the stock boot.img file that we need. This is where we move or copy the boot image file to the same folder as our ADB and Fastboot tools are in.
From here, boot the Pixel 2 or Pixel 2 XL into Fastboot Mode and then connect a USB cable to it from the PC. Now launch a Command Prompt or Windows Powershell in the same folder as these ADB/boot.img files and execute the command in Step 10 of the guide. After a few seconds you should get a couple of OKAY messages and then you can execute the command in Step 14 of the guide. With that done, we have restore the stock boot image to both boot partitions (a and b) and can restart the phone back into Android.
Unless you made previous changes to Android with root or other mods, you should now be able to accept that official OTA update. Once it is installed, you can then load up TWRP again, install Magisk or SuperSU and go back to the modded version of Android that you prefer.
If this tutorial helped you in any way, please consider donating via PayPal, Patreon, Cryptocurrency, or GoFundMe. If you can't afford to donate then sharing this on social networks such as Facebook, Twitter, XDA, forums, etc. will also help a lot. I would also appreciate suggestions for Android tips and tutorials that you would like to see in the future.