forked from NixOS/nixos-hardware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzsbl.nix
51 lines (46 loc) · 1 KB
/
zsbl.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ buildPackages
, bison
, fetchFromGitHub
, flex
, lib
, stdenv
, ...
}:
stdenv.mkDerivation rec {
pname = "zsbl-sg2042";
version = "git-cc806273";
src = fetchFromGitHub {
owner = "sophgo";
repo = "zsbl";
rev = "cc806273e0f679bef2f6b017c68adede1594ad31";
hash = "sha256-zOlBM7mwz8FUM/BlzOxJmpI8LI/KcFOGXegvgiilbaM=";
};
patches = [
# Depending on the sdcard, reading larger initrds (say >= 25MB)
# can hit the timeout.
./zsbl-increase-timeout.patch
];
nativeBuildInputs = [
bison
flex
];
depsBuildBuild = [
buildPackages.stdenv.cc
];
hardeningDisable = [
"fortify"
"stackprotector"
];
makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
configurePhase = "make sg2042_defconfig";
installPhase = "install -D zsbl.bin $out";
enableParallelBuilding = true;
dontStrip = true;
meta = {
homepage = "https://github.com/sophgo/zsbl";
description = "Sophgo RISC-V Zero Stage Boot Loader";
license = lib.licenses.gpl2;
};
}