mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-16 11:43:21 +03:00
5116490a22
The kernel build is technically the same as google-taimen, with some options switched around. An upcoming improvement will be to share the "wahoo" platform's kernel build with an option to switch between the two at build time, and further along the line, with modular kernels, sharing the same exact builds, but with the device-specifics as modules.
55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
{
|
|
mobile-nixos
|
|
, fetchFromGitHub
|
|
, kernelPatches ? [] # FIXME
|
|
, buildPackages
|
|
}:
|
|
|
|
let
|
|
inherit (buildPackages) dtc;
|
|
in
|
|
|
|
(mobile-nixos.kernel-builder {
|
|
configfile = ./config.aarch64;
|
|
|
|
file = "Image.gz-dtb";
|
|
hasDTB = true;
|
|
|
|
version = "4.4.195";
|
|
src = fetchFromGitHub {
|
|
owner = "android-linux-stable";
|
|
repo = "wahoo";
|
|
rev = "4da1300261708136a4d431bbbf075e0e3ea5849c";
|
|
sha256 = "1677n3bw9x10d1f939sf6x36x4hbdnbvyfajh3awg2yhj6lbwdrk";
|
|
};
|
|
|
|
patches = [
|
|
./0001-mobile-nixos-Adds-and-sets-BGRA-as-default.patch
|
|
./0001-mobile-nixos-Workaround-selected-processor-does-not-.patch
|
|
./0003-arch-arm64-Add-config-option-to-fix-bootloader-cmdli.patch
|
|
];
|
|
|
|
isModular = false;
|
|
}).overrideAttrs({ postInstall ? "", postPatch ? "", nativeBuildInputs, ... }: {
|
|
installTargets = [ "zinstall" "Image.gz-dtb" "install" ];
|
|
postPatch = postPatch + ''
|
|
# FIXME : factor out
|
|
(
|
|
# Remove -Werror from all makefiles
|
|
local i
|
|
local makefiles="$(find . -type f -name Makefile)
|
|
$(find . -type f -name Kbuild)"
|
|
for i in $makefiles; do
|
|
sed -i 's/-Werror-/-W/g' "$i"
|
|
sed -i 's/-Werror=/-W/g' "$i"
|
|
sed -i 's/-Werror//g' "$i"
|
|
done
|
|
)
|
|
'';
|
|
nativeBuildInputs = nativeBuildInputs ++ [ dtc ];
|
|
|
|
postInstall = postInstall + ''
|
|
cp -v "$buildRoot/arch/arm64/boot/Image.gz-dtb" "$out/"
|
|
'';
|
|
})
|