Can I flash a custom boot.img to Nexus 5 when "Secure Boot" is enabled? I have compiled the Android Linux kernel for Nexus 5 with some modifications.

My phone is LG Nexus 5, whose bootloader has been unlocked, but the "Secure Boot" is still enabled.



As I understand, if secure boot is enabled, the bootloader will verify the boot.img when booting.

Obviously, my custom kernel cannot pass the verification.

In such a case, how to correctly flash my own boot.img?
my custom kernel cannot pass the verification.


This doesn't imply that you cannot boot into the Android with your custom kernel. When the verification would fail, your device would warn you about that and you would be given the choice to continue the boot process or not.

Google mentioned about this here


  RED, indicating the device has failed verification. The bootloader must display a warning to the user before allowing the boot process to continue. 


So now, you can flash the kernel in the same manner those having secure boot disabled would do.