Development [Kernel][GKI][05.03.2023][Android 13] Kirisakura 1.0.3 for Sony Xperia 1 IV aka "Nagara"

Search This thread

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,242
21,780
Hey @Freak07 where did you find the latest 5.10.117 original sources? Is it official or you did the update because I can't find it anywhere. Anyways thanks for this great work!
There´s no A13 source from sony yet. It will probably take a few months for them to push it. Don´t know why that´s always the case, but on each major android upgrade it takes them several months to push the first source for that.

Since it´s just the GKI kernel you can find the code for kernel/common on https://git.codelinaro.org/clo/la/kernel/common .
Check my git for the exact tag I merged.
 

Alex2008Ex

Senior Member
There´s no A13 source from sony yet. It will probably take a few months for them to push it. Don´t know why that´s always the case, but on each major android upgrade it takes them several months to push the first source for that.

Since it´s just the GKI kernel you can find the code for kernel/common on https://git.codelinaro.org/clo/la/kernel/common .
Check my git for the exact tag I merged.
Thanks! Also, I tried compiling but I get an error: "ERROR: '/media/miles/development/sony1IV/enviro/kernel_platform/out/msm-kernel-waipio/gki_kernel/common/abi_symbollist.raw' whitelist file not found"

Where can I get this file?
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,242
21,780
Thanks! Also, I tried compiling but I get an error: "ERROR: '/media/miles/development/sony1IV/enviro/kernel_platform/out/msm-kernel-waipio/gki_kernel/common/abi_symbollist.raw' whitelist file not found"

Where can I get this file?
From the QCOM kernel build environment. But you should be able to also just comment it out for just the GKI kernel.
 

Alex2008Ex

Senior Member
From the QCOM kernel build environment. But you should be able to also just comment it out for just the GKI kernel.
Great the kernel seems to be compiling normally when commenting out the line for now... What is the QCOM kernel build environment and where can I get it? I searched on Google but couldn't find anything.

UPDATE: Kernel seems to be compiled successfully using pmbootsrap's envkernel.sh and commenting out the whitelist line.
 
Last edited:

Mrxyzl

Senior Member
May 1, 2015
893
490
Sony Xperia 1 IV
Hi, today i go back to stock kernel due to the new update, then i realize that stock kernel charging is much cooler than Kirisakura. I think sony did some optimization for charging
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,242
21,780
Hi, today i go back to stock kernel due to the new update, then i realize that stock kernel charging is much cooler than Kirisakura. I think sony did some optimization for charging
kernel doesn´t do much while charging. additionally to that, the GKI zImage does not contain anything related to charging. that´s handled by the vendor specific drivers which are not included in the GKI zImage that´s shipped here. :)

So should still be fine to flash the latest release. :)
 

mark-o-solo

Member
Sep 19, 2010
20
2
LG V20
Hi everyone,
While I read through the post and features, I still wonder, and I think many others do as well:
How exactly does that feature list compare against the default kernel the device comes with ?
Thank you and cheers
 
  • Haha
Reactions: Mrcactuseater

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,242
21,780
Update to 1.0.3_T

Hey guys and girls,


Here´s the next update. Latest firmware got a slight bump in the GKI kernel again.
I decided to update the GKI kernel to the latest state from qcom repo for 5.10.
That means linux-stable is now ahead of the stock kernel to 5.10.149 and it contains a few additional security fixes that will be in the stock kernel probably over the next few months.

More changes in the Changelog below:


Changelog:
- Update common kernel to latest qcom state
- bump lrng to v45



Download:
Attached to this post as AFH does not let me upload at the moment




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
 

Attachments

  • Kirisakura_Nagara_T_1.0.3.zip
    16.5 MB · Views: 132
  • Like
Reactions: LucidLynxx

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,242
21,780
Hi everyone,
While I read through the post and features, I still wonder, and I think many others do as well:
How exactly does that feature list compare against the default kernel the device comes with ?
Thank you and cheers
Honestly I don´t understand the question. The OP contains a list of changes that are not part of the stock kernel.
A lot of additional information is linked there as well for better understanding. If nothing of that sparks any interest or you can´t make use of google for some research I really can´t help you any further.
Can we use this with 64.1.A.0.869??
Yes, check out the new release as well.
 

raven213

Senior Member
Apr 12, 2011
841
108
Honestly I don´t understand the question. The OP contains a list of changes that are not part of the stock kernel.
A lot of additional information is linked there as well for better understanding. If nothing of that sparks any interest or you can´t make use of google for some research I really can´t help you any further.

Yes, check out the new release as well.
Thanks for the update :)
 

Mijan94

Member
Mar 13, 2022
8
2
Hey I've just flashed on a Xperia 1 iv using FKM and now the device shows up as an Xperia 5 II lmao
 

Attachments

  • Screenshot_20230315-005519.png
    Screenshot_20230315-005519.png
    788.6 KB · Views: 83
  • Point Blur_Mar152023_010439.png
    Point Blur_Mar152023_010439.png
    916.8 KB · Views: 81

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Kirisakura-Kernel for the Sony Xperia 1 IV

    Hello everyone,


    To keep it short: Here is Kirisakura- GKI - Kernel for the Sony Xperia 1 IV aka Nagara. Nagara is the internal codename for this years development platform of Sony Mark IV devices.
    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.
    There´s also a cpu-battery saver mode that cuts back the CPU max- freqs, but without the disadvantages like delayed notifications from built into the system user-space power-saving modes.
    If that got your curious, I welcome you to continue reading if you´re still interested!

    Now lets continue with a list of features in the next paragraph!


    Main Features:
    - Based on kernel/common 5.10.149
    - compiled with Clang 12.0.5
    - CPU-Battery saver to be able to restrict max cpufreqs on the fly, without enabling powersaving modes that might cause missed notifications (see second post)
    - SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
    - Power saving workingqueues enabled by default
    - Change various drivers to use power efficient workingqueues. This compliments EAS in general
    - implement LRNG (thanks @arter97, see arter kernel OP for more info )
    - Enable support for TTL spoofing
    - 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
    - f2fs improvments for better efficiency
    - scheduler improvements
    - psi fixes
    - Flashing the kernel will keep root!
    - Flashable via EXKM, FKM or TWRP (if available) on a rooted system!


    Flashing Guide, Download and Changelog

    Requirements:

    - unlocked Bootloader
    - USB-Debugging in developer options enabled
    - latest adb and fastboot binaries
    - working adb and fastboot environment
    - magisk root
    - a backup of stock boot.img or your magisk patched boot.img in case you want to go back to stock.

    How to flash the Kernel:
    1. Download the latest kernel.zip and make sure you have properly updated to the latest matching Firmware (check the feature list for the current firmware the source is based on). When there´s an OTA update for the Sony Xperia 1 IV it takes Sony 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.
    If you want to be sure there are no issues, 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, or attached to the release posts in case AFH is wonky.

    Important: Read after Download
    Please take a look at the second post after flashing the kernel!

    Changelog:

    Android 12

    1.0.0 Initial Release

    Android 13
    1.0.0 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-87711541
    1.0.1 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-87945391
    1.0.3 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-88241223


    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:
    Sony 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_GKI_Nagara
    7
    F.A.Q:

    Question:
    Is root preserved when flashing this kernel?
    Answer: Yes, the AnyKernel.zip will detect root and keep it.

    Question: Safetynet does not pass on my phone since I unlocked the phone, why is this so?
    Answer: Google introduced hardware backed attestation recently. Unfortunately the old kernel tricks to still get safetynet passing won´t work. Instead you will have to rely on some magisk modules. Short guide in post #4 below.

    Question: How do I return back to stock or another kernel.
    Answer: Extract boot.img from the matching firmware you are on (you can do so by using this tool or similar ones found on XDA and when googling around) and flash 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.
    5
    How to pass Safetynet after unlocking the bootloader

    With the introduction of hardware backed safetynet attestation, passing safetynet has become a lot more complicated.
    Some probably remember a while ago, flashing a kernel that forced some flags was enough to pass it. However these days are gone.
    Below is a short guide how to pass safetynet on phones that are flagged to use HW attestation (such as the ROG 5).

    1. Make sure you´re running latest magisk canary.
    2. In Magisk Manager enable both zygisk and deny list.
    4. Download the latest Universal Safety Net Fix from @kdrag0n ´s github for zygisk cand flash it in Magisk Manager. Reboot.
    5. Profit
    4
    Feature Documentation:
    Here´s a brief documentation about some of the features included in the kernel that can be changed as the user desires.
    They can be accessed via either terminal, scripts or for example EXKM manager ( tools -> user settings).

    CPU-Frequency Limiting:
    Another option is CPU-Freq Limiting. You can now limit the CPU frequency to a few different levels with a sysfs interface. Original implementation is from @tbalden, I only changed it to be accessible via traditional root methods.
    Main Switch:
    sys/module/cpufreq/parameters/batterysaver
    Set this option to "1" to enable the feature

    Max-Frequency Selection (Input boosts, such as scrolling boost or app launching boosts will still apply, if touch boost restriction is not set to 1)
    sys/module/cpufreq/parameters/batterysaver_level
    Set this to "1" to restrict the max CPU-Freqs to 1,6GHZ/1,9GHZ/2,22GHZ (Little Cluster/Big Cluster/Prime Core)
    Set this to "2" to restrict the max CPU-Freqs to 1,4GHZ/1,6GHZ/1,8GHZ (Little Cluster/Big Cluster/Prime Core)
    Set this to "3" to restrict the max CPU-Freqs to 1,1GHZ/1,1GHZ/1,1GHZ (Little Cluster/Big Cluster/Prime Core)

    Touch-Boost Restriction
    sys/module/cpufreq/parameters/batterysaver_touch limiting
    Set this to "1" to restrict the powerhal from boosting over the limit defined in batterysaver_level
    Set this to "0" to allow the powerhal to boost above the values defined in batterysaver_level, but only during interaction with the Phone!

    Screenshots:
    View attachment 5309899View attachment 5309901View attachment 5309903


    This is for example very useful during gaming to prevent additional heat, if not the highest performance from the CPU is required. Check if the game is running fine on level 1 or 2, and you´ll notice much less heat. Powerdraw will be reduced as well.
    Another very useful trick while doing video calls or long extended navigation sessions with google maps to preserve battery or keep the phone from heating. Especially during summer if the ambient temperatures are high.
    This is a very easy way to preserve battery or reduce heat without toggling the battery save mode in settings as that restricts background data usage, which can lead to delayed notifications.
    3
    Update to 1.0.0_T

    Hey guys and girls,

    Here´s the next update. Android 13 dropped for the Xperia 1 IV.
    No kernel source was released yet, but thanks to this kernel being only based on the GKI part, I can update it without the source, by guessing the right GKI-base.

    All previous features are brought to the Android 13 compatible GKI release.




    More changes in the Changelog below:


    Changelog:
    - Update kernel for Android 13 firmware
    - fix wifi vulnerabilities/cves



    Download:
    Attached to this post as AFH does not let me upload at the moment




    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