use openwrt kernel for gl-ar750

This commit is contained in:
Daniel Barlow
2022-10-16 15:15:18 +01:00
parent 77922c875b
commit 4b513cdb98
4 changed files with 59 additions and 46 deletions

View File

@@ -1,44 +1,19 @@
{
callPackage
, buildPackages
, stdenvNoCC
, fetchFromGitHub
, config
, checkedConfig
, sources
}:
let
# 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
'';
};
in rec {
{
vmlinux = callPackage ./vmlinux.nix {
inherit tree config checkedConfig;
tree = sources.kernel;
inherit config checkedConfig;
};
uimage = callPackage ./uimage.nix { };
dtb = callPackage ./dtb.nix {
openwrt = sources.openwrt;
kernel = tree;
inherit (sources) openwrt kernel;
};
}

View File

@@ -92,8 +92,9 @@ stdenv.mkDerivation rec {
installPhase = ''
${CROSS_COMPILE}strip -d vmlinux
cp vmlinux $out
make clean
mkdir -p $modulesupport
cp .config $modulesupport/config
make clean
cp -a . $modulesupport
'';