commit 03b17fa3edf6209508ff3bd7e7df8dd7a698ac00
parent a8891461aace35c52fc549a6c3be86f97d117e70
Author: Daniel Barlow <dan@telent.net>
Date: Thu, 7 Dec 2023 22:31:26 +0000
add zImage output
Diffstat:
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git 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
@@ -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