1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-16 20:21:32 +03:00
mobile-nixos/devices/google-walleye/kernel/default.nix

58 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.230";
src = fetchFromGitHub {
owner = "android-linux-stable";
repo = "wahoo";
rev = "b7a52ef11ab0e2f59ac8d6034821bee07145b44c";
sha256 = "0npmpsv6mid9vd7yqbnzx83ddhqxdmjfh0mpl06gqx4ywqbc8ph0";
};
patches = [
./0001-Revert-four-tty-related-commits.patch
./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;
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
)
'';
}).overrideAttrs({ postInstall ? "", nativeBuildInputs, ... }: {
installTargets = [ "zinstall" "Image.gz-dtb" "install" ];
nativeBuildInputs = nativeBuildInputs ++ [ dtc ];
postInstall = postInstall + ''
cp -v "$buildRoot/arch/arm64/boot/Image.gz-dtb" "$out/"
'';
})