1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 04:51:31 +03:00
mobile-nixos/devices/asus-z00t/kernel/default.nix

62 lines
1.8 KiB
Nix
Raw Normal View History

2019-04-14 07:48:29 +03:00
{
mobile-nixos
2018-06-10 03:57:12 +03:00
, fetchFromGitHub
2019-04-14 07:48:29 +03:00
, kernelPatches ? [] # FIXME
2018-06-10 03:57:12 +03:00
, dtbTool
}:
2018-06-10 03:57:12 +03:00
2019-04-14 07:48:29 +03:00
(mobile-nixos.kernel-builder-gcc6 {
version = "3.10.108";
configfile = ./config.aarch64;
2019-06-10 02:31:57 +03:00
2019-04-14 07:48:29 +03:00
file = "Image.gz";
2019-06-10 02:31:57 +03:00
hasDTB = true;
2018-06-10 03:57:12 +03:00
src = fetchFromGitHub {
owner = "LineageOS";
repo = "android_kernel_asus_msm8916";
rev = "1a45c63742b8c3253a38c2ff97b672918c88d8df"; # lineage-15.1
sha256 = "02mfz3h5s3lvkdinglqmhm2hyfw4w0hqzzh1xla1i9wfc31ddbap";
2018-06-10 03:57:12 +03:00
};
2019-04-14 07:48:29 +03:00
2018-06-10 03:57:12 +03:00
patches = [
./0001-Porting-changes-found-in-LineageOS-android_kernel_cy.patch
./0001-Revert-qmp-sphinx-Add-Qualcomm-Malware-Protection-ke.patch
./0001-Revert-Handle-sk-being-NULL-in-UID-based-routing.patch
./0001-Revert-Grants-system-server-access-to-proc-pid-oom_a.patch
./0001-Revert-misc-uidstat-change-release-handler-for-stat-.patch
./0001-netfilter-xt_IDLETIMER-make-compatible-with-USER_NS.patch
./0001-asus-flash-Remove-hardcoded-IDs-for-USER_NS.patch
./0001-firmware-class-Remove-rude-firmware-path-trampling.patch
./01_more_precise_arch.patch
2018-06-10 03:57:12 +03:00
./01_fix_gcc6_errors.patch
./02_mdss_fb_refresh_rate.patch
./05_dtb-fix.patch
./90_dtbs-install.patch
./99_framebuffer.patch
2018-06-10 03:57:12 +03:00
];
2019-04-14 07:48:29 +03:00
isModular = false;
2018-06-10 03:57:12 +03:00
2019-04-14 07:48:29 +03:00
}).overrideAttrs({ postInstall ? "", postPatch ? "", ... }: {
installTargets = [ "zinstall" ];
postPatch = postPatch + ''
cp -v "${./compiler-gcc6.h}" "./include/linux/compiler-gcc6.h"
2018-06-10 03:57:12 +03:00
'';
2019-04-14 07:48:29 +03:00
postInstall = postInstall + ''
${dtbTool}/bin/dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm64/boot/asus-z00t.img" "arch/arm/boot/"
cp "arch/arm64/boot/asus-z00t.img" "$out/dtbs/asus-z00t.img"
2018-06-10 03:57:12 +03:00
mkdir -p $out/dtb
for f in arch/*/boot/dts/*.dtb; do
cp -v "$f" $out/dtb/
done
2019-04-14 07:48:29 +03:00
# # FIXME: understand the specifics of why this needs to be catted together.
# (
# cd $out
# cat Image.gz dtb/*.dtb > vmlinuz-dtb
# )
2018-06-10 03:57:12 +03:00
'';
2019-04-14 07:48:29 +03:00
})