Log Message: fix build on Linux: - add some missing #ifdef __NetBSD__ and restore some Linux #includes - use subst framework instead of hardcoding /kern paths in patches