liminix/kernel/default.nix

45 lines
959 B
Nix
Raw Normal View History

2022-09-25 23:02:45 +02:00
{
callPackage
, buildPackages
, stdenvNoCC
, fetchFromGitHub
, config
, checkedConfig
, sources
2022-09-25 23:02:45 +02:00
}:
let
2022-09-25 23:02:45 +02:00
# The kernel is huge and takes a long time just to
# download and unpack. This derivation creates
# a source tree in a suitable shape to build from -
# today it just patches some scripts but as we add
# support for boards/SoCs we expect the scope of
# "pre-treatment" to grow
tree = stdenvNoCC.mkDerivation {
name = "spindled-kernel-tree";
src = sources.kernel;
phases = [ "unpackPhase" "patchPhase" "patchScripts" "installPhase" ];
patches = [ ./random.patch ];
patchScripts = ''
patchShebangs scripts/
'';
installPhase = ''
mkdir -p $out
cp -a . $out
'';
};
2022-10-05 22:52:30 +02:00
in rec {
2022-09-25 23:02:45 +02:00
vmlinux = callPackage ./vmlinux.nix {
inherit tree config checkedConfig;
};
2022-10-05 22:52:30 +02:00
uimage = callPackage ./uimage.nix { };
2022-10-05 22:52:30 +02:00
dtb = callPackage ./dtb.nix {
openwrt = sources.openwrt;
2022-10-05 22:52:30 +02:00
kernel = tree;
};
}