{HELP} Building custom 5.1.1 kernel for flo - Nexus 7 (2013) Q&A

Hello everyone. I am spinning up on a project that requires a custom rom for the flo based on 5.1.1_r28, and a custom kernel as well. The rom is built and working, but currently uses the prebuilt flo kernel. When I boot the prebuilt kernel, I can check the kernel version, 7597781.
Linux version 3.4.0-g7597781 ([email protected]) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Thu Mar 12 01:10:18 UTC 2015
This corresponds to the last commit hash, so after checking out the msm kernel source, I created a branch based on that hash.
You can find my kernel source here - https://github.com/FutureHax/flo-kernel/tree/7597781, and the actual zImage file attached to the post.
After the kernel is installed however, I am unable to boot. The device doesnt even make it to the splash screen, just loops over the initial google logo before rebooting to repeat. This also means that since nothing is started, I cant get any logs from adb to see whats wrong. The kernel is just completely failing.
The resulting boot.img file sizes are slightly off as well.
Not working
Custom built kernel boot.img size = sending 'boot' (7356 KB)...
Working
Prebuilt kernel boot.img size = sending 'boot' (7358 KB)...
I was able to get my last_kmsg as well after the panic.
http://pastebin.com/YfDzNbGS

Hello, have you fixed it?
r2DoesInc said:
I was able to get my last_kmsg as well after the panic. http://pastebin.com/YfDzNbGS
Click to expand...
Click to collapse
I see a null pointer just before the ramdisk is supposed to be unpacked...
Code:
[ 0.447845] Unable to handle kernel NULL pointer dereference at virtual address 00000001
[ 0.448059] pgd = c0004000
[ 0.448181] [00000001] *pgd=00000000
Try to pack your kernel with the original/prebuilt ramdisk and see what happens.

I did in fact resolve it. I dont actually know what that issue was, but it went away to be replaced with a real error
Unable to handle kernel paging request at virtual address 32797474
Click to expand...
Click to collapse
I was then pointed to a few commits by a friend of mine and they resolved the issue!
https://review.cyanogenmod.org/#/q/...ect:CyanogenMod/android_kernel_motorola_ghost

Related

★[DISCONTINUED!][PRIMOU-KERNEL][3.0.46][BUILD•7.5]★TITANIUM KERNEL™★Speed!★

★[DISCONTINUED!][PRIMOU-KERNEL][3.0.46][BUILD•7.5]★TITANIUM KERNEL™★Speed!★
This Kernel is DISCONTINUED and is NO LONGER SUPPORTED!
**I Do not own the device**
AND
**Overclocking can harm your device!**
READ THIS FIRST-
Code:
I am not responsible for bricked devices, dead SD cards,
thermonuclear war, or you getting fired because the alarm app failed.
YOU are choosing to make these modifications,
and if you point the finger at me for messing up your device, I will laugh at you.
Don't complain if your device explodes in your hand or vanishes into thin air..
Reporting bugs without logcat is the leading cause of male impotency xD
KERNEL Now Supports CM9,CM10 and Sense!
Ok so lets get started,
Features-
CPU:
Overclock upto 2.016 GHZ
VDD Stats support! Control Voltages -- On the Fly!
Governers: Smartass2 , Lionheart, Ondemand, Performance, Conservative
I/O:
Many Improvements made to EXT4 filesystem
EXT2 & EXT3 mounted as EXT4 (Faster! & better)
Some Misc Patches to improve I/O
Simple I/O Scheduler , Noop (SIO is default)
Cleancache
NOATIME and NODIRATIME mounts set as default
Some I/O Schedulers Tweaked
Max Readahead set to 1024
VFS Cache pressure is set to 20 (Lower the better for mobile devices)
Limit default readahead size for small devices
ARM Specific modifications:
Added Optimized RWSEM ARM Algorithm
Add optimised swahb32() byteswap helper
NET Tweaks:
Stochastic Fair Blue Net Scheduler
Proportional Rate Reduction for TCP - by Google
Some TCP tweaks
CIFS & TUN (VPN) built into the Kernel
Bluetooth Fixes for CM9/CM10
Linux Memory Management:
vmstat updated to Linux Kernel 3.4.4
vmalloc updated to Linux Kernel 3.4.4
oom_kill updated to Linux Kernel 3.4.4
readahead updated to Linux Kernel 3.4.4
shmem updated to Linux Kernel 3.4.4
page_alloc updated to Linux Kernel 3.4.4
page_writeback updated to Linux Kernel 3.1.10
Some other Misc Features:
Sweep to Wake Feature.
Compiled with Linaro-4.6.2 Toolchain
XZ Kernel compression and decompression (Faster boot + better compression/decompression)
Patched up CRC32 Libraries (+Performance)
Makefile Optimizations
memcopy macros and functions
Removed old SHA1 Implementations
Used new SHA1 Implementation (Said to improve boot speed)
VM Ratios Tuned up for Best performance!
GENTLE FAIR SLEEPERS Disabled
Disabled debugging stuff and other unneeded stuff in defconfig (--size , ++speed)
Fixed Mono Stereo Output (maxwen)
Implemented Lots of other patches & cherry-picks (Some from mainline Linux Kernel)
Scroll down for changelogs and download links-
INDEX
Changelogs
Downloads
My HTC ONE V KERNEL SOURCES.
Reserved----
DOWNLOAD LINKS
-- DO NOT USE THE CM KERNEL -- ON ANY CM BUILD LATER THAN 24/10 ---
Download TITANIUM KERNEL BUILD 7.5 HOTFIX*(Extract the zip and look at the README, all Kernels are in the zip)
*********** Fixed all flashing issues *************
-----------------OLDER DOWNLOADS--------------------------- NOT RECCOMENDED
Download TITANIUM KERNEL BUILD 7.5 (Extract the zip and look at the README, all Kernels are in the zip)
Download TITANIUM KERNEL BUILD 7 (Extract the zip and look at the README, all Kernels are in the zip)
Download TITANIUM KERNEL BUILD#6 SENSE
Download TITANIUM KERNEL BUILD#6 CM10
Download TITANIUM KERNEL BUILD#5
Download TITANIUM KERNEL BUILD#4
Download TITANIUM KERNEL BUILD#3 ( 2.016Ghz Max frequency)
Download TITANIUM KERNEL BUILD#3 ( 1.5Ghz Max frequency)
Download TITANIUM KERNEL TESTKEYS 1
Download TITANIUM KERNEL TESTKEYS 1.1
Download TITANIUM KERNEL TESTKEYS 1.2
Download TITANIUM KERNEL BUILD#1
Download TITANIUM KERNEL BUILD#2
Extract the zip and flash the boot.img via fastboot.
Changelogs
Changelogs:
Changelog Testkeys 1.1
1] Added SmartassV2 Governer (Testing required)
2] Tuned CFS Parameters
3] Some minor changes in Kernel source.​
Changelog Testkeys 1.2
1] Patched to Linux Kernel 3.0.30 (Thanks to mdeejay)
2] Some mm tweaks
2] Added Cpufreq bins upto 1.9Ghz (OC is WIP)
​
Changelog BUILD•1
1] Using Tweaked SLUB Memory Allocator
2] Disabled Perflock
3] Using only EXT4 now (Disabled EXT2 and EXT3)
4] SmartassV2 and Lagfree governers!
5] Using XZ Compression (Ported for One V since XZ files were broken)
6] CIFS and TUN modules loaded on boot
​
Changelog BUILD •2
1] Added support to run init.d support on boot
2] Added support for fudgeswap. (Android Lowmemorykiller will now control SWAP)
3] ZRAM module support!
4] Removed CIFS module, unless I am told to add it back again.
5] TUN is now built into the Kernel.
6] Readahead is set as a kernel parameter , readahead size set according to disk size.
7] Used lots of Makefile Optimizations!
8] lowmemorykiller Tweaks.
9] Using memory copy macros and functions.
Lots of other changes which are too complex to explain, you can see more about it here
​
Changelog BUILD•3
1] Overclock upto 2.016Ghz (HELL YEAH! Finally!)
2] CIFS and TUN built into the Kernel
3] Added SIO IO Scheduler (Updated)
4] Smartass2 (Tuned) and LIONHEART Governer
5] A few ARM specific changes
6] Optimized CRC32 Algorith which is essential in many Kernel mechanics.
7] Optimized ARM RWSEM Algorithm
8] Small Tweak to conservative Governer
9] Tiny RCU Enabled
10] Used new Sha-1 Implementation (Cherry-picked)
11] New Writeback feature backported from 3.1
12] Many small Patches and changes which are there on my github
13] Limited boot-up speed to 1Ghz for stability purposes
​
Changelog - Build•4
1] Device will always boot at 1Ghz.
2] Patched to Linux Kernel 3.0.35
​
Changelog - Build•5
1] Patched to Linux Kernel 3.0.36
2] Enabled JRCU
3] VDD Stats support (Control Voltages!)
4] Stochastic Fair Blue Net Scheduler
5] sched: Enabled ARCH Power
6] Updated shmem -> Linux Kernel 3.4.4
Updated vmalloc -> Linux Kernel 3.4.4
Updated vmstat -> Linux Kernel 3.4.4
Updated readahead -> Linux Kernel 3.4.4
Updated oom_kill -> Linux Kernel 3.4.4
Updated lowmemorykiller -> Linux Kernel 3.4.4
Updated page_writeback -> Linux Kernel 3.1.10
Updated page_alloc -> Linux Kernel 3.4.4
Updated cleancache -> Linux Kernel 3.4.4
Updated fs/fs-writeback -> Linux Kernel 3.4.4
7] Hack for Fsync Control (Ezeekel)
8] Added improvements/tweaks to EXT4
9] Increased GPU memory Allocation
10] Proportional Rate Reduction for TCP - by Google
​
Changelog - Build•6
1] Support for CM10/Sense Ramdisks
2] Patched to Linux Kernel 3.0.44
3] There might be performance issues with CM10, because I need to make specific changes for CM10 which I will do in future.
​
Changelog - Build•7
1] Added CM9 Support ( KERNEL NOW SUPPORTS SENSE, CM9, CM10!)
2] Patched to Linux Kernel 3.0.46
3] Fixed Bluetooth issue on CM9/CM10
4] Proper PMEM Allocations on CM9/CM10
5] Kicked off RAM Console {You should get more available RAM}
6] Fix Speaker Mono Stereo bug {maxwen}
​
Changelog - Build•7.5
1] Fixed CM9 Kernel - booting issue
2] More Bluetooth Fixes (CM)
3] Added Sweep to Wake feature (maxwen) (Only for CM ROMs for now)
4] Added BT LPM driver.
5] Stability Fixes for CM9/CM10
​
FAQ-
Please read this FAQ before asking any questions-
1) I got sudden reboot , Force Close!
Recreate the problem and post a logcat or proc/last_kmesg
2) I have issues of Signal drop
Its not related to the kernel
3) Overclock:
Anything above 1.5Ghz can be dangerous and unstable, however people have reported stable 1.7-1.8Ghz config.
Nothing above 1.5Ghz is reccomended.
4) Best Governer for battery: Conservative
Best Governer for Battery + Good performance: Lionheart
Best Governer for JUICE aka Performance - Smartass2
I will not add any more governers and bloat the Kernel.
5) If you have any issues give me a logcat
6) DO NOT USE ANY init.d scripts!!!!!!
7) Can you please add X or Y feature? Depends upon what it is and how is it useful.
8) Battery issues? Make sure no app is constantly waking up the phone and preventing the phone from going into deep sleep.
Also thanks to than33 , hlavik, and stubbakat for experimentation on their phones!
Sorry for my post,i will try install
nguyenhonganh said:
Sorry for my post,i will try install
Click to expand...
Click to collapse
Use fastboot and flash zImage .
Sent from my GT-I9003 using xda premium
Where is ur sources? Please release.. do u have github?
Sent from my Sensation 4G using xda premium
xXxVenomxXx said:
Where is ur sources? Please release.. do u have github?
Sent from my Sensation 4G using xda premium
Click to expand...
Click to collapse
Github link,
https://github.com/AdiPat/HTC_OneV
No testers?
Ill test. should I flash it like
fastboot flash boot boot.img?
assuming that boot.img is your kernel
ktool is for s2 only right?
Sent from my HTC One V using Tapatalk 2
gonemad02 said:
Ill test. should I flash it like
fastboot flash boot boot.img?
assuming that boot.img is your kernel
ktool is for s2 only right?
Sent from my HTC One V using Tapatalk 2
Click to expand...
Click to collapse
Kernel is zImage .. And you can flash it via Fastboot.
fastboot boot zImage
[For testing]
fastboot flash zimage zImage
[for permanent flash]
Sent from my GT-I9003 using xda premium
C:\>fastboot flash zimage zImage
sending 'zimage' (3416 KB)...
OKAY [ 2.531s]
writing 'zimage'...
(bootloader) signature checking...
FAILED (remote: signature verify fail)
finished. total time: 2.984s
Click to expand...
Click to collapse
C:\>fastboot boot zImage
creating boot image...
creating boot image - 3502080 bytes
downloading 'boot.img'...
OKAY [ 2.531s]
booting...
FAILED (remote: reproduce boot image with on-flash ramdisk error)
finished. total time: 2.547s
Click to expand...
Click to collapse
my phone is bootloader unlocked and rooted btw.
gonemad02 said:
my phone is bootloader unlocked and rooted btw.
Click to expand...
Click to collapse
This is some issue with the flashing.. I doubt its kernel fault..
Sent from my GT-I9003 using xda premium
so what to do then?
Sent from my HTC One V using Tapatalk 2
gonemad02 said:
so what to do then?
Sent from my HTC One V using Tapatalk 2
Click to expand...
Click to collapse
Unpack boot.img, replace zimage then repack.
ckpv5 said:
Unpack boot.img, replace zimage then repack.
Click to expand...
Click to collapse
One V kernel is in zImage format, there is no boot.img
http://www.google.com/gwt/x?hl=en&u=http://www.astronyu.com/how-to-flash-an-android-zimage-kernel-with-adb-shell.html&client=ms-opera-mini-beta-android&q=How+to+flash+zImage&ei=YS2aT52aAujC2wXy3vHbDg&sa=X&ct=res&resnum=2&ved=0CA8QFjAB
Sent from my GT-I9003 using xda premium
Adi_Pat said:
One V kernel is in zImage format, there is no boot.img
http://www.google.com/gwt/x?hl=en&u...2wXy3vHbDg&sa=X&ct=res&resnum=2&ved=0CA8QFjAB
Sent from my GT-I9003 using xda premium
Click to expand...
Click to collapse
Buddy problem with kernel...same error
Code:
C:\fastboot>fastboot flash zimage zImage
sending 'zimage' (3412 KB)...
OKAY [ 2.232s]
writing 'zimage'...
(bootloader) signature checking...
FAILED (remote: signature verify fail)
finished. total time: 2.736s
C:\fastboot>fastboot boot zImage
creating boot image...
creating boot image - 3497984 bytes
downloading 'boot.img'...
OKAY [ 2.530s]
booting...
FAILED (remote: reproduce boot image with on-flash ramdisk error)
finished. total time: 2.542s
---------- Post added at 03:26 PM ---------- Previous post was at 03:24 PM ----------
ckpv5 said:
Unpack boot.img, replace zimage then repack.
Click to expand...
Click to collapse
You mean boot.img of the superuser thing(the modded one) or the one from the ruu....
Should i try flashing that??
shubhamchamaria said:
You mean boot.img of the superuser thing(the modded one) or the one from the ruu....
Should i try flashing that??
Click to expand...
Click to collapse
Either one will do but the one from RUU no ADB access. For testing purpose only should be ok.
The first kernel that I tested just to see whether it boot or not, but I never highlight any bug, so the first kernel that I tested, wifi was not working. But never try any other kernel/latest one now as am too busy with OneX.
shubhamchamaria said:
Buddy problem with kernel...same error
Code:
C:\fastboot>fastboot flash zimage zImage
sending 'zimage' (3412 KB)...
OKAY [ 2.232s]
writing 'zimage'...
(bootloader) signature checking...
FAILED (remote: signature verify fail)
finished. total time: 2.736s
C:\fastboot>fastboot boot zImage
creating boot image...
creating boot image - 3497984 bytes
downloading 'boot.img'...
OKAY [ 2.530s]
booting...
FAILED (remote: reproduce boot image with on-flash ramdisk error)
finished. total time: 2.542s
---------- Post added at 03:26 PM ---------- Previous post was at 03:24 PM ----------
You mean boot.img of the superuser thing(the modded one) or the one from the ruu....
Should i try flashing that??
Click to expand...
Click to collapse
Can someone send the boot.img ?? I asked someone to give me stock kernel he gave me zImage so I thought stock kernel is in zImage format and no ramdisk. If there is boot.img please upload it here.
EDIT: If it is boot.img and there is no seperate recovery partition , I can try building CWM also.
Sent from my GT-I9003 using xda premium
Adi_Pat said:
Can someone send the boot.img ?? I asked someone to give me stock kernel he gave me zImage so I thought stock kernel is in zImage format and no ramdisk. If there is boot.img please upload it here.
EDIT: If it is boot.img and there is no seperate recovery partition , I can try building CWM also.
Sent from my GT-I9003 using xda premium
Click to expand...
Click to collapse
Sorry for the misunderstanding the request.
Here is the latest stock boot.img that comes from OTA_PRIMO_U_ICS_40A_hTC_Asia_WWE_1.58.707.4-1.58.707.3. It has the latest kernel.
And please make it insecure boot.img so we can have adb access and help us with the recovery too
was just going to upload the boot.img
glad too see some dev on this phone

[KEXEC] [ARM64] Kexec-Hardboot Patch

Note:
Kernel Developers: I would like to ask you to merge this patch to your kernels, because it is essential part of MultiROM (MR) - it allows MR to boot any kernel without changing the boot partition. I realize that it is no small request, but the patch is not big, touches relatively stable parts of kernel and should not cause any problems outside its intended function.
The Patch:
You'll need to cherry pick a total of 5 commits (if anyone feels like squashing them to help me out, feel free to link me to it).
Cherry-pick against: http://github.com/multirom-nexus6p/android_kernel_huawei_angler.git on the branch 'mm2'.
Commit hashes in order:
2641ac7979c0b4ef7d8c33bae57404fea89ca0de
ff67f9fae243fea2b513b1721c8cff4584f229ba
58154995579253a2ee864b839aa4a9271afdb1c5
fb7e7c6212f59fce48f83235a99c244e2432b1f3
1fb02d265b4170e193018d513de11f9a47e5e775
Related defconfig options, and their explanations:
Code:
CONFIG_KEXEC=y # Enables the Kexec SysCall to allow loading the new 'secondary' kernel into memory
CONFIG_KEXEC_HARDBOOT=y # Enables the HardBoot flag, which allows 'cold-booting' a new kernel
# CONFIG_ATAGS_PROC is not set # Prevents potential atags related discrepancies, this must be either removed or commented out
CONFIG_PROC_DEVICETREE=y # Allows us to read out the kernel config, and tell that the kernel has all the necessary configs enabled (read out from /proc/config.gz)
User-space Kexec binary: here (you'll need to extract the zip, and it will be in 'multirom/kexec')
A quick guide to use Kexec: here
Authors:
- This patch was made by Mike Kasick for Samsung Epic 4G.
- Tassadar built on this patch, and partially rewrote it to support the Nexus 4, 5, and 6.
- Zhuowei Zhang rewrote the patch from scratch for arm64.
- Myself for maintaining MultiROM for the 6P, and managing the patch.
XDA:DevDB Information
[KEXEC] [ARM64] Kexec-Hardboot Patch, Kernel for the Huawei Nexus 6P
Contributors
npjohnson, 500 Internal Server Error
Kernel Special Features:
Version Information
Status: Stable
Current Stable Version: Version 1
Stable Release Date: 2016-06-11
Created 2016-06-12
Last Updated 2016-06-12
None of the above links working
The links of commits you have mentioned are not working.
shenoy13 said:
The links of commits you have mentioned are not working.
Click to expand...
Click to collapse
Been a long while, because the related MultiROM project is no longer maintained, but the links now work

Compiling kernel? Nothing will boot

Alright, so, I'm trying to compile a custom kernel with all the rooting restrictions disabled, but I can't get anything to boot.
I've used Samsung's source (N930FXXU1APGI) and TWRP's stock-6.0 branch.
When building with no modifications:
TWRP stock-6.0 boots, but panics shortly after: Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 1
Samsung's doesn't boot (stuck at bootloader splash)
Both using the same ramdisk (with verify disabled) that I'm running with the stock kernel.
Anyone got any suggestions?
Compilers tested:
Ubuntu 16.04's arm64 toolchain (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.1))
gcc-linaro-4.9-2016.02-x86_64_aarch64
Google's 4.9 (gcc version 4.9.x 20150123 (prerelease) (GCC))

[CLOSED]CRUEL KERNEL S10 V2.3

CRUEL KERNEL S10 V2.3
The development moved to this thread. From V3 kernel supports multiple devices.
Introduction
This kernel is based on BTA8 samsung sources. Only G973F device for now. It is possible to use it on BSKO, BSL4, BTA8 firmware. All sources are open on GitHub.
Continuous integration with GitHub Actions is 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
Wireguard for VPN
CIFS for SMB
Iptables TTL and HL editing modules for bypassing tethering restrictions
Build commands (configuration presets) used for V2.3 kernel:
Code:
$ ./build mkimg name=CRUEL-V2.3-BTA8 +magisk +nohardening +wireguard +ttl +cifs
$ ./build mkimg name=CRUEL-V2.3-BTA8-CANARY +magisk+canary +nohardening +wireguard +ttl +cifs
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.
Dowload an *.img file and
With TWRP: Reboot to recovery. Install > Install Image > CruelKernel.img > BOOT.
With Heimdall: Reboot to Dowload mode.
Code:
sudo heimdall flash --BOOT CruelKernel.img
With FK Kernel Manager: Flasher > Manual Flasher.
ChangeLog
V1 is based on BSKO sources and was privately used. You can find V1 by the link.
V2 is based on BTA8 sources. nohardening, nohardening2, cifs configuration presets added.
V2.1 is for internal use only (testing release) +nohardening preset activated by default
V2.2
Canary Magisk updated to 20305 version
MALI_KUTF kernel driver removed (it's required only for kernel developers)
Pin code problem fix (thanks geiti94)
+nohardening (disable samsung protections)
V2.3
Canary Magisk updated to 20306 version
Small fixes for image format
Downloads
CruelKernel-G973F-BTA8-v2.3
CruelKernel-G973F-BTA8-v2.3-CANARY
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 name=CRUEL-V2-BTA8
+magisk
+ttl
+wireguard
+cifs
You can change the name of the kernel by replacing name=CRUEL-V2-BTA8 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.
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.
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.
nohardening - removes Samsung kernel self-protection mechanisms. Potentially can increase the kernel performance. You can enable this config if you face rooting or some other kind of restrictions. Other kernels usually use settings from this config by default. It's safe to enable this config, it just makes your system less 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.
300hz - increases kernel clock rate from 250hz to 300hz. Potentially can decrease response time. Disabled by default, untested.
1000hz - increases kernel clock rate from 250hz to 1000hz. Potentially can decrease response time. Disabled by default, untested.
For example, you can alter default configuration to something like:
Code:
- name: Kernel Configure
run: |
./build config name=CruelCanary
+magisk+canary
+wireguard
+nohardening
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 (following updates), please look at this tutorial.
Support
This thread. Feature requests accepted.
Telegram (testing and intermediate releases).
GitHub Pull Requests if you want to contribute.
Credits
Samsung for kernel sources
topjohnwu for Magisk
geiti94 for showing that it's possible to built-in Magisk into the kernel. Initially I experimented with ASIG kernel, but ASIG+Magisk on ASIG firmware just stucks on boot with an SELinux initialization problem. At that time I doubted that built-in Magisk will work.
geiti94 for his help and advices
franciscofranco for FK Kernel Manager
XDA:DevDB Information
CRUEL KERNEL S10 , Kernel for the Samsung Galaxy S10
Contributors
evdenis, evdenis
Source Code: https://github.com/CruelKernel/exynos9820-beyond1lte
Kernel Special Features:
Version Information
Status: No Longer Updated
Current Stable Version: v2.3
Stable Release Date: 2020-02-12
Created 2020-02-10
Last Updated 2020-03-16
Reserved
How to build the kernel locally on your PC
This instruction assumes that you are using Linux. Install: mkbootimg, heimdall (if you want to flash the kernel with it).
Next:
Code:
$ git clone https://github.com/CruelKernel/exynos9820-beyond1lte
$ cd exynos9820-beyond1lte
# List available branches
$ git branch -a | grep remotes | grep cruel | cut -d '/' -f 3
# Switch to the branch you need
$ git checkout samsung-g973f-bta8-cruel
# Install compilers
$ git submodule update --init --recursive
# Compile (install mkbootimg first)
$ ./build mkimg name=CustomCruel +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 +magisk+canary +wireguard +ttl +cifs +nohardening
Boots phone but after entering pin goes to black screen then right back to the pin screen.g973f
gillim74 said:
Boots phone but after entering pin goes to black screen then right back to the pin screen.g973f
Click to expand...
Click to collapse
What ROM are you using? I tested it mostly on samsung BTA8 firmware.
evdenis said:
What ROM are you using? I tested it mostly on samsung BTA8 firmware.
Click to expand...
Click to collapse
Ambassadi same firmware but i think i know what it is.i never uodated the bootloader.i will try that first
gillim74 said:
Ambassadi same firmware but i think i know what it is.i never uodated the bootloader.i will try that first
Click to expand...
Click to collapse
If your phone was able to boot to pin screen, then I doubt the problem is in bootloader. Could you try V1 kernel https://github.com/CruelKernel/exynos9820-beyond1lte/releases/tag/v1.0
If it will work, then probably V2 will also work with +nohardening option. V1 compiled with this option, V2 without it. I will rebuild V2 then.
evdenis said:
If your phone was able to boot to pin screen, then I doubt the problem is in bootloader. Could you try V1 kernel https://github.com/CruelKernel/exynos9820-beyond1lte/releases/tag/v1.0
If it will work, then probably V2 will also work with +nohardening option. V1 compiled with this option, V2 without it. I will rebuild V2 then.
Click to expand...
Click to collapse
Same thing with version 1.could it be the twrp im using?
gillim74 said:
Same thing with version 1.could it be the twrp im using?
Click to expand...
Click to collapse
No, it's definitely not related to twrp. Well, I don't know what is an exact problem here, but some guys told me they were able to flash the kernel on ambassadi with data wipe or immediately after flashing the rom itself.
It would be very nice if people will just write if the kernel works or not on their roms. This will be a huge help for me.
evdenis said:
No, it's definitely not related to twrp. Well, I don't know what is an exact problem here, but some guys told me they were able to flash the kernel on ambassadi with data wipe or immediately after flashing the rom itself.
Click to expand...
Click to collapse
Data wipe or format data
gillim74 said:
Data wipe or format data
Click to expand...
Click to collapse
Data wipe should be enough. I will test compatability with Ambassadi today-tomorrow and will provide more detailed feedback. Thanks!
hello installation successfully the nikel kernel market for now
evdenis said:
Data wipe should be enough. I will test compatability with Ambassadi today-tomorrow and will provide more detailed feedback. Thanks!
Click to expand...
Click to collapse
Worked with data wipe
evdenis said:
It would be very nice if people will just write if the kernel works or not on their roms. This will be a huge help for me.
Click to expand...
Click to collapse
write me on telegram so i can say you why all get the pin code problem so you can fix it
Does this work with BSL7? Or know of kernel that will. Need my su permission to work
Paulturn84 said:
Does this work with BSL7? Or know of kernel that will. Need my su permission to work
Click to expand...
Click to collapse
Hi, no it will not work on BSL7. This kernel is for S10 (G973F) device. This device has only BSL6 firmware. BSL7 is for other devices. Try to look at nemesis kernel.
Is it possible to build magisk rooted kernel for pie (9) roms? Or it's only for Q like LOS 17?
vomad said:
Is it possible to build magisk rooted kernel for pie (9) roms? Or it's only for Q like LOS 17?
Click to expand...
Click to collapse
Download: https://cruelkernel.org/release/special/CruelKernel-G973F-ASJG-v1.1-LOS.img
This version is based on Android 9 (ASJG) sources and should work on ASIG firmwares. I've included some patches from ivanmeler LOS tree specifically for LOS. Features: Magisk v20.3, wireguard, ttl modules and cifs. Not tested
will he s10+ every be supported with this kernel?

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

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:
How can I keep my fork in sync without adding a separate remote?
How do I update a GitHub forked repository?
Support
This thread. Feature requests accepted.
Telegram (testing and intermediate releases).
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
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
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
Good job!
Thanks Dev! Does this kernel work also with LineageOS and AOSP roms?
evdenis said:
...
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.
Click to expand...
Click to collapse
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.
hanspampel said:
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.
Click to expand...
Click to collapse
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!
Valentino911 said:
Thanks Dev! Does this kernel work also with LineageOS and AOSP roms?
Click to expand...
Click to collapse
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.
Anybody want gcam for exynos.. u can see tgis video it for android Q one ui 2.0 for s10plus exynos
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.
@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.
Another problem ive saw, the device doesnt shut down. It only reboots. Compiled with 3.0 and 3.1 sources. With the older source a week ago, it works.
Edit: So tried your released v3.1 and changed the OSPL manually for PIN Fix, seems to work(recovery and shutdown). Maybe something went wrong on my side till compiling. Have no clue atm.
hanspampel said:
Another problem ive saw, the device doesnt shut down. It only reboots. Compiled with 3.0 and 3.1 sources. With the older source a week ago, it works.
Edit: So tried your released v3.1 and changed the OSPL manually for PIN Fix, seems to work(recovery and shutdown). Maybe something went wrong on my side till compiling. Have no clue atm.
Click to expand...
Click to collapse
This could be due to enabling non-default configuration presets, like +nodebug or +nohardening2.
elchinemil said:
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.
Click to expand...
Click to collapse
Hades rom uses very good kernel. Technically, I don't see any reason to change it on hades rom, unless you really want to experiment with, for example, +1000hz or +bfq scheduler.
The reason the previous kernel restores back could be again due to patch level mismatch.
I will update installation method in the next version to dynamically repack kernel during installation procedure. Hope, this will solve os_patch_level problem (pin issue) once and for all.
nice kernel
Thanks for this wonderful kernel! It is an honour for me to be able to participate in this!
G975N
Working in 975N or not
hamidru said:
Working in 975N or not
Click to expand...
Click to collapse
If it works om F/FD devices. It will work on N devices
hamidru said:
Working in 975N or not
Click to expand...
Click to collapse
If it's an exynos device ... no reason to this

Categories

Resources