6

Development - [Kernel][24.10.2022][Android 13.0.0 Stable]Kirisakura 1.0.0 for Pi...

 1 year ago
source link: https://forum.xda-developers.com/t/kernel-24-10-2022-android-13-0-0-stable-kirisakura-1-0-0-for-pixel-7-pro-aka-pantah.4509795/page-7#post-87636873
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Top Liked Posts

Kirisakura-Kernel for the Pixel 7/Pro

Hello everyone,

To keep it short: Here is Kirisakura - Kernel for the Google Pixel 7 Pro aka Cheetah and the Pixel 7 aka Panther, together Pantah.
I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.

The kernel aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security, stability and performance!
This includes Linux-Stable, F2FS-Stable and kernel/common!
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.
By merging linux-stable regularly we get most security updates months ahead of the stock kernel and also before they even end up in the android security bulletin.


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!

Features:
Main Features:
- Based on latest A13 kernel sources from Google, Kernel is made for Android 13 Stable
- Linux-Stable-Upstream included to 5.10.149
- Compiled with prebuilt Google clang 15.0.3
- merged kernel/common (improvements to android-common-kernel straight from google)
- MM subsystem reworked (more info and some patchsets linked in this post)
- Multi-gen LRU backported/reworked and enabled (more info here, here as well and here) to improve mm and reduce cpu cycles
- pelt multiplier tied into powerhal to speed up scheduler during interaction (more info here)
- prevent frequency spikes caused by small transient tasks when the device is idle(more info here)
- tie mechanism to prevent frequency spikes caused by small tasks also into powerhal
- scheduler improvements for RT (realtime) tasks
- introduce and setup PMU limiter (prevents CPU from spiking to max when it isn´t needed, based on PMU reads, more information here)
- improve camera performance by tuning the powerhal during recording
- bias tasks of rt, sf and ta groups to prefer high capacity cpus during app launches, interactions
- improve app launches via powerhal
- restrict maximum CPU-Freqs during screen off/ idle to 1.1GHZ for all clusters to save power
- introduce unfair f2fs rwsems to prevent writer starvation and improve IO perf under heavy load
- fuse: give wakeup hints to scheduler to speed up compress/decompress in internal storage (details)
- enable RCU_BOOST (details here), also fix RCU_BOOST behaviour
- F2FS-Stable updated
- TCP backports from mainline
- SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
- scheduler backports from linux-main
- mm updates from linux-main
- locking updates frm linux-main
- improve memory performance by tweaking google´s eh zram implementation
- fix sysfs endpoint for googles eh zram
- affine IRQS to CPU 7 during camera usage for improved performance as it tends to overload the little cores
- use bbr as default TCP congestion algorithm (fasted algo according to this excellent research from @kdrag0n found here )
- include bbrv2 from google, more info here
- Enable support for TTL spoofing
- important patches from kernel/common for 5.10 (here are more details)
- several updates from QPR beta, and a few from Pixel 6 that googles missed to include in the pixel 7 kernel
- improve thermals
- change compaction proactiveness based on device state for improveed memory management
- flashing the kernel will preserve root

CleanSlate Features
- CleanSlate Features from @tbalden, big applause here! (s2s, notification booster, battery saver, flashlight notifications. Please note: cleanslate features that work otherwise with rooted devices like kadaway (adblocking) are not implemented on this kernel since I´m running rooted)
- Check the CleanSlate thread for more information about those features
- The CleanSlate thread also contains the apps that allows you to control those features!
- If you consider those features useful, maybe consider purchasing the apps in the PlayStore or a small donation to @tbalden, he deserves it! Don´t forget to switch to beta channel for those apps, as this is needed for device running A13!


Various Optimizations:
- update several drivers to use power efficient workingqueues (for example wlan driver)
- f2fs: reduce timeout for uncongestion
- f2fs: Demote GC thread to idle scheduler class
- f2fs: set ioprio of GC kthread to idle
- tcp: enable advanced tcp, give user more options for tcp alorithm
- mm: vmstat: use power efficient workingqueues
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

Powerhint Module:
- restrict little cluster to 1,19ghz mid cluster to 1,19ghz and big cluster to 1,1ghz during screen off, to reduce battery usage for example during music playback
- only use little cores during screen off/device suspend
- tie pelt multiplier into the powerhal (more info here)
- prevent frequency spikes caused by small transient tasks during idle operation (more info here)
- boost scheduler using the pelt multiplier during fingerprint unlock operation
- setup and control PMU limiter via powerhal (more info here)
- change boosts to reduce jitter, jank and greatly reduce missed frames during scrolling
- more small improvements

DOWNLOAD:
Download is always located in this folder: Changelog:
Android 13.0.0 Stable (not QPR beta!)

1.0.0 Initial Release


Requirements

- vbmeta flags for verity/verification disabled (this requires a wipe if you´re coming from stock with those flags enabled), check the FAQ for information on how to do this
- unlocked Bootloader
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment so you can flash back to stock in case something goes wrong
- working magisk environment (a device rooted with latest magisk stable in case you want to be absolutely safe)
- IMPORTANT: Unrelated to the kernel, but update both slots of your phone to A13 before you flash anything to your device!


How to flash the Kernel:
1a. Make sure you tick all the requirements above

1. Download the kernel.zip (unified for both devices) and the correct powerhint module depending on your device (Pixel 7 = panther || Pixel 7 Pro = cheetah)
2. Flash the powerhint module via magisk manager as you would any other magisk module
3. Flash the kernel.zip via EXKM, FKM or kernel flasher. Root will be preserved.
4. Reboot and profit.


Donations:
Donations are not mandatory but very welcome if you want to support development or just buy me a coffee/tea/beer
If you like my work: http://paypal.me/freak07

Credits:
@osm0sis for all his work on AK3.
@tbalden for being the best HTC, Pixel, OnePlus and Asus wingman!
@capntrips for all his work on the pixels, avb, hashtree patcher, the counsel and the kernel flasher!
@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 and his entire work!


Source Code: https://github.com/freak07
F.A.Q:

Question:
How do I update my phone to a new monthly update if this kernel is installed?
Answer: The easiest solution is to just use any full firmware package to update your phone to the new stock firmware. You can do so with the android web flash tool, a factory image or a full OTA image.

An excellent guide on how to use the factory image to do so was posted by @roirraW "edor" ehT on this thread. Feel free to use this as a reference.

This also serves as the easiest way to return back to stock, if you don´t like the kernel and feel not comfortable flashing anything via fastboot.

Just remember to disable verity/verification vbmeta flags each time you update your phone as described in the next question below.
If you boot once, without them disabled a wipe is required to disable them again.

Question: How do I disable the vbmeta flags for verity/verification?
Answer: The easiest solution is to use the android web flash tool and tick the correct checkbox.
Alternatively extract the vbmeta.img from the matching factory image and flash it in fastboot via:
Code:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Please note that disabling those flags will always require a full wipe for the device to boot up!
And a further note: You need to repeat this command every time you flash a full firmware zip ( a factory image or a full OTA.zip) as those contain a vbmeta image. Otherwise the flags will be reset to default enabled and it will require another wipe to disable them again! As with the firmware.zips, you need to tick the checkbox in the webflasher every month you update your phone or flash a firmware there!

Question: How do I return back to stock?
Answer: Extract boot.img, dtbo.img, vendor_kernel_boot.img and vendor_dlkm.img from the matching factory image provided on googles download page.
Flash those images via fastboot/fastbootd and you will be back on stock kernel. If you don't know the fastboot commands to flash the images, check the instructions how to flash those images in post #4.

Alternatively dirty flash the whole firmware without wiping by using either the android web flash tool, a factory image or a full OTA image. If you disabled the vbmeta flags, don't forget to disable them again (or tick the correct options on the web flash tool) after flashing a full firmware package and re-root.

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 supported firmware. Usually I'm announcing in the release post, the firmware the kernel.zip is compatible with, but most of the time the kernel is updated when a firmware update drops.
Please make also sure you're running 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?
Please make sure to meet the points described above, provide logs as detailed in the link above, otherwise debugging is a lot more time consuming and harder. (kernel flashing apps usually support exporting logs of flashes too) If these requirements aren´t met and I don´t find time to either reproduce the issue myself or I´m not able to reproduce the issue myself, reports might just be ignored. 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.

Question: What about unlocking, rooting, passing safetynet, apps detecting root/modifications and other topics that are vaguely related, but not really subject of this thread?
Answer: If you want to modify your phone via root/magisk in any way you need to unlock the bootloader. Unlocking will result in safetynet not passing. This has nothing to do with the kernel. At the moment of writing this, safetynet not passing can be worked around with a magisk module called "Universal SafetyNet Fix".
Not passing safetynet is unrelated to the kernel since hardware attestation is enforced on nearly all newly released devices now.
If you´re not passing safetynet banking apps might for example be detecting root. There are various tricks to hide root/modifications to the phone from banking apps or others but that´s not really subject of this thread.
I recommend taking a look at this excellent collection of helpful threads from @roirraW "edor" ehT!
It can be found following this link!

Question: I get a device corrupted message after flashing the kernel or just reboot to bootloader. How to get rid of it?
Answer:
There seems to be an issue with verity on Pixel devices that can trigger randomly. That means even if the expected hashes match the device refuses to boot due to this bug.
Short answer, flash magisk patched init_boot.img via fastboot, afterwards flash stock init_boot.img. That should clear this situation.
AOSP Build Environment and Standalone Kernel builds (monolithic builds)

I´m sure some of you followed the movement towards the Generic Kernel Image (GKI) and Qcoms adaption to it called QGKI.
You can find more information about GKI following this link.
What does that mean for custom kernels and this custom kernel?
The last few years the kernel on android devices was more or less compiled as a monolith. That means the kernel is in the zImage with all (most) drivers compiled inline.
However with GKI this changed. There´s the base kernel image while vendor/device specific drivers are compiled as dynamically loadable kernel modules.
On last years devices like the Pixel 5 (using a 4.19 kernel) and this years devices with SD888 on a 5.4 kernel base, there was the possibility to change the QGKI kernel back into a monolithic kernel image. (building the drivers that are on stock kernel external modules back into the zImage to end with a monolithic kernel)
On the Pixel 6 I wasn´t able to achieve this yet. Same goes for the Pixel 7. But during my tries I also wondered if maybe finally the time has come to follow suit, instead of trying to enforce old ways, when there´s a new way going forward.
What does that mean. This means that at this point the kernel is shipped as images that are to be flashed via fastboot. At a later stage I´m sure we can modify anykernel3 to allow flashing zips again, but at this early stage fastboot flashable images will be provided.
Those images can be flashed the same way the device is rooted, therefore I think everybody should be able to flash it easily since the device can´t be rooted any other way.

The kernel was compiled using the aosp kernel build environment. Information about it can be found on the documentation page from google.
So unfortunately we´re at the moment out of ideas and options for the vbmeta verity/verification disable requirement. @tbalden and me tried a few things and failed with our final idea this morning, which worked on a similar device.

Maybe somebody finds a way so we can actually flash custom images with the avb/vbmeta flags enabled, but at the moment not. I didn´t want to delay the release any further so here we go.

I understand this is a pain for many, but unfortunately that´s how it is now. It was a pain for me too, because on the final test, we really hoped it would work, but we we´re trapped in the wipe ourselves.


Anyway, have fun everyone with the release. It basically includes everything from the Pixel 6 kernel, as they branches are similar.
Damn, paywalled. The free CleanSlate config app is just a glorified ad. Absolutely disgusting.

Yeah well, I don't feel offended, but as the author of the app, I wanted to reply to help a better understanding.
So I'm not a ux guru and I think it could look better, but all the functionality to set those features is available in the free version.

I'll think about how to give a less obtrusive free app at some point. Till then please bear with it, as you really can set all the stuff in it.
Thanks for the feedback.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK