Mer kernel adaptations based on @CyanogenMod sources.