[Nexus 5X Android Development] nathanchance:
​

Introduction

Hello everyone, this is my kernel for the Nexus 6P ported on over to the Nexus 5X. I won't claim that you will get hours upon hours of battery life (even though optimization really is my focus here) but I will say I have added quite a few options for you guys and the optimization patches should improve your experience with this device. Hopefully you enjoy! Please read this entire post, most of your questions will be answered in here!

Features

Here are the major features of the kernel (feel free to explore Github)

Upstream Linux versions 3.10.74-3.10.104

Updated to the December security patch

Patches for some CVEs

Upstream patches from CAF and Linux

Support for overclocking to 2016 MHz on big and 1632 MHz on little (stock values by default)

Support for underclocking to 302MHz on big and little (stock values by default)

CPU governors: chill, conservative, despair, elementalx, impulse, intelliactive, interactive, ironactive, ondemand, performance, powersave, and zzmoove

Touchboost fully disabled

MSM_Hotplug v2.4

Backlight dimmer

KCAL color control

Adreno Boost

Adreno Idler

Wake gestures (sweep2wake, doubletap2wake, sweep2sleep, and camera launch gesture)

Faux Sound Control with high performance audio

Upstream zram commits (from 3.18)

UKSM support (disabled by default)

Upstream zswap commits (up to 4.7)

I/O schedulers: bfq, cfq, deadline, fiops, maple, noop, row, sioplus, and zen

Wakelock controls

TCP algorithms: bic, cubic, highspeed, htcp, hybia, illinois, lp, reno, scalable, vegas, veno, westwood (default)

Kexec patch for MultiROM support

F2FS support

Compiled with an Uber-based 6.3.1 toolchain located here

Makefile optimizations

Forced encryption and dm-verity disabled

Hides bootloader unlock from SafetyNet (can still fail through other means)

Built with AnyKernel2 thanks to [MENTION=4544860]osm0sis[/MENTION]

Downloads

7.1.1 (2.x): Main

7.0 (1.x): Main

Installation

If you are on stock:

If you are on the stock kernel: flash the kernel zip and reboot

If you are on a custom kernel: flash the stock boot image matching your build number, flash the kernel zip, and reboot

If you are on a custom ROM:

If you are on the kernel that came with your ROM: flash the kernel zip and reboot

If you are on a custom kernel: dirty flash your ROM zip, flash the kernel zip, and reboot

Upgrading from one Flash version to the other:

Just flash the kernel zip and reboot

Changelog

Nougat 7.1.1

[B]2.2[/B] ([URL=http://xdaforums.com/showthread.php?p=70246171]release post[/URL])
[LIST]
[*]Adaptive low memory killer (disabled by default)
[*]Process reclaim
[*]Other low memory killer improvements
[*]Binder improvements
[*]Improved Adreno Idler (thanks to [MENTION=5051294]frap129[/MENTION])
[*]Improved Makefile flags (thanks to [MENTION=5284595]kwoktopus[/MENTION])
[*][URL="https://lwn.net/Articles/621046/"]Lazytime[/URL] for EXT4 and F2FS
[*]Toolchain bumped to 6.3.1
[/LIST]
[B]2.1[/B] ([URL=http://xdaforums.com/showthread.php?p=70112916]release post[/URL])
[LIST]
[*]Upstream F2FS commits
[*]Upstream sdcardfs commits
[*]Upstream blu_active commits (thanks to [MENTION=5996255]jollaman999[/MENTION])
[*]Remove ironactive (we already have all of the upstream CAF commits that make it special in interactive)
[*]Improvements to cpuidle
[*]Improvements to locking
[*]Double tap to wake now works when either halfscreen or fullscreen is selected in KA
[*]Improvements to Live Display (work with KCAL thanks to [MENTION=4684315]flar2[/MENTION])
[*]Improvements to wakelocks (disable a few by default to improve battery)
[*]Attempt to fix 2% battery drop issue
[*]Security patches here and there
[/LIST]
[B]2.0[/B] ([URL=http://xdaforums.com/showthread.php?p=69964903]release post[/URL])
[LIST]
[*]Updated for the December security patch
[*]Merged some Pixel security patches
[*]Updated AnyKernel
[*]New toolchain (Uber 6.2.1 with some Linaro opts)
[/LIST]
[B]2.0-rc1[/B] ([URL=http://xdaforums.com/showthread.php?p=69859710]release post[/URL])
[LIST]
[*]Same as 1.5 but with DP source as a base
[/LIST]

Nougat 7.0/7.1

[B]1.5[/B] ([URL=http://xdaforums.com/showthread.php?p=69859703]release post[/URL])
[LIST]
[*]Fixes for sdcardfs on certain ROMs like CM 14.1
[*]Upstream patches from CAF and Linux
[*]Allow big cluster to be boosted without a task on it
[*]UKSM improvements
[*]Add exFAT driver
[*]Detect when kernel is flashed on an unsupported Android version
[*]Add support for FK Updater's performance profiles
[/LIST]
[B]1.4[/B] ([URL=http://xdaforums.com/showthread.php?p=69513015]release post[/URL])
[LIST]
[*]Chill governor updates (thanks to [MENTION=5051294]frap129[/MENTION])
[*]Upstream CAF and Linux patches
[*]Fixed some compiler warnings (thanks to [MENTION=4231562]Yoinx[/MENTION])
[/LIST]
[B]1.3[/B] ([URL=http://xdaforums.com/showthread.php?p=69264478]release post[/URL])
[LIST]
[*]Upstream Linux patches for vmstat and libgcc
[*]Backported MDSS and GPU patches from Marlin (thanks to [MENTION=3292224]franciscofranco[/MENTION])
[*]Low memory killer improvements
[/LIST]
[B]1.2[/B] ([URL=http://xdaforums.com/showthread.php?p=69247027]release post[/URL])
[LIST]
[*]Linux version 3.10.104
[*]Move back to a constant tickrate of 300HZ
[*]Add a patch to hide bootloader unlock from SafetyNet
[/LIST]
[B]1.1[/B] ([URL=http://xdaforums.com/showthread.php?p=69183236]release post[/URL])
[LIST]
[*]Add ironactive governor
[*]msm_hotplug
[*]Underclocking to 302 MHz
[/LIST]
[B]1.0[/B]
[LIST]
[*]Initial release
[*]List of features above
[*]Compiled with latest Linaro 6.2 from Uber repo
[/LIST]

Customization

Since the whole point of installing a custom kernel is to have more options available to you, here is some information regarding the tweaks available in the kernel.

Default settings:

the phone will boot with the following settings (the ones I recommend sticking with if you are not into tweaking):

Governors: interactive on both clusters

Frequencies: 384-1440MHz on little and 633-1824MHz on big

Input boost: 1248MHz on little and 768MHz on big for 40ms

core_control on, msm_thermal off

Wake gestures and backlight dimmer disabled

Adreno Idler enabled

Sound controls set at 0

ZRAM enabled and UKSM disabled

zen at 128kb

Governor profiles:

If you want to try and squeeze a little bit more battery life out of your phone or increase performance, you may consider exploring governor profiles. Below are some links to various posts containing links/descriptions of these profiles:

From [MENTION=5886947]soniCron[/MENTION] - HawkTail, GlassFish, and FairPark

From [MENTION=4752299]Alcolawl[/MENTION] - list of profiles

Virtual memory:

I have implemented ZRAM and UKSM in the kernel and there are many ways to tweak these. I would only recommend messing with vm_swappiness but you can read about ZRAM tunables here and UKSM tunables here. To make the kernel use more or less ZRAM, type this in a terminal emulator (or change it in EX Kernel Manager under the Memory section):

echo # > /proc/sys/vm/swappiness

This number can be between 0 and 100. 0 will make the kernel swap to ZRAM only if there is an out of memory error, 100 will make the kernel swap to ZRAM as much as it can. I set it at 15 by default, I would set it to 1 if you don't want to use it as much as 1 will use the minimum amount possible (basically when the phone is super under load). Highest I would go is 60 (which is the stock/default value in the Linux kernel). Read more about swappiness here. Additionally, UKSM is disabled by default. You can either enable it with EXKM or echo 1 to the sys path /sys/kernel/mm/uksm/run

Frequently asked questions

1.1 Q: I am having an issue, can you help me?

1.1 A: I am not a superstar kernel developer but I will certainly try my best. First, start by reading the release posts, as I may make note of a particular issue. Also search the thread to see if I have discussed it before. If you see nothing, please provide me with a dmesg/last_kmsg and logcat, your ROM/kernel version, and a detailed description of the issue. With that, I'll do my best to assist you.

adb logcat -d > logcat.txt
adb shell dmesg > dmesg.txt

1.2 Q: Can you add xyz feature?

1.2 A: If you link me the commits or tell me what kernel you had the feature in, I can take a look at them. I will not go digging super hard for commits and I will ignore requests that don't include this information. I won't promise that I will merge every request but I will always take it into consideration.

1.3 Q: How do I control the kernel?

1.3 A: I'd recommend using either [MENTION=4684315]flar2[/MENTION]'s EX Kernel Manager or [MENTION=4231562]Yoinx[/MENTION]'s Kernel Adiutor-Mod; both are extremely solid and have given me no issues.

Thanks to:

[MENTION=5037435]REV3NT3CH[/MENTION] for showing me what a good developer and kernel looks like

The various developers for their patches ([MENTION=3685904]ak[/MENTION], [MENTION=2967322]Buckmarble[/MENTION], [MENTION=4684315]flar2[/MENTION], [MENTION=3292224]franciscofranco[/MENTION], [MENTION=5051294]frap129[/MENTION], [MENTION=3357040]imoseyon[/MENTION], [MENTION=5996255]jollaman999[/MENTION], and [MENTION=2033478]Yank555[/MENTION] to name a few)

[MENTION=4544860]osm0sis[/MENTION] for AnyKernel2

[MENTION=5169465]mdalexca[/MENTION] for helping me with some kernel compilation issues and the prebuilt toolchain I use

[MENTION=5284595]kwoktopus[/MENTION] for giving me good advice on Makefile flags and other patches

[MENTION=329570]malybru[/MENTION] for my nifty new signature and thread banner!

All of you guys for viewing the thread

A note about donations

Quite a few people have asked to donate to me in the past and I have turned them down. I am not in this for the money, this is my hobby, something I truly enjoy. If you truly want to donate to something (it is not expected in the slightest), I recommend an entity like the Open Source Initiative, the Free Software Foundation, XDA, or any one of the people I have thanked in the OP. Additionally, you are free to copy any and all of my work; the only thing I request is that you not ask for donations as well (though I can't really enforce this lol). Thank you.

Kernel source links

7.0: https://github.com/nathanchance/bullhead

DISCLAIMER:

I openly welcome off topic in my threads. Mods, please do not clean off topic discussion and users, do not complain about off topic discussion here. I may direct you to another thread if it is so suited but I won't have the discussion cleaned. Thank you.

XDA:DevDB Information

Flash Kernel, Kernel for the LG Nexus 5X

Contributors

The Flash

Source Code: https://github.com/nathanchance/bullhead

Kernel Special Features:

Version Information

Status: Stable

Current Stable Version: 2.2 - Nougat 7.1.1

Stable Release Date: 2016-12-25

Created 2016-10-15

Last Updated 2019-07-02