• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Development [KERNEL] leanKernel for Fold Z3

Search This thread

chrisaw

Senior Member
Jun 12, 2007
304
235
Description

This is the first publicly released build of leanKernel for the Samsung Galaxy Z3 Fold.

Please be aware - this kernel does *NOT* currently include any fixes for the camera issue on Z3 Fold since none are known at this time. If a fix is found and kernel changes are needed - I will include them going forward.


Download

Google Drive

Changelog

leanKernel-1

- Compiled with clang 11.x
- Embedded needed firmware in to kernel
- Spoof stock kernel defconfig to prevent "device is damaged" warning
- Built ALL modules directly in to kernel
- Added datarmnet + datarmnet-ext to enable mobile data
- Added qcacld-3.0 to enable wifi
- Disabled EDAC for battery savings
- Spoof verifiedbootstate to pass SafetyNet (will still need Universal Safetynet Fix for other reasons though)
- Disabled KNOX_NCM
- Disabled Coresight debugging
- Added Wireguard
- Enabled power efficient work queues
- Set schedutil as default CPU scheduler
- Added a bunch of TCP/IP algos and set westwood as default
- Disabled KPERFMON
- Added Boeffla Wakelock Blocker (with no defaults blocked)
- Added KCAL
- Added KLAPSE 5.0
- Added a sysfs interface for use_spi_crc and enabled by default (/sys/kernel/mmc/use_api_crc)
- Added kAdaway ad blocking and disabled by default (/sys/kernel/leankernel/use_kadaway)

Thanks

@ianmacd - countless ideas and lots of his code went in to making this kernel possible.
@Mentalmuso - provided both help and code to get mobile data working on this device.
@tbalden - implemented his kAdaway functionality and adapted it for a root-enabled environment.
whatawurst on GitHub - fixed qcacld-3.0 to enable WiFi on the ZenPhone 8 which worked for us on Fold Z3 too.

Source

The source code for leanKernel is available at:

Build Script: https://github.com/cawilliamson/android_build_q2q_kernel
Kernel Sources: https://github.com/cawilliamson/android_kernel_samsung_q2q
 
Last edited:
Not a Fold 3 owner, so sorry to intrude. I just happened to notice you were crediting StarKissed with the SafetyNet bypass code written by kerneltoast and updated by kdrag0n. I would have posted it as an issue on Github, but they're disabled.

I happened to look around when I was there and also noticed that you probably haven't disabled avb, unless it was luck or you are using code not published.

You removed "CONFIG_BUILD_ARM64_DT_OVERLAY=y" from the build command, but did not change the disabled config flag. Your dtb / dtbo changes are skipped. You also aren't copying a dtb / dtbo into the release, so the ones used by the kernel would be the stock version without the avb change.
 
  • Like
Reactions: chrisaw

chrisaw

Senior Member
Jun 12, 2007
304
235
Not a Fold 3 owner, so sorry to intrude. I just happened to notice you were crediting StarKissed with the SafetyNet bypass code written by kerneltoast and updated by kdrag0n. I would have posted it as an issue on Github, but they're disabled.

I happened to look around when I was there and also noticed that you probably haven't disabled avb, unless it was luck or you are using code not published.

You removed "CONFIG_BUILD_ARM64_DT_OVERLAY=y" from the build command, but did not change the disabled config flag. Your dtb / dtbo changes are skipped. You also aren't copying a dtb / dtbo into the release, so the ones used by the kernel would be the stock version without the avb change.
You are ALWAYS welcome here! I was actually looking at your source code the other day - was some really awesome additions - great job!

I'll amend the commit to credit the fine folks you mentioned - thanks for bringing that to my attention! I'll enable issues on GitHub too - must be a default or something that they changed.

The CONFIG_BUILD_ARM64_DT_OVERLAY flag you mentioned is actually just present in my build scripts under "KERNEL_MAKE_ENV" - I removed the build_kernel.sh script from the repo entirely.

You are, however, spot on about the fact that the avb changes wont actually happen because I'm not packing up the dtbo - thanks for that! I'll fix that in the next build! :)
 
  • Love
Reactions: twistedumbrella
You are ALWAYS welcome here! I was actually looking at your source code the other day - was some really awesome additions - great job!

I'll amend the commit to credit the fine folks you mentioned - thanks for bringing that to my attention! I'll enable issues on GitHub too - must be a default or something that they changed.

The CONFIG_BUILD_ARM64_DT_OVERLAY flag you mentioned is actually just present in my build scripts under "KERNEL_MAKE_ENV" - I removed the build_kernel.sh script from the repo entirely.

You are, however, spot on about the fact that the avb changes wont actually happen because I'm not packing up the dtbo - thanks for that! I'll fix that in the next build! :)

Thanks. I was actually looking through yours to figure out how Knox and SELinux are being handled these days. It's good to see leanKernel. That was always a personal favorite.

I am glad to hear I missed the flag, honestly. I was confused how you had built an Image-dtb without it and starting to question if I was trying to break stuff building for the Flip with it.
 
  • Love
Reactions: chrisaw

chrisaw

Senior Member
Jun 12, 2007
304
235
Thanks. I was actually looking through yours to figure out how Knox and SELinux are being handled these days. It's good to see leanKernel. That was always a personal favorite.

I am glad to hear I missed the flag, honestly. I was confused how you had built an Image-dtb without it and starting to question if I was trying to break stuff building for the Flip with it.
If you're interested in these Samsung flipping and folding devices - you should join us on Telegram: https://t.me/infinityflex :)

Topic of the week is, of course, the bootloader disabled camera on the fold z3 but we have some flip users too! I'd know - my wife is one! :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    Description

    This is the first publicly released build of leanKernel for the Samsung Galaxy Z3 Fold.

    Please be aware - this kernel does *NOT* currently include any fixes for the camera issue on Z3 Fold since none are known at this time. If a fix is found and kernel changes are needed - I will include them going forward.


    Download

    Google Drive

    Changelog

    leanKernel-1

    - Compiled with clang 11.x
    - Embedded needed firmware in to kernel
    - Spoof stock kernel defconfig to prevent "device is damaged" warning
    - Built ALL modules directly in to kernel
    - Added datarmnet + datarmnet-ext to enable mobile data
    - Added qcacld-3.0 to enable wifi
    - Disabled EDAC for battery savings
    - Spoof verifiedbootstate to pass SafetyNet (will still need Universal Safetynet Fix for other reasons though)
    - Disabled KNOX_NCM
    - Disabled Coresight debugging
    - Added Wireguard
    - Enabled power efficient work queues
    - Set schedutil as default CPU scheduler
    - Added a bunch of TCP/IP algos and set westwood as default
    - Disabled KPERFMON
    - Added Boeffla Wakelock Blocker (with no defaults blocked)
    - Added KCAL
    - Added KLAPSE 5.0
    - Added a sysfs interface for use_spi_crc and enabled by default (/sys/kernel/mmc/use_api_crc)
    - Added kAdaway ad blocking and disabled by default (/sys/kernel/leankernel/use_kadaway)

    Thanks

    @ianmacd - countless ideas and lots of his code went in to making this kernel possible.
    @Mentalmuso - provided both help and code to get mobile data working on this device.
    @tbalden - implemented his kAdaway functionality and adapted it for a root-enabled environment.
    whatawurst on GitHub - fixed qcacld-3.0 to enable WiFi on the ZenPhone 8 which worked for us on Fold Z3 too.

    Source

    The source code for leanKernel is available at:

    Build Script: https://github.com/cawilliamson/android_build_q2q_kernel
    Kernel Sources: https://github.com/cawilliamson/android_kernel_samsung_q2q
    2
    Thanks. I was actually looking through yours to figure out how Knox and SELinux are being handled these days. It's good to see leanKernel. That was always a personal favorite.

    I am glad to hear I missed the flag, honestly. I was confused how you had built an Image-dtb without it and starting to question if I was trying to break stuff building for the Flip with it.
    If you're interested in these Samsung flipping and folding devices - you should join us on Telegram: https://t.me/infinityflex :)

    Topic of the week is, of course, the bootloader disabled camera on the fold z3 but we have some flip users too! I'd know - my wife is one! :D
    1
    First Kernel out - good work!!
    1
    Not a Fold 3 owner, so sorry to intrude. I just happened to notice you were crediting StarKissed with the SafetyNet bypass code written by kerneltoast and updated by kdrag0n. I would have posted it as an issue on Github, but they're disabled.

    I happened to look around when I was there and also noticed that you probably haven't disabled avb, unless it was luck or you are using code not published.

    You removed "CONFIG_BUILD_ARM64_DT_OVERLAY=y" from the build command, but did not change the disabled config flag. Your dtb / dtbo changes are skipped. You also aren't copying a dtb / dtbo into the release, so the ones used by the kernel would be the stock version without the avb change.
    1
    Not a Fold 3 owner, so sorry to intrude. I just happened to notice you were crediting StarKissed with the SafetyNet bypass code written by kerneltoast and updated by kdrag0n. I would have posted it as an issue on Github, but they're disabled.

    I happened to look around when I was there and also noticed that you probably haven't disabled avb, unless it was luck or you are using code not published.

    You removed "CONFIG_BUILD_ARM64_DT_OVERLAY=y" from the build command, but did not change the disabled config flag. Your dtb / dtbo changes are skipped. You also aren't copying a dtb / dtbo into the release, so the ones used by the kernel would be the stock version without the avb change.
    You are ALWAYS welcome here! I was actually looking at your source code the other day - was some really awesome additions - great job!

    I'll amend the commit to credit the fine folks you mentioned - thanks for bringing that to my attention! I'll enable issues on GitHub too - must be a default or something that they changed.

    The CONFIG_BUILD_ARM64_DT_OVERLAY flag you mentioned is actually just present in my build scripts under "KERNEL_MAKE_ENV" - I removed the build_kernel.sh script from the repo entirely.

    You are, however, spot on about the fact that the avb changes wont actually happen because I'm not packing up the dtbo - thanks for that! I'll fix that in the next build! :)