2022-09-25 23:02:45 +02:00
|
|
|
{
|
|
|
|
callPackage
|
|
|
|
, buildPackages
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
, config
|
2022-09-30 18:45:05 +02:00
|
|
|
, checkedConfig
|
2022-09-25 23:02:45 +02:00
|
|
|
}:
|
2022-09-20 19:54:27 +02:00
|
|
|
let
|
|
|
|
source = fetchFromGitHub {
|
|
|
|
owner = "torvalds";
|
|
|
|
repo = "linux";
|
|
|
|
rev = "3d7cb6b04c3f3115719235cc6866b10326de34cd"; # v5.19
|
|
|
|
hash = "sha256-OVsIRScAnrPleW1vbczRAj5L/SGGht2+GnvZJClMUu4=";
|
|
|
|
};
|
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
|
|
|
|
|
2022-09-20 19:54:27 +02:00
|
|
|
tree = stdenvNoCC.mkDerivation {
|
|
|
|
name = "spindled-kernel-tree";
|
|
|
|
src = source;
|
|
|
|
phases = [ "unpackPhase" "patchScripts" "installPhase" ];
|
|
|
|
patchScripts = ''
|
|
|
|
patchShebangs scripts/
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -a . $out
|
|
|
|
'';
|
|
|
|
};
|
2022-10-05 22:52:30 +02:00
|
|
|
|
|
|
|
openwrtSource = fetchFromGitHub {
|
|
|
|
repo = "openwrt";
|
|
|
|
owner = "openwrt";
|
|
|
|
rev = "a5265497a4f6da158e95d6a450cb2cb6dc085cab";
|
|
|
|
hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-03 23:28:15 +02:00
|
|
|
in rec {
|
2022-09-25 23:02:45 +02:00
|
|
|
vmlinux = callPackage ./vmlinux.nix {
|
2022-09-30 18:45:05 +02:00
|
|
|
inherit tree config checkedConfig;
|
2022-09-20 19:54:27 +02:00
|
|
|
};
|
2022-10-05 22:52:30 +02:00
|
|
|
|
2022-10-03 23:28:15 +02:00
|
|
|
uimage = callPackage ./uimage.nix { };
|
2022-10-05 22:52:30 +02:00
|
|
|
|
|
|
|
dtb = callPackage ./dtb.nix {
|
|
|
|
openwrt = openwrtSource;
|
|
|
|
kernel = tree;
|
|
|
|
};
|
2022-09-20 19:54:27 +02:00
|
|
|
}
|