From 03b17fa3edf6209508ff3bd7e7df8dd7a698ac00 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 7 Dec 2023 22:31:26 +0000 Subject: [PATCH] add zImage output --- modules/outputs.nix | 14 ++++++++++++++ pkgs/kernel/default.nix | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/outputs.nix b/modules/outputs.nix index ce2ba66..98edad5 100644 --- a/modules/outputs.nix +++ b/modules/outputs.nix @@ -30,6 +30,16 @@ in Kernel vmlinux file (usually ELF) ''; }; + zimage = mkOption { + type = types.package; + internal = true; + description = '' + zimage + ****** + + Kernel in compressed self-extracting package + ''; + }; dtb = mkOption { type = types.package; internal = true; @@ -80,6 +90,10 @@ in kernel = liminix.builders.kernel.override { inherit (config.kernel) config src extraPatchPhase; }; + zimage = liminix.builders.kernel.override { + targets = ["arch/arm/boot/zImage"]; + inherit (config.kernel) config src extraPatchPhase; + }; dtb = liminix.builders.dtb { inherit (config.boot) commandLine; dts = config.hardware.dts.src; diff --git a/pkgs/kernel/default.nix b/pkgs/kernel/default.nix index 3c3db7a..743f5ed 100644 --- a/pkgs/kernel/default.nix +++ b/pkgs/kernel/default.nix @@ -7,6 +7,7 @@ , config , src , extraPatchPhase ? "echo" + , targets ? ["vmlinux"] } : let writeConfig = import ./write-kconfig.nix { inherit lib writeText; }; @@ -90,12 +91,12 @@ stdenv.mkDerivation rec { ''; buildPhase = '' - make vmlinux modules_prepare -j$NIX_BUILD_CORES + make ${lib.concatStringsSep " " (map baseNameOf targets)} modules_prepare -j$NIX_BUILD_CORES ''; installPhase = '' ${CROSS_COMPILE}strip -d vmlinux - cp vmlinux $out + cp ${lib.concatStringsSep " " targets} $out mkdir -p $headers cp -a include .config $headers/ mkdir -p $modulesupport