nixfmt-rfc-style
There is nothing in this commit except for the changes made by nix-shell -p nixfmt-rfc-style --run "nixfmt ." If this has mucked up your open branches then sorry about that. You can probably nixfmt them to match before merging
This commit is contained in:
@@ -34,9 +34,9 @@ stdenv.mkDerivation rec {
|
||||
perl
|
||||
]);
|
||||
CC = "${stdenv.cc.bintools.targetPrefix}gcc";
|
||||
HOSTCC = with buildPackages.pkgs;
|
||||
"gcc -I${openssl}/include -I${ncurses}/include";
|
||||
HOST_EXTRACFLAGS = with buildPackages.pkgs;
|
||||
HOSTCC = with buildPackages.pkgs; "gcc -I${openssl}/include -I${ncurses}/include";
|
||||
HOST_EXTRACFLAGS =
|
||||
with buildPackages.pkgs;
|
||||
"-I${openssl.dev}/include -L${openssl.out}/lib -L${ncurses.out}/lib";
|
||||
PKG_CONFIG_PATH = "./pkgconfig";
|
||||
CROSS_COMPILE = stdenv.cc.bintools.targetPrefix;
|
||||
@@ -45,7 +45,12 @@ stdenv.mkDerivation rec {
|
||||
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
outputs = ["out" "headers" "modulesupport" "config"] ++ targetNames;
|
||||
outputs = [
|
||||
"out"
|
||||
"headers"
|
||||
"modulesupport"
|
||||
"config"
|
||||
] ++ targetNames;
|
||||
phases = [
|
||||
"unpackPhase"
|
||||
"butcherPkgconfig"
|
||||
@@ -61,8 +66,7 @@ stdenv.mkDerivation rec {
|
||||
patches = [
|
||||
./cmdline-cookie.patch
|
||||
./mips-malta-fdt-from-bootloader.patch
|
||||
] ++ lib.optional (lib.versionOlder version "5.18.0")
|
||||
./phram-allow-cached-mappings.patch;
|
||||
] ++ lib.optional (lib.versionOlder version "5.18.0") ./phram-allow-cached-mappings.patch;
|
||||
|
||||
# this is here to work around what I think is a bug in nixpkgs
|
||||
# packaging of ncurses: it installs pkg-config data files which
|
||||
|
@@ -1,24 +1,25 @@
|
||||
{
|
||||
stdenv
|
||||
, dtc
|
||||
, lib
|
||||
, runCommand
|
||||
, writeText
|
||||
stdenv,
|
||||
dtc,
|
||||
lib,
|
||||
runCommand,
|
||||
writeText,
|
||||
}:
|
||||
{ dts
|
||||
, includes
|
||||
, commandLine
|
||||
}:let
|
||||
{
|
||||
dts,
|
||||
includes,
|
||||
commandLine,
|
||||
}:
|
||||
let
|
||||
cppDtSearchFlags = builtins.concatStringsSep " " (map (f: "-I${f}") includes);
|
||||
dtcSearchFlags = builtins.concatStringsSep " " (map (f: "-i${f}") includes);
|
||||
cmdline = lib.concatStringsSep " " commandLine;
|
||||
chosen = writeText "chosen.dtsi" "/{ chosen { bootargs = ${builtins.toJSON cmdline}; }; };";
|
||||
combined = writeText "combined-dts-fragments"
|
||||
(lib.concatStrings
|
||||
(builtins.map
|
||||
(f: "#include \"${f}\"\n")
|
||||
(dts ++ [ chosen ])));
|
||||
in stdenv.mkDerivation {
|
||||
combined = writeText "combined-dts-fragments" (
|
||||
lib.concatStrings (builtins.map (f: "#include \"${f}\"\n") (dts ++ [ chosen ]))
|
||||
);
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "dtb";
|
||||
phases = [ "buildPhase" ];
|
||||
nativeBuildInputs = [ dtc ];
|
||||
|
@@ -1,10 +1,10 @@
|
||||
{
|
||||
lzma
|
||||
, stdenv
|
||||
, ubootTools
|
||||
, dtc
|
||||
, lib
|
||||
} :
|
||||
lzma,
|
||||
stdenv,
|
||||
ubootTools,
|
||||
dtc,
|
||||
lib,
|
||||
}:
|
||||
let
|
||||
objcopy = "${stdenv.cc.bintools.targetPrefix}objcopy";
|
||||
arch = stdenv.hostPlatform.linuxArch;
|
||||
@@ -12,21 +12,29 @@ let
|
||||
${objcopy} -O binary -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id -S vmlinux.elf vmlinux.bin
|
||||
rm -f vmlinux.bin.lzma ; lzma -k -z vmlinux.bin
|
||||
'';
|
||||
in {
|
||||
kernel
|
||||
, commandLine
|
||||
, commandLineDtbNode ? "bootargs"
|
||||
, entryPoint
|
||||
, extraName ? "" # e.g. socFamily
|
||||
, loadAddress
|
||||
, imageFormat
|
||||
, alignment ? null
|
||||
, dtb ? null
|
||||
} : stdenv.mkDerivation {
|
||||
in
|
||||
{
|
||||
kernel,
|
||||
commandLine,
|
||||
commandLineDtbNode ? "bootargs",
|
||||
entryPoint,
|
||||
extraName ? "", # e.g. socFamily
|
||||
loadAddress,
|
||||
imageFormat,
|
||||
alignment ? null,
|
||||
dtb ? null,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "kernel.image";
|
||||
phases = [
|
||||
"preparePhase"
|
||||
(if commandLine != null then assert dtb != null; "mungeDtbPhase" else ":")
|
||||
(
|
||||
if commandLine != null then
|
||||
assert dtb != null;
|
||||
"mungeDtbPhase"
|
||||
else
|
||||
":"
|
||||
)
|
||||
(if imageFormat == "fit" then "buildPhaseFIT" else "buildPhaseUImage")
|
||||
"installPhase"
|
||||
];
|
||||
@@ -71,7 +79,9 @@ in {
|
||||
};
|
||||
};
|
||||
_VARS
|
||||
mkimage -f mkimage.its -E ${lib.optionalString (alignment != null) "-B 0x${lib.toHexString alignment}"} kernel.uimage
|
||||
mkimage -f mkimage.its -E ${
|
||||
lib.optionalString (alignment != null) "-B 0x${lib.toHexString alignment}"
|
||||
} kernel.uimage
|
||||
mkimage -l kernel.uimage
|
||||
'';
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
{
|
||||
lib
|
||||
, writeText
|
||||
lib,
|
||||
writeText,
|
||||
}:
|
||||
name : config: writeText name
|
||||
(builtins.concatStringsSep
|
||||
"\n"
|
||||
(lib.mapAttrsToList
|
||||
(name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}"))
|
||||
config
|
||||
))
|
||||
name: config:
|
||||
writeText name (
|
||||
builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (
|
||||
name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}")
|
||||
) config
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user