Fix building with custom kernel