Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkgs/os-specific/linux/kernel/generic.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
let
# Map of images representations to legacy Makefile targets.
defaultMapImageToTargets = {
"uImage" = "uinstall";
"zImage" = "zinstall";
"Image.gz" = "zinstall";
"vmlinux" = "install";
};
in
{ buildPackages
, callPackage
, perl
Expand Down Expand Up @@ -64,6 +73,11 @@
# easy overrides to stdenv.hostPlatform.linux-kernel members
, autoModules ? stdenv.hostPlatform.linux-kernel.autoModules
, preferBuiltin ? stdenv.hostPlatform.linux-kernel.preferBuiltin or false
, kernelTarget ? null
# FIXME: this should go whenever we can rely on KBUILD_IMAGE to install
# our kernel targets, MIPS is probably the only recent kernel in-tree
# which does not support that yet.
, installTargets ? [ ]
, kernelArch ? stdenv.hostPlatform.linuxArch
, kernelTests ? []
, nixosTests
Expand Down
17 changes: 11 additions & 6 deletions pkgs/os-specific/linux/kernel/manual-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ in lib.makeOverridable ({
src,
# a list of { name=..., patch=..., extraConfig=...} patches
kernelPatches ? [],
# KBUILD_IMAGE
kernelTarget ? null,
# a list of install targets, e.g. :
# - uinstall for uImage, U-Boot wrapped image
# - zinstall for zImage, self-extracting images
# - install, the generic binary image
# those targets are legacy and are present
# only for compatibility with old kernels or MIPS for now.
# prefer KBUILD_IMAGE instead.
installTargets ? [],
# The kernel .config file
configfile,
# Manually specified nixexpr representing the config
Expand Down Expand Up @@ -267,12 +277,7 @@ let
'';

# Some image types need special install targets (e.g. uImage is installed with make uinstall)
installTargets = [
(kernelConf.installTarget or (
/**/ if kernelConf.target == "uImage" then "uinstall"
else if kernelConf.target == "zImage" || kernelConf.target == "Image.gz" then "zinstall"
else "install"))
];
installTargets = if installTargets == [ ] then [ "install" ] else installTargets;

postInstall = optionalString isModular ''
mkdir -p $dev
Expand Down