This fixes problems with cross compiled kernels failing to boot. (cherry picked from commit 1f4bb8c6) (cherry picked from commit 828fdd61b9b5ae0d3c9253309f3d115210348096)