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-25 22:54:09 +03:00
|
|
|
}:
|
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";
|
2019-10-10 01:49:47 +03:00
|
|
|
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 = [
|
2018-07-07 01:30:06 +03:00
|
|
|
./0001-Porting-changes-found-in-LineageOS-android_kernel_cy.patch
|
2019-10-10 04:46:17 +03:00
|
|
|
./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
|
2019-09-22 05:43:39 +03:00
|
|
|
./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
|
2018-07-05 05:33:09 +03:00
|
|
|
./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
|
|
|
})
|