Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Created March 26, 2019 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lheckemann/4cd0cc20b475473ef1ebee4fe51fa649 to your computer and use it in GitHub Desktop.
Save lheckemann/4cd0cc20b475473ef1ebee4fe51fa649 to your computer and use it in GitHub Desktop.
# 6min kernel, 7m30 zfs, on community box
{ pkgs ? import <nixpkgs> {}}: with pkgs;
linuxPackagesFor ((buildLinux rec {
src = fetchFromGitHub {
owner = "friendlyarm";
repo = "kernel-rockchip";
rev = "decbad503ca983f939baca6c19a79117b11f5bd6";
sha256 = "1mwykah9yr68gscrc8lqi3jay4553yq9cs86m5b21wizm5ikhpfn";
};
version = "4.4.154";
defconfig = "nanopi4_linux_defconfig";
structuredExtraConfig = with import (pkgs.path + "/lib/kernel.nix") {inherit lib version;}; {
CROSS_COMPILE = freeform "";
IKCONFIG = yes;
IKCONFIG_PROC = yes;
BPF_SYSCALL = yes;
IP_NF_MATCH_RPFILTER = yes;
};
allowImportFromDerivation = true;
kernelPatches = [];
}).overrideAttrs (o: {
buildFlags = ["nanopi4-images"] ++ o.buildFlags;
nativeBuildInputs = [ lz4 ] ++ o.nativeBuildInputs;
postInstall = o.postInstall + ''
cp $buildRoot/kernel.img $buildRoot/resource.img $out
'';
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment