Two minor changes needed (other than s/freebsd/netbsd) for the sysvinit patch - NetBSD's reboot() doesn't seem to do poweroff, so I changed that #define to just halt the system, and reboot() takes two arguments, magic and a string that can be passed to the firmware under certain circumstances. Changing reboot() to be defined as reboot(magic,"") sorted that.
#include <sys/reboot.h> reboot(RB_POWERDOWN, NULL); (i note this is missing in reboot(2). i'll fix that.)