Zest Kernel ꜰᴏʀ ʙʀᴀᴍʙʟᴇ

LazerL0rd

Senior Member
Nov 2, 2016
1,353
1,110
123
Aberdeen, United Kingdom
www.thezest.dev
Let's get this out of the way, I'm not responsible for anything more than a kernel panic.

Now that we've got that over with, I introduce to you - Zest Kernel. This ain't your average kernel on XDA. Zest Kernel is tuned down to every last mmap() to ensure that your device runs as fast and smooth as your hardware permits. No longer are the days of your battery dying on the bus, slow network speeds at home, or lags when swiping on those hot, new Android 11 gestures. Zest Kernel will revamp the experience of your device.

Boot Time
By shrinking the kernel's size with Dead Code Elimination (DCE) and removing a bloat of debug and unused drivers, we decrease boot times [1].

LLVM Tools
Zest Kernel is built exclusively with the LLVM toolchain and tools, which allows us to utilise a wide range of security and performance features as well as satisfying my LLVM fanboy needs.

Networking Performance
Due to the addition of the rmnet_perf and rmnet_shs drivers from Qualcomm, cellular networking performance can see improvements due to network aggregation.

Performance
Through backporting mainline improvements to mmap() and locking, the kernel's core code receives improvements in performance and works to reduce jitter and improve system responsiveness. The return of BPF JIT allows us to improve performance with eBPF programs that Android utilises. As well as these changes, Danny (kdrag0n)'s efficient frequencies and Sultan's latency reduction patchsets are included which improve system fluidity and performance. LTO is also enabled, improving overall kernel performance. Tuning for ext4

Security
Zest Kernel utilises Clang's Control Flow Integrity (CFI) to protect against undefined behaviour that tries to subvert the kernel's control flow. Clang's ShadowCallStack, which protects programs against return address overwrites such as stack overflows, is also switched on and enabled with virtually mapped call stacks. All locals that are automatically initialised with zeros instead of patterns, which is safer for strings, pointers, indexes, and sizes. WireGuard is also included to provide a secure, performant VPN tunnel for those who wish to use it.

zRAM Improvements
Backports from mainline and changes from Sony allow us to utilise a more efficient zRAM backend, z3fold. While zRAM is only used on bramble, since 8GB is more than enough memory on redfin, this should provide a nice improvement for zRAM on bramble.

[1] - The first boot may take longer as F2FS (the filesystem we use) needs to check for corruption every time the kernel is changed for safety measures. Subsequent boots should be much faster.

1) Make sure you're on the December or January SP.
2) Download Zest Kernel from the link below.
3) Enter fastboot (not fastbootd) with adb reboot bootloader or another method.
4) fastboot boot ZestKernel-Installer-P4A5G<DATE>.img where <DATE> refers to the release date of the specific kernel.
5) Yes, I said boot not flash. I hope you read that correctly.
6) Read my beautiful installation header and wait for your device to boot up.

Visit https://www.thezest.dev, click on "builds", then get the latest build from the relevant folder (Zest Kernel/bramble, in this case).

Releases are named in the form of ZestKernel-Installer-<Device Name><ISO 8601 Date>.img.


Jitter (After).jpg

Battery 1 (After).jpg
Battery 2 (After).jpg

Network (Before).jpg
Network (After).jpg

Sultan Alsawaf (kerneltoast/@Sultanxda) for his patchsets which help to improve the fluidity of graphics and more.
Danny Lin (@kdrag0n) for kramflash (the kernel installer) as well as a load of useful patches.
Jason Donenfeld (@zx2c4) for WireGuard.
Artem Labazov for his suggestion to use z3fold as a backend for zRAM.

***
If you enjoyed Zest Kernel, please donate to help keep up maintenance at https://paypal.me/paydiab. I'm strict on quality, and give each release it's quality time and care (possibly even more so than your OEM). Having a small income from these kernels gives me a better incentive to keep pushing them out for y'all.
***
 
Last edited:

PhantomCoder24

New member
Dec 11, 2013
2
1
21
Nashville
So far so good. Battery life seems to have improved which is very nice. Thanks so much for the awesome kernel!

I know this may be a dumb question, but how do I enable Wire guard? Do I need to install a separate client?
 
  • Like
Reactions: LazerL0rd

mistermojorizin

Senior Member
Dec 21, 2011
792
166
63
Appreciate your work.

I just installed and it seems to have disabled zRAM according to Ex Kernel Manager and FKM. Is it because of the change to z3fold? and if so, are there any apps that could help monitor this?

Also, I was curious if there's any chance you will eventually add color control and high brightness mode like in cleanslate?
 
  • Like
Reactions: LazerL0rd

LazerL0rd

Senior Member
Nov 2, 2016
1,353
1,110
123
Aberdeen, United Kingdom
www.thezest.dev
So far so good. Battery life seems to have improved which is very nice. Thanks so much for the awesome kernel!

I know this may be a dumb question, but how do I enable Wire guard? Do I need to install a separate client?
To use the kernel-backend of WireGuard, install the WireGuard app from GPlay/F-Droid and provide root access when asked. You can check which backend you are using if you go into WireGuard's settings.
 

LazerL0rd

Senior Member
Nov 2, 2016
1,353
1,110
123
Aberdeen, United Kingdom
www.thezest.dev
I just installed and it seems to have disabled zRAM according to Ex Kernel Manager and FKM. Is it because of the change to z3fold? and if so, are there any apps that could help monitor this?
I'll need to look into that, thanks for bringing it up. zRAM should still be visible in those applications with any backend, by the way.

Also, I was curious if there's any chance you will eventually add color control and high brightness mode like in cleanslate?
I've been thinking about that, and while HBM seems to be a good addition I'm not a fan of colour control within the kernel. If it's an important feature for many users, I'll add it and just build a separate kernel for myself.
 
  • Like
Reactions: J0kker

MegaJuif

Member
Nov 17, 2018
12
2
1
Sherbrooke
Let's get this out of the way, I'm not responsible for anything more than a kernel panic.

Now that we've got that over with, I introduce to you - Zest Kernel. This ain't your average kernel on XDA. Zest Kernel is tuned down to every last mmap() to ensure that your device runs as fast and smooth as your hardware permits. No longer are the days of your battery dying on the bus, slow network speeds at home, or lags when swiping on those hot, new Android 11 gestures. Zest Kernel will revamp the experience of your device.

Boot Time
By shrinking the kernel's size with Dead Code Elimination (DCE) and removing a bloat of debug and unused drivers, we decrease boot times [1].

LLVM Tools
Zest Kernel is built exclusively with the LLVM toolchain and tools, which allows us to utilise a wide range of security and performance features as well as satisfying my LLVM fanboy needs.

Networking Performance
Due to the addition of the rmnet_perf and rmnet_shs drivers from Qualcomm, cellular networking performance can see improvements due to network aggregation.

Performance
Through backporting mainline improvements to mmap() and locking, the kernel's core code receives improvements in performance and works to reduce jitter and improve system responsiveness. The return of BPF JIT allows us to improve performance with eBPF programs that Android utilises. As well as these changes, Danny (kdrag0n)'s efficient frequencies and Sultan's latency reduction patchsets are included which improve system fluidity and performance. LTO is also enabled, improving overall kernel performance. Tuning for ext4

Security
Zest Kernel utilises Clang's Control Flow Integrity (CFI) to protect against undefined behaviour that tries to subvert the kernel's control flow. Clang's ShadowCallStack, which protects programs against return address overwrites such as stack overflows, is also switched on and enabled with virtually mapped call stacks. All locals that are automatically initialised with zeros instead of patterns, which is safer for strings, pointers, indexes, and sizes. WireGuard is also included to provide a secure, performant VPN tunnel for those who wish to use it.

zRAM Improvements
Backports from mainline and changes from Sony allow us to utilise a more efficient zRAM backend, z3fold. While zRAM is only used on bramble, since 8GB is more than enough memory on redfin, this should provide a nice improvement for zRAM on bramble.

[1] - The first boot may take longer as F2FS (the filesystem we use) needs to check for corruption every time the kernel is changed for safety measures. Subsequent boots should be much faster.

1) Make sure you're on the December or January SP.
2) Download Zest Kernel from the link below.
3) Enter fastboot (not fastbootd) with adb reboot bootloader or another method.
4) fastboot boot "Zest Kernel.img"
5) Yes, I said boot not flash. I hope you read that correctly.
6) Read my beautiful installation header and wait for your device to boot up.




Sultan Alsawaf (kerneltoast/@Sultanxda) for his patchsets which help to improve the fluidity of graphics and more.
Danny Lin (@kdrag0n) for kramflash (the kernel installer) as well as a load of useful patches.
Jason Donenfeld (@zx2c4) for WireGuard.
Artem Labazov for his suggestion to use z3fold as a backend for zRAM.

***
If you enjoyed Zest Kernel, please donate to help keep up maintenance at https://paypal.me/paydiab. I'm strict on quality, and give each release it's quality time and care (possibly even more so than your OEM). Having a small income from these kernels gives me a better incentive to keep pushing them out for y'all.
***
Can i relock bootloader after flashing the kernel ?
 

Wet999

Senior Member
Apr 8, 2009
61
13
38
Moscow
I tested the kernel on my smartphone for several days (firmware stock, bootloader open, magisk and root installed), everything is fine. Smartphone performance is faster and better battery drain.
Only there is one caveat - adaptive charging does not work at night, it worked on the stock core.
Measurements were made using Accubattery and 3C programs
 
  • Like
Reactions: LazerL0rd

LazerL0rd

Senior Member
Nov 2, 2016
1,353
1,110
123
Aberdeen, United Kingdom
www.thezest.dev
AFAIK No!
Do not relock the bootloader unless the firmware is 100 percent stock. You might brick your phone, if it is not 100 percent stock when you relock the bootloader.
I think he's noticed ROMs liek Calyx ship lockable ROMs for Pixel devices, this is possible but the entire ROM (inc. the kernel) needs to be signed with a single key - which can't eb done with my installation method unfortunately.
 

LazerL0rd

Senior Member
Nov 2, 2016
1,353
1,110
123
Aberdeen, United Kingdom
www.thezest.dev
Thanks for all your support with Zest Kernel, and the lovely messages on XDA. Today I've released an update to Zest Kernel for redfin and bramble. The changelog is as follows:

- A bug which caused stuttering and high jitter randomly has been fixed, jitter should stay consistently low now.
- Improvements to the security of your device, with hardening inspired by GrapheneOS and the linux-hardened project.


As always, if you wish to donate my PayPal is available at https://paypal.me/paydiab. It's a great help for those of you who do, as I put in quite some time into my kernels.