HTC One M8 GPE unable to run Android 5.0 or 5.1 Attempts to install Android 5.0 and 5.1 ROMs from various sources result in a device that doesn't boot properly. Among side effects:


it doesn't display the boot animation (just a static Android logo)
takes forever to boot
WiFi cannot be turned on


This is due to incorrect firmware, but the device is S-ON and installing any available RUU .zips fails with a signature check error.
The trick is to install the firmware-only RUUs rather than the full RUUs. While the full RUUs are tampered with and therefore won't pass signature checks on non-S-OFF devices, the firmware RUUs provided on http://www.graffixnyc.com/m8.php are authentic, and will install on S-ON devices.

Make sure you update in stages:


Install firmware 3.11.1700.5 (for Android 5.0.1) — look for file with MD5 a3e2bd4b51c0ceff46e52f521e9454be on the GraffixNYC page
Install firmware 4.04.1700.4 (for Android 5.1) — look for file with MD5 6ac5701060b4e15adb0cef7f13eddccd on the GraffixNYC page


If your device is unlocked (not S-OFF, just unlocked), you might need to temporarily relock it before you can install RUUs:


fastboot oem lock


Installing RUUs is done with:


fastboot oem rebootRUU
fastboot flash zip firmware.zip