netbsd.sys: actually build the kernel

Before, we were only building the headers, firmware, and bootloader.

CONFIG could be overridden to use another pre-defined kernel, but
there's no way to pass a custom kernel configuration yet.

Tested booting the built kernel in a NetBSD VM.
This commit is contained in:
Alyssa Ross 2021-04-18 16:53:11 +00:00
parent 37ac32a351
commit ddcb48cc3d
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -433,12 +433,35 @@ let
path = "sys";
version = "8.0";
sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w";
CONFIG = "GENERIC";
propagatedBuildInputs = [ include ];
nativeBuildInputs = [ makeMinimal install tsort lorder statHook uudecode ];
nativeBuildInputs = [
makeMinimal install tsort lorder statHook uudecode config genassym
];
postConfigure = ''
pushd arch/$MACHINE/conf
config $CONFIG
popd
'';
makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ];
hardeningDisable = [ "pic" ];
MKKMOD = "no";
NIX_CFLAGS_COMPILE = [ "-Wa,--no-warn" ];
postBuild = ''
make -C arch/$MACHINE/compile/$CONFIG $makeFlags
'';
postInstall = ''
cp arch/$MACHINE/compile/$CONFIG/netbsd $out
'';
meta.platforms = lib.platforms.netbsd;
extraPaths = [ common.src ];
MKKMOD = "no";
makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ];
};
headers = symlinkJoin {