summary refs log tree commit diff
path: root/vm
diff options
context:
space:
mode:
Diffstat (limited to 'vm')
-rw-r--r--vm/sys/net/default.nix22
1 files changed, 14 insertions, 8 deletions
diff --git a/vm/sys/net/default.nix b/vm/sys/net/default.nix
index 1914b6a..59549a4 100644
--- a/vm/sys/net/default.nix
+++ b/vm/sys/net/default.nix
@@ -60,6 +60,18 @@ let
         -T ${writeReferencesToFile packagesSysroot} .
   '';
 
+  kernelTarget =
+    if stdenvNoCC.hostPlatform.isx86 then
+      # vmlinux.bin is the stripped version of vmlinux.
+      # Confusingly, compressed/vmlinux.bin is the stripped version of
+      # the top-level vmlinux target, while the top-level vmlinux.bin
+      # is the stripped version of compressed/vmlinux.  So we use
+      # compressed/vmlinux.bin, since we want a stripped version of
+      # the kernel that *hasn't* been built to be compressed.  Weird!
+      "compressed/vmlinux.bin"
+    else
+      stdenvNoCC.hostPlatform.linux-kernel.target;
+
   kernel = (buildPackages.linux_latest.override {
     structuredExtraConfig = with lib.kernel; {
       VIRTIO = yes;
@@ -70,13 +82,7 @@ let
     };
   }).overrideAttrs ({ installFlags ? [], ... }: {
     installFlags = installFlags ++ [
-      # vmlinux.bin is the stripped version of vmlinux.
-      # Confusingly, compressed/vmlinux.bin is the stripped version of
-      # the top-level vmlinux target, while the top-level vmlinux.bin
-      # is the stripped version of compressed/vmlinux.  So we use
-      # compressed/vmlinux.bin, since we want a stripped version of
-      # the kernel that *hasn't* been built to be compressed.  Weird!
-      "KBUILD_IMAGE=$(boot)/compressed/vmlinux.bin"
+      "KBUILD_IMAGE=$(boot)/${kernelTarget}"
     ];
   });
 in
@@ -90,7 +96,7 @@ stdenvNoCC.mkDerivation {
   nativeBuildInputs = [ jq lseek s6-rc tar2ext4 util-linux ];
 
   PACKAGES_TAR = packagesTar;
-  KERNEL = "${kernel}/vmlinux.bin";
+  KERNEL = "${kernel}/${baseNameOf kernelTarget}";
 
   makeFlags = [ "prefix=$(out)" ];