1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-25 17:02:45 +03:00
mobile-nixos/devices/xiaomi-tissot/kernel/default.nix
2020-09-30 02:11:47 -04:00

45 lines
1.1 KiB
Nix

{ mobile-nixos
, fetchFromGitHub
, kernelPatches ? []
, dtbTool
, buildPackages
}:
let inherit (buildPackages) dtc; in
(mobile-nixos.kernel-builder-gcc6 {
version = "3.18.71";
configfile = ./config.aarch64;
file = "Image.gz-dtb";
hasDTB = true;
src = fetchFromGitHub {
owner = "lineageos";
repo = "android_kernel_xiaomi_msm8953";
rev = "80cb3f607eb78280642c3b9b6e89f676e9c263bf";
sha256 = "13p326acpyqvlh5524bvy2qkgzgyhwxgy0smlwmcdl6y7yi04rg5";
};
patches = [
./99_framebuffer.patch
./0003-arch-arm64-Add-config-option-to-fix-bootloader-cmdli.patch
];
postPatch = ''
# 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//g' "$i"
done
echo "Patched out -Werror"
'';
makeFlags = [ "DTC_EXT=${dtc}/bin/dtc" ];
isModular = false;
}).overrideAttrs ({ postInstall ? "", ... }: {
installTargets = [ "Image.gz" "zinstall" "Image.gz-dtb" "install" ];
postInstall = postInstall + ''
cp $buildRoot/arch/arm64/boot/Image.gz-dtb $out/
'';
})