The KexecFileLoad syscall wrapper and the KEXEC_* constants were added to golang.org/x/sys/unix. Use them instead of open-coding them.
Utsname from golang.org/x/sys/unix contains byte array members instead of int8/uint8. This allows to simplify the NULL byte indexing in addHostname.
...now that it was added there.