I have been building my own kernels for myself for a while now. Recently, I have been implementing features in my kernel that many people will find useful. Since there is interest in my kernel, I have decided to release it for everyone to use.
I am not in any way responsible for any damage you happen to cause to your phone trying to use my kernels features (for example, overvolting). Be careful!
No Magisk: TALUs_Custom_Kernel_i9100_LOS_16_20191130_No_Magis k.imgg
Magisk Stable: TALUs_Custom_Kernel_i9100_LOS_16_20191130_Magisk_S table_v20.1_ramdisk.img Magisk version: 20.1
Magisk Canary: TALUs_Custom_Kernel_i9100_LOS_16_20191130_Magisk_C anary_v20.2-11b7076a_ramdisk.img Magisk version: 20.2-11b7076a
- Fix build warnings and remove unnecessary function argument for additional IO schedulers. Maybe improves stability of these schedulers. (Commit: 9679a484951a031be188bdd91575e17a42f562fa)
- mach-u1: actually allow minimum voltage to be set to 0.7V and maximum to 1.6V - CPU voltage control implementation has always supposed to allow undervolts to 0.7V and overvolts to 1.6V, but mach-u1 never allowed these voltages. Overvolt at your own risk! (Commit: 183f0f328e148bb396c024d1c6ffa19555463462)
- lineageos_i9100_defconfig: use generic Bluetooth stack instead of mgmt stack. Please test this Bluetooth stack to make sure it is fully working. I have currently tested file transfer and Bluetooth audio. (Commit: 9889d567274957471bf2343d2c0186fea27a701f)
- [Prebuilt images] Change LOCALVERSION to 3.0.101-lineage-g8800d0c.
- Add some commits relating to tmpfs, mm and kconfig.h. These commits were accidentally committed by @rINanDO to the lineage-16.0 branch, and then removed as they were intended for the lineage-17.0 branch. I have reverted the commits that don't work and kept the commits that do work as they fix or add things and nothing else breaks.
- Implement Intellidemand, HYPER, ZZMOOVE, NeoX, darkness and nightmare CPU governors from DorimanX from Saber/gsstudios for Nougat (https://github.com/gsstudios/Dorimanx-SG2-I9100-Kernel). All pre-existing CPU governors will work exactly the same as before. (Commit: 2a892719e0e124e2aae15c7b000b4ae10df37293)
- Implement BFQ version v7r8, SIOplus, zen and tripndroid IO schedulers. BFQ scheduler is straight from original source code in patch files with minimal modifications, zen and SIOplus schedulers come from the DorimanX kernel for Jellybean that are slightly modified to run on our kernel and tripndroid scheduler comes from the DorimanX kernel from Saber/gsstudios for Nougat also with modifications to run on our kernel. All pre-existing IO schedulers will work exactly the same as before. (Commit: 9bccb9589d353b8994c50f24de708a1d2bb99dd7)
- Remove unnecessary earlysuspend.h. Our kernel doesn't have earlysuspend, earlysuspend.h is unnecessary. (Commit: 25b2dd54676724b46aa27edab7e5e7254051ffc6)
- Fix exFAT kernel panics relating to truncating (https://github.com/TALUAtGitHub/andr...1c5b446956224f)
- Remove WiFi MAC address changing patch, not sure how it works and editing /efs/wifi/.mac.info doesn't do anything (https://github.com/TALUAtGitHub/andr...d67b1f5aa214f4)
- Remove recovery ramdisk from initramfs - the recovery ramdisk is unnecessary as we already have TWRP in the recovery partition that's loaded using IsoRec. The boot image has shrunk from around 7.8MB to around 5.3-5.6MB doing this. This will allow more features and future source updates without it exceeding the boot partition size (https://github.com/TALUAtGitHub/andr...1b733669a5515c)
Please don't use this release if you want to use exFAT! This release has an exFAT bug relating to truncating which causes kernel panics that were fixed in release 20191102.
- Initial release.
All commands mentioned here must be run as root.
standard kernel for LineageOS 16.0. ExFAT can now be used with the kernel in the ROM installation zip or Magisk images made by @rINanDO. You no longer have to use my kernel if you were only using it for native exFAT support.
exFAT support is available via a slightly modified implementation of this in-kernel, native driver: https://github.com/arter97/exfat-linux The modifications are required as the kernel we are using has many backports from newer kernels and this driver selects what code is used based on kernel version. The result is features that the kernel no longer has are selected and there are build errors. With a SD card formatted as exFAT, you can now have files that are bigger than 4GB in size and with better performance than FAT32. exFAT support was already available via a fuse implementation which is not favorable due to bad performance. Implementing the exFAT driver in-kernel means that it is used instead of the fuse implementation. NTFS support is also enabled with CONFIG_NTFS_FS=y but that may be a fuse driver.
Overclocking to 1.4GHz:
echo "1200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
CPU voltage control:
CPU voltage control is implemented in this kernel via a typical SysFS interface. You can use either a kernel manager to control CPU voltage or use an echo command in a terminal:
echo "<1.4GHz voltage> <1.3GHz voltage> <and so on....>" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo "1215 1190 1165 1115 1065 1015 965 915 915 890 890 890 865 865" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
Charging current control and slightly higher charging current by default:
Charging current control is implemented and is controllable using another typical SysFS interface. The interface can be controlled with milliamps (mA) using yet another typical SysFS interface:
echo "<AC current> <Miscellaneous current> <USB current>" > /sys/devices/virtual/misc/charge_control/charge_current
GPU clock speed and voltage control:
GPU clock speed and voltage control is implemented. This is controllable using yet another SysFS interface and is only controllable using an echo command once again.
echo "<Step0> <Step1> <Step2> <Step3" > /sys/devices/virtual/misc/gpu_<clock/voltage>_control/gpu_control
A few additional CPU governors:
To check what governors are available, run:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors neox nightmare HYPER darkness zzmoove intellidemand conservative ondemand userspace powersave pegasusq performance
echo "<governor>" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
A few additional IO schedulers:
To check available IO schedulers, run:
cat /sys/block/mmcblk0/queue/scheduler noop deadline [cfq] row sio sioplus zen bfq tripndroid
echo "<scheduler>" > /sys/block/mmcblk0/queue/scheduler
Building the kernel:
Kernel source code: https://github.com/TALUAtGitHub/andr...msung_smdk4412
To get full sources, you can use @linusdan's manifests: https://github.com/linusdan/lineage_manifests The instructions for getting sources are all there. However, before you run repo sync, you must edit <sources_root>/.repo/local_manifests/roomservice.xml from this:
<project name="rINanDO/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="lineage-16.0" /> <project name="rINanDO/android_kernel_samsung_smdk4412" path="kernel/samsung/smdk4412" remote="github" revision="lineage-16.0" />
<project name="TALUAtGitHub/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="lineage-16.0" /> <project name="TALUAtGitHub/android_kernel_samsung_smdk4412" path="kernel/samsung/smdk4412" remote="github" revision="lineage-16.0" />
. build/envsetup.sh lunch lineage_i9100-userdebug
mka adbd mka bootimage
Solve kernel localversion issues:
First of all, install the latest Magisk boot image from @rINanDO or install the boot.img from the ROM installation zip (this will be installed anyway when installing the whole ROM in TWRP). Boot your phone up and go to Settings -> About Phone -> Android version and keep the string under "Kernel version" saved somewhere or written down for later. The string looks like "3.0.101-lineage-xxxxxxx".
In the kernel source code <sources_root>/kernel/samsung/smdk4412, run:
During a kernel build, the modules are built and stored in <sources_root>/out/target/product/i9100/system/vendor/lib/modules/. You can use "adb push" to push all of the files here to /system/lib/modules/ and /system/vendor/lib/modules/ or copy them to your devices storage or SD card and copy them to those 2 locations.
Building the kernel with magisk:
If the Magisk build script fails, you must run:
rm <sources_root>/buildspec.mk* touch <sources_root>/buildspec.mk
rm buildspec.mk* rm -rf <sources_root>/out/target/product/i9100/*ramdisk* mka bootimage touch buildspec.mk
@rINanDO for LineageOS 16.0 on our phone and all of his work.
@arter97 for the exfat-linux driver.
@linusdan for LineageOS manifests.
All of the people who have worked on other custom kernels which I could use parts of for some features.
...and of course, anyone who has worked on the Linux kernel.