diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index a2f80505cd95d..67cf40a21287c 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -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 @@ -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 diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index baf0231f13e16..25fc4ee6f48a3 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -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 @@ -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