[KERNEL][2020-12-01] CRUEL KERNEL S10/Note10 V3.9

Search This thread

funiewski

Senior Member
Dec 18, 2010
1,227
465
Stockholm
ASUS ZenFone 8
kernel problem with camera access

@evdenis I've a problem with an app which need access to camera for qr scanning. I've nailed it down to changes that was made in your kernel between version 3.6 to 3.7. This app is working on your kernel up to 3.6, stock kernel, lineage based kernel, all of them with or without magisk. On 3.7 and 3.8 the app don't get access to camera and the phone freezes and reboots.
If you would like to look at it I would gladly provide you with logs. In that case which log do you need for investigate the problem?
 

evdenis

Senior Member
Jan 30, 2020
61
101
Hi,
@evdenis I've a problem with an app which need access to camera for qr scanning. I've nailed it down to changes that was made in your kernel between version 3.6 to 3.7. This app is working on your kernel up to 3.6, stock kernel, lineage based kernel, all of them with or without magisk. On 3.7 and 3.8 the app don't get access to camera and the phone freezes and reboots.
If you would like to look at it I would gladly provide you with logs. In that case which log do you need for investigate the problem?

I think this is because of gcc10.2 compiler that I started to use since 3.7 version. Could you try one of default/samsung/proton kernel versions https://cruelkernel.org/release/V3.9-rc1/alt/? They are built with clang. What is the app, btw?
 

funiewski

Senior Member
Dec 18, 2010
1,227
465
Stockholm
ASUS ZenFone 8
Hi,


I think this is because of gcc10.2 compiler that I started to use since 3.7 version. Could you try one of default/samsung/proton kernel versions https://cruelkernel.org/release/V3.9-rc1/alt/? They are built with clang. What is the app, btw?
The app is bankid, it's for verification during different economic transaction here in Sweden.
Which of them should I test, this CruelKernel-v3.9-rc1-proton.zip?
I've tried flash rc1.zip from github but got error 1 as far as I remember , can't harm to try another one;)

error 1 with all of them
 
Last edited:

funiewski

Senior Member
Dec 18, 2010
1,227
465
Stockholm
ASUS ZenFone 8
What is this? Camera error? Kernel logs can help. After reboot caused by camera error you need to
Code:
# With adb
$ adb shell su -c "cat /proc/last_kmsg" > kernel.log
# or with termux
$ su
$ cat /proc/last_kmsg > /sdcard/kernel.log

And send kernel.log file to me.

error 1 was in twrp when i tried to flash .zip file
After unpacking kernels - rc1 and arter - phone freezes when I try to access camera from app, proton, default and samsung img - app can access camera
kernel log later today, working and flashing at same time is a little bit troublesome
 
Last edited:

evdenis

Senior Member
Jan 30, 2020
61
101
I have this problem too....
help....pls...

There are two possible reasons for this. Either you use combo button during boot. You don't need to hold buttons during boot with this kernel. Either your rom (for example, BeyondRom) forces reboot with kernel from recovery partition. This can be changed in ROM if during installation you choose in aroma non-patched services to install.
 

otto-dev

New member
Dec 5, 2020
3
0
For some reason I don't have CIFS support with this kernel on my Galaxy S10 5G (G977B). I tried both the pre-built kernel, and I compiled it myself with +cifs using the (fantastic) Github action.

The kernel is loaded, but I can't mount samba shares using busybox mount, nor is CIFS included in the kernel configuration:

Code:
# cat /proc/version
Linux version 4.14.113-Cruel-V3.9+ ([email protected]) [...]
# zcat /proc/config.gz | grep -i CIFS  # returns nothing

Could somebody help me how I can modify the build for G977B to include CIFS, or enable CIFS some other way? Thanks!

Edit: I can see in the github logs that the +cifs configuration values appear to be overwritten, or are otherwise lost:

Code:
Value requested for CONFIG_CIFS not in final .config
Requested value:  CONFIG_CIFS=y
Actual value:
 
Last edited:

evdenis

Senior Member
Jan 30, 2020
61
101
Edit: I can see in the github logs that the +cifs configuration values appear to be overwritten, or are otherwise lost:

Code:
Value requested for CONFIG_CIFS not in final .config
Requested value:  CONFIG_CIFS=y
Actual value:

Hi, could you post the github link? This will help me to debug the problem. Thanks!
 

evdenis

Senior Member
Jan 30, 2020
61
101
Ah, I disabled CONFIG_NETWORK_FILESYSTEMS not so long ago in ./kernel/configs/cruel.conf and forgot to check that cifs may depend on it. PRs are welcome. Yes, please add it in cruel+cifs.conf Thanks!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Introduction
    Based on samsung sources and android common tree. Supported devices: G970F/N, G973F/N, G975F/N G977B/N, N970F, N975F, N971N, N976B/N. 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 v21.1
    • Various toolchains (cruel,arm,samsung,proton,arter97...) supported
    • 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
    • reiser4 filesystem added. reiser4progs (https://github.com/CruelKernel/reiser4progs/releases)
    • DEX cable vendor lock for WQHD resolution removed
    • ZIP installer with XZ compression
    • ZIP installer with automatic os_patch_level patching
    Build commands (configuration presets) used for V3.9 kernel:
    Code:
    $ ./cruelbuild pack model=<MODEL> name=CRUEL-V3.9 +magisk +nohardening +force_dex_wqhd +ttl +cifs +ntfs +sdfat +nodebug +noaudit +noksm +nomodules +wireguard +usb_serial +sched_powersave +sched_performance +morosound +boeffla_wl_blocker +fake_config +dtb
    Where model can be one of G970F/N, G973F/N, G975F/N G977B/N, N970F, N975F, N971N, N976B/N.

    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 *.zip file. Reboot to TWRP. Install > Install ZIP > Flash CruelKernel.zip. Reboot to system.

    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.
    • V3.3 - CTC9 sources. The camera will work only on CTC9 based firmwares.
    • V3.4 - CTE9/CTF1 sources. Small fixes, overall improvements, more customization configs for building on github.
    • V3.7 - Various toolchains added (arm, arter97, samsung, proton, system, default)
    • V3.8 - DTI1 sources added for N971N, N976N.
      DTH7 sources added for G977N model.
      Some debugging flags disabled. performance config fixed (-O3).
      Cruel toolchain added (gcc 10.2 with PGO/LTO and inlining params from gcc 9 branch)
      simple_lmk added (github.com/kerneltoast/simple_lmk)
    • V3.9 - G977N, G973N models added.
      G970F/N, G975F/N, G973F/N updated to DTJA.
      N976B, N970F, N975F updated to DTJ4.
      Magisk updated to v21.1 version.
      Vendor lock for dp cable for DEX removed (thanks, fart1-git).
      Zip installer implemented.
      Automted os_patch_level level patching in installer (https://github.com/CruelKernel/clone_header).

    Downloads
    OS Patch Level: 2020-11
    V3.9 Download folder
    Sources

    If you like the work and want to help me with hosting: https://www.paypal.me/evdenis Hitting star button on GitHub and thanks button on XDA really helps to stay motivated.

    Instructions here could be outdated a bit, one can find the latest version in project's readme at github.
    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.3"
                    +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/N, G973F/N, G975F/N G977B/N, N970F, N975F, N971N, N976B/N.

    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
    fart1-git for disabling DEX cable vendor lock
    corsicanu for default blocklist of wakelocks for boeffla_wl_blocker driver
    Nico (@NicoMax2012) for porting moro sound module
    bamsbamx for porting boeffla_wakelock_blocker
    thehacker911 for general improvements and advices
    ExtremeGrief for overall improvements, porting maple scheduler
    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.9
    Stable Release Date: 2020-12-01

    Created 2020-03-08
    Last Updated 2020-12-01
    9
    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? 5 ways:
    • You can restore your previous kernel and the pin problem will gone
    • You can check the os_patch_level date of your previous kernel here https://cruelkernel.org/tools/bootimg/ and patch cruel kernel image to the same date. If your previous kernel is nemesis, patch cruel to 2099-12 date.
    • You can reboot to TWRP, navigate to data/system and delete 3 files those names starts with 'lock'. Reboot. Login, set a new pin. To fix samsung account login, reinstall the app
    • You can rebuild cruel kernel with os_patch_level that suites you. To do it, you need to add the line os_patch_level="<your date>" to the main.yml cruel configuration. See the next section if you want to rebuild the kernel.
    • You can do the full wipe during cruel kernel flashing
    8
    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
    4
    Ok here it is. S10 untested, dont own it. S10+ works. Its not a flashable zip, so extract it and flash boot.img via twrp to boot slot. Or use the app "flashify" for example to flash to boot.
    3
    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.