FORUMS

[KERNEL][2020-03-25] CRUEL KERNEL S10/Note10 V3.2

30 posts
Thanks Meter: 33
 
Post Reply Email Thread
Announcement from evdenis: Custom kernel for Samsung S10/Note10 models
Introduction
Based on samsung sources and android common tree. Supported devices: G970F, G973F, G975F, G977B, N970F, N975F, N976B. All sources are open on GitHub.

Continuous integration with GitHub Actions set up. This means you can customize the kernel from browser and build the version suitable for you without leaving the browser (see —Āustomization section).

Features
  • Customizable build with config presets
  • Only part of samsung security features disabled (DEFEX, Process Authentification, root restrictions)
  • Switchable SELinux (by default it's locked in "always enforcing" mode in samsung sources)
  • Built-in in Magisk v20.4
  • Wireguard for VPN
  • CIFS for SMB
  • Iptables TTL and HL editing modules for bypassing tethering restrictions
  • NTFS module for OTG usb drives
  • Moro sound module
  • Boeffla WakeLock Blocker
  • sdfat driver for vfat and exfat filesystems

Build commands (configuration presets) used for V3.2 kernel:
Code:
$ ./build mkimg model=<MODEL> name=CRUEL-V3.2 +magisk +nohardening +ttl +wireguard  +cifs +sdfat +ntfs +tcp_cubic +morosound +boeffla_wl_blocker
Where model can be one of G970F, G973F, G975F, G977B, N970F, N975F, N976B.

Installation Instructions
First of all, TWRP Recovery + multidisabler should be installed in all cases. This is a preliminary step. Backup your existing kernel. You will be able to restore it in TWRP Recovery in case of any problems.
Download an *.img file and
  • With TWRP: Reboot to recovery. Install > Install Image > CruelKernel.img > BOOT.
  • With Heimdall: Reboot to Dowload mode.
    Code:
    heimdall flash --BOOT CruelKernel.img
  • With FK Kernel Manager: Flasher > Manual Flasher.

ChangeLog
  • V3 - Support for G970F, G975F, G977B, N970F, N975F, N976B models.
  • V3.1 - Boeffla wl blocker, BTB5 sources for N10 models.
  • V3.2 - Magisk update v20.4, wireguard update, sdfat for VFAT, exFAT, ntfs module, tcp cubic by default.

Downloads
OS Patch Level: 2020-03
CruelKernel-G970F-v3.2
CruelKernel-G973F-v3.2
CruelKernel-G975F-v3.2
CruelKernel-G977B-v3.2
CruelKernel-N970F-v3.2
CruelKernel-N975F-v3.2
CruelKernel-N976B-v3.2
Sources

How to customize the kernel build

It's possible to customize the kernel and build it from the browser. First of all, create and account on GitHub. Next, fork this repository. Switch to the "Actions" tab and activate GitHub Actions. At this step you've got your own copy of the sources and you can build it with GitHub Actions. You need to open github actions configuration file (.github/workflows/main.yml) and edit it from the browser. For example, to alter the kernel configuration you need to edit lines:

Code:
    - name: Kernel Configure
      run: |
        ./build config           
                model=G973F      
                name=CRUEL-V3.2  
                +magisk          
                +nohardening     
                +ttl             
                +wireguard       
                +cifs            
                +sdfat           
                +ntfs            
                +tcp_cibuc       
                +morosound       
                +boeffla_wl_blocker
First of all, you need to change G973F model to the model of your phone. Supported models: G970F, G973F, G975F, G977B, N970F, N975F, N976B.

You can change the name of the kernel by replacing name=CRUEL-V3 with, for example, name=my_own_kernel. You can remove wireguard from the kernel if you don't need it by changing "+" to "-" or by removing the "+wireguard" line and "" on the previous line. OS patch date can be changed with os_patch_level=2020-02 argument, the default current date is in build.mkbootimg.G973F file.

Available configuration presets can be found at kernel/configs folder. Only the *.conf files prefixed with "cruel" are meaningful. For example:
  • +magisk - integrates magisk into the kernel. This allows to have root without booting from recovery. Enabled by default.
  • magisk+canary - integrates canary magisk into the kernel.
  • bfq - enable bfq I/O scheduler in the kernel.
  • sched_... - enable various (conservative, ondemand, powersave, userspace, performance) CPU schedulers in the kernel.
  • ttl - adds iptables filters for altering ttl values of network packets. This helps to bypass tethering blocking in mobile networks.
  • wireguard - adds wireguard VPN module to the kernel.
  • cifs - adds CIFS (SMB) support.
  • tcp_cubic - use CUBIC as default TCP congestion control.
  • tcp_westwood - use WestWood as default TCP congestion control.
  • sdfat - use sdfat for exFAT and VFAT filesystems.
  • ntfs - enable ntfs filesystem support (read only).
  • boeffla_wl_blocker - enable boeffla wakelock blocker module.
  • morosound - enable moro sound control module.
  • +nohardening - removes Samsung kernel self-protection mechanisms. Potentially can increase the kernel performance. Enabled by default. Disable this if you want to make your system more secure.
  • nohardening2 - removes Android kernel self-protection mechanisms. Potentially can increase the kernel performance. Don't use it if you don't know what you are doing. Almost completely disables kernel self-protection. Very insecure.
  • nodebug - remove debugging information from the kernel.
  • noksm - disable Kernel Samepage Merging (KSM).
  • nomodules - disable loadable modules support.
  • noaudit - disable kernel auditing subsystem.
  • 300hz - increases kernel clock rate from 250hz to 300hz. Potentially can improve ui responsiveness.
  • 1000hz - increases kernel clock rate from 250hz to 1000hz. Potentially can improve ui responsiveness.
For example, you can alter default configuration to something like:
Code:
    - name: Kernel Configure
      run: |
        ./build config                 
                os_patch_level=2020-12 
                model=G975F            
                name=OwnKernel         
                +magisk+canary         
                +wireguard             
                +nohardening           
                +1000hz
After editing the configuration in the browser, save it and commit. Next, you need to switch to the "Actions" tab. At this step you will find that GitHub starts to build the kernel. You need to wait about 25-30 mins while github builds the kernel. If the build is successfully finished, you will find your boot.img in the Artifacts section. Download it, unzip and flash.

To keep your version of the sources in sync with main tree, please look at one of these tutorials:
Support
  1. This thread. Feature requests accepted.
  2. Telegram (testing and intermediate releases).
  3. GitHub Pull Requests if you want to contribute.

Credits
Samsung for kernel sources
Nico (@NicoMax2012) for porting moro sound module
bamsbamx for porting boeffla_wakelock_blocker
thehacker911 for general improvements and advices
geiti94 for his advices
topjohnwu for Magisk
franciscofranco for FK Kernel Manager
and testers.
I'm sorry if I missed someone, just write me and I will update the list.

XDA:DevDB Information
[KERNEL] CRUEL KERNEL S10/Note10, Kernel for the Samsung Galaxy S10

Contributors
evdenis, evdenis
Source Code: https://github.com/CruelKernel/samsung-exynos9820

Kernel Special Features:

Version Information
Status: Testing
Current Stable Version: v3.2
Stable Release Date: 2020-03-25

Created 2020-03-08
Last Updated 2020-03-25
The Following 11 Users Say Thank You to evdenis For This Useful Post: [ View ] Gift evdenis Ad-Free
8th March 2020, 09:54 AM |#2  
OP Member
Thanks Meter: 33
 
More
How to build the kernel locally on your PC
This instructions assumes you are using Linux. Install mkbootimg (AIK tool) from osm0sis, heimdall (if you want to flash the kernel automatically).

Next:
Code:
# Install prerequisites
# If you use ubuntu or ubuntu based distro then you need to install these tools:
$ sudo apt-get install build-essential libncurses-dev libtinfo5 bc bison flex libssl-dev libelf-dev
# If you use Fedora:
$ sudo dnf group install "Development Tools"
$ sudo dnf install ncurses-devel ncurses-compat-libs bc bison flex elfutils-libelf-devel openssl-devel

# Install mkbootimg
$ wget https://github.com/osm0sis/mkbootimg/archive/master.zip
$ unzip master.zip
$ cd mkbootimg-master
$ sed -i -e 's/-Werror//g' Makefile
$ make
$ sudo mv mkbootimg /usr/local/bin/mkbootimg

# Get the sources
$ git clone https://github.com/CruelKernel/samsung-exynos9820
$ cd samsung-exynos9820
# List available branches
$ git branch -a | grep remotes | grep cruel | cut -d '/' -f 3
# Switch to the branch you need
$ git checkout cruel-v3
# Install compilers
$ git submodule update --init --recursive
# Compile
$ ./build mkimg name=CustomCruel model=G973F +magisk+canary +wireguard +ttl +cifs +nohardening
# You will find your kernel in boot.img file after compilation.
$ ls -lah ./boot.img

# You can automatically flash the kernel with heimdall
# if you connect your phone to the PC and execute:
$ ./build :flash

# Or in a single command (compilation with flashing)
# ./build flash name=CustomCruel model=G973F +magisk+canary +wireguard +ttl +cifs +nohardening
The Following 3 Users Say Thank You to evdenis For This Useful Post: [ View ] Gift evdenis Ad-Free
8th March 2020, 09:54 AM |#3  
OP Member
Thanks Meter: 33
 
More
Pin problem
The problem is not in sources. It's due to os_patch_level mismatch with you current kernel (and/or twrp). CruelKernel uses common security patch date to be in sync with the official twrp and samsung firmwares. You can check the default os_patch_level in build.mkbootimg.* files. However, this date can be lower than other kernels use. When you flash a kernel with an earlier patch date on top of the previous one with a higher date, android activates rollback protection mechanism and you face the pin problem. It's impossible to use a "universal" os_patch_level because different users use different custom kernels and different firmwares. CruelKernel uses the common date by default in order to suite most of users.

How can you solve the problem? 4 ways:
  • You can restore your previous kernel and the pin problem will gone
  • You can do the full wipe during cruel kernel flashing
  • You can reboot to TWRP, navigate to data/system and delete 3 files those names starts with 'lock'. Reboot. Login, set a new pin. However, this method will not solve Samsung account activation problem
  • You can rebuild cruel kernel with os_patch_level that suites you. You need to know os_patch_level of your current level. If you use the default samsung kernel then you can check the date in "Software information" > "Android security patch level". If you use a custom kernel then you need to extract the date from it's boot.img (nemesis kernel uses "2099-12"). To extract the date you can backup the kernel and obtain boot.img. Next use, for example, AIK from osm0sis to check the date of the image. After that you need to add the line os_patch_level="<your date>" to the main.yml cruel configuration and rebuild it. See the customization section if you want to rebuild the kernel.
The Following 2 Users Say Thank You to evdenis For This Useful Post: [ View ] Gift evdenis Ad-Free
8th March 2020, 06:00 PM |#5  
Member
Thanks Meter: 28
 
More
Thanks Dev! Does this kernel work also with LineageOS and AOSP roms?
8th March 2020, 06:07 PM |#6  
hanspampel's Avatar
Senior Member
Thanks Meter: 3,052
 
Donate to Me
More
Quote:
Originally Posted by evdenis

...
After that you need to add the line os_patch_level="<your date>" to the main.yml cruel configuration and rebuild it. See the customization section if you want to rebuild the kernel.

Did you checked it if it works for you? For me the oneliner didnt work in main.yml. I must edit the build.mkbootimg.G975F file and rebuild. Then i got no pin problems cause the OPL was now changed.
9th March 2020, 05:28 PM |#7  
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by hanspampel

Did you checked it if it works for you? For me the oneliner didnt work in main.yml. I must edit the build.mkbootimg.G975F file and rebuild. Then i got no pin problems cause the OPL was now changed.

Yes, I checked that it works. Here you did't use os_patch_level setting and the date is 2020-02. Next, you updated os_patch_level and you can see the date changed if you unfold "Show information about build" section in build log. In the third commit you removed the os_patch_level and cancelled the build, so the date reverted to default one 2020-02. And in finial commit the date was changed in build.mkbootimg.G975F file. If you doubt the date changed, you can check the build settings either in "Show information about build" section in build log or in "Kernel Configuration Info" file next to the kernel image in "Artifacts". Thanks!
9th March 2020, 05:33 PM |#8  
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by Valentino911

Thanks Dev! Does this kernel work also with LineageOS and AOSP roms?

As for now, it compatible only with Samsung based firmwares. Works on native samsung firmwares, BeyondROM, on Ambasadii it's better to use Nemesis kernel (you will face pin problem if you try to install cruel). The kernel doesn't work on LOS.
The Following User Says Thank You to evdenis For This Useful Post: [ View ] Gift evdenis Ad-Free
10th March 2020, 12:40 AM |#9  
Junior Member
Flag Cairo
Thanks Meter: 1
 
More
Anybody want gcam for exynos.. u can see tgis video it for android Q one ui 2.0 for s10plus exynos
The Following User Says Thank You to Ali.M7mmoud For This Useful Post: [ View ] Gift Ali.M7mmoud Ad-Free
14th March 2020, 06:10 PM |#10  
elchinemil's Avatar
Junior Member
Baku
Thanks Meter: 1
 
More
I have a question . The hadest rum was established, respectively the hadest kernel. I install the cruel kernel, but after the reboot the kernel of the hadest returns. Why? The first time I encounter this phenomenon, How to solve the problem?
Before rebooting the cruel core, the necessary functions work. After a reboot, the hades kernel returns.
15th March 2020, 04:20 PM |#11  
hanspampel's Avatar
Senior Member
Thanks Meter: 3,052
 
Donate to Me
More
@evdenis
I got problems with your latest sources (3.0 and 3.1). It doesnt boot to recovery with an app. This works for a few commits earlier(last week or so). Now its not working. And the OSPL in main.yml doesnt work for me too. Doesnt pass the restart pin. But thats not a problem, changed it in the other side.
Cant test your compiled versions, pin problem, i was on nemesis kernel, so i have to compile it myself.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes