[Kernel][20.09.2020][Android 10] Kirisakura 1.2.4 for OnePlus 8 Pro aka InstantNoodle - OnePlus 8 Pro ROMs, Kernels, Recoveries, & Other

Kirisakura-Kernel for the OnePlus 8 Pro
Hello everyone,
To keep it short: Here is Kirisakura - Kernel for the OnePlus 8 Pro aka InstantNoodle.
I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.
Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!
This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security and performance, while keeping stability as the foucs during testing! This includes Linux-Stable, CAF-Upstream and kernel/common.
Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features. In fact this may be (and probably is) the first 4.19 msm kernel with a fully working Kernel-CFI implementation and CFI-Violations fixed on a smartphone.
The only kernels made by OEMs offering this security feature are the ones for the Pixel 3 and Pixel 4 devices.
If that got you curious,have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.
Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 865 that´s built into the OP8 Pro.
The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
This kernel focuses amongst others to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.
The kernel includes a lot of improvements and contributions from other developers as well. Without this kernel would not exist.
I´d like to mention @tbalden ´s excellent CleanSlate features at this place. They improve usability by a big margin for me personally. The highly customizable sweep to sleep implementation (adjustable to different navigation settings), long tap to bring down status bar (very useful on a big device), backlight dimmer and notification reminder are very useful features that I use personally every day, which can be enabled rootless if one desires to run without root.
Another big part of improvements originate from @arter97´s, @kdrag0n´s and @Sultanxda´s work. Many others contributed in some way or another to this kernel.
A big thanks to all of them at this place!
Now lets continue with a list of features in the next paragraph!
Main Features:
- Based on latest kernel sources from OnePlus for Android 10 and intended for use on OOS-Stable releases
- compiled with Clang 11.0.3 and built with -O3 speed optimizations
- Linux-Stable-Upstream included to 4.19.146
- CAF base for the Snapdragon 865 (SD865) updated to CAF-Tag LA.UM.8.12.r1-12500-sm8250.0
- Kernel Control-Flow-Integration (CFI) andLink-Time-Optimization (LTO) ported from 4.19 kernel/common and Pixel 4/XL Kernel
- Shadow Call Stack (SCS) Security-Feature
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Preview Kernel instead of full LTO
- fix various CFI-Violations found in various subsystems like OnePlus drivers and qualcomm drivers
- Link the kernel with LLD and use RELR-Relocation
- include important fixes/improvements from kernel/common
- Flashing the kernel will keep root!
- Cleanslate Features included! See @tbaldens´s CleanSlate Thread for more information
- Flashable via EXKM and FKM on a rooted system!
- Anykernel zip is based on the Anykernel3 release from @osm0sis
EAS related features:
- EAS implementation patched up to latest CAF state
- disable autogroups and use cgroups for more efficient task placement!
- Dynamic Stune Boost to inflate task utilization and not overload cores on interaction (thanks to @RenderBroken, @joshuous and @tbalden for the rootless implementation )
- updates from kernel/common
CPU related features:
- Change various drivers (WLAN, MM, audio, charger, power, thermal, glink etc) to user power efficient workingqueues. This compliments EAS
- include cpuidle patches from CAF
- improvements to cpufreq/times/stats
- improve memory allocations in binder driver
GPU related features:
- GPU driver updated to latest CAF-State
- remove POPP functionality from GPU driver to avoid constant fight about downscaling with msm-adreno-tz
- don´t wake the gpu on touch input, instead wake when receiving an ioctl
- don´t copy fence names by default to save a bit of cpu-time (explanation)
- msm: kgsl: Stop slab shrinker when no more pages can be reclaimed
File System related features:
- improve memory allocations in sdcardfs
- improve eventpoll logging to stop indicting timerfd (improves kernel wakelock readability)
- improve memory allocations in kernfs
- writeback: hardcode dirty_expire_centisecs=3000 based on this commit
UI/UX/Usability related features from CleanSlate:
- CleanSlate features made by @tbalden
- Flashlight Notification/Call blinking
- Vibrating Notification Reminder
- Sweep to Sleep touchscreen gesture - highly customizable
- DoubleTap on Sweep2Sleep's area gestures - new way to pull down android Notification Area
- Face down screen off - new gesture
- Backlight Dimmer - possibility to use lower panel brightness (switch DC dimming off in Lab settings!)
- KCAL Color Control (credit to @savoca)
Network related features:
- Wireguard Support (Details)
- advanced TCP algorithms enabled
- includes new bbr and bbr2
Memory related features:
- Speculative Page Faults left enabled (1. 2) (CAF default)
- various fixes for PSI-Monitor, which is used by the userspace lowmemorykiller-daemon
- Fix various memory leaks in different subsystems
- improved mm with patches from mainline
- various other changes from mainline
- included zstd as an option for ZRAM-algorithm (lz4 is probably the best all around, so only change it if you know why and what you are doing)
- improve memory allocations in various subsystems
Security related features:
- Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) ported from 4.19 kernel/common and Pixel 4/XL Kernel
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Kernel instead of full LTO
- fix various CFI-Violations found in various subsystems like OnePlus drivers and qualcomm drivers
- enable init_on_alloc for even more security, more information can be found in the commit message
Misc Features:
TCP Congestion Algorithms:
- advanced algorithms enabled, enable them with your favorite kernel manager
- includes new bbr2
Wakelock Blocker:
- advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info
- blocking a kernel wakelock should only be done in case of firmware incompatabilities (WiFi network at work (can´t be changed) causes deep sleep to not work on the phone.) That´s the only use case I see for this feature. The kernel does not features this to improve battery life!
Other features:
- disable logging and debugging to make the kernel more lightweight in various places (includes binder, mm, vma, gpu, ipa etc)
- fix several coding issues detected by newer Clang-Toolchains
- add support for steam controller
- add support for nintendo switch controller
Feature section for the "non visible" but perceptible improvements:
- updated binder section (responsible for interprocess communication)
- updated sdcardfs ; have a read about it here:
Requirements
- unlocked Bootloader
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment
- magisk root
How to flash the Kernel:
1. Download the latest kernel.zip and make sure you have properly updated to the latest matching OnePlus firmware. When OOS receives an update it takes OnePlus a while to release the source code for the new OS and me a while to build a new kernel. If you don´t want to face any issues, wait until I either release an updated kernel or give green light because there were no kernel changes.
1a. Optional: While it may not be necessary all times, you may want to restore stock boot.img, re-root with magisk and optionally install twrp.zip if coming from another kernel. Before reporting issues make sure you do that! Thank you!
2. Make sure to use latest Magisk-stable, if you choose to use Magisk.
3. Flash the kernel.zip via latest EXKM or FKM app, or TWRP (haven´t tested TWRP myself as I don´t need it) and do a full reboot.
4. Reboot and profit.
DOWNLOAD:
Download is located always in this folder:
https://www.androidfilehost.com/?w=files&flid=313864
Important: Read after Download
Please take a look at the second post after flashing the kernel!
Changelog:
Android 10
1.0.0 Initial Release
1.2.0 https://forum.xda-developers.com/showpost.php?p=83260487&postcount=67
1.2.2 https://forum.xda-developers.com/showpost.php?p=83521551&postcount=119
1.2.4 https://forum.xda-developers.com/showpost.php?p=83539543&postcount=125
Donations:
Donations are not mandatory but very welcome if you want to support development or just buy me a coffee
If you like my work: http://paypal.me/freak07
Credits:
@osm0sis for all his work, including the ak3 installer!
@tbalden for being the best HTC wingman!
@LeeDroid and @mwilky for their awesome roms and work!
@Captain_Throwback for all the mentoring and guidance!
@Eliminater74 for bringing me into the game and the Inspiration
@nathanchance for his upstream guidance and assistance
@RenderBroken for helping me out
@flar2 for all his work
@joshuous for all the help he provided to me in the past!
@arter97 for giving me advice
@kdrag0n for his help too
@topjohnwu for magisk!
XDA:DevDB Information
Kirisakura Kernel, Kernel for the OnePlus 8 Pro
Contributors
Freak07
Source Code: https://github.com/freak07/Kirisakura_OP8PRO_InstantNoodle
Kernel Special Features:
Version Information
Status: Stable
Created 2020-06-19
Last Updated 2020-09-20

FAQ
F.A.Q:
Question: Is root preserved when flashing this kernel?
Answer: Yes, the AnyKernel.zip will detect root and keep it.
Question: How do I return back to stock or another kernel.
Answer: Extract boot.img from matching firmware you are on and flash the extracted boot.img via fastboot. If you want to keep root flash back the magisk_patched_boot.img. Or dirty flash your rom.
Question: How to report bugs properly?
Answer: Have a look at post #3 in this thread. The linked guide is a pretty good starting point.
Before reporting any bug make sure you´re not using any mods, magisk modules, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
Is the issue reproducible? Does it happen frequently?
Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.
If the device force reboots/randomly reboots (that means you see the bootloader unlocked screen!) provide a ramoops file.
Easiest way is immediately after booting up, with a root explorer navigate to sys/fs/pstore. Copy the contents to your internal storage, zip it up and send it to me.
If the issue happens while the device is running provide a dmesg plus a logcat that you take while/shortly after the issue happens. This will log what´s running in the current session. Try to be as detailed as possible what´s happening when the issue appears. It will also help me in reading the log!

Useful Resources
How to report bugs:
It is incredibly useful if bug reports are done in a proper way. That saves everyones time and will ultimately lead to a faster bugfix (hopefully).
The following guide from @nathanchance is a very good guideline on how to properly report a bug!
Please also take a log at the FAQ one post above. It covers some procedural steps as well and serves as a guideline too!
https://github.com/nathanchance/Android-Tools/blob/master/Guides/Proper_Bug_Reporting.txt

Hello everyone
I want to lose a few words about this kernel.
Before anybody asks, it´s made for the OP8 Pro only!
As you may or may not have noticed by reading the OP this kernel is very far from the stock base.
Adding linux-stable upstream and CAF-Upstream causes the commit-count to increase from 805000 to about 840000.
A "higher" commit count does not automatically translater to a better kernel. However upstreaming linux-stable and the CAF-Base to the latest code is an important aspect, that´s often cast aside. (after all the android kernel is based on the linux-kernel and the CAF-Base is the kernel base OnePlus bases the kernel for the OP8 Pro on) . Many developers work constantly on improving the linux-stable branches with commits that are tested, same goes for the qualcomm developers over at the CAF-Forums.
The main goals of this kernel are summarized in the OP. I encourage everyone to at least read once through it.
Here´s a short summary of what I think are the most characteristic and important aspects (also an excerpt from the first post of this thread ):
This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security, stability and performance! This includes Linux-Stable, CAF-Upstream and kernel/common.
Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features. In fact this may be (and probably is) the first 4.19 kernel with a fully working Kernel-CFI implementation and CFI-Violations fixed.
The only kernels made by OEMs offering this security feature are the ones for the Pixel 3 and Pixel 4 devices.
If some of that got you curious,have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.
Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 865 that´s built into the OP8 Pro.
The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
This kernel focuses amongst others to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.
I invite everybody to try the kernel
If you face any bugs, I´d appreciate if bug reports are done in the proper way, like it is asked for and explained in the 2nd and 3rd post.
If you read the OP you probably noticed I´m not talking about any improvments (some call it even magic) to performance or battery life. This is not one of the direct goals of this kernel.
If the modifications present in the kernel make you feel a noticable difference in either of these I´m very happy for you. I know that artifical benchmarks are improved and some other things I tested.
If this kernel is not for you you can very easy return to the stock kernel, like it´s described in the FAQ as well!
There might not be updates of this kernel for every single linux-stable upstream revision that is released at kernel.org or every single new commit added to the tree, but rather less updates but bigger ones.
I guess that gives everybody a rough idea of where this project might be going.
I wish everybody a nice day

Loved this for the 7 pro. Welcome ?

Woohoo, welcome!
Congrats on this truly great achievement.
Keep it up.
[emoji106][emoji106][emoji122][emoji122]
Sent from my Pixel 4 XL using Tapatalk

Excellent, welcome!

Hey buddy! Nice to see you here! ?

possible to add option to disable touchboost?

tbalden said:
Woohoo, welcome!
Congrats on this truly great achievement.
Keep it up.
[emoji106][emoji106][emoji122][emoji122]
Sent from my Pixel 4 XL using Tapatalk
Click to expand...
Click to collapse
Thank you! Glad to have you as a wingman for a very long time across different devices now!
Keep on rocking with all the CleanSlate goodies!
Reuben_skelz92 said:
Loved this for the 7 pro. Welcome
Click to expand...
Click to collapse
kristofpetho said:
Excellent, welcome!
Click to expand...
Click to collapse
TheKnux said:
Hey buddy! Nice to see you here!
Click to expand...
Click to collapse
Thank you
Nekromantik said:
possible to add option to disable touchboost?
Click to expand...
Click to collapse
Yes, since all Cleanslate features are included it´s accessible via CleanSlate config app.
https://forum.xda-developers.com/showpost.php?p=82598221&postcount=192
Gestures and Extras Section - Stock touchboost.

nice to see ya here

Doing a sexy dance right this minute! :victory: Dam glad your covering this device now also buddy Always a great solid kernel that runs smooth and fluid without issue! :good:

Omg the kernel was amazing on the OP7P, can't wait to use this one again on my 8!

Running smooth as butter for me ?

Thank you sir, donation sent.

Nice to see this Kernel here for the 8pro
Gesendet von meinem IN2023 mit Tapatalk

seems it disable lowmemorykiller? i cant check it from FK kernel App and i want change it, **** OS with12g RAM still killng bg app
max its used 65% RAM, can not used more than it.

Lxeon said:
seems it disable lowmemorykiller? i cant check it from FK kernel App and i want change it, **** OS with12g RAM still killng bg app
max its used 65% RAM, can not used more than it.
Click to expand...
Click to collapse
The lowmemorykiller daemon is no longer in the kernel. it’s handled from userspace on the op8 pro on android 10 OOS.
Unfortunately nothing I can do in the kernel to change this.
If apps are getting killed say thank you to OnePlus and OOS. Not related to the kernel.

Lxeon said:
seems it disable lowmemorykiller? i cant check it from FK kernel App and i want change it, **** OS with12g RAM still killng bg app
max its used 65% RAM, can not used more than it.
Click to expand...
Click to collapse
Try to disable zram/swap

cultofluna said:
Try to disable zram/swap
Click to expand...
Click to collapse
still around 65%
---------- Post added at 11:49 AM ---------- Previous post was at 11:49 AM ----------
Freak07 said:
The lowmemorykiller daemon is no longer in the kernel. it’s handled from userspace on the op8 pro on android 10 OOS.
Unfortunately nothing I can do in the kernel to change this.
If apps are getting killed say thank you to OnePlus and OOS. Not related to the kernel.
Click to expand...
Click to collapse
good hardware, suck software

Related

[ROM] [6.0.1] [Build 4] [03/04] Unofficial CyanogenMod 13.0

Introduction
This ROM is inspired by JustArchi's build optimizations that provide up to 6x performance boost .​
I am not a developer by any means, I did my homework and I figured out how to compile and cherry-pick cool things. I am open to advice and guides that can help me make this ROM even better, you can also always ask for features and I'll do my best to bring them in.
As this is my rom for daily use, it contains many, many tweaks and endless hours of work of the best devs of XDA. In these features you can find Faux's Intelliplug, Yank555 powersuspend driver and many other stuff. At this point if you use any other kernel with my ROM you will lose about 80% of the features and the experience I want to provide will be lost. If you like other custom kernels such as Pink please kindly use official Nightlys.
If you are still here and haven't ran away you must know that you can always ask me for new features you see in other fine roms (Such as Temasek, CrDroid, etc) and if everybody like that feature (Including me) I will gladly bring it into the ROM. Don't forget that if you want a full featured ROM there's plenty of fine choices. The main idea with this is the same as with my old CM11 builds; "To stay as close to Stable CM as possible while adding on a little somethin' somethin' to make things better."
DISCLAIMER: I am not responsible for any damages to your device, always have a nandroid on hand if anything happens​
Main Features
Based on CyanogenMod 13 latest updates
ROM compiled with UberTC 5.2
Build optimized with Graphite and O3 flags
Build optimized Cortex A7 architecture
Custom cosmetical changes
Screen Record
Custom msm8226-common device branch (Different PowerHAL)
Custom Kernel with several features out of the box such as:
-Upstream GPU patches
-GPU Overclock
-HTC dynamic fsync
-USB fast charging
-Some Interactive picks
-Power efficient workqueues
-Simple GPU Algorithm
And much more, for a deep insight you can visit my github
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation Instructions:
Upgrading from a previous build:
1.- Flash the ROM
2.- Flash any add-ons you want
3.- Wipe dalvik and cache
4.- Reboot into ROM
Upgrading from any other ROM even CM11:
1.- Full wipe
2.- Flash the ROM
3.- Flash GApps
4.- Flash any add-ons you want
5.- Wipe dalvik and cache
6.- Reboot into ROM
Downloads:
ROM
Build 4
Build 3
Build 2.1
Build 2
Build 1
Kernel
[MM]Beto's_Kernel_V6.0.zip
5.1.1 releases,
Beto's_Kernel_V5.0.zip
Beto's_Kernel_V4.1.zip
My preferred GApps:
Open Gapps
--Recommended Settings--
Nope.
Source and credits:
*CyanogenMod for the awesome ROM and great support for our device
*Somcom3X our beautiful CM maintainer.
*JustArchi for the countless hours of testing build flags and Toolchains.
*Chainfire for the great Superuser.
*bedalus (picked lot of things from your kernel)
*GalacticStrider for his amazing build work on SaberSunset.
*CL3Kener
*Faux
*Synergy510 For his amazing work with Saberize optimizations which made possible this ROM. (I also took his thread as base to make this one )
This ROM wouldn't be possible without them, so please donate and show your support to them.
ROM OS Version: 6.0.1 Lollipop
ROM Kernel: Linux 3.4.x
Based On: CyanogenMod 13
Source: My kernel sauce
Version Information
Status: Stable
Created 01/30/2015
Changelog
Build 4
-Updated to latest cm-13.0
-Changed some out of the box kernel settings
Click to expand...
Click to collapse
Build 3
Synced with latest cm-13.0 sources
MSM8226-Common
- Revert "msm8226-common: Add falcon and peregrine sensors HAL" …
- Revert "msm8226-common: Enable proximity check on wake" …
- Revert "msm8226-common: Enable Ambient Display" …
- msm8226-common: Kill Doze and sensor usage …
vendor/motorola
- Revert "falcon peregrine: Remove proprietary sensors HAL" …
cm/vendor
- Added Kcal control by savoca
- Added latest AdAway
- Added Nova Launcher
Click to expand...
Click to collapse
Build 2.1
Fixed derps with BT and optimzation flags
Click to expand...
Click to collapse
Build 2
ROM:
-Updated to latest cm-13.0 release
Kernel:
-Added Kcal support
-Added Faux Sound Control
Click to expand...
Click to collapse
Build 1
MSM8226-COMMON
-Default scheduler is ROW
[+] Which is vastly superior than default on real life usage
-Killed custom cm PowerHAL in favour of Qualcomm implementation.
[+] This improves battery consumption both on iddle and screen on.
-Disabled hispeed_freq when screen is off
[+] Intended to improve energy usage on iddle
-Replaced some libs to match qcom vendor
[+] This one fix some very annoying logs on the PowerHAL as it looked for libs that didn't exist. Such as “QCOM*PowerHAL:*Failed to acquire lock”
-Added MSM8226 board optimizations
[+] Given more data to the compiler such as number of cores and cache L1/L2 to allow it to optimize the code even further
Frameworks/Base:
-Ability to hide root icon
-Switchable kill-app timer
Build
-Compiled with Arter97 optimization flags
-Build compiled with UberTC 5.3 optimized
Vendor/cm
-Some cosmetical changes
Kernel: (Featuring my old kernel which is a stock kernel with a couple of extra features)
-Upstream GPU patches
-GPU Overclock
-Intelli-Plug and Mako hotplug
-HTC dynamic fsync
-USB fast charging
-Some Interactive picks
-Power efficient workqueues
-Simple GPU Algorithm
-Intelliactive governor
-More TCP congestion
-CPU-Boost on which is needed by qcom PowerHAL
-“A lot” of misc stuff which you can check on my github
Click to expand...
Click to collapse
Final
-Updated to latest cm-12.1 sources
-Reverted some custom PowerHal upstream commits since we are using qcom implementation
-Deleted profile settings that used to turn on MP-Decision on several tasks (We may now use Intelli-Plug without it messing around)
Click to expand...
Click to collapse
Build 26
-Updated to latest CM-12.1 sources
-Added wakelock blocker.
-Default scheduler is ROW again.
-Reverted custom PowerHal implementation
-Reverted readahead back to normal values
Click to expand...
Click to collapse
Build 25
ROM:
Updated to latest cm-12.1 sources.
Removed Nova Launcher
Custom PowerHAL implementation
[+] This one changes the battery profiles, specially for power saving, making the phone actually usable on saving mode (More info here)
Added MSM8226 board optimizations
[+] Given more data to the compiler such as number of cores and cache L1/L2 to allow it to optimize the code even further for our phone.
Bionic changes
[+] Added optimized memcpy implementation for Cortex A7
ART Optimizations
Patch to allow Viper4Android on enforcing mode
Misc UI changes
Kernel:
Pushed readahead to 512Kb
Intelli-Plug updates
Default scheduler is now BFQ
SELinux is now enforced.
soc: qcom: bam_dmux: Add fast-shutdown flag
[+] This one should greatly reduce bam_dmux_wakelock on our 4G device
Click to expand...
Click to collapse
Build 24
-Updated to latest CM-12.1 sources
-Reverted some unnecesary framework/base commits
-Restored MotoDoze
-ROM compiled now with Uber 4.9, which is fairly similar to SaberMod. Just for testing purposes.
-Cleaned my build environment squashing commits
Click to expand...
Click to collapse
Build 23
-Updated to latest CM-12.1 sources
-ROM is now compiled with GCC 4.9, the toolchain that'll be shiped on M.
-Fixed wrong auto-vectorization of ID3 iterator causing various media crashes with badly-tagged MP3s
-Kernel compiled with Linaro 4.9.4
-Added built in SuperSu menu (Require SuperSu)
-Updated to ArchiDroid Optimizations 4.1.
Click to expand...
Click to collapse
Build 22
-Updated to latest CM-12.1 sources
-Refactored kernel after *some guy* decided to fix Interactive governor when there it was nothing wrong with it.
-Updated kernel toolchain to Linaro 4.9.4
-Updated SaberMod 4.8 to latest release
Click to expand...
Click to collapse
Build 19
Updated to latest CM12 sources
Fixed hide supersu icon option
Disabled Faux123 Simple_Ondemand
Enabled Arter97 AdrenoIdler 1.1
Misc kernel cherry-picks I had before my phone died
Click to expand...
Click to collapse
Build 18
-Updated to latest CM12 sources
-Lot of things have been fixed, specially fixed parameters for lowminfree memory and possibly bluetooth hiccups
-Updated SaberMod toolchain.
Click to expand...
Click to collapse
Build 16
Updated to latest CM12 sources
Kernel and ROM are now separated, if you want my kernel it must be downloaded and flashed after the ROM.
Merged pull request of @Frazew
Fixed screen record which I had broke on Build 15
Build lited with Opti-Charger
Misc updates to Kernel
Click to expand...
Click to collapse
Build 15.1
-Finished bringing features of old kernel to the new one
-Implemented misc build.prop tweaks (Commit)
-Introduced Opti-Charger (To improve RAM use, more info in the spoiler)
Custom ROMs in the beginning had limited space to work with which is why Cyanogen introduced opticharging to the custom release tool in order to shrink apks to fit more apps on system partitions of the original android devices. The opticharger script pulls apart apks near the end of the build and optimizes all pngs drawables found in them. Originally this script used optipng which is great and there is absolutely no quality loss involved in the png compressions but more recently I’ve begun using pngquant because it compresses pngs even smaller 30-70% with usually an average of about 50%. Pngquant does result in a slight loss of quality but nobody has noticed yet (See more on pngquant here: http://pngquant.org/) (If you are worried about quality you can always use optipng which compresses without any quality loss themers usually use this option instead)
Currently, CyanogenMod has abandoned the use of the opticharger but many ROMs still use it such as SLIM, AOKP, LiquidSmooth, Dirty Unicorns, Carbon, Validus, and many others. Themers and app developers alike use these techniques as well to make their apps/themes run more smoothly. Making pngs 70% smaller actually makes the loading time 3 times faster for these pngs and also saves you RAM. I understand apks aren't all pngs but you'd be surprised how many junk pngs google has left behind since froyo that serve no purpose but are loaded into your ram with SystemUI anyways. Thankfully opticharging shrinks all of those undesirables by usually 50-70% and saves you several MB worth of space and speeds up your SystemUI. Since you can't unload the system UI this is well worth the effort! My motto always is every little bit counts
Many still argue that high end device don’t need opticharging anymore because they are fast enough to handle these full-sized pngs. While this is true it still doesn’t change the fact that opticharing IS still slightly faster and opticharged apks do use less ram
.
Click to expand...
Click to collapse
Build 15
-Updated latest CM-12.1 sources
-Switched kernel to latest CM sources, meaning you can use Optimus and Spirit kernel now. Make sure to update your bootloader if you don't want "screen-tearing" lines.
-Merged Arter97's fix to Play Store FC's
Click to expand...
Click to collapse
Build 14.1
First attempt to fix suddenly battery drops
Added more TCP congestion options
Click to expand...
Click to collapse
Build 14
Synced latest CM-12.1 sources
Featuring latest 5.1.1 R1 release.
Fixed crazy radio wakeups on deep sleep
Removed p-thread to get more battery life (MOAR!)
Added quick lockscreen gestures (To turn screen on when notification led is blinking and pocket mode)
Switched to latest JusArchi 5.1 gcc optimized for Cortex A7.
Added screen-recorder, which can be enabled on "Buttons" -> "Poweroff Menu"
Probably more stuff I don't remember right now
Click to expand...
Click to collapse
Build 11
Updated to latest CM-12.1 sources 8/05
We are back to my "stock" kernel which doesn't have DT2W
Released 2 variants of my kernel, one with DT2W and the other without it.
Click to expand...
Click to collapse
Build 10.1
Enabled DT2W implementation
Enabled power efficient workqueues
Activated fast charge via USB
Some misc picks to enhance kernel
Click to expand...
Click to collapse
Build 8.1
Fixed kernel Toolchain (Crucial for a perfect synergy with optimizations)
Click to expand...
Click to collapse
Build 8
Featuring Android 5.1.1
Synced latest CM12.1 sources 21/04/15
Updated kernel Toolchain to SaberMod 5.0
Complete rebase to kernel.
Updated graphite flags.
Beast benchmark scores (over 20k)
All old optimizations that are posted on OP are up and running too.
Click to expand...
Click to collapse
Build 6
Updated with latest CM12 sources
Intelli-Plug 4.0 with eco-mode is back.
Added some special changes to hotplug
Added option to hide the annoying icon of root at status bar. (@Pupet_Master bet you are going to love this one)
Switched to Linaro Toolchain 4.9.2 optimized for A7 Cortex architecture. (Rom is still compiled with SaberMod)
Misc tweaks to kernel.
Click to expand...
Click to collapse
Build 5
Reworked Project, added all optimization flags.
Click to expand...
Click to collapse
Build 4
*Synced latest CM12 sources
*No screen-tearing issues
*Re-Enabled MP-Decision
*Added new implementation of Intelliplug directly from Faux's Github
*Removed IntelliMinMax governor (For now)
*Updated powersuspend driver to v1.5
*Updated SaberMod Toolchains
*Ditched my old build environment and bringed up @JustArchi optimizations which takes Android to a whole new level
Important changes:
- Optimized for speed yet more all instructions - ARM and THUMB (-O3)
- Optimized for speed also parts which are compiled with Clang (-O3)
- Turned off all debugging code (lack of -g)
- Eliminated redundant loads that come after stores to the same memory location, both partial and full redundancies (-fgcse-las)
- Ran a store motion pass after global common subexpression elimination. This pass attempts to move stores out of loops (-fgcse-sm)
- Performed interprocedural pointer analysis and interprocedural modification and reference analysis (-fipa-pta)
- Performed induction variable optimizations (strength reduction, induction variable merging and induction variable elimination) on trees (-fivopts)
- Didn't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions (-fomit-frame-pointer)
- Attempted to avoid false dependencies in scheduled code by making use of registers left over after register allocation. This optimization most benefits processors with lots of registers (-frename-registers)
- Tried to reduce the number of symbolic address calculations by using shared “anchor” symbols to address nearby objects. This transformation can help to reduce the number of GOT entries and GOT accesses on some targets (-fsection-anchors)
- Performed tail duplication to enlarge superblock size. This transformation simplifies the control flow of the function allowing other optimizations to do a better job (-ftracer)
- Performed loop invariant motion on trees. It also moved operands of conditions that are invariant out of the loop, so that we can use just trivial invariantness analysis in loop unswitching. The pass also includes store motion (-ftree-loop-im)
- Created a canonical counter for number of iterations in loops for which determining number of iterations requires complicated analysis. Later optimizations then may determine the number easily (-ftree-loop-ivcanon)
- Assumed that loop indices do not overflow, and that loops with nontrivial exit condition are not infinite. This enables a wider range of loop optimizations even if the loop optimizer itself cannot prove that these assumptions are valid (-funsafe-loop-optimizations)
- Moved branches with loop invariant conditions out of the loop (-funswitch-loops)
- Constructed webs as commonly used for register allocation purposes and assigned each web individual pseudo register. This allows the register allocation pass to operate on pseudos directly, but also strengthens several other optimization passes, such as CSE, loop optimizer and trivial dead code remover (-fweb)
- Sorted the common symbols by alignment in descending order. This is to prevent gaps between symbols due to alignment constraints (-Wl,--sort-common)
Click to expand...
Click to collapse
Build 3
Updated CM12 commits.
Initial Modular O3 Implementation … (Yay!)
armv7-a-neon: Apply Correct mfpu and mfloat tunings per arch …
Updated Graphite flags
Speed up Recents Menu, StatusBar and Windows Orientation.
Added a setting to disable expanded notifications.
Disabled MP-Decision (Conflicting with Intelli-Plug when performance per app is ON)
Enabled Intelli-Plug by default.
Misc cherry-picks to polish new optimizations
Click to expand...
Click to collapse
Build 2
Added Graphite optimizations
Added Strict-Aliasing optimizations
Updated latest CM12 sources.
Click to expand...
Click to collapse
FAQ
Thanks a lot @Travisholt92 for writing this guide, please give him a big thanks here!
Question 1: I am coming from (Stock or CM11), how can i install this?
Answer 1:
1. Back up all of your files, text messages, and everything else that you dont want to lose (try Easy Backup in the Google Play Store). You will lose everything stored on your phones internal storage and applications , your SD card will be safe.
2. Download the latest build posted in OP and Download GAPPS and move the .zip files onto your SD card (Remember where you put these files).
3. Shut down your phone.
4. Reboot into recovery mode by holding down the volume down button and the power button, then releasing the power button. This will come up with the Fastboot interface. Press volume down to highlight Recovery and then press volume up to boot into recovery mode.
(through TWRP)
5. Press Wipe
6. Press Advanced Wipe
7. Select Dalvik Cache, Data, Internal Storage, Cache, and System.
(Do not select microSD card or USB OTG)
8. Swipe to wipe.
9. Press Install. At the top of the screen make sure it says "Storage: microSD card". Navigate to the ROM .zip file and press it.
10. Press Add More Zips and select the GAPPS .zip file.
11. Swipe to confirm flash, reboot system, enjoy SaberMod!
(If none of these answers fix your issue read the comments for others having similar issues to see if anybody has found a fix for the issue. If the issue hasn't been meantioned previously please report the issue, leave a comment. Make sure to state what build you are running and what kernel you are using if you installed a custom kernel. If its something that happens when you perform a certain action such as after sending a text your phone reboots, try and be as detailed as possible when reporting the bug)
Question 2: I just installed (insert build name here and issue below). How do i fix this?
A. and my device is stuck at boot animation, device boots but spams with system application errors (meaning installed by your ROM not from GAPPS) , or anything else that prevents you from using your phone.
Answer: Backup your device and follow the directions for answer 1. (install the last ROM you were running if you are coming from an AOSP build if needed to back up your data)
B. and my device boots but spams with my downloaded application errors.
Answer: Uninstall the application and redownload it from the Google Play Store.
Gonna test
Que buena ver un chileno por estos lares, y más aun desarrollando roms, bastante bueno; voy a probar la ROM y ver como anda
English; Gonna test the rom and will say how it works
Any severe bugs up to know?
primewell said:
Any severe bugs up to know?
Click to expand...
Click to collapse
Only CM11 bugs, wich at this stage of develeopment are almost zero. That's the idea of applying only minimal stuff, the result is a enhanced CM11 experience with the same stability.
Next build will inlude GPU and RAM OC.
.
I also prefer CM 11 for now. Better stability and performance. And your ROM is great! No bugs so far. Thanks!
BUG
I Got Alll cores running on 1190hz all time and i can't change the frequencies
SplaszIG said:
I Got Alll cores running on 1190hz all time and i can't change the frequencies
Click to expand...
Click to collapse
It is not a bug, MPdecision shows all cores at full freq, but if you check them at real time (I.E using CoolTool) you'll see they work normally.
Anyway, I DK if add more features on the next build (Halo maybe?) or keep things simple with Linaro and Archi's optimizations. What do you guys think?
keep it simple, there are other ROMs for those who want more.
or you can make it modular and give additional functions in flashable zips
WiCiO_MeDi said:
keep it simple, there are other ROMs for those who want more.
or you can make it modular and give additional functions in flashable zips
Click to expand...
Click to collapse
+1
WiCiO_MeDi said:
keep it simple, there are other ROMs for those who want more.
or you can make it modular and give additional functions in flashable zips
Click to expand...
Click to collapse
Will do.
Thanks for your input!
I Think that modular add ons wolud be great , btw i would like more perfomance improvements too:good:
Wonderful job, hermano trasandino'. One thing I'm missing is the Tap2Wake feature. How can I add it to this ROM ?
Thanks
I'm guessing there's still this mystical memory leak problem as in CM11?
Sent from my XT1039 using XDA Free mobile app
New build is up. Currently I'm adding general tweaks before fetching more advanced stuff. (I'm having a lot of fun on Blechdose's AeroKernel and Faux github )
Changelog:
Updated with latest CM sources
Added GPU OC 550mhz
Added Min CPU Freq 192mhz
GPU optimizations
Added instructions for Cortex A7 architecture
ARM: use -mcpu=cortex-a7 when targeting MSM8226 CPU
Added frequency to corner mappings for msm8226v2
Reverted RAM OC due overheating
Interactive governor misc tweaks.
Click to expand...
Click to collapse
Link: Build 2
Can I flash this doing a clean install from CM12? There will be no problem right?
rodsayd said:
Can I flash this doing a clean install from CM12? There will be no problem right?
Click to expand...
Click to collapse
Yes. That's the way I've done it. Just simply erase everything EXCEPT sdcard and usbotg. Then, as usual, flash this ROM and then Gapps
I've been using it since yesterday and the perfomance is amazing! I will keep this as a daily driver, just one problem: sometimes the camera doesn't take the photo, it freezes just after I push the botton (I had the same problem on CM12).
rodsayd said:
I've been using it since yesterday and the perfomance is amazing! I will keep this as a daily driver, just one problem: sometimes the camera doesn't take the photo, it freezes just after I push the botton (I had the same problem on CM12).
Click to expand...
Click to collapse
Glad to see there's actually someone using and enjoying it. I'm having pretty good battery life and performance too, I guess Linaro and JustArchi's optimizations are just magical.
Regarding the camera, I don't use stock CM11 app but "A Better Camera" from the PlayStore. GIve it a shot and tell me if the issue persists.
Regards!
Great, I will try it. By the way, there isn't block screen notifications on the rom? That would be a nice feature if you can add it and keep up the good work, I'm staying with this.

[KERNEL] [OREO] [G960F/G965F] [2019-11-16] APGK 1.0.56 [Linux 4.9.202] [BSA1]

APGK - A Pretty Good Kernel
"Another kernel for the S9/S9+? Why? Aren't they all more or less the same?"
This kernel exists, because I couldn't find quite the right kernel for my device: one that was conservative enough in its feature set to favour stability over the inclusion of experimental code, yet one bold enough not to shy away from embracing low-risk self-contained enhancements. The concept is an obvious one, yet no other kernel for the S9/S9+ catered to this market, something that holds true to this day.
APGK differentiates itself from the alternatives by striking a happy medium between the standard Samsung kernel and some of the more adventurous alternatives, without compromising on the original's stability.
To that end, APGK judiciously draws from the work of others, cherry-picking only the juiciest and safest fruit from several sources, including, but not limited to the ElementalX and now defunct Notorious kernels.
Every development decision is carefully weighed, eschewing changes that could affect stability, either by pushing the device's tolerances to their limits or by introducing features whose potential usefulness is outweighed by the danger posed by their invasive nature. Patches that are not widely understood and whose effects are difficult to predict and/or measure after application do not make it into APGK's code base. I personally verify the scope and correct working of everything that I include.
The finished kernel is packaged in a custom-built installer, which offers a choice between hands-free and interactive installation. Automatic post-installation rooting with Magisk is also offered as a convenience.
"Why is this kernel called APGK?"
The full name is actually A Pretty Good Kernel. I did consider a few others and even delayed the initial release of the kernel in the pursuit of the perfect name, but at the end of the day, a name is just a name; and, to paraphrase Shakespeare, a kernel by any other name would be just as dull.
Importantly, the acronym APGK is easy to type and easy to say. And, as luck would have it, A Pretty Good Kernel happens to be a reasonable, modest description of what this project actually is. If you want a kernel called Testosterone or High Octane Rocket Fuel, you'll have to look elsewhere.
Key characteristics
Forked from a clean exynos-linux-stable (ELS) base (Linux 4.9.109 at project launch).
Updated with regular merges of the upstream Linux kernel, the android-4-9-o tree and updates to the stock Samsung kernel (downstreamed from ELS until v0.99.33; manually merged since then).
Packed into a boot.img (boot image) taken directly from Samsung's latest stock firmware and kept as close to the original as possible. No obscure boot-time kernel configuration is stashed away here, and no changes are made to any other part of the file system at either install time or run time. No kernel has any business touching any part of your device's file-system. APGK religiously adheres to this principle and is fully transparent.
Provides a fully automated installer, with the option of interactive installation to allow manual selection of features, and the ability to automatically root the device with Magisk in the post-installation phase.
Comes in standard, underclocking and overclocking flavours. Choose the kernel that fits your usage profile.
Removes a large number of debugging and logging features that bloat a release kernel and make it unnecessarily noisy.
Enabled extra Deadline I/O scheduler. The default scheduler remains CFQ.
Includes WireGuard VPN support (version 0.0.20180613 at the time of launch), which is regularly updated as available.
Includes @Lord Boeffla's generic kernel wakelock blocker. The default block-list is: wlan_rx_wake, wlan, wlan_wow_wl, wlan_extscan_wl, netmgr_wl and NETLINK.
Utilises Westwood+ TCP congestion algorithm by default (as of v0.99.27; previous versions used BIC).
Includes Veno TCP congestion algorithm (as of v0.99.27).
Includes @flar2's Sweep2Wake, DoubleTap2Wake and Sweep2Sleep wake gestures.
Includes @flar2's RGB colour control override.
Includes Paolo Valente's BFQ (Budget Fair Queuing) I/O scheduler (v8r7) (based on CFQ).
Includes Shaohua Li's FIOPS (Fair Input/Output) scheduler (based on CFQ).
Includes Miguel Boton's SIO (Simple Input/Output) scheduler (based on Noop, Deadline and V(R) IO).
Includes Brandon Berhent's Zen I/O scheduler (based on Noop, Deadline and SIO).
Includes Joe Maples' eponymous Maple I/O scheduler (based on Zen and SIO).
SELinux operates in enforcing mode and (as of 0.99.7) cannot be dynamically switched to permissive mode.
FAQ
Q. Is this kernel still actively developed?
A. No. Version 1.0.56 was the final ianmacd release on 16th November 2019. No other person has come forward to take over maintenance of the project.
Q. Can I overclock or underclock the CPU using this kernel?
A. Yes.
The underclocking kernel is identical in specification to the one offered by ElementalX: the big cluster CPU (Samsung Mongoose 3) is limited to 2.314 GHz instead of the usual 2.704 GHz. If you need to maximise the amount of time the device can last on a single battery charge, this may be the kernel variant for you. It comes at the expense of a small performance penalty that you may not even notice in practice.
The overclocking kernel is a little more involved. This kernel will boost the maximum frequency of the big cluster CPU to 2.964 GHz from the usual 2.704 GHz (2.496 GHz vs. 2.314 GHz in dual mode; 2.002 GHz vs. 1.794 GHz in triple/quad mode). This is slightly higher than the boost provided by ElementalX's overclocking kernel, which provides for frequencies up to 2.886 GHz. Additionally, APGK's overclocking kernel will boost the small cluster 's (ARM Cortex-A55) maximum frequency to 2.002 GHz from the usual 1.794 GHz. This is identical to ElementalX's mode 2 overclocking behaviour.
Furthermore, APGK's overclocking kernel also features GPU overclocking. The Mali-G72 GPU has its maximum frequency boosted to 598 MHz from 572 MHz, and its minimum frequency boosted to 299 MHz from 260 MHz. This is identical to the behaviour of the Notorious kernel in its final release before being abandoned. Gamers in particular may appreciate the slight performance increase this provides.
It should go without saying that the overclocking kernel will incur, at a minimum, a small battery performance penalty. Whether the gains outweigh the cost will depend on individual usage and is for the user himself to determine. Furthermore, there may be an additional tax to pay in the form of reduced device stability. The overclocking kernel has proven 100% stable on my S9+ during testing, but it is entirely possible that individual units may demonstrate a lower tolerance. If you find your device spontaneously rebooting on the overclocking kernel, simply revert to using the standard kernel.
To install the underclocking kernel instead of the standard kernel, either create a file on your external SD card called .apgk_underclock or rename the APGK archive to contain _underclock in the name.
Similarly, to install the overclocking kernel instead of the standard kernel, either create a file on your external SD card called .apgk_overclock or rename the APGK archive to contain the string _overclock.
Then, simply install APGK as usual. The installer will infer your wishes from the renamed ZIP file or the presence of the dot-file and install the appropriate kernel. On-screen messages will confirm that the correct kernel is being installed.
As an alternative to providing hints to the installer via the file-system, you may prefer to utilise interactive installation mode. See below for details.
Use MTweaks or EX Kernel Manager to verify the modified CPU and GPU frequencies, and look for either the -uc or the -oc suffix to the kernel's name (obtainable, for example, with uname -a) to indicate that you have installed the underclocking or the overclocking variant, respectively.​
Q. Can I run SELinux in permissive mode with this kernel?
A. No. APGK's SELinux mode was enforcing by default until version 0.99.7, at which time this became the only permitted mode. It is no longer possible to dynamically switch to permissive mode after booting.
Despite what some others may tell you, running SELinux in permissive mode is a terrible idea, because it makes it much easier for a process with elevated privileges to wreak havoc on your device. Not only that, permissive mode is almost never actually necessary to achieve the goal that the user is pursuing.
If you believe that you cannot get by without SELinux in permissive mode, you can simply recompile APGK from source with the feature enabled. The GPL is a wonderful thing.​
Q. How does interactive installation mode work?
A. If the ZIP file name contains the string _interactive or a dot-file called .apgk_interactive is present in the root of the external SD card, interactive installation mode is triggered. Selections made in this mode will overrides any implied by the archive name or the presence of dot-files on the file-system.
In interactive mode, you will be asked questions regarding which kernel to install and whether to root the device afterwards with Magisk. Selections are made using the Bixby and Volume buttons. Just follow the on-screen prompts.​
Q. Can I safely use I/O scheduler X?
A. Maybe. Probably even. Although no guarantee of any kind is provided regarding the usability of this kernel, you should experience no problems whatsoever using the default I/O scheduler (CFQ). Others are configured at your own risk and may yield degraded performance.​
Q. Can I safely block wakelock X?
A. Again, perhaps. However, unless you know what a particular wakelock does and and have determined that it is causing an actual problem on your device, I suggest you leave it alone.​
Q. Is this kernel safe to use? Who are you, anyway? Can you be trusted?
A. At the height of its popularity, well over 100 people were using APGK as their kernel of choice. I have personally used nothing else on my S9+ since June 2018.
APGK went through almost 40 public beta releases and an untold number of internal test builds over a 6 month period before finally seeing its stable v1.0.0 release on New Year's Eve 2018. That was followed by a further 56 stable releases, so this kernel has proven itself in the field.
As the maintainer of APGK, I know exactly what's in it. The only risk I'm exposing myself to when I run it is that of my own incompetence, i.e. the possibility that I've made a mistake somewhere. You, however, don't know who you're dealing with and should therefore exercise due caution and at least pause for a moment to consider what you're installing, and the far-reaching powers you are about to grant this unaudited code over your device. Although I provide a link to the source code below, you have only my word for it that this code bears any relationship to the kernel actually provided in the installer.
Please see the Installation section below for an important note regarding the use of this kernel in combination with unmodified Samsung firmware.​
Q. Does this kernel also work on Android 9 (Pie)?
A. It would, if someone were to go to the trouble of merging Samsung's Android 9 kernel sources, building APGK against them and packaging the resulting kernel inside a boot image modified from the one supplied with Samsung's official Android 9 firmware. During my ownership of an S9+, I chose not to update it to Android 9, however, and was therefore unable to test kernels built for that version of the operating system. For that reason, official APGK builds continued to target Android 8.0 (Oreo).​
Q. Can I safely root this kernel?
A. Of course. What use would it be if you couldn't? I recommend Magisk for the task. Magisk has matured to the point that it is now the de facto root solution for Android devices.
It just so happens that I also produce my own builds of Magisk, which you are welcome to use. These are release builds (as opposed to debugging builds) and are produced from my own fork of @topjohnwu's original source code, sometimes augmented with patches. You can use anyone's builds, though.
Again, these builds work for me on various Samsung devices, but you should approach them with the appropriate caution.​
Q. Can I auto-root the APGK kernel with Magisk at installation time?
A. As of version 0.99.19, yes. This feature was extended and improved over the next few versions and is now mature.
To make use of this facility, either rename the APGK zip file to contain the string _magisk or create a file called .apgk_magisk in either the root of your external SD card or in the standard Download directory of the internal SD card. Alternatively, you may utilise interactive installation mode. See above for details.
If any of these trigger conditions is met, the installer then looks in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.
For example:
Code:
star2lte:/ $ ls -l /storage/0000-0000/.apgk_magisk
-rwxrwx--x 1 root sdcard_rw 0 2018-09-15 14:31 /storage/0000-0000/.apgk_magisk
star2lte:/ $ ls /storage/0000-0000/Magisk/Magisk-* | tail -n 3
/storage/0000-0000/Magisk/Magisk-v17.2-2018091001-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091201-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091501-ianmacd.zip
When you flash the APGK archive in TWRP, the most recent version of Magisk that could be found will now be used to automatically root your kernel, i.e. Magisk-v17.2-2018091501-ianmacd.zip in this example.​
Q. Can I use this kernel on an 'N' (Korean) model device?
A. At least one user has reported success flashing this kernel onto an 'N' model device. Since version 0.99.17, the APGK installer allows flashing onto the G960N/G965N.​
Q. Why doesn't APGK have its own Telegram group?
A. Because it has been my experience that Android-themed Telegram groups invariably degenerate into seething cesspits of ignorance, superstition and — on a good day — pseudo-science. I don't wish to police or even inhabit such a forum. Of course, it's a free world (or so I still like to tell myself), so you are at liberty to create your own Telegram group for APGK if you wish. Just please don't invite me to it.​
Building
Building a kernel is beyond the scope of this document. If you really want to build this kernel from scratch, start with this handy reference tailored to building kernels for Android.
Download
See posting #2 in this thread for links to the latest and all previous versions.
Installation
Make a back-up of your existing boot partition using the custom recovery environment provided by TWRP. If your device doesn't yet have TWRP, you will need to install that first. Then, use TWRP to flash the APGK ZIP file. The boot image will automatically be installed in the boot partition.
If your device has unmodified Samsung firmware, you will encounter problems with Bluetooth (namely delayed initiation and forgotten pairings) after installing this or any other custom kernel. To remedy this, you will need to patch your system with modified libsecure_storage.so libraries. Some custom kernel installers actually silently install these without your permission, overwriting your system libraries and transparently circumventing the problem before you can run into it. This approach necessarily modifies your device's file-system, however, which may not be what you want. At the very least, the user should be made aware what is happening to his device.
For this reason, I have instead prepared a companion Magisk module that achieves the same goal without modifying the file-system. This will allow you to run a custom kernel (not just this one, but any custom kernel) on pristine stock firmware without any Bluetooth issues. The module is attached to this posting for your convenience, but can also be found in the official Magisk module repository, accessible from Magisk Manager on your phone. If you use this Magisk module, you may wish to also disable the secure_storage_daemon by editing /system/etc/init/secure_storage_daemon.rc (change start to stop), as it no longer serves a purpose.
In a similar vein, you may encounter authentication errors when connecting to wireless networks after installing this or any other custom kernel. This problem is not serious, and easily remedied by re-entering your passphrase for any affected networks.
Finally, if SecurityLogAgent notifies you that unauthorised actions have been detected, do not be alarmed. This is a normal consequence of having installed a custom kernel. You may wish to disable SecurityLogAgent to avoid being repeatedly notified. Most custom ROMs and some kernel installers simply remove it, but again, I leave this up to the user.
If the above issues sound like more trouble than they're worth, you may be happier simply sticking to Samsung's stock kernel, which, in the case of the S9 and S9+ at least, is a perfectly good kernel.
Configuration
You are encouraged to use either MTweaks (a modified version of Kernel Aduitor) or EX Kernel Manager to manage the features provided by this kernel.
Source code
APGK's GitHub repository.
References
A useful overview of Android I/O schedulers.
The same author has produced a guide to CPU governors, I/O schedulers (and more).
For more information on the some of the individual schedulers included in this kernel, you can also look under Documentation/block in the kernel source.
Additionally, Documentation/cpu-freq/governors.txt may be interesting for exhaustive information on the Linux CPUFreq governors, although APGK has abandoned support for all but schedutil as of version 0.99.11.
The WireGuard user guide, control app, home page and source code.
The ELS source code.
The ElementalX home page, source code and XDA thread.
The Notorious source code and XDA thread. The Notorious project is now defunct.
The BFQ home page.
Credits
Thank you to everyone in the wider Linux kernel universe for getting us this far. Closer to home, I am grateful to the following Android luminaries for their considerable, ongoing contributions:
@Farovitus for providing and maintaining ELS, his dedication to experimentation in Notorious, and his permanent good grace and willingness to help other people.
@AndreiLux for the insights arising from his journey to the centre of the G96X kernel.
@osm0sis for Android Image Kitchen, which has saved me a huge amount of work in packing and unpacking boot images.
An honorary mention is due to @Chainfire, the extent of whose benefaction to the Android community is still not fully understood or appreciated in some quarters.
Thanks also to @Maxiroe1912 for his help with testing the G960F build of 0.99.2, the dual installer ZIP, and the libsecure_storage kernel companion Magisk module.​
Change log
v1.0.56 (final ianmacd version) (2019-11-16)
Updated to upstream Linux 4.9.202.
v1.0.55 (2019-11-14)
Updated to upstream Linux 4.9.201.
v1.0.54 (2019-11-11)
Updated to upstream Linux 4.9.200.
v1.0.53 (2019-11-06)
Updated to upstream Linux 4.9.199.
v1.0.52 (2019-10-31)
Updated to upstream Linux 4.9.198.
v1.0.51 (2019-10-18)
Updated to upstream Linux 4.9.197.
Updated WireGuard to v0.0.20191012.
v1.0.50 (2019-10-08)
Updated to upstream Linux 4.9.196.
v1.0.49 (2019-10-07)
Updated to upstream Linux 4.9.195.
v1.0.48 (2019-09-21)
Updated to upstream Linux 4.9.194.
v1.0.47 (2019-09-16)
Updated to upstream Linux 4.9.193.
Updated WireGuard to v0.0.20190913.
v1.0.46 (2019-09-11)
Updated to upstream Linux 4.9.192.
v1.0.45 (2019-09-06)
Updated to upstream Linux 4.9.191.
Updated WireGuard to v0.0.20190905.
v1.0.44 (2019-08-26)
Updated to upstream Linux 4.9.190.
v1.0.43 (2019-08-12)
Updated to upstream Linux 4.9.189.
v1.0.42 (2019-08-07)
Updated to upstream Linux 4.9.188.
v1.0.41 (2019-08-05)
Updated to upstream Linux 4.9.187.
v1.0.40 (2019-07-23)
Updated to upstream Linux 4.9.186.
v1.0.39 (2019-07-10)
Updated to upstream Linux 4.9.185.
Updated WireGuard to v0.0.20190702.
v1.0.38 (2019-06-28)
Updated to upstream Linux 4.9.184.
v1.0.37 (2019-06-24)
Fix for super slow motion recording, which was broken in v1.0.36.
v1.0.36 (2019-06-22)
Updated to upstream Linux 4.9.183.
v1.0.35 (2019-06-18)
Updated to upstream Linux 4.9.182.
v1.0.34 (2019-06-11)
Updated to upstream Linux 4.9.181.
Updated WireGuard to v0.0.20190601.
v1.0.33 (2019-05-31)
Updated to upstream Linux 4.9.180.
Updated WireGuard to v0.0.20190531.
v1.0.32 (2019-05-27)
Fixed serious bug in v1.0.31 that caused failure of zswap.
Updated to upstream Linux 4.9.179.
v1.0.31 (2019-05-22)
Updated to upstream Linux 4.9.178.
v1.0.30 (2019-05-17)
Updated to upstream Linux 4.9.177.
v1.0.29 (2019-05-15)
Updated to upstream Linux 4.9.176.
v1.0.28 (2019-05-11)
Updated to upstream Linux 4.9.175.
v1.0.27 (2019-05-08)
Updated to upstream Linux 4.9.174.
v1.0.26 (2019-05-04)
Updated to upstream Linux 4.9.173.
v1.0.25 (2019-05-02)
Updated to upstream Linux 4.9.172.
v1.0.24 (2019-05-02)
Updated to upstream Linux 4.9.171.
v1.0.23 (2019-04-21)
Updated to upstream Linux 4.9.170.
v1.0.22 (2019-04-17)
Updated to upstream Linux 4.9.169.
v1.0.21 (2019-04-06)
Updated to upstream Linux 4.9.168.
Updated WireGuard to v0.0.20190406.
v1.0.20 (2019-04-05)
Updated to upstream Linux 4.9.167.
v1.0.19 (2019-03-31)
Updated to upstream Linux 4.9.166.
Fixed disk I/O performance regression introduced in 1.0.18.
Fixed a small bug introduced in 1.0.16.
v1.0.18 (2019-03-24)
Updated to upstream Linux 4.9.165.
v1.0.17 (2019-03-20)
Updated to upstream Linux 4.9.164.
v1.0.16 (2019-03-14)
Updated to upstream Linux 4.9.163.
v1.0.15 (2019-03-05)
Updated to upstream Linux 4.9.162.
Built without process authentication code (CONFIG_FIVE_PA_FEATURE), since this doesn't work with custom kernels anyway. This change was accidentally omitted from v0.99.23.
Updated WireGuard to v0.0.20190227.
Rebased to Samsung's BSB1 boot images.
v1.0.14 (2019-02-27)
Updated to upstream Linux 4.9.161.
v1.0.13 (2019-02-23)
Updated to upstream Linux 4.9.160.
v1.0.12 (2019-02-20)
Updated to upstream Linux 4.9.159.
v1.0.11 (2019-02-16)
Updated to upstream Linux 4.9.158.
v1.0.10 (2019-02-13)
Updated to upstream Linux 4.9.156.
v1.0.9 (2019-02-07)
Updated to upstream Linux 4.9.155.
Rebased to Samsung's BSA1 boot images.
v1.0.8 (2019-02-01)
Updated to upstream Linux 4.9.154.
v1.0.7 (2019-01-26)
Updated to upstream Linux 4.9.153.
Updated WireGuard to v0.0.20190123.
v1.0.6 (2019-01-23)
Updated to upstream Linux 4.9.152.
BFQ I/O scheduler updated to v8r10.
v1.0.5 (2019-01-18)
Rebased to Samsung's BRL3 kernel source code and boot images.
v1.0.4 (2019-01-17)
Updated to upstream Linux 4.9.151.
v1.0.3 (2019-01-13)
Updated to upstream Linux 4.9.150.
v1.0.2 (2019-01-10)
Updated to upstream Linux 4.9.149.
v1.0.1 (2019-01-03)
Rebased to Samsung's BRK3 kernel source code and boot images.
v1.0.0 (2018-12-31)
Updated version to 1.0.0.
v0.99.39 (2018-12-29)
Updated to upstream Linux 4.9.148.
v0.99.38 (2018-12-22)
Updated to upstream Linux 4.9.147.
Updated WireGuard to v0.0.20181218.
v0.99.37 (2018-12-17)
Updated to upstream Linux 4.9.146.
v0.99.36 (2018-12-14)
Reverted 4 accidental commits.
v0.99.35 (2018-12-13)
Updated to upstream Linux 4.9.145.
v0.99.34 (2018-12-09)
Updated to upstream Linux 4.9.144.
Sundry kernel options re-enabled, mostly to bring back CONFIG_SEC_DEBUG_LAST_KMSG:
CONFIG_TRACE
CONFIG_SEC_DEBUG
CONFIG_SEC_DEBUG_RESET_REASON
CONFIG_SEC_DEBUG_EXTRA_INFO
CONFIG_SEC_DEBUG_HW_PARAM
CONFIG_SEC_DEBUG_AUTO_SUMMARY
CONFIG_SEC_DEBUG_LAST_KMSG
CONFIG_SEC_PARAM
CONFIG_CM_OFFSET=7340596
CONFIG_EXYNOS_SNAPSHOT
CONFIG_EXYNOS_SNAPSHOT_CALLSTACK=4
CONFIG_EXYNOS_SDM
v0.99.33 (2018-12-05)
Updated to upstream Linux 4.9.142.
Realtek RTL8152 driver upgraded to latest version (v2.10.00) (after having been downgraded in APGK 0.99.32 by a change in upstream ELS).
v0.99.32 (2018-11-28)
Updated to upstream Linux 4.9.141.
Rebased to Samsung's BRJ6 kernel source code and boot images.
Many more debugging and logging features disabled:
CONFIG_TRACE and its dependencies:
CONFIG_SEC_DEBUG
CONFIG_SEC_DEBUG_RESET_REASON
CONFIG_SEC_DEBUG_EXTRA_INFO
CONFIG_SEC_DEBUG_HW_PARAM
CONFIG_SEC_DEBUG_UPLOAD
CONFIG_SEC_PARAM
CONFIG_CM_OFFSET
CONFIG_SEC_DEBUG_AUTO_SUMMARY
CONFIG_SEC_UPLOAD
CONFIG_SEC_DEBUG_LAST_KMSG
CONFIG_SEC_DEBUG_PPMPU
CONFIG_EXYNOS_SDM
CONFIG_EXYNOS_SNAPSHOT_LOGGING_SMC_CALL
CONFIG_EXYNOS_ITMON
CONFIG_EXYNOS_SNAPSHOT
CONFIG_EXYNOS_SNAPSHOT_CALLSTACK
CONFIG_EXYNOS_SNAPSHOT_IRQ_EXIT
CONFIG_EXYNOS_SNAPSHOT_IRQ_EXIT_THRESHOLD
CONFIG_EXYNOS_SNAPSHOT_CLK
CONFIG_EXYNOS_SNAPSHOT_PMU
CONFIG_EXYNOS_SNAPSHOT_FREQ
CONFIG_EXYNOS_SNAPSHOT_DM
CONFIG_EXYNOS_SNAPSHOT_HRTIMER
CONFIG_EXYNOS_SNAPSHOT_REGULATOR
CONFIG_EXYNOS_SNAPSHOT_ACPM
CONFIG_EXYNOS_SNAPSHOT_THERMAL
CONFIG_EXYNOS_SNAPSHOT_I2C
CONFIG_EXYNOS_SNAPSHOT_SPI
CONFIG_EXYNOS_SNAPSHOT_PANIC_REBOOT
CONFIG_EXYNOS_SNAPSHOT_WATCHDOG_RESET
CONFIG_EXYNOS_SNAPSHOT_CRASH_KEY
CONFIG_EXYNOS_CORESIGHT
CONFIG_EXYNOS_CORESIGHT_PC_INFO
CONFIG_PC_ITERATION
CONFIG_EXYNOS_CONSOLE_DEBUGGER
CONFIG_EXYNOS_CONSOLE_DEBUGGER_INTERFACE
CONFIG_USB_DEBUG_DETAILED_LOG
CONFIG_MMC_DW_DEBUG
CONFIG_SEC_DEBUG_TSP_LOG
CONFIG_SDFAT_DBG_MSG
CONFIG_SDFAT_DEBUG
CONFIG_PHY_EXYNOS_DP_DEBUGFS
CONFIG_PHY_EXYNOS_DEBUGFS is not set
CONFIG_CGROUP_DEBUG
CONFIG_CMUCAL_DEBUG
CONFIG_SEC_BOOTSTAT
CONFIG_SEC_DUMP_SUMMARY
v0.99.31 (2018-11-22)
Many debugging and logging features disabled.
CONFIG_DISPLAY_USE_INFO
CONFIG_SEC_DISPLAYPORT_LOGGER
CONFIG_LOCKUP_DETECTOR (and dependencies)
CONFIG_DETECT_HUNG_TASK
CONFIG_TIMER_STATS
CONFIG_DEBUG_ATOMIC_SLEEP
CONFIG_DEBUG_LIST
CONFIG_DEBUG_NOTIFIERS_PRINT_ELAPSED_TIME
CONFIG_DEBUG_EXCEPTION_STACK
CONFIG_PROFILING
CONFIG_MODULES (and dependencies)
CONFIG_SEC_PM_DEBUG
CONFIG_DEBUG_INFO (and dependencies)
CONFIG_SCHED_DEBUG
Strip assembler symbols (CONFIG_STRIP_ASM_SYMS).
Overclocking kernel variant now uses 8 ms PELT (Per Entity Load Tracking).
Updated WireGuard to v0.0.20181119.
v0.99.30 (2018-10-20)
Updated to upstream Linux 4.9.135.
v0.99.29 (2018-10-19)
Updated to upstream Linux 4.9.134.
v0.99.28 (2018-10-19)
Rebased to Samsung's BRJ3 kernel source code and boot images.
v0.99.27 (2018-10-18)
CPU and GPU overclocking now offered via overclocking kernel variant.
CPU underclocking now offered via underclocking kernel variant.
Westwood+ TCP congestion algorithm now the default (formerly BIC).
Veno TCP congestion algorithm added to kernel.
Interactive installation mode now available.
Updated WireGuard to v0.0.20181018.
Trigger file to request Magisk chaining is now .apgk_magisk (formerly .magisk).
v0.99.26 (2018-10-14)
Updated to upstream Linux 4.9.133.
v0.99.25 (2018-10-12)
Updated to upstream Linux 4.9.132.
Minor changes to custom LED fader timings implementation.
Updated WireGuard to v0.0.20181007.
v0.99.24 (2018-10-07)
Bug fixes to custom LED fader timings implementation.
Updated WireGuard to v0.0.20181006.
v0.99.23 (2018-10-06)
Updated to upstream Linux 4.9.131.
Built without process authentication code (CONFIG_FIVE_PA_FEATURE), since this doesn't work with custom kernels anyway.
LED fader timings now adjustable (via /sys/devices/virtual/sec/led/, EX Kernel Manager [>= 3.71] or MTweaks).
v0.99.22 (2018-09-30)
Updated to upstream Linux 4.9.130.
Further improvements made to the installer's Magisk chaining feature (see the OP and release post for details).
v0.99.21 (2018-09-27)
Updated to upstream Linux 4.9.129.
Updated WireGuard to v0.0.20180925.
A bug fix and further improvements made to the installer's Magisk chaining feature (see the OP and release post for details).
v0.99.20 (2018-09-21)
Updated to upstream Linux 4.9.128.
Rebased to Samsung's BRI1 kernel source code.
Updated WireGuard to v0.0.20180918.
Improvements made to the Magisk chaining feature (see the OP and release post for details).
v0.99.19 (2018-09-15)
Updated to upstream Linux 4.9.127.
Updated WireGuard to v0.0.20180910.
Installer will now optionally automatically chain installation of Magisk.
v0.99.18 (2018-09-10)
Updated to upstream Linux 4.9.126.
v0.99.17 (2018-09-08)
Updated to upstream Linux 4.9.125.
Updated WireGuard to v0.0.20180904.
Installer now permits installation on 'N' model devices.
v0.99.16 (2018-09-05)
The definition of MAX_LOAD_AVG in the EHMP code was not dependent on the configured PELT decay rate. (Thanks to @Eamo5 for spotting this omission.)
v0.99.15 (2018-08-24)
Updated to upstream Linux 4.9.124.
Removed non-functioning Samsung DeX universal HDMI adapter code added in 4.9.123.
Reinstated support for extracting kernel config from kernel image or running kernel.
v0.99.14 (2018-08-22)
Updated to upstream Linux 4.9.123.
Samsung DeX should now work with any model of HDMI adapter. (Untested prior to release and reported not working.)
v0.99.13 (2018-08-19)
Updated to upstream Linux 4.9.122.
Rebased to Samsung's BRGA kernel source code; boot image rebased to BRH1.
v0.99.12 (2018-08-17)
Updated to upstream Linux 4.9.120.
Further installer refinements.
v0.99.11 (2018-08-11)
Updated to upstream Linux 4.9.119.
Updated WireGuard to v0.0.20180809.
Removed ondemand, powersave and userspace CPU governors, as these provide no benefit on these devices. The only supported governor is now schedutil.
v0.99.10 (2018-08-06)
Updated to upstream Linux 4.9.118.
Removed interactive CPU governor, as this (now) leads to a reboot on these devices.
v0.99.9 (2018-08-04)
Updated to upstream Linux 4.9.117.
Updated WireGuard to v0.0.20180802.
Removed ondemand and conservative CPU governors, as these (now) cause an immediate reboot on these devices.
v0.99.8 (2018-08-03)
Updated to upstream Linux 4.9.116.
Rebased to Samsung's BRG6 kernel source code, including boot image updates.
Updated WireGuard to v0.0.20180731.
Disabled process authenticator daemon (pa_daemon) via init.local.rc in boot image.
v0.99.7 (2018-07-18)
Updated to upstream Linux 4.9.113.
CONFIG_SECURITY_SELINUX_DEVELOP unset. With this change, dynamically switching the kernel to SELinux permissive mode is no longer possible.
Further installer refinements to reduce ZIP file size.
Remove support for unused compression types: BZIP2, LZMA, XZ, LZO and LZA4.
Removed support for extracting kernel config from image or running kernel.
Remove support for CONFIG_SLUB_DEBUG.
v0.99.6 (2018-07-12)
Updated to upstream Linux 4.9.112.
Further installer refinements.
v0.99.5 (2018-07-12)
EAS scheduling updated.
16ms PELT half-life for improved scheduling performance.
Kernel optimised for performance over size.
Updated WireGuard to v0.0.20180708.
New installer written in shell.
v0.99.4 (2018-07-04)
Updated to upstream Linux 4.9.111.
Rebased to Samsung's BRF8 kernel source code, including boot image updates.
v0.99.3 (2018-06-26)
Updated to upstream Linux 4.9.110.
Updated WireGuard to v0.0.20180625.
v0.99.2 (2018-06-25)
Added support for the G960F (S9).
Updated WireGuard to v0.0.20180620.
v0.99.1 (2018-06-19)
Initial release supporting G965F (S9+) only.
Good work!!!! I will test it later, this is a very good idea, thanks ?
Pretty Good Privacy.. Why would you want all these governors with EAS scheduler
Going to test on treble as it's close to stock
Noxxxious said:
Why would you want all these governors with EAS scheduler
Click to expand...
Click to collapse
This kernel doesn't have EAS, because EAS is a major overhaul of the scheduling subsystem, making it invasive and therefore relatively high-risk.
Some other custom kernels do have it, though, so users have plenty of choice.
ianmacd said:
This kernel doesn't have EAS, because EAS is a major overhaul of the scheduling subsystem, making it invasive and therefore relatively high-risk.
Some other custom kernels do have it, though, so users have plenty of choice.
Click to expand...
Click to collapse
It does. Other kernels merely have it updated and/or changes to the energy model. The exynos9810 is the very first exynos to make use of EAS.
Noxxxious said:
It does.
Click to expand...
Click to collapse
Sorry, I stand corrected. It doesn't appear to have the latest changes from r1.4 and r1.5, though. At least, I don't see the commits that the AOSP common 4.9 kernel has.
@ianmacd
Thank you for your Kernel.
I got 2 questions.
How to enabled Double tap 2 wake and do you have a own thread for your magisk builds?
madhub said:
@ianmacd
How to enabled Double tap 2 wake and do you have a own thread for your magisk builds?
Click to expand...
Click to collapse
The easiest way to manage the wake gestures is with the EX Kernel Manager. It's a great front-end, and you can set up your gestures to be activated at boot.
Otherwise, as root, do the following:
Code:
# echo 1 > /sys/android_touch/doubletap2wake
Echoing a 0 would disable the gesture.
sweep2wake and sweep2sleep are configured using the same mechanism, except that the value to echo is a bit-wise AND of the values corresponding to the swipe directions you want to allow for the gesture. You'd have to pluck them from the source if you really want to know them. They can be found in drivers/input/touchscreen/wake_gestures.c. All things considered, this is why I say that EX Kernel Manager should be high on your purchase list.
As for Magisk, no, my builds don't have their own thread, but my source repo is on GitHub, along with a separate repo for the binaries built from it. I haven't yet seen the need for a second thread with unofficial builds. I didn't want to risk diverting useful postings from the existing unofficial build thread to a second one, so I just announced the launch of my builds in that thread and occasionally respond to people there.
any plan on vibration intensity?
Muntasir Mahmud Saif said:
any plan on vibration intensity?
Click to expand...
Click to collapse
Can you give some details of what you're envisaging?
ianmacd said:
Can you give some details of what you're envisaging?
Click to expand...
Click to collapse
i mean on some kernels(maybe not on Samsung i guess) but on op6 and other phones there is vibration control..i mean u can increase or decrease on ex kernel manager
Muntasir Mahmud Saif said:
i mean on some kernels(maybe not on Samsung i guess) but on op6 and other phones there is vibration control..i mean u can increase or decrease on ex kernel manager
Click to expand...
Click to collapse
You can use EX Kernel Manager in the same way with this kernel, or you can echo a value into /sys/android_touch/vib_strength (off the top of my head).
When available for s9 960?
Your magisk builds are stable and they dont remove itself on restart! you should post this on the main thread!
saxena1 said:
When available for s9 960?
Click to expand...
Click to collapse
I've had about 5 requests for this now, so I'll do the work and release a test build either this evening or tomorrow.
nosar77 said:
Your magisk builds are stable and they dont remove itself on restart! you should post this on the main thread!
Click to expand...
Click to collapse
There's nothing magical about my Magisk builds, I'm afraid. I just pull the latest code, remove anything that obviously breaks things, add one or two useful patches, build, package and release. The builds work well for me, though, and it's gratifying to read that they work well for others, too.
ianmacd said:
I've had about 5 requests for this now, so I'll do the work and release a test build either this evening or tomorrow.
Click to expand...
Click to collapse
I cant seem to see the 960 release... did I miss it?
kgr said:
I cant seem to see the 960 release... did I miss it?
Click to expand...
Click to collapse
No. As always, these things turn out to be slightly more complicated than at first sight, so it's taken a little longer to test and prepare things.
The release will be coming today.

[KERNEL] [8.0/8.1/9.0] Endurance Kernel V2.0.27 / V1.2.33 [Linux 4.9.190] [CSGD/BSB1]

Endurance Kernel • Galaxy S9 / S9+​
Endurance Kernel was designed by me with the goal of providing a much more responsive user experience whilst simultaneously conserving the devices battery as much as possible. The Oreo kernel is forked from A Pretty Good Kernel by ianmacd so everything from there has been ported over and likely will consistently for the lifespan of this kernel, and the Pie kernel is forked from ELS. If you want the best battery this kernel offers, flash the underclocking build. If you want the best performance this kernel offers, flash the overclocking build. Each variant of the kernel is explained in more depth below. The kernel is largely adjustable in the paid app EX Kernel Manager (EXKM) by flar2 or in the free app MTweaks by Morogoku. Please note I don't own my S9 anymore!
DISCLAIMER - I am not responsible for any harm that may come to your device as a result of flashing this kernel. I am however happy to provide support if required.
Downloads
I am trialing GitHub and Mega releases only for now in order to simplify and speed up the release process. 1.x.x indicates the kernel should be used with an Oreo based firmware. 2.x.x indicates the kernel should be used with a Pie based firmware.
Latest GitHub Release
MEGA Repository
Key Features
Latest ELS (almost) always merged in
Implemented AndreiLux’s custom scheduling, EAS backports, 16ms PELT half-life, and migration hysteresis filter
Hotplugging enabled
Boeffla wakelock blocker supported (default list tweaked for improved deep sleep)
Support CPU overclocking and underclocking in overclock and underclock kernel builds
Support GPU overclocking up to 598MHz on all builds
Adapted notification LED fade support from NX Kernel from the Galaxy S8
Enabled fsync on / off support (on is default and recommended)
DoubleTap2Wake, Sweep2Wake, Sweep2Sleep & RGB colour control
CFQ (stock and kernel default), deadline, noop, FIOPS, SIO, Zen, Maple and BFQ support
Westwood (kernel default), bic (stock), cubic, reno, htcp, lia, veno and olia TCP congestion algorithms enabled
8.1.0 and 9.0 AOSP support
Several kernel optimizations from Notorious Kernel
WireGuard Support
DriveDroid Support
F2FS support
SELinux set to enforcing
Unofficially supported adjustable SELinux status through the 'Magisk SELinux Manager' module or # setenforce 1 or 0
Disabled almost all logging, debugging and tracing
Various patches to improve performance and battery
No bull****
Detailed Overview
The PELT half-life has been reduced from 32ms (stock) to 16ms which greatly improves device responsiveness, alongside the use of updated custom scheduling, both thanks to Andrei Frumusanu’s amazing work on the kernel. For a more up to date reference on the performance of the Exynos 9810, look at Andrei's investigation comparing the Exynos Note 9 to the Snapdragon Note 9.
This kernel supports overclocking and underclocking. In order to use overclocking or underclocking, simply rename 'Endurance-Kernel-1.x.x' to 'Endurance-Kernel-1.x.x_oc' or 'Endurance-Kernel-1.x.x_uc'. If the kernel has '_uc' or '_oc' in the name of the zip file, it will flash the selected build of the kernel.
The overclock build will now use big cluster (M3) quad / triple frequencies up to 2106MHz, dual frequencies up to 2416MHz and single frequencies up to 2964MHz. The small cluster has now also been overclocked to 2002MHz. The overclock build also removes Andrei's conservative frequencies for Samsung's default scheduling in order to utilise the higher frequencies more. There is no guarantee that your battery will perform well with overclocking, nor your device will be safe running above stock frequencies. Use at your own risk.
The underclock build will now limit quad workloads at 1586MHz but still allow single frequencies up to 2704MHz, dual frequencies up to 2314MHZ or triple frequencies of up to 1794MHz. This finds a good balance between battery conservation and performance. Due to the 16ms PELT half-life the underclock should be hopefully be less noticeable than it would be on a stock kernel at 32ms.
Notification LED fade support has also been added and enabled by default. The fade can be turned on and off and have fade in and out speed adjusted in EXKM or MTweaks. Additionally, in both EXKM and MTweaks such as fsync on / off support, DoubleTap2Wake, Sweep2Wake, Sweep2Sleep & RGB colour control.
This kernel unofficially supports (but I typically strongly advise against the use of) a permissive SELinux status through the 'Magisk SELinux Manager' module.
Magisk installation chaining has also been added as a feature thanks to Ian's updated installer script. To use the the magisk chaining feature, simply rename the zip from, for example 'Endurance-Kernel.1.x.x_underclock' to 'Endurance-Kernel-1.x.x_underclock_magisk'. Ian's thorough explanation of the feature has been attached below.
To make use of this facility, either rename the APGK Endurance Kernel zip file to contain the string _magisk or create a file called .magisk in either the root of your external SD card or in the standard Download directory of the internal SD card.
If any of these trigger conditions is met, the installer then looks in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.
Click to expand...
Click to collapse
AOSP Kernels
As of V1.1.2, the kernel now supports 8.1 and 9.0 AOSP ROMs. These builds are entire ports of Endurance Kernel that have been adapted for AOSP, hence any changes that are made to the base kernel will almost always also be included in the AOSP kernels. The 8.1 AOSP kernel seems to entirely work with all ROMs that support the current kernel firmware and vendor. Lineage OS will not work due to the merging of Note 9 sources and the dependency on the Note 9 vendor.
If you are using any of CodeFox / Mohammed's builds of PixysOS, Pixel Experience 9.0 sGSI or a build newer than Rainbow_Dash's V3, you must use the 8.1 AOSP Kernel. All other sGSI's should use the GSI build.
Due to SELinux interfering with Bluetooth's functioning on CodeFox / Mohammed's newer builds of Pixel Experience or PixysOS, you will need to set the kernel to a permissive SELinux status through the 'Magisk SELinux Manager' module for Bluetooth to work.
If SafetyNet is failing, this can be worked around to allow SafetyNet to pass. You will need the 'MagiskHideProps' module installed. After rebooting, using a Terminal Emulator app enter the following commands in the order listed without quotation marks.
Type 'su'
Type 'props'
Type '1' to edit the device fingerprint
Type 'f'
Type '13' to select Samsung
Type '23' if you have a Galaxy S9 (G960X) or '24' if you have a Galaxy S9+ (G965X)
Reboot
Due to the sheer diversity of AOSP ROMs, it is important to ensure you are concise when reporting an issue. Before you report an issue ensure you explicitly state the variant of the kernel you are using (TW, 9.0 GSI, 8.1 AOSP) as well as the ROM, firmware and vendor once you have ensured the ROM is compatible with the kernel. If these requirements are not met, you may receive support for the wrong platform or no response at all. It is preferred that you ask in the relevant telegram group prior to publishing on the XDA thread if possible.
Telegram Groups
If you're joining the Telegram group for support, please read the FAQ first!
Endurance Kernel Discussion / Support Group - https://t.me/endurancekernel
Endurance Kernel News Channel - https://t.me/endurancekernelnews
Credits
A huge thank you to everyone involved in the production of this kernel. Particularly a few names I would like to mention.
ianmacd - For creating A Pretty Good Kernel and doing all the hard work for me, as well as being a fantastic mentor who has assisted me through every stage of this kernel. My words understate my appreciation for your efforts. Seriously, try APGK if you do not enjoy this kernel!
AndreiLux - For pushing the device to its limits in many regards and paving the pathway from which many other devs, myself included rely on, and for assisting me in the production of the kernel.
farovitus - For his vast efforts included in the development of Notorious Kernel and for providing inspiration of changes and commits to include in the kernel as well as making another great kernel before the production of Endurance Kernel. Also thanks for maintaining ELS and keeping it simple for me!
flar2- For his fantastic EXKM app, and all his work from ElementalX included in APGK such as wake / sleep gestures and RGB colour control.
djb77 - For inspiring a few additions to the ramdisk and for being another fellow Aussie.
WhoIsJohnGalt1979 - For being by far the most exceptional beta tester and friend. Your efforts and kindness do not go unnoticed.​
Huge thanks to everyone else who was involved in development of the kernel, and helped me during the stages of instability in the early phases of this kernel. You know who you are!
And of course, everyone involved in mainline Linux development!
Additonally
Lord Boeffla for Boeffla Wakelock Blocker
franciscofranco for fsync on / off support
Ktoonsez for initially introducing Notification LED fade support.
Noxxxious for making it easier to adapt Notification LED fade to the S9!
osm0sis for Android Image Kitchen
If I included your work and forgot you, let me know and I’ll add you to the credits list!
Source - https://github.com/eamo5/starlte-endurance
Click here to donate! I used to not accept donations but while I'm undertaking my degree, a small donation could go a long way.
OneUI Current Build Changelog
V2.0.27
Linux 4.9.190
CSGD kernel source and ramdisk
Converted GPU workqueues to kthreads (thanks farovitus)
Previous Changelogs
V2.0.26
Linux 4.9.186
CSG8 source and ramdisk
Removed various unneeded drivers
Disabled swap on AOSP
V2.0.25
Linux 4.9.185
V2.0.24
Linux 4.9.184
Introduced the latest stable Simple LMK from Sultanxda in AOSP kernel
V2.0.23
Linux 4.9.183
Addressed some regressions from the previous build
I forgot to update the kernel version lol
V2.0.22
Linux 4.9.182
CSF2 kernel source and ramdisk
Several improvements to ashmem, binder, SELinux dynamic memory allocation, IRQs & qos from Sultanxda
V2.0.21
Linux 4.9.180
V2.0.20
Linux 4.9.179
Cross compiled with GCC 9.1
Fixed instability in 4.9.178
V2.0.19
Linux 4.9.177
CSE3 ramdisk
V2.0.18
Linux 4.9.176
Cleaned up defconfigs
Unset CONFIG_DEBUG_KERNEL (and all it's dependencies)
Optimised F2FS configuration
Fixed issues with unofficial TWRP (hopefully)
V2.0.17
Linux 4.9.175
Fixed F2FS
V2.0.16
Linux 4.9.174
F2FS support
V2.0.15
Linux 4.9.173
V2.0.14
Linux 4.9.172
Updated Gator driver to v6.9
V2.0.13
Linux 4.9.171
Unset CONFIG_AUDIT (reduce SELinux overhead)
Updated Gator driver to 6.8
V2.0.12
Linux 4.9.170
V2.0.11
CSD4 kernel sources
CSD4 ramdisk
Linux 4.9.169
V2.0.10
Linux 4.9.168
V2.0.9
Linux 4.9.166
Fixed 4.9.165 performance regression
V2.0.8
Linux 4.9.165
Reduced kernel size
V2.0.7
CSC8 kernel sources
Linux 4.9.164
V2.0.6
Linux 4.9.163
V2.0.5
Linux 4.9.162
Unset approximately 15 CONFIG_TRACE & CONFIG_EXYNOS_SNAPSHOT related options
V2.0.4
Linux 4.9.161
Set CONFIG_STRIP_ASM_SYMS
Unset CONFIG_BT_DEBUGFS
Unset CONFIG_USB_DEBUG_DETAILED_LOG
Unset CONFIG_DEBUG_ATOMIC_SLEEP
Unset CONFIG_SEC_BOOTSTAT
Unset CONFIG_SEC_UPLOAD
Unset CONFIG_SEC_DEBUG_PPMPU
Fixed an issue with the r8152 ethernet driver & updated the driver.
V2.0.3
Linux 4.9.160
Unset CONFIG_EXYNOS_CORESIGHT (and everything it unsets)
Unset CONFIG_DEBUG_LIST
Unset CONFIG_DEBUG_EXCEPTION_STACK
Unset CONFIG_TIMER_STATS
Unset CONFIG_DEBUG_NOTIFIERS_PRINT_ELAPSED_TIME
Unset CONFIG_CGROUP_DEBUG
Unset CONFIG_MMC_DW_DEBUG
Unset CONFIG_SEC_DEBUG_TSP_LOG
Unset CONFIG_PHY_EXYNOS_DEBUGFS
Suppressed additional minor logging
V2.0.2
Linux 4.9.159
Unset CONFIG_KSM
Unset CONFIG_SDFAT_DEBUG
Unset CONFIG_SCHED_DEBUG
Fixed SD Card issue on AOSP ROMs
Maybe fixed vibration issue on AOSP ROMs
Oreo, GSI and AOSP Current Build Changelog
V1.2.33
Linux 4.9.190
Previous Changelogs
V1.2.32
Linux 4.9.186
Removed various unneeded drivers
V1.2.31
Linux 4.9.185
Reverted Simple LMK on AOSP builds as it doesn't appear to be making reclaims correctly atm.
V1.2.30
Linux 4.9.184
Introduced the latest stable Simple LMK from Sultanxda in AOSP kernels
V1.2.29
Linux 4.9.183
Addressed some regressions from the previous build
I forgot to update the kernel version lol
V1.2.28
Linux 4.9.182
Several improvements to ashmem, binder, SELinux dynamic memory allocation, IRQs & qos from Sultanxda
V1.2.27
Linux 4.9.180
V1.2.26
Linux 4.9.179
Cross compiled with GCC 9.1
Fixed instability in 4.9.178
V1.2.25
Linux 4.9.177
V1.2.24
Linux 4.9.176
Cleaned up defconfigs
Unset CONFIG_DEBUG_KERNEL (and all it's dependencies)
Optimised F2FS configuration
Fixed issues with unofficial TWRP (hopefully)
V1.2.23
Linux 4.9.175
Fixed F2FS
V1.2.22
Linux 4.9.174
F2FS support
V1.2.21
Linux 4.9.173
V1.2.20
Linux 4.9.172
Updated Gator driver to v6.9
V1.2.19
Linux 4.9.171
Unset CONFIG_AUDIT (reduce SELinux overhead)
Updated Gator driver to 6.8
V1.2.18
Linux 4.9.170
V1.2.17
Linux 4.9.169
V1.2.16
Linux 4.9.168
V1.2.15
Linux 4.9.166
Fixed 4.9.165 performance regression
V1.2.14
Linux 4.9.165
Unset CONFIG_ION_EXYNOS_STAT_LOG
V1.2.13
Linux 4.9.164
V1.2.12
Linux 4.9.163
V1.2.11
Linux 4.9.162
Unset CONFIG_FIVE_PA_FEATURE
V1.2.10
Linux 4.9.161
V1.2.9
Linux 4.9.160
Suppressed additional minor logging
FAQ
A FAQ section will be established as kernel development progresses. If you have any explicit unanswered questions, feel free to ask away. If you must contact me due to an issue, please report your device variant, ROM, firmware, vendor and previous kernel.
1. I can’t unlock / boot my phone! What do I do?
If you're stuck in a lockscreen loop, make sure you're on a firmware with a matching ramdisk to the kernel. Do not mix a CSC1 kernel ramdisk with a CSA2 ROM for example. Anytime the ramdisk is changed, it will be listed in the changelog. Are you on the correct firmware and vendor? If not, you can always flash this zip or revert back to previous versions through the Android File Host folder. Can anyone else successfully flash the kernel? If yes, verify the MD5 sum by referencing and ensuring a matching MD5 sum between the local file and the Android File Host file. Is it isolated to one device variant? (G960F / G965F) Did I just push an update? If yes, contact me on Telegram in the Endurance Kernel group for a faster response, and XDA for an eventual response. Does your ROM require a permissive SELinux status to boot? If yes, use the 'Magisk SELinux Manager' module to adjust your SELinux status. If none of this can solve your problem, contact me through the Endurance Kernel group.​
2. Why doesn't my camera work after flashing the kernel?
Verify that you are on the correct firmware, vendor and a ROM that supports the current kernels sources. If you are still encountering issues after verifying this is correct, then let me know! If you do not wish to update, you can maintain a version of the kernel that does support your ROM by reading the relevant changelog for your OS and downloading the previous version from the Android File Host folder​
3. Why doesn't my Bluetooth work after flashing the kernel?
Are you on an Oreo ROM that does not patch libsecure_storage, such as DevBase? If your Bluetooth is broken, the answer is probably. Instead you can use ianmacd's Magisk module 'libsecure_storage companion for rooted Samsung (Oreo) devices' or you can manually flash a zip to patch it yourself, without the need for Magisk.​
4. Should I use the permissive or enforcing SELinux status?
The decision is yours. There is plenty of documentation available online outlining their differences. I strongly recommend enforcing, hence why permissive is not officially supported. Permissive is far less secure, and hence I do not condone the use of permissive. If you are using permissive, you should either have to due to a dependency or have another specific reason for doing so. eg. ROM requires disabled signature check. For most users, unless directed otherwise, use the default enforcing build.​
5. When will you update the kernel?
Once ELS is updated and the kernel is ready! This is just a side hobby and I do have a life outside of kernel development. Be patient, the update will arrive within a few days if not ASAP.​
6. Does this kernel support 9.0 AOSP GSI's?
Yes! Anything that's currently working on the Pixel Experience YEET kernel (lol) such as dual audio and MTP should also be working there too, plus some extra relevant changes.​
7. Does the 8.1 AOSP kernel work with Lineage OS?
As of the Lineage OS 20181112 release, the kernel will no longer boot at all on Lineage OS due to the merging of Note 9 sources and the dependency on the incompatible Note 9 vendor. Albeit, Lineage previously wasn't recommended regardless due to the outdated vendor and kernel sources, which breaks the camera.​
8. Will you add CPU undervolting?
No, EAS (Energy Aware Scheduling) has mostly made undervolting mostly irrelevant. Google EAS if you would like it find out more information as to why it is the case. I've included a detailed YouTube video outlining the scheduling mechanisms of EAS here.​
9. Does this kernel support Note 9 ROM ports?
Not at this point in time but perhaps in the future. Almost certainly not within Oreo's lifespan anyway.​
10. Do I need to install Magisk?
Nope, Magisk is entirely optional with this kernel.​
11. Why when I flash the kernel, do I get a Magisk zip not found error?
Unfortunately, that means your Magisk distribution is not supported by the Magisk chaining feature. The kernel should have still installed despite not finding the Magisk zip, so you'll just have to flash Magisk manually afterwards. Personally I use ianmacd's nightly builds for S9 and have 0 issues with the chaining feature.​
12. Why does this kernel offer no additional governors?
Because most of them are unstable and cause the device to crash, as well as EAS' integration with schedutil and EHMP.​
13. Why does this kernel makes my device crash / battery poor / performance poor?
Because this kernel is still in beta. At this point, these should hopefully not be issues due to me and several others testing this kernel for several months. If this is the case, report it on the XDA thread or Telegram group.​
14. Why is my WiFi performance worse when using this kernel?
This may be the case for some people. This kernel uses the Westwood+ TCP algorithm for enhanced WiFi speeds on certain networks. However there may be scenarios on poor signal networks, this TCP algorithm may cause packet loss at a greater rate than is default. This should hopefully not be an issue for anyone, however if it is, try using bic as default and contact me.​
15. Why is my battery still terrible?
Are you in an area with poor signal reception? Unfortunately that is one thing a custom kernel cannot compensate for due to the device modem having restricted access and also legal issues. That leaves us with optimizations that can only be done to the SOC of the device. How you use your device can also greatly lead to variation in battery stats. If you are in need of further battery, 'underclocking' is available and is explained in OP. If you want the best battery life, I advise you try out that build.​
16. Does the kernel support Samsung's Pie beta program?
Not yet, we still have to wait for sources to be released. Once sources are available, I'll begin work!​
17. Why doesn't Bluetooth work on Pixel Experience with the 8.1 AOSP kernel?
Due to SELinux interfering with Bluetooth's functioning, you will need to set the kernel to a permissive SELinux status through the 'Magisk SELinux Manager' module.​
18. Why does SafetyNet fail on the AOSP kernels?
This is a minor issue I don't believe I can address on my end. This can be worked around however to allow SafetyNet to pass. You will need the 'MagiskHideProps' module installed. After rebooting, using a Terminal Emulator app enter the following commands in the order listed without quotation marks.
Type 'su'
Type 'props'
Type '1' to edit the device fingerprint
Type 'f'
Type '13' to select Samsung
Type '23' if you have a Galaxy S9 (G960X) or '24' if you have a Galaxy S9+ (G965X)
Reboot
19. How do I overclock / underclock?
I can't believe I need this as a FAQ still. If you've been redirected here, read the OP! In order to use overclocking or underclocking, simply rename 'Endurance-Kernel-1.x.x' to 'Endurance-Kernel-1.x.x_oc' or 'Endurance-Kernel-1.x.x_uc'. If the kernel has '_uc' or '_oc' in the name of the zip file, it will flash the selected build of the kernel.​
20. How can I use F2FS?
To use F2FS, you must erase your data and format your data partition (and optionally cache partition) to F2FS using the N9 TWRP available here, even if you are on S9. From there you should be able to reboot your device and restore your data through a backup.​
21. Where can I donate?
I used to not accept donations but while I'm undertaking my degree, a small donation could go a long way. You can donate through my PayPal link here.​
Installed and testing. Look good so far. No lags in PUBG ...
Battery life we will see
Thanks for this kernel!
Oel said:
Installed and testing. Look good so far. No lags in PUBG ...
Battery life we will see
Thanks for this kernel!
Click to expand...
Click to collapse
Great, future builds should allow for increased frequency usage when I enable overclocking. Stay tuned for that for an even better experience
Will install it today and test it
Just a note, I didn't port the GPU stuff, flar2 did.
djb77 said:
Just a note, I didn't port the GPU stuff, flar2 did.
Click to expand...
Click to collapse
Updated the post. Thanks!
support 960/965n?
Cosis1 said:
support 960/965n?
Click to expand...
Click to collapse
I personally haven't tested an N device yet. Feel free to try it out though. I think it should work
I've been eagerly awaiting on the sidelines to try your kernel. I have heard you mention it many times in different groups and now it has finally arrived. Many thanks and greatly appreciated. I'll let you know how I get on cheers eamon your a star.:good:
@Eamo5
hi, one question.
what exactly does the boeffla wakelock blocker patch?
greetings
emphazer said:
@Eamo5
hi, one question.
what exactly does the boeffla wakelock blocker patch?
greetings
Click to expand...
Click to collapse
It allows the blocking of default kernel wakelock which can in return give better battery due to less time being awoken from deep sleep, but should only be used if you know what you're doing
Eamo5 said:
It allows the blocking of default kernel wakelock which can in return give better battery due to less time being awoken from deep sleep, but should only be used if you know what you're doing
Click to expand...
Click to collapse
im asking because i noticed that the clock timer for ringing up on custom roms with android 5-7 didnt work correctly.
It didn't start to ring because the device was in a deep sleep. I just wanted to know if this behavior maybe has something to do with a kernel patch like that.
normally I say blocking of wakelocks are really good but if it blocks the wrong stuff then it can easy result in really bad sidechain effects.
edit: found a good descrption.
so its just a optional feature.
V1.0.1 Changelog
- ELS 4.9.131
- Frequency cap at 1794MHz removed to compensate for Samsung's updated scheduling mechanisms. (Should not reduce battery)
- Added Magisk chaining support.
- Overclocking and 'underclocking' support (Explained further in OP)
- Added unofficial N device support (Untested)
- Fixed LED adjustment at the source in original commit. Thanks flar2.
- Fixed dual audio on Pie GSIs (Untested)
- Remove GPU voltage control due to it's current broken state. (Will return when fixed)
- Improve kernel source
Download link is updated in OP!
V1.0
- Initial Release
Cosis1 said:
support 960/965n?
Click to expand...
Click to collapse
Can you try out that please? ^^
Eamo5 said:
Can you try out that please? ^^
Click to expand...
Click to collapse
I can use now. Thx :good:
Very good beginning!
Eamo5 said:
V1.0.1 Changelog
- ELS 4.9.131
- Frequency cap at 1794MHz removed to compensate for Samsung's updated scheduling mechanisms. (Should not reduce battery)
- Added Magisk chaining support.
- Overclocking and 'underclocking' support (Explained further in OP)
- Added unofficial N device support (Untested)
- Fixed LED adjustment at the source in original commit. Thanks flar2.
- Fixed dual audio on Pie GSIs (Untested)
- Remove GPU voltage control due to it's current broken state. (Will return when fixed)
- Improve kernel source
Download link is updated in OP!
V1.0
- Initial Release
Click to expand...
Click to collapse
Hi
@Eamo5 Thank you for your hard work.
I started with overclock, and the kernel is pretty good, performance is ok snappy system and battery life seems to be good even with overclocking.
I noticed that CPU never reach 2900 neither 2700 mhz even in heavy use. Maybe it is the ELS that have a better management of cores. I will continu testing and give feedback.
Have a nice day all
Sorry for my bad English
Phahec said:
Hi
@Eamo5 Thank you for your hard work.
I started with overclock, and the kernel is pretty good, performance is ok snappy system and battery life seems to be good even with overclocking.
I noticed that CPU never reach 2900 neither 2700 mhz even in heavy use. Maybe it is the ELS that have a better management of cores. I will continu testing and give feedback.
Have a nice day all
Sorry for my bad English
Click to expand...
Click to collapse
Great, glad to hear performance and battery are great. The very limited usage of those frequencies is due to how the hotplugging driver works after the BRE5 update I believe, where it will only use those frequencies in single threaded workloads ie. not very often, hence there will be very little regression in battery. I'm thinking of making some adjustments to the quad, dual and single frequencies next build to allow for greater usage of these frequencies and potentially an entire overhaul of the underclock build. Thanks for your testing, and your english is pretty good btw

[Kernel][ANDROID 10][20.02.2021][4.14.220] Kirisakura 1.0.1_R Asus Zenfone 6 aka Kirin

Kirisakura-Kernel for the Asus Zenfone 6
Hello everyone,
After rising to the most popular Kernel on Pixel 3/XL, here it is for the Asus Zenfone 6!
Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!
This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security and performance, while keeping stability as the foucs during testing! This includes Linux-Stable, CAF-Upstream and kernel/common.
Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features. In fact this, alongside Kirisakura-Kernel for the OnePlus 8 Pro, may be (and probably is) the first 4.19 msm kernel with a fully working Kernel-CFI implementation and CFI-Violations fixed on a smartphone.
The only kernels made by OEMs offering this security feature are the ones for the Pixel 3, 4 and 5 devices.
The recently released Kirisakura-Kernel for the OnePlus 8 Pro was featured on the XDA-Portal due to the inclusion of CFI. The featured article explains CFI in great details, is easy to understand and definitely worth to read.
Another security feature is Shadow Call Stack (SCS). Similar to CFI, only the Pixel 3, 4 and 5 kernels use this security feature.
SCS is another security patchset that is aimed at preventing attacks via return oriented programming (ROP).
ROP is a technique where the attacker gains control of the kernel stack to overwrite function return addresses and redirect execution to carefully selected parts of existing kernel code.
If you´re interested here are a few good links:
Google Security Blog explaining SCS.
LLVM doc about SCS
Android DOCs documenting SCS
If reading about upstream in the paragraph above got you curious,have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.
Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 855/+ that´s built into the different SKUs of the Zenfone 6.
The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
This kernel focuses amongst the other features to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.
The kernel includes a lot of improvements and contributions from other developers as well. Without this kernel would not exist.
Many of the improvements originate from @arter97´s, @kdrag0n´s and @Sultanxda´s work. Many others contributed in some way or another to this kernel.
A big thanks to all of them at this place!
Now lets continue with a list of features in the next paragraph!
Main Features:
- Based on latest kernel sources from Asus for Android 11
- Upstreamed against latest CAF
- Linux-Stable-Upstream included to latest 4.14.220
- compiled with Clang 11.0.1 prebuilt from Google
- Link-Time-Optimization (LTO)
- Kernel Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) ported from 4.19 kernel/common
- Shadow Call Stack (SCS) Security-Feature
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Preview Kernel instead of full LTO for full program visibility (needed by CFI)
- fix CFI-Violations found in various subsystems like Asus/device specific drivers and qualcomm drivers
- Link the kernel with LLD and use RELR-Relocation
- include important fixes/improvements from kernel/common
- Flashing the kernel will keep root!
- Anykernel zip is based on the all new Anykernel3 release from @osm0sis
- include vDSO 32 patches to improve 32-bit performance
- disable various debugging configs, that are not needed in a perf build kernel according to google.
- disable selinux auditing (we don´t have to adress selinux denials running a stock rom)
EAS related features:
- backported scheduler from sd865
- disable autogroups and use cgroups for more efficient task placement!
- disable core_ctl for improved task placement and load balancing
- updates from kernel/common
- scheduler updates from Googles Pixel kernel
CPU related features:
- Power saving workingqueues enabled by default (toggleable in EXKM)
have a read here: https://lwn.net/Articles/731052/
this complements EAS in general
- Change various drivers ( MM, audio) to user power efficient workingqueues. This should work well in conjunction with EAS
- include cpuidle patches from CAF
- improvements to cpufreq/times/stats
- improve memory allocations in binder driver
- vdso32 patches as found on Google Pixel devices (brief documentation here)
File System related features:
- Set the bio REQ_NOENCRYPT flag (When lower layers such as dm-crypt observe the REQ_NOENCRYPT flag, it helps the I/O stack avoid redundant encryption, improving performance and power utilization. ) (CAF default)
- improve memory allocations in sdcardfs
- improve eventpoll logging to stop indicting timerfd (improves kernel wakelock readability)
- improve memory allocations in kernfs
- writeback: hardcode dirty_expire_centisecs=3000 based on this commit
- ufs improvements from pixel 4/ pixel 5 kernel
GPU related features:
- KCAL to control the display
- KLAPSE integrated
- KCAL/KLAPSE: changes safety measures -> allow completely disabling two RGB values (this was requested to, for example, only have red values on night dimming)
Network related features:
- Wireguard Support (Details)
- advanced TCP algorithms enabled
- includes new bbr and bbrv2
Memory related features:
- Memory Management patches from mainline kernel
- Speculative Page Faults (1. 2)
- Fix various memory leaks in different subsystems
- Reap memory of a task that receives sigkill
- enabled per process reclaim
- allow ZRAM to use higher swappiness values than 100
- possibility to use lzo-rle as default ZRAM compression algorithm (more information here and there )
Security related features:
- Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) ported from 4.19 kernel/common and Pixel 4/XL Kernel
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Kernel instead of full LTO
- Shadow Call Stack (SCS) Security-Feature
- fix various CFI-Violations found in various subsystems like Asus/device specific drivers and qualcomm drivers
- enable init_on_alloc for even more security, more information can be found in the commit message
WLAN Driver
- use CAF wlan driver and compile it inline, the only way to ensure working wlan with this kernel
- the kernel cannot even force load prebuild WLAN module as the kernel base is way to far from stock!
- do no longer rely on the pre compiled wlan driver module
- completely removed qcom_rx wakelock in the wlan driver
- removed debugging from wlan driver
- removed logging from wlan driver
Magisk Companion Module
- set kernel settings like I intend them to be
Misc Features:
Wakelock Blocker:
- advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info
- blocking a kernel wakelock should only be done in case of firmware incompatabilities (WiFi network at work (can´t be changed) causes deep sleep to not work on the phone.) That´s the only use case I see for this feature. The kernel does not features this to improve battery life!
Other features:
- disable logging to make the kernel more lightweight in various places
- fix several coding issues detected by newer Clang-Toolchains
- add support for steam controller
- add support for nintendo switch controller
- ufs improvements from pixel 4/ pixel 5 kernel
- gpu/kgsl improvements from pixel 4/pixel 5 kernel
Feature section for the "non visible" but perceptible improvements:
- updated binder section (responsible for interprocess communication)
- updated sdcardfs ; have a read about it here:
Requirements
- unlocked Bootloader
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment
- magisk root
How to flash the Kernel:
1. Download the latest kernel.zip
1a. Optional: While it may not be necessary all times, you may want to restore stock boot.img, re-root with magisk and optionally install twrp.zip if coming from another kernel. Before reporting issues make sure you do that! Thank you!
2. Make sure to use latest Magisk stable. (not the latest canary!)
3. Flash the kernel.zip via latest EXKM or FKM app. Alternatively via TWRP.
4. Reboot and profit.
DOWNLOAD:
Download is located always in this folder:
Downloads for : -Android- Generic Device/Other | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
Important: Read after Download
Please take a look at the second post after flashing the kernel!
Changelog:
Android 9/Pie
1.0.0 Initial Release
1.3.0 https://forum.xda-developers.com/showpost.php?p=79852192&postcount=21
1.5.0 https://forum.xda-developers.com/showpost.php?p=79948337&postcount=36
1.6.0 https://forum.xda-developers.com/showpost.php?p=80037776&postcount=46
1.8.1 https://forum.xda-developers.com/showpost.php?p=80275065&postcount=58
3.0.0 https://forum.xda-developers.com/showpost.php?p=80712703&postcount=66
Android 10/Q
1.0.0_Q https://forum.xda-developers.com/showpost.php?p=81368413&postcount=73
1.0.3_Q https://forum.xda-developers.com/showpost.php?p=82387237&postcount=86
1.2.0_Q https://forum.xda-developers.com/showpost.php?p=83920653&postcount=92
Android 11/R
1.0.1_R https://forum.xda-developers.com/t/...sus-zenfone-6-aka-kirin.3940178/post-84526765
Donations:
Donations are not mandatory but very welcome if you want to support development or just buy me a coffee
If you like my work: http://paypal.me/freak07
Credits:
Asus for the Zenfone 6!
@osm0sis for all his work, including the ak2 installer!
@tbalden for being the best HTC wingman!
@LeeDroid for his awesome roms!
@Captain_Throwback for all the mentoring and guidance!
@Eliminater74 for bringing me into the game and the Inspiration
@nathanchance for his upstream guidance and assistance
@RenderBroken for helping me out
@flar2 for all his work
@joshuous for all the help he provided to me in the past!
@arter97 for giving me advice
@topjohnwu for magisk!
@osm0sis for anykernel!
XDA:DevDB Information
Kirisakura-Kernel, Kernel for the ASUS ZenFone 6 (2019)
Contributors
Freak07
Source Code: https://github.com/freak07/Kirisakura_Kirin
Version Information
Status: Stable
Mine for FAQ
Too
And too
Flashed it today and no problems so far.
Everything seems to work as intended
Freak07 said:
Mine for FAQ
Click to expand...
Click to collapse
Which RAM version do you have please?
Is the kernel for both?
EMJI79 said:
Which RAM version do you have please?
Is the kernel for both?
Click to expand...
Click to collapse
The 8GB version. RAM variant shouldn´t matter.
1. Does it have to be magisk stable or is canary (dev version) ok? I am asking because i need to use canary so my stupid pay app will not detect root.
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.[/QUOTE]
It's in the downloads folder at the end of the afh link in the OP
isthisadagger said:
1. Does it have to be magisk stable or is canary (dev version) ok? I am asking because i need to use canary so my stupid pay app will not detect root.
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.
Click to expand...
Click to collapse
jeremyet said:
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.
Click to expand...
Click to collapse
It's in the downloads folder at the end of the afh link in the OP[/QUOTE]
1. you can probably use the canaries of magisk too. But keep in mind, they’re canary builds for a reason. If you’re having issues, flash to magisk stable and see if you can reproduce them.
2. Like @jeremyet said, it’s in the download folder in the OP
good job man
@Freak07: Cool, the first costom kernel for the Zenfone 6, thanks
I am still thinking of switching to the Zenfone 6, one feature I currently use a lot, is the "USB fast charge" : it makes a big difference, if I have my Smartphone for file transfer on my Laptop or PC, whether it charges in the background only with 500 mAh or with a little over 900 mAh on my USB 3 ports.
Does your kernel support USB fast charge / if not: will it be supported? (some custom kernels devs don't want to implement it, bacause it is not an official feature and "might" not work perfectly)
Coming from stock kernel, I got stuck at the Zenfone logo during reboot after the first flash with exkm. Volume down+power fixed that and after flashing a second time all seems to be working ? zram is at 684mb for my 6Gb variant.
Thank you a lot.
A quick question about the kernel source: Is there an API/kernel endpoint that can be used to query and manipulate the flip camera's motor? If so, is it something than can be accessed from userland? I was wondering if one might be able to write a shell script that can be used to send commands to it.
Does camera has OIS? I've seen OIS code in DTS
dmd79 said:
Does camera has OIS? I've seen OIS code in DTS
Click to expand...
Click to collapse
It's not the object of this thread.
There's a "ask me anything thread" in the discussions forum.
Flashing via EXKM will NOT work, if you’re on the latest magisk canary! (currently 19305!)
19302 is still working fine with EXKM, as is stable 19.3. Big changes in magisk are coming. we will have to wait for flar2 to find a new way of flashing zips.
Can this be flashed on the latest update or does it require an update from you? If not are there any downsides to it not being based on the most current kernel source code then?
Kind regards
regenwurm16 said:
Can this be flashed on the latest update or does it require an update from you? If not are there any downsides to it not being based on the most current kernel source code then?
Kind regards
Click to expand...
Click to collapse
Wait a bit. I’ll release an update soon. (hopefully later today) This will have latest asus sources merged.
I currently see 2 downloads for my kernel :cyclops: so I thought I can take it slow.
Testing was good so it should be ready for prime time stay tuned!
Thanks for your effort.
If think the two downloads are because of the scarce availability of the phone. I ordered mine on 5th of June on Amazon Germany the 6GB RAM 128GB ROM variant (only model they sell) and it took until 1st of July to get to me
I would have ordered on the Asus eShop but they don't ship to my country/don't have a shop for my country
Just take a look in the UK availability thread it's even worse there

Development [Kernel][11.06.2023][Android 13] Kirisakura 3.0.2_T for Asus Zenfone 8 aka "Sake"

Kirisakura-Kernel for the Asus Zenfone 8
Hello everyone,
To keep it short: Here is Kirisakura - Kernel for the Asus Zenfone 8 aka Sake. The Zenfone line-up internal codenames are traditionally derived from alcoholic drinks. Two years ago the Zenfone 6 bore the title "Kirin". The Zenfone 7 was codenamed "Tequila".
I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.
Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!
If you expect a custom kernel to magically improve your devices battery life manifold and this is your only priority then this might not be the right place for you.
However the kernel is built to keep battery life close to the same as you would experience the on stock kernel while being tuned to perform better in various UI related benchmarks. The same benches are used by google to verify and ensure UI smoothness on the Pixel devices. The scheduler is tuned to yield lower jitter and reduce jank frames.
If that got your curious, I welcome you to continue reading if you´re still interested!
This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security and performance, while keeping stability as the foucs during testing! This includes Linux-Stable, CAF-Upstream and kernel/common.
A very positive development. Google pushed for CFI and SCS to be enabled by default in the android-common kernel. In this years generation ( 5.4 linux kernel base/ SD 888 ) CFI and SCS are enabled by default. It was a lot of work to get these features working nicely on the kernel I did the years back. So it´s nice to see this is now there by default in everybody can profit from it.
I put the explanations and links in hide tags here.
Spoiler: Documentation Control-Flow-Integrity (CFI) / Shadow Call Stacj (SCS)
Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features.
The recently released Kirisakura-Kernel for the OnePlus 8 Pro was featured on the XDA-Portal due to the inclusion of CFI. The featured article explains CFI in great details, is easy to understand and definitely worth to read.
If possible the latest Kirisakura-Kernel releases for various devices aim to include CFI in enforcing mode so users can benefit from this security features.
Another security feature is Shadow Call Stack (SCS).
SCS is another security patchset that is aimed at preventing attacks via return oriented programming (ROP).
ROP is a technique where the attacker gains control of the kernel stack to overwrite function return addresses and redirect execution to carefully selected parts of existing kernel code.
If you´re interested here are a few good links:
Google Security Blog explaining SCS.
LLVM doc about SCS
Android DOCs documenting SCS
If reading about upstream in the paragraph above got you curious, have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.
Read more about the Release-Model following this link.
This conversation on the LKML mailing list also shows the power of Linux-Stable and why it´s very beneficial to not just say it´s not worth and a potentiol source for bugs:
Starting with the Initial Message , the following reply and a good summarizing statement.
Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 888 that´s built into the different SKUs of the Zenfone 8.
The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
This kernel focuses amongst the other features to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.
The kernel includes a lot of improvements and contributions from other developers as well. Without this kernel would not exist.
A big part of improvements originate from @arter97´s, @kdrag0n´s and @Sultanxda´s work. Many others contributed in some way or another to this kernel.
A big thanks to all of them at this place!
Now lets continue with a list of features in the next paragraph!
Main Features:
- Based on latest kernel sources from Asus for Android 13 and intended to be used on the latest Asus Stock-Firmware
- compiled with Clang 14.0.7 and built with -O3 speed optimizations
- Linux-Stable-Upstream included to 5.4.231
- upstreamed CAF base for the Snapdragon 888 (qcoms internal codename "lahaina")
- include important fixes/improvements from kernel/common
- tune scheduler for improved jitter and less jank frames
- reduce power consumption during deep sleep
- remove logging while device is suspended
- remove sleep debugging from Asus for release build
- disable various debugging mechanisms for drivers which are not needed on a perf build (for example touchscreen, fingerprint reader, display, binder)
- disable various debugging configs, that are not needed in a perf kernel build according to google.
- disable selinux auditing (we don´t have to adress selinux denials running a stock rom)
- display tweaks to reduce power consumption on statically rendered images
- disable unnecessary CPU errata for our specific SoC
- disable per cgroup pressure tracking to reduce overhead
- SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
- free up RAM by removing reserved mem regions used only for debugging
- implement LRNG (thanks @arter97, see arter kernel OP for more info )
- Flashing the kernel will keep root!
- Flashable via EXKM, FKM or TWRP (if available) on a rooted system!
- Anykernel zip is based on the Anykernel3 release from @osm0sis
EAS related features:
- Implement dynamic WALT-Window size depending on current FPS, collecting information about CPU-Load to provide more precise information for the scheduler
- EAS implementation patched up to latest CAF state
- updates from kernel/common
- scheduler updates from sd888/ 5.4 kernel
- scheduler update from sony xperia 1 III kernel aiming to improve WALT
CPU related features:
- Power saving workingqueues enabled by default (toggleable in EXKM)
- Change various drivers (WLAN, MM, audio, charger, power, thermal, glink etc) to use power efficient workingqueues. This compliments EAS in general
- improvements to cpufreq/times/stats
- vdso32 patches as found on Google Pixel devices (brief documentation here) (CAF 5.4 default, keep for documentation)
- remove event debug logging
- disable broken irq detection, disable debugmon
- improve suspend/resume from audio driver (caf-upstream for audio-kernel)
- cpuidle: wake only cpus for which qos has changed (this allows cores to keep idle states better)
- disable debugging during sleep states as per qcom recommendation
- remove RTB logging to reduce overhead
- disable trace_printk as it shouldn´t be used on production/perf kernel builds
- enable suspend_skip_sync to save power during suspend/resume
- disable edac and coresight (following google on the pixel kernels)
- disable jtagv8 debugging as recommended by qcom for perf builds to avoid potential power, performance and memory penalty
- disable s2idle in favor of deep idle state -> improves deep sleep drain (google initially used 2idle for improved suspend/resume latency on pixel 3 and pixel 4, but disabled it on pixel 5. qcom followed suit for sd 888, but apparently didn´t see google reverting it on pixel 5. Other OEMs such as Xiaomi or OnePlus already disabled s2idle on their SD888 devices in favor of deep- read more about s2idle vs deep here)
GPU related features:
- GPU driver updated to latest CAF-State
- gpu/kgsl improvements from pixel 4/pixel 5 kernel
- add low_prio_worker thread for gpu driver (Improves performance when tearing down processes (eg, via LMK) and not blocking currently running UI from submitting work to the GPU
File System related features:
- upstream BFQ-MQ to latest state in linux-mainline and default to 128KB readahead
- improve memory allocations in kernfs
- ufs improvements from pixel 4/ pixel 5 kernel
- improve GC as to not interfere while user interaction is happening and prevent possible jitter or latency spikes
UI/UX/Usability related features from CleanSlate:
- CleanSlate features made by @tbalden
- Disclaimer: All CleanSlate features can be controlled via the free companion and config app found on CleanSlate thread here on the Zenfone 8 Forums on XDA. Please consider buying the premium versions if you enjoy using the CleanSlate features, to give a little something back to @tbalden.
Network related features:
- Wireguard Support (Details)
- advanced TCP algorithms enabled
- use bbr as default TCP congestion algorithm (fasted algo according to this excellent research from @kdrag0n found here )
- includes new bbr
- improved networking drivers from caf-upstream (especially wifi)
- remove unnecessary wakelock from WLAN driver to reduce thousands of very short wakeups during a 7 hour deep sleep period
- improved bluetooth performance (¹, ²)
- Enable support for TTL spoofing
Memory related features:
- Speculative Page Faults left enabled (1. 2) (CAF 5.4 default, keep for documentation)
- Fix various memory leaks in different subsystems
- improved mm with patches from mainline
- patches from kernel/common
- improve memory allocations in various subsystems, video encode/decode, kernfs, cgroup
- Backport to enable CONFIG_HAVE_MOVE_PMD (see here) , thanks @arter97
- Backport to enable CONFIG_HAVE_MOVE_PUD (commit here) , thanks @arter97
- free more RAM by removing unused reserved memory regions
- mm: Micro-optimize PID map reads for arm64 (improves game performance, especially unity based games such as genshin impact)
- MGLRU added (info here and here
Security related features:
- Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) (CAF 5.4 default, keep for documentation)
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Kernel instead of full LTO (CAF 5.4 default, keep for documentation)
- Shadow Call Stack (SCS) Security-Feature ( 5.4 default, keep for documentation)
- enable init_on_alloc for even more security, more information can be found in the commit message (CAF 5.4 default, keep for documentation)
Misc Features:
Wakelock Blocker:
- advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info
- blocking a kernel wakelock should only be done in case of firmware incompatabilities (WiFi network at work (can´t be changed) causes deep sleep to not work on the phone.) That´s the only use case I see for this feature. The kernel does not features this to improve battery life!
Other features:
- clean up asus drivers and fix a few warnings in kernel log
- disable logging and debugging to make the kernel more lightweight in various places (includes binder, mm, vma, gpu, ipa etc)
- fix several coding issues detected by newer Clang-Toolchains
- enlarge dmesg size to ease debugging
Flashing Guide, Download and Changelog
Requirements:
- unlocked Bootloader (this will void warranty and kill future OTA updates on all asus phones at the moment)
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment
- magisk root
- a backup of stock boot.img, vendor_boot.img and dtbo.img so you can go back to stock conditions (simplest way is TWRP or to extract from stock firmware)
How to flash the Kernel:
1. Download the latest kernel.zip and make sure you have properly updated to the latest matching Asus Stock-Firmware. When the Zenfone 8 receives an OTA update it takes Asus a while to release the source code for the new OS and me a while to build a new kernel. If you don´t want to face any issues, wait until I either release an updated kernel or give green light because there were no kernel changes.
Always make sure to run the firmware the kernel is built for!
If you feel adventurous and try in advance, make sure you have a backup ready!
2. Flash the kernel.zip via latest TWRP (if available), EXKM or FKM app and do a full reboot.
3. Reboot and profit.
DOWNLOAD:
Download is located always in this folder:
https://www.androidfilehost.com/?w=files&flid=326387
Important: Read after Download
Please take a look at the second post after flashing the kernel!
Changelog:
Android 11
1.0.0 Initial Release
1.0.3 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85230887
1.1.8 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85369421
1.3.1 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85471991
1.4.7 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85580815
1.5.1 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85708459
1.7.5 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85845707
1.7.8 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-85845707
1.7.9 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-86004361
Android 12
1.0.0 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-86200913
1.0.1 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-86219239
1.0.2 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-86221081
1.0.8 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-86546997
2.0.0 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-86856077
2.0.1 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-87005047
2.0.2 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-87053951
2.0.8 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-87244107
2.0.10 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-87432111
2.0.12 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-87641841
2.0.15 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-87944971
Android 13
3.0.0 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-88195025
3.0.1 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-88326835
3.0.2 https://forum.xda-developers.com/t/...asus-zenfone-8-aka-sake.4295287/post-88632657
Donations:
Donations are not mandatory but very welcome if you want to support development or just buy me a coffee/tea
If you like my work: http://paypal.me/freak07
Credits:
Asus for the development device, giving me the opportunity to create this project!
@osm0sis for all his work, including the ak3 installer!
@tbalden for being the best HTC, Pixel, OnePlus and now Asus wingman!
@LeeDroid and @mwilky for their awesome roms and work I used on multiple devices!
@Captain_Throwback for all the mentoring and guidance!
@Eliminater74 for bringing me into the game and the Inspiration
@nathanchance for his upstream guidance and assistance
@RenderBroken for helping me out
@flar2 for all his work
@joshuous for all the help he provided to me in the past!
@arter97 for giving me advice
@kdrag0n for his help and advices!
@topjohnwu for magisk!
Source Code: https://github.com/freak07/Kirisakura_SAKE_Zenfone_8
F.A.Q:
Question: Is root preserved when flashing this kernel?
Answer: Yes, the AnyKernel.zip will detect root and keep it.
Question: How do I return back to stock or another kernel.
Answer: Extract boot.img, vendor_boot.img as well as dtbo.img from matching firmware you are on and flash them via fastboot. If you want to keep root flash back the magisk_patched_boot.img. Or dirty flash your rom and re-root.
Question: Why is having Magisk installed mandatory for this kernel?
Answer: The kernel uses a ramdisk overlay to apply some settings after boot. If you are not rooted these settings will not get applied and you miss some of the optimizations.
Question: How to report bugs properly?
Answer: Have a look at post #3 in the linked thread. The linked guide is a pretty good starting point.
Before reporting any bug make sure you´re running on a stock configuration. That´s means you´re not using any mods, tweaks in kernel managers or other root tweaks , magisk modules, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
Is the issue reproducible? Does it happen frequently?
Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.
If the device force reboots/randomly reboots (that means you see the bootloader unlocked screen!) provide a .zip of /asdf.
Easiest way is immediately after booting up, with a root explorer navigate to /asdf. Copy the contents to your internal storage, zip it up and send it to me.
If the issue happens while the device is running provide a dmesg plus a logcat that you take while/shortly after the issue happens. This will log what´s running in the current session. Try to be as detailed as possible what´s happening when the issue appears. It will also help me in reading the log!
and this is mine too
justincase
last one I promise
Woah another kernel for sake ! Might give it a try later !
Update to 1.0.3
Hey guys and girls,
I hope everyone is having a good day or starting into one. Here´s the next update.
The kernel is updated for the latest firmware:
30.11.51.67. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.
The link to the firmware can be found here:
https://dlcdnets.asus.com/pub/ASUS/ZenFone/ZS590KS/UL-I006D-ASUS-30.11.51.67-1.1.25-user.zip
md5sum: 0f30d5e043f4a675e7db3250d5218125
More changes in the Changelog below:
Changelog:
- Import zenfone8_zs590ks.MR0.4-30.11.51.67 source code
- Linux-Stable Upstream to 5.4.128
- bump clang to latest prebuilt clang by google (12.0.7)
Download:
https://www.androidfilehost.com/?fid=14943124697586354960
Instructions can be found in the OP!
But look at this post too
Have fun, enjoy the kernel and your phone.
Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
Freak07 said:
Update to 1.0.3
Hey guys and girls,
I hope everyone is having a good day or starting into one. Here´s the next update.
The kernel is updated for the latest firmware:
30.11.51.67. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.
The link to the firmware can be found here:
https://dlcdnets.asus.com/pub/ASUS/ZenFone/ZS590KS/UL-I006D-ASUS-30.11.51.67-1.1.25-user.zip
md5sum: 0f30d5e043f4a675e7db3250d5218125
More changes in the Changelog below:
Changelog:
- Import zenfone8_zs590ks.MR0.4-30.11.51.67 source code
- Linux-Stable Upstream to 5.4.128
- bump clang to latest prebuilt clang by google (12.0.7)
Download:
https://www.androidfilehost.com/?fid=14943124697586354960
Instructions can be found in the OP!
But look at this post too
Have fun, enjoy the kernel and your phone.
Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
Click to expand...
Click to collapse
Hello. I tried this kernel recently. But now I want to return to the stock core. But when I flash boot.img and dtbo.img, the settings stop working for me. There are also no items in Quick Settings. What am I doing wrong?
a7lanov said:
Hello. I tried this kernel recently. But now I want to return to the stock core. But when I flash boot.img and dtbo.img, the settings stop working for me. There are also no items in Quick Settings. What am I doing wrong?
Click to expand...
Click to collapse
Soory, wrong post
a7lanov said:
Hello. I tried this kernel recently. But now I want to return to the stock core. But when I flash boot.img and dtbo.img, the settings stop working for me. There are also no items in Quick Settings. What am I doing wrong?
Click to expand...
Click to collapse
Hey,
I forgot to mention to restore vendor_boot.img as well.
Sorry for the inconvenience, I adjusted the OP and the FAQ already.
So to get back to stock, extract boot.img, vendor_boot.img and dtbo.img from the matching stock firmware.zip. make sure you extract from the same firmware you're currently running.
Then flash these via fastboot.
If it doesn't work afterwards your problem lies elsewhere.
Freak07 said:
Hey,
I forgot to mention to restore vendor_boot.img as well.
Sorry for the inconvenience, I adjusted the OP and the FAQ already.
So to get back to stock, extract boot.img, vendor_boot.img and dtbo.img from the matching stock firmware.zip. make sure you extract from the same firmware you're currently running.
Then flash these via fastboot.
If it doesn't work afterwards your problem lies elsewhere.
Click to expand...
Click to collapse
Thank you. Today I will also try to flash the vendor_boot.img
no updates?
I know IT clearly says 'Zenfone 8', but is there any chance this Kernel will work on the 'Zenfone 8 Flip', too? (ZS672KS)... Ty!
elchmartin said:
I know IT clearly says 'Zenfone 8', but is there any chance this Kernel will work on the 'Zenfone 8 Flip', too? (ZS672KS)... Ty!
Click to expand...
Click to collapse
unfortunately no. 8 flip uses a separate kernel.
Hi @Freak07 ,
Thanks a lot for your effort and time that you invested into developing this kernel.
However, as is the case with other custom kernels, I would like to know what kind of battery life benefits I can expect from using this kernel on my device?
Unlocking the bootloader on Asus phones right now means a bit more hassle with the updates, also rooting the phone means a bit more hassle with using some apps (safety net etc),so I would really like to know what are the benefits in terms of battery life.
Update to 1.1.8
Hey guys and girls,
I hope everyone is having a good day or starting into one. Here´s the next update.
The kernel is updated for the latest firmware:
30.11.51.83. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.
The link to the firmware can be found here:
https://dlcdnets.asus.com/pub/ASUS/ZenFone/ZS590KS/zenfone8_zs590ks.MR0.5-30.11.51.83.zip
md5sum: 0f30d5e043f4a675e7db3250d5218125
More changes in the Changelog below:
Changelog:
- Import zenfone8_zs590ks.MR0.5-30.11.51.83 source code
- Linux-Stable Upstream to 5.4.134
- bump clang to latest prebuilt clang by google
- Merge CAF (QCOM) upstream
- enable ddr cooling device
- raise lto inlining limit
- other improvements please take a look at github
Download:
https://www.androidfilehost.com/?fid=14943124697586372325
Instructions can be found in the OP!
But look at this post too
Have fun, enjoy the kernel and your phone.
Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
Freak07 said:
Update to 1.1.8
Hey guys and girls,
I hope everyone is having a good day or starting into one. Here´s the next update.
The kernel is updated for the latest firmware:
30.11.51.83. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.
The link to the firmware can be found here:
https://dlcdnets.asus.com/pub/ASUS/ZenFone/ZS590KS/zenfone8_zs590ks.MR0.5-30.11.51.83.zip
md5sum: 0f30d5e043f4a675e7db3250d5218125
More changes in the Changelog below:
Changelog:
- Import zenfone8_zs590ks.MR0.5-30.11.51.83 source code
- Linux-Stable Upstream to 5.4.134
- bump clang to latest prebuilt clang by google
- Merge CAF (QCOM) upstream
- enable ddr cooling device
- raise lto inlining limit
- other improvements please take a look at github
Download:
https://www.androidfilehost.com/?fid=14943124697586372325
Instructions can be found in the OP!
But look at this post too
Have fun, enjoy the kernel and your phone.
Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
Click to expand...
Click to collapse
Hi. Thanks. And I have a question. I noticed through the Kernel Adiutor that big and prime cpu do not sleep when there is no load, they work at low frequency (original kernel). Is this a hotplug problem? Should they not go to Offline? Do they sleep in your kernel?
a7lanov said:
Hi. Thanks. And I have a question. I noticed through the Kernel Adiutor that big and prime cpu do not sleep when there is no load, they work at low frequency (original kernel). Is this a hotplug problem? Should they not go to Offline? Do they sleep in your kernel?
Click to expand...
Click to collapse
That´s expected behaviour on the few last gens of QCOM SoCs. and you´re also fooled by the ui of the app.
if there are no tasks/work the clusters go into idle c-states, but kernel managers/monitors will show you the frequency that you described.
depeding which battery mode you chose in settings, minfreqs for the clusters will be higher or lower.
dynamic should be at 300mhz for little cluster, 710mhz for big cores and and 844mhz for the prime core.
Freak07
Thanks for clarifying
Freak07 said:
Update to 1.1.8
Click to expand...
Click to collapse
Thanks man!
Could you please let us know if defconfig is stable or it's better to configure something (like cpu/gpu freq's) on the device ?
Does it support both 8GB and 16GB RAM devices?

Categories

Resources