Using Gentoo?? Why using gcc? Use clang compiler instead (fast and less ram-eater) - Linux

!!!! WARNING !!!!
-> This Article is for "Gentoo" or Gentoo-based linux users only..
-> Follow this article carefully otherwise u may break ur system completely, resulting in reinstallation of Gentoo
NOTE!! >>>
->This article will be updated always
-> Using clang instead of gcc isn't recommended but u can use clang if u follow this guide fully
-> Some packages fail with gcc and need clang to compile even if u don't need clang and vice versa (some packages even fail with clang)
Read Carefully -->>
Hello everyone !
First of all I apologize for any spelling mistakes made by me
This is a full guide to use clang as the default compiler for packages in ur pc with Gentoo linux installed
Make sure u read these manpages first >> make.conf , man make.conf and GCC Optimization
This articles says to use clang as the native compiler for ur system but not tells to completely replace gcc
Most of the linux distros use glibc which needs gcc and makes it impossible to use clang as the only compiler in the system i.e., u can't completely remove and replace gcc with clang
Some packages have gcc in their default config files which makes them break in using clang coz this makes the package to use clang with gcc (mixing compilers)
But..... There are still several packages which compile well with clang without any errors
Wait!! Why am I telling to use clang instead of gcc??
ans-> Clang is much faster than gcc and uses far less ram.. It has a special feature called thinlto which optimizes the package/app to provide more performance and uses much less ram than full lto or gcc lto..... gcc has no thinlto... Clang also uses lld as default linker which is much faster than gold/bfd..
For using clang we need to completely build our clang environment first and then properly setup
Below are the steps::
1) First of all, edit /etc/portage/make.conf file and set this :- USE="${USE} -clang -llvm"
2) Run "emerge -av clang llvm compiler-rt llvm-libunwind lld" to compile and install the clang toolchain with gcc first.. This isn't enough, don't use clang now in any case
3) Now make a dir named "env" in /etc/portage by running "mkdir -v /etc/portage/env"
4) Make a separate clang environment by running command "nano /etc/portage/env/compiler-clang" and add the following lines :
CC="clang"
CXX="clang++"
LD="ld.lld"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
STRIP="llvm-strip"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS} -stdlib=libstdc++"
LDFLAGS="-stdlib=libstdc++ -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,-O2 -Wl,--as-needed"
or for thinlto
CC="clang"
CXX="clang++"
LD="ld.lld"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
STRIP="llvm-strip"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
CFLAGS="-march=native -O2 -pipe -flto=thin"
CXXFLAGS="${CFLAGS} -stdlib=libstdc++ -flto=thin"
LDFLAGS="-stdlib=libstdc++ -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,-O2 -Wl,--as-needed"
5) Edit /etc/portage/make.conf and add this -> USE="${USE} clang llvm default-compiler-rt default-lld llvm-libunwind -default-libcxx" ...
Note here we have added a few changes in USE flag: removed "-" present in-front of clang and llvm and also added "default-compiler-rt default-lld llvm-libunwind -default-libcxx"
Also here we putted a "-" in front of default-libcxx to prevent clang from using libc++ by default instead of libstdc++ as libc++ and libstdc++ aren't ABI compatible
Why dont use libc++??
ans-> As I previously said, most of linux distros use glibc and for which we can't remove gcc.. before installing clang u have gentoo installed on ur system with packages installed with gcc which uses libstdc++ by default
Here if u compile some packages with libc++, then they may not work untill u rebuild all gentoo linux packages with libc++ which is a lengthy and time consuming process.. So I don't recommend to use libc++.. Only use libstdc++
Let me give an example
Suppose u compiled package A with libstdc++ .. Now u are compiling package B which needs package A as dependency to work with libc++.. U will see that the installation may fail or be sucessful.. If sucessful, the package may not work properly as libc++ and libstdc++ aren't ABI compatible...
There are only two ways to fix this type of problem,
a) Compile package B with libstdc++ EASY
b) Compile package A and its dependencies with libc++ HARD
So use libstdc++
6) We have properly set our clang environment but the clang toolchain isn't completely built yet
If the clang toolchain is not properly bootstrapped then u may get lld linker errors
So its needed to build a proper clang toolchain
Make a file/edit /etc/portage/package.env and add these lines
sys-devel/llvm compiler-clang
sys-libs/libcxx compiler-clang
sys-libs/libcxxabi compiler-clang
sys-libs/compiler-rt compiler-clang
sys-libs/compiler-rt-sanitizers compiler-clang
sys-libs/llvm-libunwind compiler-clang
sys-devel/lld compiler-clang
sys-devel/clang compiler-clang
With these lines we are forcing packages listed here to compile using the separate clang environment we created in /etc/portage/env/compiler-clang rather than using default gcc compiler set in make.conf....
This means we will now recompile the whole clang toolchain using the clang compiler itself, making a proper clang toolchain..
7) Finally rebuild the whole clang toolchain with the command "emerge clang llvm libcxx libcxxabi compiler-rt llvm-libunwind lld"
8) Make a gcc fallback environment for packages failing with clang or for those which compulsory eed gcc in /etc/portage/env/compiler-gcc by adding these lines
CC="gcc"
CXX="g++"
LD="ld.bfd"
NM="gcc-nm"
AR="gcc-ar"
RANLIB="gcc-ranlib"
STRIP="strip"
OBJCOPY="objcopy"
OBJDUMP="objdump"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-fuse-ld=bfd -Wl,-O2 -Wl,--as-needed"
9) Now edit /etc/portage/package.env and add these lines to prevent packages that compulsory need gcc from using clang
# Compulsory gcc needed
app-admin/eselect compiler-gcc
app-arch/bzip2 compiler-gcc
app-arch/gzip compiler-gcc
app-arch/xz-utils compiler-gcc
app-arch/tar compiler-gcc
app-shells/bash compiler-gcc
net-misc/rsync compiler-gcc
net-misc/wget compiler-gcc
sys-devel/autoconf compiler-gcc
sys-devel/automake compiler-gcc
sys-devel/libtool compiler-gcc
sys-apps/baselayout compiler-gcc
sys-apps/makedev compiler-gcc
sys-apps/coreutils compiler-gcc
sys-apps/diffutils compiler-gcc
sys-apps/file compiler-gcc
sys-apps/findutils compiler-gcc
sys-apps/gawk compiler-gcc
sys-apps/grep compiler-gcc
sys-apps/less compiler-gcc
sys-apps/net-tools compiler-gcc
sys-apps/portage compiler-gcc
sys-apps/sed compiler-gcc
sys-apps/shadow compiler-gcc
sys-devel/binutils compiler-gcc
sys-devel/bison compiler-gcc
sys-devel/flex compiler-gcc
sys-devel/gcc compiler-gcc
sys-devel/gettext compiler-gcc
sys-devel/gnuconfig compiler-gcc
sys-devel/make compiler-gcc
sys-devel/patch compiler-gcc
virtual/editor compiler-gcc
virtual/libc compiler-gcc
virtual/os-headers compiler-gcc
virtual/pkgconfig compiler-gcc
sys-apps/which compiler-gcc
DONE !!
Now we have a clean and proper clang environment
If u want to use clang system-wide, replace the envs like CC="" CXX="" LDFLAGS="" LD="",etc from /etc/portage/env/compiler-clang in /etc/portage/make.conf, otherwise put "package/name compiler-clang" in /etc/portage/package.env for those packages u need clang (if not using clang system-wide), e.g. dev-qt/qtwebengine compiler-clang
If u are using clang system-wide then some packages may fail to compile.. To fix this, put "package-name compiler-gcc" in /etc/portage/package.env to use the gcc fallback environment..
We are good to go now..
Enjoy Clang's fast compilation speed and less ram usage
U may ask does clang really use less ram?
ans-> Yes, when compiling qtwebengine with make -j6 using gcc, the ram usage was above 8gb
but with clang, ram usage was less than 5gb
I Hope This Guide Helps
EDIT 1: All The places where I used -march=native in CFLAGS/CXXFLAGS should be updated by urself according to ur processor specs... Please read the gcc-optimization article I pasted in the starting and put -march=specificcpu to optimize all packages according to ur processor... Also some packages don't support -march=native and need -march=specificcpu to work
EDIT 2: Using -O3 instead of -O2 in CFLAGS/CXXFLAGS isn't recommended unless u have a high end pc with atleast 16gb ram because, clang's "-O3" is an alias of "-O2 -flto" ... -flto enables full link time optimizations which will consume a lot ram during compilation.... If u still want to optimize ur applications more than "-O2", then I recommend u to use "-O2 -flto=thin" which will activate clang's thinlto instead of full lto and thinlto uses a few more ram compared to "-O2" but hugely less than full lto
EDIT 3: Some packages also fail to compile with lto .. If u face any package failure due to lto , then disable full lto or thinlto by removing "-flto=thin / -flto / -flto=full" from CFLAGS and CXXFLAGS
to be continued::::

Related

[KERNEL] marmite v10.6 final

Download latest marmite: this post
Download marmite for old versions e.g. Jellybean: version matrix
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Marmite once made me more sick than I'd ever been before or since.
But I still love it. #truefact
This kernel is based on the stock jb kernel. I have kept, added or tweaked the features I approve of:
- CFQ I/O scheduler (best performing)
- Ondemand, tweaked values
- BLN (no blinking), BLD and Fast-Charge
- more free RAM
- Bluetooth fixed and PM_FAST (keeps fast wifi even with screen off)
- Voodoo sound and colours with my settings for a stable whitepoint at all brightnesses.
- Zcache: compressed cache stored in ram, improves performance by retrieving cached pages from ram rather than flash
- MTP (explanation below the links)
- custom OC available
Voltage and OC quoted from a chip designer with 14 years industry experience: here.
What is ORD?: here.
Facebook by leap_ahead: here
What you need to know about Custom OverClocking [OC]: here.
Interesting discussion of gamma and RGB setting (voodoo): here.
My kernel doesn't wipe your cache or dalvic, so you can flash and reboot in less than a minute. Read this.
What is MTP?
Firstly, huge props to krfoy for making this work with the any-kernel script. Great work!
Microsoft's Media Transfer Protocol. It allows for dramatically faster transfers too the phone, so it is really good when you are copying over films or mp3 folders. What's really good is that you can continue to use your apps while these transfers happen. Faster? More functional? You bet! The limitations are that it is relatively unsupported on non-Windows platforms. However, you can investigate these possibilities: Ubuntu: here. --- --- Mac: here.
How to Select MTP/PTP
Go to Settings>Storage>(Hit capacitive menu button)>USB Computer Connection to select.
If your ROM doesn't have the switch there then check this tip from pigsan! or use the command line.
* * *
Big thanks: ...to the community! So many people supported my research that it's impossible to thank them all individually. Particular thanks to tchaari and Harbb. Credit goes to: _thalamus for getting me started with git, correcting my misconceptions about merging; KalimochoAz for CM; ezekeel for the incredible variety of mods; mathkid95 for ondemand tweaks; steve.garon for help with scripting; morfic for his advice and permission to use his colour settings; and supercurio for voodoo. Big thanks to krarvind for MTP, legend! Congrats to krfoy for enabling MTP via the any-kernel script. Nice work! Thanks to caliban2 for his consistent and unbiased feedback. Thanks to brainmaster, when I originally joined the forums for being so helpful. Hopefully I treat newcomers just as kindly.
Old versions: http://goo.gl/B0p8Z
TOOLCHAIN: Linaro a8 optimised by @Christopher83 here
SOURCE: http://github.com/bedalus/marmite
Download ICS version: v1.5b (For ICS 4.0.4)
NOTE: Opening AnTuTu breaks Deep Idle! If you have to use this app, disable DI until you can reboot.
Flashable Patch for BiggerMem: http://d-h.st/NSx
This kernel is based on the work of the cyanogenmod team:
Cyanogenmod base features:
- Merged to 3.0.39 from mainline.
- Voodoo sound v10
- "Biggermem" 404MB (morfic's idea if I remember right)
- BLN
- SLUB memory allocator*
- Deep Idle:- Kalim included code that limits the maximum frequency to 800MHz when DI is active. Great innovation Kalim! I have modified this code to fix the screen off frequency to 400MHz for efficiency.
Click to expand...
Click to collapse
I have enabled the things I like:
- CFQ scheduler. It's a tiny notch down from deadline in performance, but very consistent. Kalim disabled it in the nightlies where I got my base configuration, so I've brought it back.
- Deadline I/O scheduler adjusted for flash for lowest I/O latencies (thanks thalamus)
- BLX
- BLD
- Voodoo colour
- Gamma settings by morfic, thank him for giving permission
>>> Try these settings in Voodoo: raise all gamma to 20, then set RGB to 189-185-214
- SmartassV2 governor*
- Deep Idle locks to 400MHz regardless of your governor settings. This is an adaptation of kalim's code. Why? Because I proved that 400MHz is the most power saving state for Deep Idle. Excerpt from research: here.
- Removed pointless governors
- Removed noop scheduler
- Removed OC and custom voltage
- PM_FAST (fast wifi with screen off: power saving for downloading files, but slightly higher power use when idle compared to PM_MAX)
- 1.2 GHz step
- v0.6 onward have MTP working for ROMs that support it. Krarvind is the one who made this work (donate to him here), with the help of another dev, so kudos to them.
Version History
v1.5b: http://d-h.st/BhK
-Morfic's colours fixed!
-Merged to 3.0.39
-DI fixed at 400 MHz, the most power saving state, using thalamus' code, which is stable!
-ICS ONLY!!
v1.4d http://d-h.st/66r (ICS ONLY)
-stable
-probably last version I'll do for ICS
-DI fixed at 800MHz
-reorganised fixed DI code a little
-If you have no video on MIUI, check out this tip!
v1.4b http://d-h.st/l7X
-Made some code reorganisation based on thalamus suggestion
-Created a patch!
v1.4 http://d-h.st/MoU
-Made DI fix at 800 MHz using the performance governor which saves CPU cycles
v1.4_test http://d-h.st/UOt
-Possibly unstable, please try to collect last_kmsg
-Includes new 'performance DI': When Deep Idle state is called the governor switches to performance to save CPU cycles
-DI fixed at 800MHz for stability
-thalamus' DI spinlock patch
-Mathematically sensible smartassV2 tunable settings to save CPU cycles (working well)
v1.3c: http://d-h.st/HJY
-Stable
-Minor bugfix release (bugs in freq stepping that were my own faulty code merges)
-_thalmus' DI patch
-If you have no issues with 1.3b skip this, and wait for v1.4
v1.3b http://d-h.st/n55
-Frequency stepping bugfix
-Stable (I really mean it this time ) ...so I deleted the other download links, apart from the early _thalamus based one.
-Shrank the download to a normal size: I'd forgotten to remove the redundant zImage from the any-kernel script. (I don't use that since I flash a boot image).
v1.3
-thalamus' mutex to spinlock patch has been integrated. I've tested this, as I'm sure thalamus has, and DI of course still works fine, but because this is the first time anyone has touched the DI code in a few months, I think it's safer to call this a TEST release.
-I fixed the minimum fq getting stuck 200MHz issue, which was an issue actually caused by myself: when I was altering the available OC I failed to adjust all the levels correctly.
-Having trouble with 200MHz? >Read this<
All previous releases have been pulled. Use the current stable please! Remember: enjoy marmite!
Big thanks: ...to the community! So many people supported my research that it's impossible to thank them all individually. And big thanks to the developers who have selflessly helped a total noob get his kernel off the ground. Credit goes to: KalimochoAz for representing cyanogenmod in this forum and his tweaks; _thalamus for his patience and getting me started with git and modules, correcting my misconceptions about merging; ezekeel for the mods; mathkid95 for ondemand tweaks; steve.garon for help with scripting; morfic for his advice and permission to use his colour settings; and supercurio for voodoo. Big thanks to krarvind for MTP, legend!
SOURCE: http://github.com/bedalus
Note: If you want to repost this guide, feel free to download it here (text file, includes all XDA formatting.) Please give credit.
Why would you want to build a kernel yourself?
Click to expand...
Click to collapse
Have you read this: http://forum.xda-developers.com/showpost.php?p=21006133&postcount=1144
In that spirit, I'm going to attempt to write a plain-English tutorial on what to do to build this kernel. In fact, change one or two URLs, and you could build practically any kernel!
Note: I'm assuming you're on a PC here. I'm also assuming this isn't your first trip to linux-land, and you've at least used the terminal a few times before now. I'm also going to assume that even if you are a noob, you're not mentally sub-normal.
Note2: If this is your first time building a kernel, you may want to print this out, and go slowly, and if you get stuck, post about it in the thread! It will help me improve the guide.
What makes this different to other tutorials?
Click to expand...
Click to collapse
I'm a noob at building, but a professional at teaching. It's literally my job! In my noobishness, I made good records of pretty much every step, and I've got lots of time for explaining what each step actually does.
THE STEPS
Got a computer?
Click to expand...
Click to collapse
You'll need one to compile stuff. "For Gingerbread (2.3.x) and newer versions, including the master branch, a 64-bit environment is required." (source)
OK. You're probably thinking of compiling a kernel for ICS or higher right? Is your computer only 32 bit? Pull the processor off the motherboard and count the pins. Just kidding. It won't matter if it is AMD or Intel, but it needs to be a 64 bit processor. I can compile a kernel with just 2GB of RAM and my processor is approaching its 9 year. Even with this lousy set-up, compiling a whole kernel from scratch takes only five minutes.
Install Ubuntu 10.04 64-bit. (Click on this link to download the install CD.)
If you've got a spare hard drive, use the whole thing. If you're good at partitioning, you might consider putting the linux swap partition on a separate disk. You'll want it to be at least 8GB. Putting it on a separate disk will speed things up.
If you don't have a spare disk, you're going to have to resize a partition of an existing OS, to make some new space for Ubuntu. Lets say a minimum of 12GB for the OS plus 8GB for the swap. The more space you can give to the OS, the easier your life will be if you're serious about building stuff.
At the end of the installation it will ask to install a boot-loader. This should be on sda (not sda1!) but you may need to adjust your BIOS to point at the right hard-drive if you later find it doesn't boot into Ubuntu when you restart. Don't worry about Windows, Ubuntu provides a boot menu, so you have the option of booting to Windows instead.
Once Ubuntu is installed, reboot then open a terminal and sort out your credentials:
Code:
sudo passwd root
Type in the password you set during the install, then decide on a password for the root user, and enter it once, then again for confirmation. It can be the same as your user password if you like.
Do some updates (this could take a while):
Code:
sudo apt-get update && sudo apt-get dist-upgrade
When it's finally finished, you'll have to reboot, then repeat until there's no updates left.
You're ready to set up a build environment!
Click to expand...
Click to collapse
First, you need a whole bunch of packages. You could copy and paste this into your terminal:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" && sudo apt-get update && sudo apt-get install sun-java6-jdk
That's java sorted.
Next up is the dependencies for compiling stuff:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32ncurses5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libsdl-dev libesd0-dev libwxgtk2.6-dev libncurses5-dev lib32z1-dev gcc-multilib git-core && sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
Make sure ADB is initialised:
Code:
gedit /etc/udev/rules.d/51-android.rules
and copy the below into a blank text file, then edit both instances of <username> to your Ubuntu username (lower-case!) and no chevrons: ="<bedalus>" is wrong. You want ="bedalus"
Code:
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
Now save the file!
Get hold of a Cross-Compiler
Click to expand...
Click to collapse
Follow this link to Mentor Graphics Sourcery CodeBench LITE and do a free signup to get the download link. You can get hold of other ones, like Linaro or Google's own, but I'm using this as an example, because it's the one I use, and Ezekeel published some R&D here that showed there was no measurable benefit to one toolchain over another.
When you've downloaded it, you need to copy it to /opt:
Code:
cd /home/<username>/Downloads
cp arm-some-date-some-version-some-arch.tar.bz2 /opt
Note- Obviously that's not the actual name of the file! But you can see what it's really called when you download it.
Now go to /opt and unpack it:
Code:
cd /opt
tar xjf arm-some-date-some-version-some-arch.tar.bz2
So I've got all the tools. Now what?
Click to expand...
Click to collapse
So now you need to get some source code. You can use 'git clone' if you don't plan on publishing your kernel. But if you've made some modifications and want to share your end result, you need to obey the GPL terms for the linux kernel, which is Open Source, meaning that you are required to make your source available publicly.
Go to github: https://github.com/
...and sign up. It's just a free registration provided you are non-commercial. Github has some useful getting started tutorials, which I suggest you follow:
https://help.github.com/articles/set-up-git
(just follow that first page for now. I will walk you through git in a bit...)
Next, fork a repo:
Go to whichever kernel you like: https://github.com/bedalus/bedalusKERNEL
I'm using mine as an example. Look for the big 'Fork' button.
You've now got your own copy on github, and you can do whatever you like with it, without affecting the original.
However, it's no use if it exists only in the cloud. You need to get a local copy. You'll also want something called a 'remote tracking branch', which will enable you to keep up-to-date with the changes going on in the original repository that you have forked-off from.
Critical Step:
Click to expand...
Click to collapse
Shout 'fork-off!' at the top of your voice.
Uh... okay. Now, to get a local copy, and set up your remote-tracking branches, execute:
Code:
cd /home/<username>/
mkdir mykernel
...you can name your new directory whatever you want. It doesn't have to be 'mykernel', then:
Code:
git clone https://github.com/<your github username>/bedalusKERNEL.git
In the above, put your git username, and substitute bedalusKERNEL.git for whatever your fork is called. You can actually copy and paste the URL from the top of your new github repo's page if you want.
It's going to download about 800MB if I remember correctly. This will take a while, so go have some marmite on toast.
When that's done, you're ready for the remote-tracking branch:
Code:
cd bedalusKERNEL (or whatever your fork is called)
git remote add upstream https://github.com/bedalus/bedalusKERNEL.git
git fetch upstream
The 'git remote add upstream' creates a new branch called upstream, and any changes that the original developer uploads to github can be fetched to your machine with the 'git fetch upstream' command. Notice how this time, the download time is much shorter? That's because of 'delta downloads' which only downloads the differences between what you have, and what they have. (There's some technical detail here.)
Git Tip No. 1: What branches do I have?
Click to expand...
Click to collapse
You can now enter:
Code:
git branch
...to see all your branches. At this point there should be 'origin' and 'upstream'.
Git Tip No. 2: How do I change branches?
Click to expand...
Click to collapse
Changing branches (you might as well do this now just to have a little go):
Code:
git checkout upstream
That will move you onto the upstream branch, as long as you haven't made any 'uncommited' changes in origin. (More on that later.) Change back to origin with:
Code:
git checkout origin
Git Tip No. 3: How do I rename a branch?
Click to expand...
Click to collapse
You might want to rename your branches to help personalise them, just to make remembering which is which a little bit easier. To change origin to 'my_version' do this:
Code:
git branch -m origin my_version
You can change upstream to 'their_version' or something else if you want to. It won't stop anything from working.
More Git Tips later. Let's sort out a build script. If you tinker with any code, you'll inevitably break stuff, and need to fix it, and then need to try building again... So, having a build script is going to save you a lot of time, because there are several steps that can be automated.
Here's how the start of my script looks:
Code:
#!/bin/sh
cd /home/dave/mykernel
git branch
read -p "Correct branch? [Y/N]: " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo -e "\n"
exit 1
fi
This is just a little precaution that I put in to give myself the chance to abort the build before it starts if I'm on the wrong branch. If I don't hit y then the script aborts, and I can checkout the right branch, then restart the script.
Code:
echo -e "\nSTARTING...\n"
The \n prints a new line, then on that new line the message 'STARTING...' and then begins another new line. If you put \n\n you can print a blank line. The echo command is a good way of putting notices in a script so you know what stage it is at.
Code:
export PATH=$PATH:/opt/toolchain/bin/
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-none-eabi-
If you put these lines in your script, it sets 'environment variables' that tells the make program where to find the compiler, and what processor it's compiling for (ARM).
If you now save your script in the /mykernel directory you created earlier, git can keep track of it as well as the files integral to the kernel. Save it as whatever you like, e.g. "myscript.sh"
...It's important to have the .sh extension so the system knows it is a script.
To make your script executable, run:
Code:
chmod a+x myscript.sh
Before you execute the script, you need a .config file in the mykernel directory. If you've cloned my repo, you can get a working one by executing:
Code:
cp arch/arm/configs/crespo_release_defconfig ./.config
...this command will only work properly if you are in the mykernel directory when you execute it.
You can mess with this config file if you like! But it's very easy to break the kernel. However, you can always just copy the crespo_release_defconfig again.
Now, to execute the build script run:
Code:
./myscript
If you execute your script, your compiler will now build the kernel. It will take time, but even on my ten-years-old PC it takes less than ten minutes from scratch.
The compiler will spit out a lot of messages. Most of the time it's telling you that it has compiled an object (i.e. a .o file, which will all be linked up later to form the kernel) and sometimes you'll see warnings, which is the compiler telling you it thinks something might be wrong. Don't worry, most of the time the compiler is just being over-cautious.
If the compiler hits a real problem with the code, it will print an error, and tell you what file, and what line, and how far along that line it managed to get to before it didn't know what to do. I'll get back to this later. For now, let's assume everything compiled.
You'll see a message about the zImage being created. That's the kernel. You can't use it as it is, you need to put it into a boot.img so you can flash it.
I find it useful to add this command in my build-script:
Code:
ls -l /home/dave/mykernel/arch/arm/boot/zImage
ls -l means list with long format. It'll print out the entire contents of a directory with size, time, permissions, etc. if you execute it in a directory, or point it to a directory. However, in the command above, I've pointed it specifically at the zImage file, so it only prints out the details for that. This is so I can check the time. If the time is from yesterday, I can see quickly that there has been an error in the build, and the zImage is still the same one I built yesterday, or an hour ago... etc. depending on the time-stamp printed out.
If you get a 'No such file' error, it's because there is no old zImage, because you haven't ever successfully built one yet.
If you sat and watched the entire thing build, then the timestamp should show the current time, minus a few seconds.
How do I make this zImage into a CWM flashable .zip file?
Click to expand...
Click to collapse
Yay! You've built a kernel. Now you need to make everybody else flash it to their phones too
To do this you need to put it into a boot.img, and then into a .zip file.
Making the boot.img
Click to expand...
Click to collapse
Download this: http://d-h.st/wVZ (make-boot necessary files)
It's a small download. It's some very simple tools that can split an existing boot image into a ramdisk and zImage, and can also stitch them back up.
Move mkboot.zip into your mykernel folder, right click on it, and select 'Extract Here'. You can now delete mkboot.zip. There is a tool called unbootimg, that can take apart existing boot.img files, I've made things simple by including my own ramdisk, which is compatible with AOSP and CM ROMs. That file is called cyan2disk_new.cpio.gz
We now need to add some new stuff to the script to stitch our zImage and ramdisk together.
If you've not already added the ls -l command I mentioned above, also add this now. Then:
Code:
cp /home/dave/mykernel/arch/arm/boot/zImage /home/dave/mykernel/mkboot/
cd /home/dave/mykernel/mkboot
./mkbootimg --kernel zImage --ramdisk cyan2disk_new.cpio.gz --cmdline 'no_console_suspend=1 console=bull's --base 0x30000000 --pagesize 4096 -o boot.img
Remember, your username is not dave! Unless it is. Make the appropriate changes to the path.
How do I make the CWM flashable .zip file?
Click to expand...
Click to collapse
We're nearly there! This bit is relatively painless. At this point you could save and run the script to check that mkboot is working. If it has worked you can use the same ls -l trick from before, but this time target the boot.img file you just created. If the time-stamp is fresh, it means your boot.img is correct.
TIP: If you haven't switched branches, or run 'make clean', all your .o files are unchanged. The make program keeps track of changes, and only recompiles .o files when the corresponding .c file has been altered. If nothing has changed, your build script will execute very quickly!
To make a flashable .zip file, the easiest thing to do is modify an existing .zip file. You can download my kernel for simplicity, since it already has the necessary script for flashing the entire boot partition. (Most kernels here use koush's any-kernel script, which updates only the zImage and keeps the boot partition's existing ramdisk, so if you try to use another kernel .zip as a template, make sure you correct their updater-script. Using my ramdisk and kernel script will also ensure you keep MTP!)
Once you've downloaded my kernel you should extract it in your home folder, then rename the directory to something like 'myzip'
Now add these lines to your build-script:
Code:
cp /home/dave/mykernel/mkboot/boot.img /home/dave/myzip/boot.img
cp /home/dave/mykernel/drivers/scsi/scsi_wait_scan.ko /home/dave/myzip/system/modules/
"What's that second line? With the .ko file?" I hear you say. Depending on what modules you build, you'll need to copy all of them to the folder specified above. Fortunately, when the kernel finishes building, it tells you what modules have also been built. If you don't want modules in your kernel, you can remove the second line above. However, you must edit your .config file: Open it in gedit, use CTRL+F to open the find dialogue, then type "=m" Now, change every one you find into a "=y" ...so now instead of building modules, the kernel will now incorporate all that code into the zImage instead.
Finally, add this line to your build-script:
Code:
7z a -r -tzip /home/dave/mykernel.zip /home/dave/myzip/*
Run the script again. if everything has gone smoothly, then you now have a flashable .zip in your home directory!
Congratulations!
* * * * * * * * *
More git tips!
Click to expand...
Click to collapse
I've compiled a list of commands you may find handy when getting to know git.
Add a remote branch and track it
git remote add ezekeel git://github.com/Ezekeel/GLaDOS-nexus-s-ics.git
git fetch ezekeel
git checkout --track -b bln ezekeel/bln
Merge in the changes
git merge bln
Resolve conflicts
git mergetool
List local branches
git branch
List remote branches
git branch -r
Switch branch
git checkout branch_name
Rename a branch
git branch -m old_branch_name new_branch_name
View log with short sha1 hash
git log -10 --pretty=format:"%h - %ar: %s"
Restore to a particular point
(IMPORTANT! Don't do this if you've already pushed your commits to github!)
git reset --hard <sha1 hash>
Restore to your last commit
git reset --hard HEAD
Restore to one commit before your last commit:
git reset --hard HEAD^
Restore to two commits before your last commit:
git reset --hard HEAD^^ (etc.)
As long as you haven't pushed to github,
squash all your recent commits into one:
git rebase -i <sha1> ...then change push to squash (or fixup) for all except the first one
git rebase -i --abort (to abort!)
Add .file (i.e. hidden file)
git add .file (simple!)
Add all new and modified files
git add .
Deleting files
(i.e. after doing rm <files>)
git add -u (git will note which files have been deleted)
Bring files from a directory in another branch
git checkout cyanogenmod drivers/cpufreq/
Tells you what changes you've made so far
git status
Commit your changes
git commit (type in your notes about what you did, then CTRL+X then Y to save)
Sync your commits to your github repo
git push <repo_name> <branch_name>
Delete a remote branch
(WARNING: This will delete the entire branch from github
Note: You cannot do this to the default github branch, but you can change the default branch in the admin tab on the website)
git push <repo_name> :<branch to be deleted>
General tips! File management, searching... etc.
Click to expand...
Click to collapse
Find a file (useful for troubleshooting in some situations)
find /home/dave/ -name 'buildlean.sh'
(searches the home folder and subdirectories for 'buildlean.sh')
Find within any *.c file, the text "s5pv210_driver" (good for finding bits of code)
find ./ -type f -name *.c | xargs grep s5pv210_driver
Find within any file, the text "s5pv210_driver" (good for finding bits of code)
find ./ -type f | xargs grep s5pv210_driver
bedalus said:
Thalamus recently changed the way he compiles his kernel. This was his previous stable release, based on Samsung source code.
The cyann.mobi adds bln, touchwake. Features that thalamus has said are unnecessary.
Click to expand...
Click to collapse
bedalus Hello, I can add this kernel to the list I made on the kernel and rom?
Yes, but be sure to give credit to the right people.
I've decided to attempt to build my own version of thalamus' kernel with some mods.
If I'm not too retarded, hopefully i can achieve this in the next few days.
As a result of learning to manage git and c, I'll have less time for forum posts.
bedalus said:
Yes, but be sure to give credit to the right people.
I've decided to attempt to build my own version of thalamus' kernel with some mods.
If I'm not too retarded, hopefully i can achieve this in the next few days.
As a result of learning to manage git and c, I'll have less time for forum posts.
Click to expand...
Click to collapse
Looking forward to this
Sent from my Nexus S 4G using xda premium
bedalus said:
Yes, but be sure to give credit to the right people.
I've decided to attempt to build my own version of thalamus' kernel with some mods.
If I'm not too retarded, hopefully i can achieve this in the next few days.
As a result of learning to manage git and c, I'll have less time for forum posts.
Click to expand...
Click to collapse
This is good news, Dave. I've been hearing a lot of good things about the new stable release of thalamus in the thread for his kernel that I've been moderating. However, a lot of people including me will be missing BLD and BLN so it's nice to see how it would perform with these mods. With those two plus Voodoo sound that's already cooked in the last release, this may be a kernel to be reckoned with. Cheers!
Sent from my Nexus S
bedalus said:
Thalamus recently changed the way he compiles his kernel. This was his previous stable release, based on Samsung source code.
The cyann.mobi adds bln, touchwake. Features that thalamus has said are unnecessary.
Click to expand...
Click to collapse
waiting for bedalus thalamus base plus addons
an interesting benchmark would be bedalus vs thalamus
Off-Topic: I've been discussing with thalamus about the need for a dalvik wipe before flashing a kernel, and he had some pretty convincing arguments against it. You can read his statement here.
Just wanted to get your opinion on this, if you have time. Thanks, Dave.
Sent from my Nexus S
jjhrrsn said:
Looking forward to this
Sent from my Nexus S 4G using xda premium
Click to expand...
Click to collapse
+1. Me too! Would be nice to have voodoo color included.
ironia. said:
waiting for bedalus thalamus base plus addons
an interesting benchmark would be bedalus vs thalamus
Click to expand...
Click to collapse
Thalamus wins,
REMATCH!
Thalamus wins again.
Good news, BLN added. I now know what I'm doing with the code merges, so more features to come soon.
Later on I may start trying to make some original mods, but for now we'll focus on existing ones.
Thanks to thalamus for his help with some extremely noobish questions,
...thalamus' latest but with added BLN and marmite.
To Do
Get organised
Push back to github so changes can be observed
Get some sleep
bedalus said:
Thalamus wins,
REMATCH!
Thalamus wins again.
Good news, BLN added. I now know what I'm doing with the code merges, so more features to come soon.
Later on I may start trying to make some original mods, but for now we'll focus on existing ones.
Thanks to thalamus for his help with some extremely noobish questions,
Here: http://d-h.st/Df6
...thalamus' latest but with added BLN and marmite.
To Do
Get organised
Push back to github so changes can be observed
Get some sleep
Click to expand...
Click to collapse
Lol at marmite.
Sent from my Nexus S®
apatal said:
Off-Topic: I've been discussing with thalamus about the need for a dalvik wipe before flashing a kernel, and he had some pretty convincing arguments against it. You can read his statement here.
Just wanted to get your opinion on this, if you have time. Thanks, Dave.
Sent from my Nexus S
Click to expand...
Click to collapse
Yeah, i agree with thalamus. I only wipe when switching ROMs.
I modified the script so it doesn't bother wiping cache or dalvic-cache
This makes flashing much more painless.
If anyone has trouble, reboot into recovery and wipe cache.
apatal provides some handy scripts for wiping: http://forum.xda-developers.com/showthread.php?p=19746141
To be completely honest, I wouldn't have been so helpful had I known you intended to release this, specially without saying anything to me about it.
I fully accept that the GPL doesn't require permission but to ask is both the polite and respectful thing to do.
The majority of others have always when they have wanted to release my work with superficial alterations...all it takes is 'I plan on doing this, what do you think?'
I have never had any objection, but to be asked first is just common courtesy, specially when you are asking me for help! You had plenty of chance to mention it whilst I was assisting you with your queries via email.
But hey...
_thalamus said:
To be completely honest, I wouldn't have been so helpful had I known you intended to release this, specially without saying anything to me about it.
I fully accept that the GPL doesn't require permission but to ask is both the polite and respectful thing to do.
The majority of others have always when they have wanted to release my work with superficial alterations...all it takes is 'I plan on doing this, what do you think?'
I have never had any objection, but to be asked first is just common courtesy, specially when you are asking me for help! You had plenty of chance to mention it whilst I was assisting you with your queries via email.
But hey...
Click to expand...
Click to collapse
From what i see here... Give him the big daddy credits as you used his sources...
_thalamus said:
To be completely honest, I wouldn't have been so helpful had I known you intended to release this, specially without saying anything to me about it.
I fully accept that the GPL doesn't require permission but to ask is both the polite and respectful thing to do.
The majority of others have always when they have wanted to release my work with superficial alterations...all it takes is 'I plan on doing this, what do you think?'
I have never had any objection, but to be asked first is just common courtesy, specially when you are asking me for help! You had plenty of chance to mention it whilst I was assisting you with your queries via email.
But hey...
Click to expand...
Click to collapse
Sorry, links pulled.
bedalus said:
Sorry, links pulled.
Click to expand...
Click to collapse
Too bad i was diggin the marmite just now lol
Sent from my Nexus S®
I feel quite bad now. I don't know what possessed me to release without getting the okay first. Eager to show off i think.
I'll get this thread locked as a lesson to myself!
bedalus said:
I feel quite bad now. I don't know what possessed me to release without getting the okay first. Eager to show off i think.
Click to expand...
Click to collapse
We're not perfect we have our own mistakes in life
Sent from my Nexus S®
Actually thalamus is fine for me to release this! Yay. Thanks thalamus.
Links will reappear when the OP is properly organised and credited.

[DEV][KERNEL SOURCE]Patched 3.0.21 - Bootmode Aware

Hi Folks
I thought I throw this one up for good measure.
Archos Kernel 3.0.21
I've made a couple of changes which are outline in the README2 file in the repo, but a quick summary.
Patched arch/arm/mach-omap4/omap4-reboot-reason.c to enable bootmode system property setting from the kernel command line which is required by CWM-SDE
I also back-ported the arch/arm/mm/proc-v7.S from the android-omap-3.4 kernel which means the kernel can be built using the standard android aosp toolchains Although It's probably still better to use Linaro Optimized!!
github.com/trevd/android_kernel_ti_archos.git
README2
Code:
android linux kernel 3.0.21 based on original archos sources found at
http://gitorious.org/archos/archos-gpl-gen9-kernel-ics branch: linux-ics-3.0.21
Android boot mode awareness:
----------------------------
changes made to arch/arm/mach-omap2/omap4-reboot-reason.c to enable correct setting
of android system property ro.bootmode.
designed to be used in conjunction with roms created using device files locating in
https://github.com/trevd/android_device_ti_archos.git
Proc-v7.S changes
-----------------
I've backported arch/arm/mm/Proc-v7.S from the android-omap-3 kernel 3.4 branch, this
was done to allow the kernel to be built using the standard android toolchain.
Building
--------
Clone the android aosp toolchain
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
Using the Bourne Again Shell ( bash ) export an alias to make cross compiling easy
alias make-arm='<toolchain path>/arm-eabi-4.6/bin/:$PATH ARCH=arm SUBARCH=arm CROSS_COMPILE=arm-eabi- LOCALVERSION_AUTO=n make'
make-arm distclean && make-arm mrproper
make-arm ti_archos_defconfig
make-arm -j$(grep -c processor /proc/cpuinfo)
Out of tree drivers
-------------------
PowerVR Kernel Modules are not included in this release, they are available from omapzoom android aosp
repo located at git://git.omapzoom.org/device/ti/proprietary-open.git. this repo also contains the matching
userland binary blobs, versions of which exist for Gingerbread, ICS and JellyBean. See device tree documentation
for further details ( https://github.com/trevd/android_device_ti_archos.git )
Hi Trevd !
Thank you very much for your great work ! :good:
....how much I wish I could be useful ( I am currently with hands tied :laugh: - I have not my tablet ....but I'll be back as soon as I will receive my tablet from reparation centre ! )
Good luck & keep up your awesome work ! :good::good::good:
Wifi Drivers info and resources.
Hi Folks.
Along with building the PowerVR Drivers out of tree, It should be also possible to use the latest drivers for the wireless chip
This Page [ linuxwireless.org ] provides some nice documentation with the links to the repo's contain the lastest code along with what looks like some useful android related utilities

[KERNEL][4.1.2][03 Jan.] ★ LiteGX v5.8.0 ★ <><> ... DISCONTINUED !!

[KERNEL][4.1.2][03 Jan.] ★ LiteGX v5.8.0 ★ <><> ... DISCONTINUED !!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
WARNING : THIS KERNEL IS ONLY FOR ANDROID 4.1.2 (SAMSUNG) !
This is a pure LITE, STOCK WAY & STABLE kernel with MINIMAL features.
If you are looking to a kernel with less features and more close to stock, check out my StockGX kernel.
My goal is to offer a slight modification of our Samsung stock kernel's, with few features, aiming a better battery life than stock without affecting any drain.
This is a kernel "plug-and-play" or I would say more "flash-and-play". No need for tools or apps to configure the kernel. This is the way I wanted it. A bit like speedmod kernel did.
Unfortunately, I'am not a developer but just a basic person with some android/linux knowledge already.
My dream was one day to create my own kernel, and thanks to great developers that answered my many questions, this dream has been possible. I'am very happy and proud to share my first ever kernel to everybody here.
It must be only flashed over an official Samsung ROM and not AOSP/AOKP !
Feel free to include my kernel to your ROMs / Threads but please don't forget to inform/ask first via PM and credit me in your original thread.​​
★ FEATURES (up-to-date) ★ :​
Base :
Directly based on update11 source from Samsung (for clean work and stability).
Compiled with ARM EABI (v4.4.3) toolchain (with flags optimizations).
Ramdisk from XXEMD3 (for update10 ROMs compatibility without the need to change radio).
Main :
ZZMoove (v0.7d) governor (added and set as default). Many profiles included, grab them below.
ROW (v4) optimized and as only I/O scheduler.
Wolfson Boeffla Sound (v1.6.4 drivers) compatibility.
hardcore mDNIe tweaks (for better colors + sharpness fix for better readability).
Touch-to-Wake (v1.1a) (but disabled by default). Many profiles included, grab them below.
USB charging increased (to 900mA instead of 475 by default).
Allow manual brightness to 300 candela.
zRam added (but disabled by default) with LZ4 compression and 4x swaps. Many profiles included, grab them below.
init.d support.
CRT-off effect friendly (early_suspend set to 100ms).
Native ExFAT support (from official Samsung source).
xbox controller support.
Triangle Away support.
Various tweaks :
4x zRam swaps capability (instead of single one).
Optimized ARM CPU topology.
"GENTLE_FAIR_SLEEPERS" disabled.
"ARCH_POWER" enabled.
"SCHED_MC" added. Many profiles included, grab them below.
"CONFIG_SCHED_AUTOGROUP" enabled.
ROW scheduler & blk-core tweaks.
"Westwood", "HTCP" and "BIC" TCP congestion control modules added. Many profiles included, grab them below.
Enabled persistent TRIM support for all partitions.
Fully compressed libs ".ko" modules.
Automatic dalvik-cache wiping in kernel flashing procedure.
Logging and debugging tweaks :
Android logger disabled.
Kernel logger disabled.
Disabled kernel debugging : Samsung / sec_log / last_kmsg / touchscreen / modem / max77686 / sec_watchdog.
Disabled various debug in defconfig.
Features that will NEVER be included in this kernel :
Overclock / Underclock / Undervolt.
auto-root
LED control.
Charge control.
Master sequence (screen calibrated).
ABB (Adaptive Body Bias).
Any upgrade of Linux kernel 3.0.XX.
STweaks compatibility.
Dual-Boot Sammy/AOSP.
CyanogenMod compatibility.
MIUI compatibility.
etc.
★ PREREQUISITE ★ :​
Any odexed or deodexed international I9300 Samsung 4.1.2 Jelly Bean ROM.
A custom recovery (CWM recommanded) to flash the kernel.
★ FREQUENTLY ASKED QUESTIONS ★ :​
How can I customize this kernel ? :
> Mainly with ZZMoove/zRam profiles (grab them below) and with TricksterMOD / SetCPU apps.
What does the LiteGX cleaner script ? :
> It deletes all ZZMoove/zRam profiles that you flashed after this kernel. So you can go in another kernel safely. It don't removes anything else since this kernel is pure stock based and don't add any files/folders that need to be deleted after. This cleaner script will be only efficient in this situation only, it does not clean anything before coming from another kernel to mine.
Do I need to wipe cache + dalvik each time I flash a new kernel version ? :
> Nope. Moreover dalvik cache is already wiped automatically during flashing procedure.
Do I really need to flash any profiles/scripts ? :
> Definitely not. It's user choice to do it but zRam profiles for example are highly recommanded to be flashed since it adds a lot of smoothness and performance to the kernel (and on which is disabled by default).
Do I need to re-flash ZZMoove ZIP profiles each time I flash a new kernel version ? :
> Nope. It just install an init.d script, so it will be permanent until you delete files from your init.d folder or flash "Cleaner" version which will do this for you.
Do I need to remove old ZZMoove profiles manually before flashing a new profile ZIP ? :
> Nope. Each ZIP's include an automatic removal of previously used profile.
Android OS usage is very often at top of my battery stats ! :
> Try wiping cache and dalvik cache manually in your favorite CWM, then make a full charging until green led appears.
★ SOURCES ★ :​
Github >> LiteGX.
Need supports ? all kind of questions must be posted on this thread directly. Be sure to read at least completely this first post before asking any question.
If you enjoy this kernel, don't forget to rate it
stars, and clicking the 'thanks' button (right below) is always appreciated to keep this thread maintained ​
LIKE MY WORK ?
OFFER ME A
!​​
Changelog + links
★ All ZZMoove / zRam / Cleaner scripts can be found HERE ★​★ All oldest releases can be found HERE ★​
★ CHANGELOG ★ :​
03.01.2013 : v5.8.0 released.
Disabled "CONFIG_SCHED_AUTOGROUP" (useless in Android).
xbox controller now loaded as internal module (instead of external).
30.12.2013 : v5.7.0 released.
Now compiled with stock Android ARM EABI 4.4.3.
28.12.2013 : v5.6.0 released.
Touch-to-Wake is now disabled by default (for battery purpose).
Added some "Touch-to-Wake profiles" into scripts folder :
- Touch-to-Wake_disabled(stock).zip
- Touch-to-Wake_enabled_3s.zip
- Touch-to-Wake_enabled_5s.zip
- Touch-to-Wake_enabled_8s.zip
- Touch-to-Wake_enabled_10s.zip
- Touch-to-Wake_enabled_15s.zip
Updated "LiteGX-KERNEL_full_cleaner.zip" to match new Touch-to-Wake flashable ZIP's (please remove old one).
15.12.2013 : v5.5.0 released.
ramdisk : re-enabled lowmemory killer in 'init.rc'.
SCHED_MC disabled back by default (0) to avoid some people facing some lags due to agressive value (moreover, I prefer to trust ZZMoove stock behaviour).
Added some "SCHED_MC profiles" into scripts folder :
- "SCHED_MC_power_savings_0(stock).zip"
- "SCHED_MC_power_savings_1.zip"
- "SCHED_MC_power_savings_2.zip"
It will be useful for those who wants to change it without the need to use TricksterMOD (etc) anymore.
Updated "LiteGX-KERNEL_full_cleaner.zip" to match new SCHED_MC flashable ZIP's (please remove old one).
05.12.2013 : Flashable ZIP's adding.
Added some "TCP congestion profiles" into scripts folder :
- "TCP-congestion_bic.zip"
- "TCP-congestion_westwood.zip"
- "TCP-congestion_htcp.zip"
- "TCP-congestion_reno.zip"
- "TCP-congestion_cubic(stock).zip"
It will be useful for those who wants to change it without the need to use TricksterMOD (etc) anymore.
Updated "LiteGX-KERNEL_full_cleaner.zip" to match new TCP flashable ZIP's (please remove old one).
02.12.2013 : v5.4.0 released.
zRam is disabled as default again (this time for ever), for battery purpose at the cost of a bit less multitasking (if you want it again : just flash any zRam script).
"GENTLE_FAIR_SLEEPERS" disabled (back), should improve UI responsiveness.
Updated "zRam_disabled.zip" to match new zRam disabling as default (please delete old one).
28.11.2013 : v5.3.0 released.
zRam is now initialized by default once flashing the kernel with 600MB disksize and 100% swapiness. If you feel some lags, try different values with scripts (hope it will help people finding this kernel more smooth than default without it).
All zRam scripts has been reworked and updated (please delete olders and download latest ones). If you want to turn off zRam, this time you'll have to flash "zRam_disabled.zip" file.
zRam initialization is now using a custom busybox binary directly integrated in the kernel, it will avoid some people not having their zRam properly working due to some roms busybox which cannot execute 'swapon' shell command and with priorities.
- A little reminder : to check if your zRam is working, no more need to install Turbo zRam app, on a Terminal, write : "free" (if you see swap values, then zRam is working) or "cat /proc/swaps" (which will give you more informations on both 4 swap partitions).
- I would like to thanks personally my friend @Yank555 to help finding some zRam initialization problems.
Clic below to see older changelog ..
21.11.2013 : v5.2.0 released.
ramdisk : 'root helper' is back (same as v4.6.1).
Add several TCP congestion control modules :
- Westwood
- BIC
- HTCP
'cubic' TCP congestion will stay as default like stock. You can set your favorite congestion module via TricksterMOD app.
19.11.2013 : v5.1.0 released.
Enabled back: Persistent TRIM support for all partitions.
Enabled back: USB charging increased (to 900mA instead of 475 by default).
18.11.2013 : v5.0.0 released.
Total redesign again from Samsung update11 source.
Removed a LOT of tweaks (back to 'stock way' for real), battery life should be much better than before.
List of removed tweaks :
- Removed: NTFS support.
- Removed: CIFS support.
- Removed: NFS support.
- Removed: Reduced WiFi wakelock.
- Removed: Reduced battery-monitor wakelock timeouts.
- Removed: Proportional Rate Reduction for TCP.
- Removed: Network speed tweak.
- Removed: Decreased touch boost frequency (from 800 to 600Mhz).
- Removed: MMC : Fix the workqueue overload battery waste.
- Removed: MMC : Increased timeout limits for bad sdcards.
- Removed: Doubled min-max readahead.
- Removed: ipv4: save CPU cycles from "check_leaf()" (backport from Linux 3.8).
- Removed: Intelli memory writeback (0 when screen ON & 500ms when screen off).
- Removed: Higher random entropy.
- Removed: Enabled persistent TRIM support for all partitions.
- Removed: Dynamic FSync control (v1.2).
- Removed: Dynamic Screen Frequency Scaling capability (for ZZMoove governor).
- Removed: "GENTLE_FAIR_SLEEPERS" disabled.
- Removed: USB charging increased (to 900mA instead of 475 by default).
- Removed: "cpu_load_slope" correctly set.
- Removed: bcmdhd : Disabled multicast on suspend.
- Removed: AIO enabled (backport of Linux 3.6.x) and tweaked.
Some optimizations into litegx_defconfig.
Overall kernel size is now slightly lighter (again) than previous version.
17.11.2013 : v4.6.2 released.
ramdisk : Fixed zRam which was enabled at boot by default.
ramdisk : Modified 'root helper tweaks' (again) to remove many useless lines, which finally now finally looks like more as an 'init.d helper'.
ramdisk : Many useless files in 'sbin' folder has been removed to let only needed ones for 'root helper tweaks'.
Overall kernel size is now slightly lighter than before.
14.11.2013 : v4.6.1 released.
ramdisk : included 'root helper tweaks' from adam kernel but modified to fit the needs of LiteGX kernel only (removed build.prop and pegasusq governor tweaks).
10.11.2013 : v4.6.0 released.
Updated compilation toolchain Linaro GCC from 13.09 to 13.10 (20131014).
05.11.2013 : v4.5.6 released.
AIO enabled.
Backport AIO from Linux 3.6.x.
AIO tweak : Don't plug the I/O queue in do_io_submit().
03.11.2013 : v4.5.5 released.
Enabled "ARCH_POWER" to use 'arm_cpu_topology' power management features.
litegx_defconfig : Added "CONFIG_TOUCH_WAKE".
28.10.2013 : v4.5.4 released.
Disabled "GENTLE_FAIR_SLEEPERS" (should improve UI responsiveness).
27.10.2013 : v4.5.3 released.
"sched_mc_power_savings" set to aggressive value (2) by default.
17.10.2013 : v4.5.2 released.
Decreased touch boost frequency from 1000 to 600Mhz (should slightly decrease smoothness, but be a bit more battery friendly).
15.10.2013 : v4.5.1 released.
Increased touch boost frequency from 800 to 1000Mhz (should boost smoothness a bit without affecting much battery).
09.10.2013 : v4.5.0 released.
Kernel logging (linux printk) disabled (credits to @Lord Boeffla).
litegx_defconfig : disabled some more debug.
05.10.2013 : ZZMoove profiles updated.
All ZZMoove profiles updated to latest revision (thanks to @Yank555).
Removed "ZZMoove_LCDFreq_optimizations_removal.zip" and included it directly in "ZZMoove_Profiles_Cleaner.zip" instead.
Changed priorities into scripts for init.d : "S98" for every ZZMoove profiles and "S99" for LCDFreq optimizations, to override ones already included in S98 profiles.
Modified "LiteGX-KERNEL_full_cleaner.zip" to proper remove new "S98" profiles.
01.10.2013 : v4.4.4 released.
zRam is now disabled by default (to stay as stock as possible).
zRam : set default to 4 devices instead of 1 (resulting Turbo zRam app compatibility from @rlorange).
Removed all zRam scripts to create some new with 4x zRam swaps instead of single ones. Should be MUCH smoother than single zRam (not a single lag detected after hard use of few hours). As always, you can flash new zRam scripts without the need to delete anything from init.d, since it will do it automatically.
Please remember that all my provided scripts are NOT necessary. They are just here for confirmed people or those who wants to increase smoothness or battery life a bit. Stock flashing will always provide best balance. Don't worry, this kernel will always stays like I wanted to do it : a "flash-and-play" one firstly.
29.09.2013 : v4.4.3 released.
Changed default zRam swappiness value from 90% to 80%.
Restored Boeffla Sound v1.6.4 original work with saturation prevention, since it was useless to remove it (just select "Over-saturation Supress" in "Graphical Equalizer" in Boeffla Sound app).
29.09.2013 : v4.4.2 released.
Changed default zRam disksize and swappiness values from 200MB / 10% to 600MB / 90% (thanks to @Yank555 for the tips).
Added 3 new zRam scripts with 90% swappiness.
29.09.2013 : v4.4.1 released.
Updated compilation toolchain Linaro GCC from 13.08 to 13.09 (20130903).
27.09.2013 : some changement about scripts.
All "ZZMoove profiles" has been removed from post #1. You can grab now them directly at top of post #2.
Added several zRam profiles (300/600/800 MB disksize, and 80/100% swappiness) scripts.
Added a full cleaner ZIP for those who want to remove cleanly everything from this kernel and want to migrate to another one.
27.09.2013 : v4.4.0 released.
Introducing zRam (with stock values for the moment). Should increase performance. Use zRam & Swap Control (made by @rlorange) to set your values and make init.d scripts like you want; or directly use my scripts HERE.
zRam : added LZ4 compression and using it as default.
Activated native ExFAT support.
Now using "make mrproper" (instead of "make clean") to stay with local number #1 (thanks @googy_anas for the tips).
22.09.2013 : v4.3.5 released.
ipv4: save CPU cycles from "check_leaf()" (backport from linux 3.8) (thx @googy_anas).
22.09.2013 : v4.3.4 released.
Fixed Boeffla Sound saturation prevention which wasn't removed since v4.0.0 (sorry about this, just saw it).
21.09.2013 : v4.3.3 released.
Hotfix from v4.3.2 : added spica1234's missing line tweak about "persistent TRIM support".
21.09.2013 : v4.3.2 released.
Enabled persistent TRIM support for all partitions (credits to @spica1234).
Added automatic dalvik-cache wiping in kernel flashing procedure.
20.09.2013 : v4.3.1 released.
Updated "Touch-to-Wake" from 1.1 to v1.1a again.
18.09.2013 : v4.3.0 released.
Updated "Dynamic FSync control" from v1.1 to v1.2 again.
NTFS support.
NFS support again.
CIFS support again.
sched: LOAD_FREQ tweak (this time definitely) removed.
18.09.2013 : v4.2.0 released.
Fixed "Dynamic FSync control" which was not working ("dyn_sync_cntrl.c" file was missing).
CONFIG_SCHED_AUTOGROUP enabled again (smoothness should be back).
Added again : Intelli memory writeback (0 when screen ON & 500ms when screen off).
Added again : sched: LOAD_FREQ (4*HZ+122) avoids loadavg Moire.
Touch-to-Wake back from v1.1a to v1.1 for the moment.
15.09.2013 : v4.1.0 released.
Updated compilation toolchain to Linaro GCC 4.7 from 20130626 to 20130812.
USB charging increased back to 900mA (instead of 475 by default).
15.09.2013 : v4.0.0 released.
Total beginning from zero (clean update11 sources) again.
"Android OS" battery drain on top is now gone.
Kernel is now cleaner than before : almost everything has been made using git patches, and minimally manually.
Litest release ever (5,42 MB), smoothest and best battery friendly release ever too.
Releases will now be "x.x.x" (latest number for minor fixes/tweaks, the middle one for good ones, and the first one for major ones).
Removed a lot of tweaks since v3.6, which was useless or that I don't want to include anymore to stay as close as possible from stock. I prefered to let only important and relevant tweaks for now.
List of modified features :
CIFS / NFS support removed.
Intelli memory writeback removed.
AIO tweak: No plug I/O queue in "do_io_submit()" removed.
CONFIG_SCHED_AUTOGROUP is now disabled.
sched: LOAD_FREQ (4*HZ+122) avoids loadavg Moire removed.
Reverted USB charging from 900mA back to 475mA default value.
Reverted "Dynamic FSync control" from v1.2 to v1.1 from AndiP.
List of added feature :
ARM CPU Topology : many patches has been included about optimizations/fixes.
Thanks & greetings
★ THANKS & GREETINGS ★ :​
XDA board and community
Google
Samsung
CyanogenMod Team
gokhanmoral
Andreilux
wanam
spica1234
ZaneZam
Yank555
googy_anas
hardcore
AndiP
DONATIONS
★ DONATIONS ★ :​
Many thanks to @fuxmen ! :good:
Many thanks to @colingpt ! :good:
Thank you to support my work !
Thanks bro tested ( Pardus HD Rom MG6 v18 )
downloading and nandorid backing up
does the setting Stweak compatible ?
qtwrk said:
does the setting Stweak compatible ?
Click to expand...
Click to collapse
Sorry, no STweaks support for the moment, but planning to do it. Need to learn how to add the compatibility. Stay tuned.
Envoyé depuis un téléphone qui pique les yeux.
Great work. The S3 community is getting richer with you aboard congratulations!
UPDATE
UPDATE :​
16.08.2013 : v1.1 released.
ramdisk from XXEMF6.
Note : If you have a message before reboot in your recovery asking you to disable stock recovery flash, click yes to keep your custom recovery. I guess it's due to XXEMF6 ramdisk on which included a stock recovery flashing procedure with.
googy_anas said:
Great work. The S3 community is getting richer with you aboard congratulations!
Click to expand...
Click to collapse
Thank you mate, XDA is proud to have such great devs like you, and sharing to us kernels of your quality is such a chance that only a few people will understand this on this board :good:
My goal is to stay as stock as possible, so.. sorry but no competition with mine ! :laugh:
Cheers from France
UPDATE
UPDATE :​
18.08.2013 : v1.2 released.
Linux kernel branch from 3.0.91 (kernel.org).
Enjoy :good:
This kernel is amazing
I flashed it.
Will be kernel compiled with Linaro Toolchain?
Assa551N said:
This kernel is amazing
I flashed it.
Will be kernel compiled with Linaro Toolchain?
Click to expand...
Click to collapse
Glad you like it
Yeah, I will compile it using linaro toolchain soon (already tried but had some errors when compiling resulting an abort. Need to learn a bit more flags configuration for compiling, hehe) :good:
Stay tuned!
Androidgx nice work.
For linaro 4.6 and above you will require this patch https://github.com/AndreiLux/Perseus-S3/commit/71f536fb9957c64cc6274221faa056694e010616
After this you're good to go with Linaro toolchain
Sent from my GT-I9300 using xda app-developers app
spica1234 said:
Androidgx nice work.
For linaro 4.6 and above you will require this patch https://github.com/AndreiLux/Perseus-S3/commit/71f536fb9957c64cc6274221faa056694e010616
After this you're good to go with Linaro toolchain
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
Thanks mate :good:
You write at the good moment, was currently trying to compile and learning how to compile right without errors using linaro gcc 4.7
I stay you tuned!
Androidgx,
This is the simple fsync which I wrote in 2012 which turns fsync on untill phone is booted and later after ,it"s booted it turns off fsync.
Plus the code has been optimized with branch prediction feature of cortexa-9 cpu by gcc accembly code and it does use cortex-a9 's preload engine (prefetch) to keep fsync state in L2 cache. Plus by branch prediction there is a less cpu overhead checking about whether fsync is on or off. It assumes fsync is off and with probable branch prediction it executes faster.
Below is the fsync as a patch which I wrote in mid 2012 for my older phone. You can use it .The basic fsync functional code is based on alrahi's code.
Simple Fsunc patch is here: http://db.tt/rdikFoKY
Sent from my GT-I9300 using xda app-developers app
AndroidGX said:
Thanks mate :good:
You write at the good moment, was currently trying to compile and learning how to compile right without errors using linaro gcc 4.7
I stay you tuned!
Click to expand...
Click to collapse
Linaro 4.8 is out. Try it as well
Sent from my GT-I9300 using xda app-developers app
spica1234 said:
Androidgx,
This is the simple fsync which I wrote in 2012 which turns fsync on untill phone is booted and later after ,it"s booted it turns off fsync.
Plus the code has been optimized with branch prediction feature of cortexa-9 cpu by gcc accembly code and it does use cortex-a9 's preload engine (prefetch) to keep fsync state in L2 cache. Plus by branch prediction there is a less cpu overhead checking about whether fsync is on or off. It assumes fsync is off and with probable branch prediction it executes faster.
Below is the fsync as a patch which I wrote in mid 2012 for my older phone. You can use it .The basic fsync functional code is based on alrahi's code.
Simple Fsunc patch is here: http://db.tt/rdikFoKY
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
Thank tou very much mate, will try it tomorrow :good:
Just tried compiling with your link "Toolchain fixes regarding smc architecture extensions", and managed to almost compile the kernel without "-Werror" flag removed.
Here is where it stops :
Code:
CC drivers/video/samsung/mdnie_tunning.o
CC drivers/video/samsung/s3cfb_s6e8aa0.o
CC drivers/video/samsung/smart_dimming.o
CC drivers/video/samsung/s5p_dsim_lowlevel.o
CC drivers/video/samsung/s5p-dsim.o
LD drivers/video/samsung/built-in.o
CC drivers/video/samsung_extdisp/s3cfb_extdsp_main.o
CC drivers/video/samsung_extdisp/s3cfb_extdsp_ops.o
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_check_var':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:181:30: error: called from here
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_set_par':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:197:30: error: called from here
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_open':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:315:30: error: called from here
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_release':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:345:30: error: called from here
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_blank':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:387:30: error: called from here
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_pan_display':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:468:30: error: called from here
In file included from drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:32:0:
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c: In function 's3cfb_extdsp_ioctl':
drivers/video/samsung_extdisp/s3cfb_extdsp.h:154:43: error: inlining failed in call to always_inline 'get_extdsp_global': function body not available
drivers/video/samsung_extdisp/s3cfb_extdsp_ops.c:491:30: error: called from here
make[3]: *** [drivers/video/samsung_extdisp/s3cfb_extdsp_ops.o] Erreur 1
make[2]: *** [drivers/video/samsung_extdisp] Erreur 2
make[1]: *** [drivers/video] Erreur 2
make: *** [drivers] Erreur 2
[B][email protected] ~/projects/kernels/LiteGX $ [/B]
Any idea ?
Maybe another flag need to be removed ?
Androidgx,
Seems like this will solve it.
Open file drivers/video/samsung_extdisp/s3cfb_extdsp.h
Now goto line 154 and remove the word "inline" before struct declaration or add "static" before inline. Save file and try to compile back
Sent from my GT-I9300 using xda app-developers app
spica1234 said:
Androidgx,
Seems like this will solve it.
Open file drivers/video/samsung_extdisp/s3cfb_extdsp.h
Now goto line 154 and remove the word "inline" before struct declaration or add "static" before inline. Save file and try to compile back
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
Thank you mate it worked almost perfectly after. Just faced the same problem as THIS guy before finishing compiling, followed exactly what he said (replacing the Makefile completely, and it worked, finally :laugh. I just hope it was the right way to do.
Currenty testing my fresh new kernel with linaro 4.7.4 gcc toolchain thanks to you.
Btw, about your fsync tips patch you send me, I have very poor knowledge, is this something really noticable in term of difference as stock ? I mean a good improvement over ?
Many thanks for your explanations :good:
does this kernel supports exfat sd cards ???

[KERNEL] [OREO] [G960F/G965F] [2019-11-16] APGK 1.0.56 [Linux 4.9.202] [BSA1]

APGK - A Pretty Good Kernel
"Another kernel for the S9/S9+? Why? Aren't they all more or less the same?"
This kernel exists, because I couldn't find quite the right kernel for my device: one that was conservative enough in its feature set to favour stability over the inclusion of experimental code, yet one bold enough not to shy away from embracing low-risk self-contained enhancements. The concept is an obvious one, yet no other kernel for the S9/S9+ catered to this market, something that holds true to this day.
APGK differentiates itself from the alternatives by striking a happy medium between the standard Samsung kernel and some of the more adventurous alternatives, without compromising on the original's stability.
To that end, APGK judiciously draws from the work of others, cherry-picking only the juiciest and safest fruit from several sources, including, but not limited to the ElementalX and now defunct Notorious kernels.
Every development decision is carefully weighed, eschewing changes that could affect stability, either by pushing the device's tolerances to their limits or by introducing features whose potential usefulness is outweighed by the danger posed by their invasive nature. Patches that are not widely understood and whose effects are difficult to predict and/or measure after application do not make it into APGK's code base. I personally verify the scope and correct working of everything that I include.
The finished kernel is packaged in a custom-built installer, which offers a choice between hands-free and interactive installation. Automatic post-installation rooting with Magisk is also offered as a convenience.
"Why is this kernel called APGK?"
The full name is actually A Pretty Good Kernel. I did consider a few others and even delayed the initial release of the kernel in the pursuit of the perfect name, but at the end of the day, a name is just a name; and, to paraphrase Shakespeare, a kernel by any other name would be just as dull.
Importantly, the acronym APGK is easy to type and easy to say. And, as luck would have it, A Pretty Good Kernel happens to be a reasonable, modest description of what this project actually is. If you want a kernel called Testosterone or High Octane Rocket Fuel, you'll have to look elsewhere.
Key characteristics
Forked from a clean exynos-linux-stable (ELS) base (Linux 4.9.109 at project launch).
Updated with regular merges of the upstream Linux kernel, the android-4-9-o tree and updates to the stock Samsung kernel (downstreamed from ELS until v0.99.33; manually merged since then).
Packed into a boot.img (boot image) taken directly from Samsung's latest stock firmware and kept as close to the original as possible. No obscure boot-time kernel configuration is stashed away here, and no changes are made to any other part of the file system at either install time or run time. No kernel has any business touching any part of your device's file-system. APGK religiously adheres to this principle and is fully transparent.
Provides a fully automated installer, with the option of interactive installation to allow manual selection of features, and the ability to automatically root the device with Magisk in the post-installation phase.
Comes in standard, underclocking and overclocking flavours. Choose the kernel that fits your usage profile.
Removes a large number of debugging and logging features that bloat a release kernel and make it unnecessarily noisy.
Enabled extra Deadline I/O scheduler. The default scheduler remains CFQ.
Includes WireGuard VPN support (version 0.0.20180613 at the time of launch), which is regularly updated as available.
Includes @Lord Boeffla's generic kernel wakelock blocker. The default block-list is: wlan_rx_wake, wlan, wlan_wow_wl, wlan_extscan_wl, netmgr_wl and NETLINK.
Utilises Westwood+ TCP congestion algorithm by default (as of v0.99.27; previous versions used BIC).
Includes Veno TCP congestion algorithm (as of v0.99.27).
Includes @flar2's Sweep2Wake, DoubleTap2Wake and Sweep2Sleep wake gestures.
Includes @flar2's RGB colour control override.
Includes Paolo Valente's BFQ (Budget Fair Queuing) I/O scheduler (v8r7) (based on CFQ).
Includes Shaohua Li's FIOPS (Fair Input/Output) scheduler (based on CFQ).
Includes Miguel Boton's SIO (Simple Input/Output) scheduler (based on Noop, Deadline and V(R) IO).
Includes Brandon Berhent's Zen I/O scheduler (based on Noop, Deadline and SIO).
Includes Joe Maples' eponymous Maple I/O scheduler (based on Zen and SIO).
SELinux operates in enforcing mode and (as of 0.99.7) cannot be dynamically switched to permissive mode.
FAQ
Q. Is this kernel still actively developed?
A. No. Version 1.0.56 was the final ianmacd release on 16th November 2019. No other person has come forward to take over maintenance of the project.
Q. Can I overclock or underclock the CPU using this kernel?
A. Yes.
The underclocking kernel is identical in specification to the one offered by ElementalX: the big cluster CPU (Samsung Mongoose 3) is limited to 2.314 GHz instead of the usual 2.704 GHz. If you need to maximise the amount of time the device can last on a single battery charge, this may be the kernel variant for you. It comes at the expense of a small performance penalty that you may not even notice in practice.
The overclocking kernel is a little more involved. This kernel will boost the maximum frequency of the big cluster CPU to 2.964 GHz from the usual 2.704 GHz (2.496 GHz vs. 2.314 GHz in dual mode; 2.002 GHz vs. 1.794 GHz in triple/quad mode). This is slightly higher than the boost provided by ElementalX's overclocking kernel, which provides for frequencies up to 2.886 GHz. Additionally, APGK's overclocking kernel will boost the small cluster 's (ARM Cortex-A55) maximum frequency to 2.002 GHz from the usual 1.794 GHz. This is identical to ElementalX's mode 2 overclocking behaviour.
Furthermore, APGK's overclocking kernel also features GPU overclocking. The Mali-G72 GPU has its maximum frequency boosted to 598 MHz from 572 MHz, and its minimum frequency boosted to 299 MHz from 260 MHz. This is identical to the behaviour of the Notorious kernel in its final release before being abandoned. Gamers in particular may appreciate the slight performance increase this provides.
It should go without saying that the overclocking kernel will incur, at a minimum, a small battery performance penalty. Whether the gains outweigh the cost will depend on individual usage and is for the user himself to determine. Furthermore, there may be an additional tax to pay in the form of reduced device stability. The overclocking kernel has proven 100% stable on my S9+ during testing, but it is entirely possible that individual units may demonstrate a lower tolerance. If you find your device spontaneously rebooting on the overclocking kernel, simply revert to using the standard kernel.
To install the underclocking kernel instead of the standard kernel, either create a file on your external SD card called .apgk_underclock or rename the APGK archive to contain _underclock in the name.
Similarly, to install the overclocking kernel instead of the standard kernel, either create a file on your external SD card called .apgk_overclock or rename the APGK archive to contain the string _overclock.
Then, simply install APGK as usual. The installer will infer your wishes from the renamed ZIP file or the presence of the dot-file and install the appropriate kernel. On-screen messages will confirm that the correct kernel is being installed.
As an alternative to providing hints to the installer via the file-system, you may prefer to utilise interactive installation mode. See below for details.
Use MTweaks or EX Kernel Manager to verify the modified CPU and GPU frequencies, and look for either the -uc or the -oc suffix to the kernel's name (obtainable, for example, with uname -a) to indicate that you have installed the underclocking or the overclocking variant, respectively.​
Q. Can I run SELinux in permissive mode with this kernel?
A. No. APGK's SELinux mode was enforcing by default until version 0.99.7, at which time this became the only permitted mode. It is no longer possible to dynamically switch to permissive mode after booting.
Despite what some others may tell you, running SELinux in permissive mode is a terrible idea, because it makes it much easier for a process with elevated privileges to wreak havoc on your device. Not only that, permissive mode is almost never actually necessary to achieve the goal that the user is pursuing.
If you believe that you cannot get by without SELinux in permissive mode, you can simply recompile APGK from source with the feature enabled. The GPL is a wonderful thing.​
Q. How does interactive installation mode work?
A. If the ZIP file name contains the string _interactive or a dot-file called .apgk_interactive is present in the root of the external SD card, interactive installation mode is triggered. Selections made in this mode will overrides any implied by the archive name or the presence of dot-files on the file-system.
In interactive mode, you will be asked questions regarding which kernel to install and whether to root the device afterwards with Magisk. Selections are made using the Bixby and Volume buttons. Just follow the on-screen prompts.​
Q. Can I safely use I/O scheduler X?
A. Maybe. Probably even. Although no guarantee of any kind is provided regarding the usability of this kernel, you should experience no problems whatsoever using the default I/O scheduler (CFQ). Others are configured at your own risk and may yield degraded performance.​
Q. Can I safely block wakelock X?
A. Again, perhaps. However, unless you know what a particular wakelock does and and have determined that it is causing an actual problem on your device, I suggest you leave it alone.​
Q. Is this kernel safe to use? Who are you, anyway? Can you be trusted?
A. At the height of its popularity, well over 100 people were using APGK as their kernel of choice. I have personally used nothing else on my S9+ since June 2018.
APGK went through almost 40 public beta releases and an untold number of internal test builds over a 6 month period before finally seeing its stable v1.0.0 release on New Year's Eve 2018. That was followed by a further 56 stable releases, so this kernel has proven itself in the field.
As the maintainer of APGK, I know exactly what's in it. The only risk I'm exposing myself to when I run it is that of my own incompetence, i.e. the possibility that I've made a mistake somewhere. You, however, don't know who you're dealing with and should therefore exercise due caution and at least pause for a moment to consider what you're installing, and the far-reaching powers you are about to grant this unaudited code over your device. Although I provide a link to the source code below, you have only my word for it that this code bears any relationship to the kernel actually provided in the installer.
Please see the Installation section below for an important note regarding the use of this kernel in combination with unmodified Samsung firmware.​
Q. Does this kernel also work on Android 9 (Pie)?
A. It would, if someone were to go to the trouble of merging Samsung's Android 9 kernel sources, building APGK against them and packaging the resulting kernel inside a boot image modified from the one supplied with Samsung's official Android 9 firmware. During my ownership of an S9+, I chose not to update it to Android 9, however, and was therefore unable to test kernels built for that version of the operating system. For that reason, official APGK builds continued to target Android 8.0 (Oreo).​
Q. Can I safely root this kernel?
A. Of course. What use would it be if you couldn't? I recommend Magisk for the task. Magisk has matured to the point that it is now the de facto root solution for Android devices.
It just so happens that I also produce my own builds of Magisk, which you are welcome to use. These are release builds (as opposed to debugging builds) and are produced from my own fork of @topjohnwu's original source code, sometimes augmented with patches. You can use anyone's builds, though.
Again, these builds work for me on various Samsung devices, but you should approach them with the appropriate caution.​
Q. Can I auto-root the APGK kernel with Magisk at installation time?
A. As of version 0.99.19, yes. This feature was extended and improved over the next few versions and is now mature.
To make use of this facility, either rename the APGK zip file to contain the string _magisk or create a file called .apgk_magisk in either the root of your external SD card or in the standard Download directory of the internal SD card. Alternatively, you may utilise interactive installation mode. See above for details.
If any of these trigger conditions is met, the installer then looks in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.
For example:
Code:
star2lte:/ $ ls -l /storage/0000-0000/.apgk_magisk
-rwxrwx--x 1 root sdcard_rw 0 2018-09-15 14:31 /storage/0000-0000/.apgk_magisk
star2lte:/ $ ls /storage/0000-0000/Magisk/Magisk-* | tail -n 3
/storage/0000-0000/Magisk/Magisk-v17.2-2018091001-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091201-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091501-ianmacd.zip
When you flash the APGK archive in TWRP, the most recent version of Magisk that could be found will now be used to automatically root your kernel, i.e. Magisk-v17.2-2018091501-ianmacd.zip in this example.​
Q. Can I use this kernel on an 'N' (Korean) model device?
A. At least one user has reported success flashing this kernel onto an 'N' model device. Since version 0.99.17, the APGK installer allows flashing onto the G960N/G965N.​
Q. Why doesn't APGK have its own Telegram group?
A. Because it has been my experience that Android-themed Telegram groups invariably degenerate into seething cesspits of ignorance, superstition and — on a good day — pseudo-science. I don't wish to police or even inhabit such a forum. Of course, it's a free world (or so I still like to tell myself), so you are at liberty to create your own Telegram group for APGK if you wish. Just please don't invite me to it.​
Building
Building a kernel is beyond the scope of this document. If you really want to build this kernel from scratch, start with this handy reference tailored to building kernels for Android.
Download
See posting #2 in this thread for links to the latest and all previous versions.
Installation
Make a back-up of your existing boot partition using the custom recovery environment provided by TWRP. If your device doesn't yet have TWRP, you will need to install that first. Then, use TWRP to flash the APGK ZIP file. The boot image will automatically be installed in the boot partition.
If your device has unmodified Samsung firmware, you will encounter problems with Bluetooth (namely delayed initiation and forgotten pairings) after installing this or any other custom kernel. To remedy this, you will need to patch your system with modified libsecure_storage.so libraries. Some custom kernel installers actually silently install these without your permission, overwriting your system libraries and transparently circumventing the problem before you can run into it. This approach necessarily modifies your device's file-system, however, which may not be what you want. At the very least, the user should be made aware what is happening to his device.
For this reason, I have instead prepared a companion Magisk module that achieves the same goal without modifying the file-system. This will allow you to run a custom kernel (not just this one, but any custom kernel) on pristine stock firmware without any Bluetooth issues. The module is attached to this posting for your convenience, but can also be found in the official Magisk module repository, accessible from Magisk Manager on your phone. If you use this Magisk module, you may wish to also disable the secure_storage_daemon by editing /system/etc/init/secure_storage_daemon.rc (change start to stop), as it no longer serves a purpose.
In a similar vein, you may encounter authentication errors when connecting to wireless networks after installing this or any other custom kernel. This problem is not serious, and easily remedied by re-entering your passphrase for any affected networks.
Finally, if SecurityLogAgent notifies you that unauthorised actions have been detected, do not be alarmed. This is a normal consequence of having installed a custom kernel. You may wish to disable SecurityLogAgent to avoid being repeatedly notified. Most custom ROMs and some kernel installers simply remove it, but again, I leave this up to the user.
If the above issues sound like more trouble than they're worth, you may be happier simply sticking to Samsung's stock kernel, which, in the case of the S9 and S9+ at least, is a perfectly good kernel.
Configuration
You are encouraged to use either MTweaks (a modified version of Kernel Aduitor) or EX Kernel Manager to manage the features provided by this kernel.
Source code
APGK's GitHub repository.
References
A useful overview of Android I/O schedulers.
The same author has produced a guide to CPU governors, I/O schedulers (and more).
For more information on the some of the individual schedulers included in this kernel, you can also look under Documentation/block in the kernel source.
Additionally, Documentation/cpu-freq/governors.txt may be interesting for exhaustive information on the Linux CPUFreq governors, although APGK has abandoned support for all but schedutil as of version 0.99.11.
The WireGuard user guide, control app, home page and source code.
The ELS source code.
The ElementalX home page, source code and XDA thread.
The Notorious source code and XDA thread. The Notorious project is now defunct.
The BFQ home page.
Credits
Thank you to everyone in the wider Linux kernel universe for getting us this far. Closer to home, I am grateful to the following Android luminaries for their considerable, ongoing contributions:
@Farovitus for providing and maintaining ELS, his dedication to experimentation in Notorious, and his permanent good grace and willingness to help other people.
@AndreiLux for the insights arising from his journey to the centre of the G96X kernel.
@osm0sis for Android Image Kitchen, which has saved me a huge amount of work in packing and unpacking boot images.
An honorary mention is due to @Chainfire, the extent of whose benefaction to the Android community is still not fully understood or appreciated in some quarters.
Thanks also to @Maxiroe1912 for his help with testing the G960F build of 0.99.2, the dual installer ZIP, and the libsecure_storage kernel companion Magisk module.​
Change log
v1.0.56 (final ianmacd version) (2019-11-16)
Updated to upstream Linux 4.9.202.
v1.0.55 (2019-11-14)
Updated to upstream Linux 4.9.201.
v1.0.54 (2019-11-11)
Updated to upstream Linux 4.9.200.
v1.0.53 (2019-11-06)
Updated to upstream Linux 4.9.199.
v1.0.52 (2019-10-31)
Updated to upstream Linux 4.9.198.
v1.0.51 (2019-10-18)
Updated to upstream Linux 4.9.197.
Updated WireGuard to v0.0.20191012.
v1.0.50 (2019-10-08)
Updated to upstream Linux 4.9.196.
v1.0.49 (2019-10-07)
Updated to upstream Linux 4.9.195.
v1.0.48 (2019-09-21)
Updated to upstream Linux 4.9.194.
v1.0.47 (2019-09-16)
Updated to upstream Linux 4.9.193.
Updated WireGuard to v0.0.20190913.
v1.0.46 (2019-09-11)
Updated to upstream Linux 4.9.192.
v1.0.45 (2019-09-06)
Updated to upstream Linux 4.9.191.
Updated WireGuard to v0.0.20190905.
v1.0.44 (2019-08-26)
Updated to upstream Linux 4.9.190.
v1.0.43 (2019-08-12)
Updated to upstream Linux 4.9.189.
v1.0.42 (2019-08-07)
Updated to upstream Linux 4.9.188.
v1.0.41 (2019-08-05)
Updated to upstream Linux 4.9.187.
v1.0.40 (2019-07-23)
Updated to upstream Linux 4.9.186.
v1.0.39 (2019-07-10)
Updated to upstream Linux 4.9.185.
Updated WireGuard to v0.0.20190702.
v1.0.38 (2019-06-28)
Updated to upstream Linux 4.9.184.
v1.0.37 (2019-06-24)
Fix for super slow motion recording, which was broken in v1.0.36.
v1.0.36 (2019-06-22)
Updated to upstream Linux 4.9.183.
v1.0.35 (2019-06-18)
Updated to upstream Linux 4.9.182.
v1.0.34 (2019-06-11)
Updated to upstream Linux 4.9.181.
Updated WireGuard to v0.0.20190601.
v1.0.33 (2019-05-31)
Updated to upstream Linux 4.9.180.
Updated WireGuard to v0.0.20190531.
v1.0.32 (2019-05-27)
Fixed serious bug in v1.0.31 that caused failure of zswap.
Updated to upstream Linux 4.9.179.
v1.0.31 (2019-05-22)
Updated to upstream Linux 4.9.178.
v1.0.30 (2019-05-17)
Updated to upstream Linux 4.9.177.
v1.0.29 (2019-05-15)
Updated to upstream Linux 4.9.176.
v1.0.28 (2019-05-11)
Updated to upstream Linux 4.9.175.
v1.0.27 (2019-05-08)
Updated to upstream Linux 4.9.174.
v1.0.26 (2019-05-04)
Updated to upstream Linux 4.9.173.
v1.0.25 (2019-05-02)
Updated to upstream Linux 4.9.172.
v1.0.24 (2019-05-02)
Updated to upstream Linux 4.9.171.
v1.0.23 (2019-04-21)
Updated to upstream Linux 4.9.170.
v1.0.22 (2019-04-17)
Updated to upstream Linux 4.9.169.
v1.0.21 (2019-04-06)
Updated to upstream Linux 4.9.168.
Updated WireGuard to v0.0.20190406.
v1.0.20 (2019-04-05)
Updated to upstream Linux 4.9.167.
v1.0.19 (2019-03-31)
Updated to upstream Linux 4.9.166.
Fixed disk I/O performance regression introduced in 1.0.18.
Fixed a small bug introduced in 1.0.16.
v1.0.18 (2019-03-24)
Updated to upstream Linux 4.9.165.
v1.0.17 (2019-03-20)
Updated to upstream Linux 4.9.164.
v1.0.16 (2019-03-14)
Updated to upstream Linux 4.9.163.
v1.0.15 (2019-03-05)
Updated to upstream Linux 4.9.162.
Built without process authentication code (CONFIG_FIVE_PA_FEATURE), since this doesn't work with custom kernels anyway. This change was accidentally omitted from v0.99.23.
Updated WireGuard to v0.0.20190227.
Rebased to Samsung's BSB1 boot images.
v1.0.14 (2019-02-27)
Updated to upstream Linux 4.9.161.
v1.0.13 (2019-02-23)
Updated to upstream Linux 4.9.160.
v1.0.12 (2019-02-20)
Updated to upstream Linux 4.9.159.
v1.0.11 (2019-02-16)
Updated to upstream Linux 4.9.158.
v1.0.10 (2019-02-13)
Updated to upstream Linux 4.9.156.
v1.0.9 (2019-02-07)
Updated to upstream Linux 4.9.155.
Rebased to Samsung's BSA1 boot images.
v1.0.8 (2019-02-01)
Updated to upstream Linux 4.9.154.
v1.0.7 (2019-01-26)
Updated to upstream Linux 4.9.153.
Updated WireGuard to v0.0.20190123.
v1.0.6 (2019-01-23)
Updated to upstream Linux 4.9.152.
BFQ I/O scheduler updated to v8r10.
v1.0.5 (2019-01-18)
Rebased to Samsung's BRL3 kernel source code and boot images.
v1.0.4 (2019-01-17)
Updated to upstream Linux 4.9.151.
v1.0.3 (2019-01-13)
Updated to upstream Linux 4.9.150.
v1.0.2 (2019-01-10)
Updated to upstream Linux 4.9.149.
v1.0.1 (2019-01-03)
Rebased to Samsung's BRK3 kernel source code and boot images.
v1.0.0 (2018-12-31)
Updated version to 1.0.0.
v0.99.39 (2018-12-29)
Updated to upstream Linux 4.9.148.
v0.99.38 (2018-12-22)
Updated to upstream Linux 4.9.147.
Updated WireGuard to v0.0.20181218.
v0.99.37 (2018-12-17)
Updated to upstream Linux 4.9.146.
v0.99.36 (2018-12-14)
Reverted 4 accidental commits.
v0.99.35 (2018-12-13)
Updated to upstream Linux 4.9.145.
v0.99.34 (2018-12-09)
Updated to upstream Linux 4.9.144.
Sundry kernel options re-enabled, mostly to bring back CONFIG_SEC_DEBUG_LAST_KMSG:
CONFIG_TRACE
CONFIG_SEC_DEBUG
CONFIG_SEC_DEBUG_RESET_REASON
CONFIG_SEC_DEBUG_EXTRA_INFO
CONFIG_SEC_DEBUG_HW_PARAM
CONFIG_SEC_DEBUG_AUTO_SUMMARY
CONFIG_SEC_DEBUG_LAST_KMSG
CONFIG_SEC_PARAM
CONFIG_CM_OFFSET=7340596
CONFIG_EXYNOS_SNAPSHOT
CONFIG_EXYNOS_SNAPSHOT_CALLSTACK=4
CONFIG_EXYNOS_SDM
v0.99.33 (2018-12-05)
Updated to upstream Linux 4.9.142.
Realtek RTL8152 driver upgraded to latest version (v2.10.00) (after having been downgraded in APGK 0.99.32 by a change in upstream ELS).
v0.99.32 (2018-11-28)
Updated to upstream Linux 4.9.141.
Rebased to Samsung's BRJ6 kernel source code and boot images.
Many more debugging and logging features disabled:
CONFIG_TRACE and its dependencies:
CONFIG_SEC_DEBUG
CONFIG_SEC_DEBUG_RESET_REASON
CONFIG_SEC_DEBUG_EXTRA_INFO
CONFIG_SEC_DEBUG_HW_PARAM
CONFIG_SEC_DEBUG_UPLOAD
CONFIG_SEC_PARAM
CONFIG_CM_OFFSET
CONFIG_SEC_DEBUG_AUTO_SUMMARY
CONFIG_SEC_UPLOAD
CONFIG_SEC_DEBUG_LAST_KMSG
CONFIG_SEC_DEBUG_PPMPU
CONFIG_EXYNOS_SDM
CONFIG_EXYNOS_SNAPSHOT_LOGGING_SMC_CALL
CONFIG_EXYNOS_ITMON
CONFIG_EXYNOS_SNAPSHOT
CONFIG_EXYNOS_SNAPSHOT_CALLSTACK
CONFIG_EXYNOS_SNAPSHOT_IRQ_EXIT
CONFIG_EXYNOS_SNAPSHOT_IRQ_EXIT_THRESHOLD
CONFIG_EXYNOS_SNAPSHOT_CLK
CONFIG_EXYNOS_SNAPSHOT_PMU
CONFIG_EXYNOS_SNAPSHOT_FREQ
CONFIG_EXYNOS_SNAPSHOT_DM
CONFIG_EXYNOS_SNAPSHOT_HRTIMER
CONFIG_EXYNOS_SNAPSHOT_REGULATOR
CONFIG_EXYNOS_SNAPSHOT_ACPM
CONFIG_EXYNOS_SNAPSHOT_THERMAL
CONFIG_EXYNOS_SNAPSHOT_I2C
CONFIG_EXYNOS_SNAPSHOT_SPI
CONFIG_EXYNOS_SNAPSHOT_PANIC_REBOOT
CONFIG_EXYNOS_SNAPSHOT_WATCHDOG_RESET
CONFIG_EXYNOS_SNAPSHOT_CRASH_KEY
CONFIG_EXYNOS_CORESIGHT
CONFIG_EXYNOS_CORESIGHT_PC_INFO
CONFIG_PC_ITERATION
CONFIG_EXYNOS_CONSOLE_DEBUGGER
CONFIG_EXYNOS_CONSOLE_DEBUGGER_INTERFACE
CONFIG_USB_DEBUG_DETAILED_LOG
CONFIG_MMC_DW_DEBUG
CONFIG_SEC_DEBUG_TSP_LOG
CONFIG_SDFAT_DBG_MSG
CONFIG_SDFAT_DEBUG
CONFIG_PHY_EXYNOS_DP_DEBUGFS
CONFIG_PHY_EXYNOS_DEBUGFS is not set
CONFIG_CGROUP_DEBUG
CONFIG_CMUCAL_DEBUG
CONFIG_SEC_BOOTSTAT
CONFIG_SEC_DUMP_SUMMARY
v0.99.31 (2018-11-22)
Many debugging and logging features disabled.
CONFIG_DISPLAY_USE_INFO
CONFIG_SEC_DISPLAYPORT_LOGGER
CONFIG_LOCKUP_DETECTOR (and dependencies)
CONFIG_DETECT_HUNG_TASK
CONFIG_TIMER_STATS
CONFIG_DEBUG_ATOMIC_SLEEP
CONFIG_DEBUG_LIST
CONFIG_DEBUG_NOTIFIERS_PRINT_ELAPSED_TIME
CONFIG_DEBUG_EXCEPTION_STACK
CONFIG_PROFILING
CONFIG_MODULES (and dependencies)
CONFIG_SEC_PM_DEBUG
CONFIG_DEBUG_INFO (and dependencies)
CONFIG_SCHED_DEBUG
Strip assembler symbols (CONFIG_STRIP_ASM_SYMS).
Overclocking kernel variant now uses 8 ms PELT (Per Entity Load Tracking).
Updated WireGuard to v0.0.20181119.
v0.99.30 (2018-10-20)
Updated to upstream Linux 4.9.135.
v0.99.29 (2018-10-19)
Updated to upstream Linux 4.9.134.
v0.99.28 (2018-10-19)
Rebased to Samsung's BRJ3 kernel source code and boot images.
v0.99.27 (2018-10-18)
CPU and GPU overclocking now offered via overclocking kernel variant.
CPU underclocking now offered via underclocking kernel variant.
Westwood+ TCP congestion algorithm now the default (formerly BIC).
Veno TCP congestion algorithm added to kernel.
Interactive installation mode now available.
Updated WireGuard to v0.0.20181018.
Trigger file to request Magisk chaining is now .apgk_magisk (formerly .magisk).
v0.99.26 (2018-10-14)
Updated to upstream Linux 4.9.133.
v0.99.25 (2018-10-12)
Updated to upstream Linux 4.9.132.
Minor changes to custom LED fader timings implementation.
Updated WireGuard to v0.0.20181007.
v0.99.24 (2018-10-07)
Bug fixes to custom LED fader timings implementation.
Updated WireGuard to v0.0.20181006.
v0.99.23 (2018-10-06)
Updated to upstream Linux 4.9.131.
Built without process authentication code (CONFIG_FIVE_PA_FEATURE), since this doesn't work with custom kernels anyway.
LED fader timings now adjustable (via /sys/devices/virtual/sec/led/, EX Kernel Manager [>= 3.71] or MTweaks).
v0.99.22 (2018-09-30)
Updated to upstream Linux 4.9.130.
Further improvements made to the installer's Magisk chaining feature (see the OP and release post for details).
v0.99.21 (2018-09-27)
Updated to upstream Linux 4.9.129.
Updated WireGuard to v0.0.20180925.
A bug fix and further improvements made to the installer's Magisk chaining feature (see the OP and release post for details).
v0.99.20 (2018-09-21)
Updated to upstream Linux 4.9.128.
Rebased to Samsung's BRI1 kernel source code.
Updated WireGuard to v0.0.20180918.
Improvements made to the Magisk chaining feature (see the OP and release post for details).
v0.99.19 (2018-09-15)
Updated to upstream Linux 4.9.127.
Updated WireGuard to v0.0.20180910.
Installer will now optionally automatically chain installation of Magisk.
v0.99.18 (2018-09-10)
Updated to upstream Linux 4.9.126.
v0.99.17 (2018-09-08)
Updated to upstream Linux 4.9.125.
Updated WireGuard to v0.0.20180904.
Installer now permits installation on 'N' model devices.
v0.99.16 (2018-09-05)
The definition of MAX_LOAD_AVG in the EHMP code was not dependent on the configured PELT decay rate. (Thanks to @Eamo5 for spotting this omission.)
v0.99.15 (2018-08-24)
Updated to upstream Linux 4.9.124.
Removed non-functioning Samsung DeX universal HDMI adapter code added in 4.9.123.
Reinstated support for extracting kernel config from kernel image or running kernel.
v0.99.14 (2018-08-22)
Updated to upstream Linux 4.9.123.
Samsung DeX should now work with any model of HDMI adapter. (Untested prior to release and reported not working.)
v0.99.13 (2018-08-19)
Updated to upstream Linux 4.9.122.
Rebased to Samsung's BRGA kernel source code; boot image rebased to BRH1.
v0.99.12 (2018-08-17)
Updated to upstream Linux 4.9.120.
Further installer refinements.
v0.99.11 (2018-08-11)
Updated to upstream Linux 4.9.119.
Updated WireGuard to v0.0.20180809.
Removed ondemand, powersave and userspace CPU governors, as these provide no benefit on these devices. The only supported governor is now schedutil.
v0.99.10 (2018-08-06)
Updated to upstream Linux 4.9.118.
Removed interactive CPU governor, as this (now) leads to a reboot on these devices.
v0.99.9 (2018-08-04)
Updated to upstream Linux 4.9.117.
Updated WireGuard to v0.0.20180802.
Removed ondemand and conservative CPU governors, as these (now) cause an immediate reboot on these devices.
v0.99.8 (2018-08-03)
Updated to upstream Linux 4.9.116.
Rebased to Samsung's BRG6 kernel source code, including boot image updates.
Updated WireGuard to v0.0.20180731.
Disabled process authenticator daemon (pa_daemon) via init.local.rc in boot image.
v0.99.7 (2018-07-18)
Updated to upstream Linux 4.9.113.
CONFIG_SECURITY_SELINUX_DEVELOP unset. With this change, dynamically switching the kernel to SELinux permissive mode is no longer possible.
Further installer refinements to reduce ZIP file size.
Remove support for unused compression types: BZIP2, LZMA, XZ, LZO and LZA4.
Removed support for extracting kernel config from image or running kernel.
Remove support for CONFIG_SLUB_DEBUG.
v0.99.6 (2018-07-12)
Updated to upstream Linux 4.9.112.
Further installer refinements.
v0.99.5 (2018-07-12)
EAS scheduling updated.
16ms PELT half-life for improved scheduling performance.
Kernel optimised for performance over size.
Updated WireGuard to v0.0.20180708.
New installer written in shell.
v0.99.4 (2018-07-04)
Updated to upstream Linux 4.9.111.
Rebased to Samsung's BRF8 kernel source code, including boot image updates.
v0.99.3 (2018-06-26)
Updated to upstream Linux 4.9.110.
Updated WireGuard to v0.0.20180625.
v0.99.2 (2018-06-25)
Added support for the G960F (S9).
Updated WireGuard to v0.0.20180620.
v0.99.1 (2018-06-19)
Initial release supporting G965F (S9+) only.
Good work!!!! I will test it later, this is a very good idea, thanks ?
Pretty Good Privacy.. Why would you want all these governors with EAS scheduler
Going to test on treble as it's close to stock
Noxxxious said:
Why would you want all these governors with EAS scheduler
Click to expand...
Click to collapse
This kernel doesn't have EAS, because EAS is a major overhaul of the scheduling subsystem, making it invasive and therefore relatively high-risk.
Some other custom kernels do have it, though, so users have plenty of choice.
ianmacd said:
This kernel doesn't have EAS, because EAS is a major overhaul of the scheduling subsystem, making it invasive and therefore relatively high-risk.
Some other custom kernels do have it, though, so users have plenty of choice.
Click to expand...
Click to collapse
It does. Other kernels merely have it updated and/or changes to the energy model. The exynos9810 is the very first exynos to make use of EAS.
Noxxxious said:
It does.
Click to expand...
Click to collapse
Sorry, I stand corrected. It doesn't appear to have the latest changes from r1.4 and r1.5, though. At least, I don't see the commits that the AOSP common 4.9 kernel has.
@ianmacd
Thank you for your Kernel.
I got 2 questions.
How to enabled Double tap 2 wake and do you have a own thread for your magisk builds?
madhub said:
@ianmacd
How to enabled Double tap 2 wake and do you have a own thread for your magisk builds?
Click to expand...
Click to collapse
The easiest way to manage the wake gestures is with the EX Kernel Manager. It's a great front-end, and you can set up your gestures to be activated at boot.
Otherwise, as root, do the following:
Code:
# echo 1 > /sys/android_touch/doubletap2wake
Echoing a 0 would disable the gesture.
sweep2wake and sweep2sleep are configured using the same mechanism, except that the value to echo is a bit-wise AND of the values corresponding to the swipe directions you want to allow for the gesture. You'd have to pluck them from the source if you really want to know them. They can be found in drivers/input/touchscreen/wake_gestures.c. All things considered, this is why I say that EX Kernel Manager should be high on your purchase list.
As for Magisk, no, my builds don't have their own thread, but my source repo is on GitHub, along with a separate repo for the binaries built from it. I haven't yet seen the need for a second thread with unofficial builds. I didn't want to risk diverting useful postings from the existing unofficial build thread to a second one, so I just announced the launch of my builds in that thread and occasionally respond to people there.
any plan on vibration intensity?
Muntasir Mahmud Saif said:
any plan on vibration intensity?
Click to expand...
Click to collapse
Can you give some details of what you're envisaging?
ianmacd said:
Can you give some details of what you're envisaging?
Click to expand...
Click to collapse
i mean on some kernels(maybe not on Samsung i guess) but on op6 and other phones there is vibration control..i mean u can increase or decrease on ex kernel manager
Muntasir Mahmud Saif said:
i mean on some kernels(maybe not on Samsung i guess) but on op6 and other phones there is vibration control..i mean u can increase or decrease on ex kernel manager
Click to expand...
Click to collapse
You can use EX Kernel Manager in the same way with this kernel, or you can echo a value into /sys/android_touch/vib_strength (off the top of my head).
When available for s9 960?
Your magisk builds are stable and they dont remove itself on restart! you should post this on the main thread!
saxena1 said:
When available for s9 960?
Click to expand...
Click to collapse
I've had about 5 requests for this now, so I'll do the work and release a test build either this evening or tomorrow.
nosar77 said:
Your magisk builds are stable and they dont remove itself on restart! you should post this on the main thread!
Click to expand...
Click to collapse
There's nothing magical about my Magisk builds, I'm afraid. I just pull the latest code, remove anything that obviously breaks things, add one or two useful patches, build, package and release. The builds work well for me, though, and it's gratifying to read that they work well for others, too.
ianmacd said:
I've had about 5 requests for this now, so I'll do the work and release a test build either this evening or tomorrow.
Click to expand...
Click to collapse
I cant seem to see the 960 release... did I miss it?
kgr said:
I cant seem to see the 960 release... did I miss it?
Click to expand...
Click to collapse
No. As always, these things turn out to be slightly more complicated than at first sight, so it's taken a little longer to test and prepare things.
The release will be coming today.

[KERNEL] [8.0/8.1/9.0] Endurance Kernel V2.0.27 / V1.2.33 [Linux 4.9.190] [CSGD/BSB1]

Endurance Kernel • Galaxy S9 / S9+​
Endurance Kernel was designed by me with the goal of providing a much more responsive user experience whilst simultaneously conserving the devices battery as much as possible. The Oreo kernel is forked from A Pretty Good Kernel by ianmacd so everything from there has been ported over and likely will consistently for the lifespan of this kernel, and the Pie kernel is forked from ELS. If you want the best battery this kernel offers, flash the underclocking build. If you want the best performance this kernel offers, flash the overclocking build. Each variant of the kernel is explained in more depth below. The kernel is largely adjustable in the paid app EX Kernel Manager (EXKM) by flar2 or in the free app MTweaks by Morogoku. Please note I don't own my S9 anymore!
DISCLAIMER - I am not responsible for any harm that may come to your device as a result of flashing this kernel. I am however happy to provide support if required.
Downloads
I am trialing GitHub and Mega releases only for now in order to simplify and speed up the release process. 1.x.x indicates the kernel should be used with an Oreo based firmware. 2.x.x indicates the kernel should be used with a Pie based firmware.
Latest GitHub Release
MEGA Repository
Key Features
Latest ELS (almost) always merged in
Implemented AndreiLux’s custom scheduling, EAS backports, 16ms PELT half-life, and migration hysteresis filter
Hotplugging enabled
Boeffla wakelock blocker supported (default list tweaked for improved deep sleep)
Support CPU overclocking and underclocking in overclock and underclock kernel builds
Support GPU overclocking up to 598MHz on all builds
Adapted notification LED fade support from NX Kernel from the Galaxy S8
Enabled fsync on / off support (on is default and recommended)
DoubleTap2Wake, Sweep2Wake, Sweep2Sleep & RGB colour control
CFQ (stock and kernel default), deadline, noop, FIOPS, SIO, Zen, Maple and BFQ support
Westwood (kernel default), bic (stock), cubic, reno, htcp, lia, veno and olia TCP congestion algorithms enabled
8.1.0 and 9.0 AOSP support
Several kernel optimizations from Notorious Kernel
WireGuard Support
DriveDroid Support
F2FS support
SELinux set to enforcing
Unofficially supported adjustable SELinux status through the 'Magisk SELinux Manager' module or # setenforce 1 or 0
Disabled almost all logging, debugging and tracing
Various patches to improve performance and battery
No bull****
Detailed Overview
The PELT half-life has been reduced from 32ms (stock) to 16ms which greatly improves device responsiveness, alongside the use of updated custom scheduling, both thanks to Andrei Frumusanu’s amazing work on the kernel. For a more up to date reference on the performance of the Exynos 9810, look at Andrei's investigation comparing the Exynos Note 9 to the Snapdragon Note 9.
This kernel supports overclocking and underclocking. In order to use overclocking or underclocking, simply rename 'Endurance-Kernel-1.x.x' to 'Endurance-Kernel-1.x.x_oc' or 'Endurance-Kernel-1.x.x_uc'. If the kernel has '_uc' or '_oc' in the name of the zip file, it will flash the selected build of the kernel.
The overclock build will now use big cluster (M3) quad / triple frequencies up to 2106MHz, dual frequencies up to 2416MHz and single frequencies up to 2964MHz. The small cluster has now also been overclocked to 2002MHz. The overclock build also removes Andrei's conservative frequencies for Samsung's default scheduling in order to utilise the higher frequencies more. There is no guarantee that your battery will perform well with overclocking, nor your device will be safe running above stock frequencies. Use at your own risk.
The underclock build will now limit quad workloads at 1586MHz but still allow single frequencies up to 2704MHz, dual frequencies up to 2314MHZ or triple frequencies of up to 1794MHz. This finds a good balance between battery conservation and performance. Due to the 16ms PELT half-life the underclock should be hopefully be less noticeable than it would be on a stock kernel at 32ms.
Notification LED fade support has also been added and enabled by default. The fade can be turned on and off and have fade in and out speed adjusted in EXKM or MTweaks. Additionally, in both EXKM and MTweaks such as fsync on / off support, DoubleTap2Wake, Sweep2Wake, Sweep2Sleep & RGB colour control.
This kernel unofficially supports (but I typically strongly advise against the use of) a permissive SELinux status through the 'Magisk SELinux Manager' module.
Magisk installation chaining has also been added as a feature thanks to Ian's updated installer script. To use the the magisk chaining feature, simply rename the zip from, for example 'Endurance-Kernel.1.x.x_underclock' to 'Endurance-Kernel-1.x.x_underclock_magisk'. Ian's thorough explanation of the feature has been attached below.
To make use of this facility, either rename the APGK Endurance Kernel zip file to contain the string _magisk or create a file called .magisk in either the root of your external SD card or in the standard Download directory of the internal SD card.
If any of these trigger conditions is met, the installer then looks in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.
Click to expand...
Click to collapse
AOSP Kernels
As of V1.1.2, the kernel now supports 8.1 and 9.0 AOSP ROMs. These builds are entire ports of Endurance Kernel that have been adapted for AOSP, hence any changes that are made to the base kernel will almost always also be included in the AOSP kernels. The 8.1 AOSP kernel seems to entirely work with all ROMs that support the current kernel firmware and vendor. Lineage OS will not work due to the merging of Note 9 sources and the dependency on the Note 9 vendor.
If you are using any of CodeFox / Mohammed's builds of PixysOS, Pixel Experience 9.0 sGSI or a build newer than Rainbow_Dash's V3, you must use the 8.1 AOSP Kernel. All other sGSI's should use the GSI build.
Due to SELinux interfering with Bluetooth's functioning on CodeFox / Mohammed's newer builds of Pixel Experience or PixysOS, you will need to set the kernel to a permissive SELinux status through the 'Magisk SELinux Manager' module for Bluetooth to work.
If SafetyNet is failing, this can be worked around to allow SafetyNet to pass. You will need the 'MagiskHideProps' module installed. After rebooting, using a Terminal Emulator app enter the following commands in the order listed without quotation marks.
Type 'su'
Type 'props'
Type '1' to edit the device fingerprint
Type 'f'
Type '13' to select Samsung
Type '23' if you have a Galaxy S9 (G960X) or '24' if you have a Galaxy S9+ (G965X)
Reboot
Due to the sheer diversity of AOSP ROMs, it is important to ensure you are concise when reporting an issue. Before you report an issue ensure you explicitly state the variant of the kernel you are using (TW, 9.0 GSI, 8.1 AOSP) as well as the ROM, firmware and vendor once you have ensured the ROM is compatible with the kernel. If these requirements are not met, you may receive support for the wrong platform or no response at all. It is preferred that you ask in the relevant telegram group prior to publishing on the XDA thread if possible.
Telegram Groups
If you're joining the Telegram group for support, please read the FAQ first!
Endurance Kernel Discussion / Support Group - https://t.me/endurancekernel
Endurance Kernel News Channel - https://t.me/endurancekernelnews
Credits
A huge thank you to everyone involved in the production of this kernel. Particularly a few names I would like to mention.
ianmacd - For creating A Pretty Good Kernel and doing all the hard work for me, as well as being a fantastic mentor who has assisted me through every stage of this kernel. My words understate my appreciation for your efforts. Seriously, try APGK if you do not enjoy this kernel!
AndreiLux - For pushing the device to its limits in many regards and paving the pathway from which many other devs, myself included rely on, and for assisting me in the production of the kernel.
farovitus - For his vast efforts included in the development of Notorious Kernel and for providing inspiration of changes and commits to include in the kernel as well as making another great kernel before the production of Endurance Kernel. Also thanks for maintaining ELS and keeping it simple for me!
flar2- For his fantastic EXKM app, and all his work from ElementalX included in APGK such as wake / sleep gestures and RGB colour control.
djb77 - For inspiring a few additions to the ramdisk and for being another fellow Aussie.
WhoIsJohnGalt1979 - For being by far the most exceptional beta tester and friend. Your efforts and kindness do not go unnoticed.​
Huge thanks to everyone else who was involved in development of the kernel, and helped me during the stages of instability in the early phases of this kernel. You know who you are!
And of course, everyone involved in mainline Linux development!
Additonally
Lord Boeffla for Boeffla Wakelock Blocker
franciscofranco for fsync on / off support
Ktoonsez for initially introducing Notification LED fade support.
Noxxxious for making it easier to adapt Notification LED fade to the S9!
osm0sis for Android Image Kitchen
If I included your work and forgot you, let me know and I’ll add you to the credits list!
Source - https://github.com/eamo5/starlte-endurance
Click here to donate! I used to not accept donations but while I'm undertaking my degree, a small donation could go a long way.
OneUI Current Build Changelog
V2.0.27
Linux 4.9.190
CSGD kernel source and ramdisk
Converted GPU workqueues to kthreads (thanks farovitus)
Previous Changelogs
V2.0.26
Linux 4.9.186
CSG8 source and ramdisk
Removed various unneeded drivers
Disabled swap on AOSP
V2.0.25
Linux 4.9.185
V2.0.24
Linux 4.9.184
Introduced the latest stable Simple LMK from Sultanxda in AOSP kernel
V2.0.23
Linux 4.9.183
Addressed some regressions from the previous build
I forgot to update the kernel version lol
V2.0.22
Linux 4.9.182
CSF2 kernel source and ramdisk
Several improvements to ashmem, binder, SELinux dynamic memory allocation, IRQs & qos from Sultanxda
V2.0.21
Linux 4.9.180
V2.0.20
Linux 4.9.179
Cross compiled with GCC 9.1
Fixed instability in 4.9.178
V2.0.19
Linux 4.9.177
CSE3 ramdisk
V2.0.18
Linux 4.9.176
Cleaned up defconfigs
Unset CONFIG_DEBUG_KERNEL (and all it's dependencies)
Optimised F2FS configuration
Fixed issues with unofficial TWRP (hopefully)
V2.0.17
Linux 4.9.175
Fixed F2FS
V2.0.16
Linux 4.9.174
F2FS support
V2.0.15
Linux 4.9.173
V2.0.14
Linux 4.9.172
Updated Gator driver to v6.9
V2.0.13
Linux 4.9.171
Unset CONFIG_AUDIT (reduce SELinux overhead)
Updated Gator driver to 6.8
V2.0.12
Linux 4.9.170
V2.0.11
CSD4 kernel sources
CSD4 ramdisk
Linux 4.9.169
V2.0.10
Linux 4.9.168
V2.0.9
Linux 4.9.166
Fixed 4.9.165 performance regression
V2.0.8
Linux 4.9.165
Reduced kernel size
V2.0.7
CSC8 kernel sources
Linux 4.9.164
V2.0.6
Linux 4.9.163
V2.0.5
Linux 4.9.162
Unset approximately 15 CONFIG_TRACE & CONFIG_EXYNOS_SNAPSHOT related options
V2.0.4
Linux 4.9.161
Set CONFIG_STRIP_ASM_SYMS
Unset CONFIG_BT_DEBUGFS
Unset CONFIG_USB_DEBUG_DETAILED_LOG
Unset CONFIG_DEBUG_ATOMIC_SLEEP
Unset CONFIG_SEC_BOOTSTAT
Unset CONFIG_SEC_UPLOAD
Unset CONFIG_SEC_DEBUG_PPMPU
Fixed an issue with the r8152 ethernet driver & updated the driver.
V2.0.3
Linux 4.9.160
Unset CONFIG_EXYNOS_CORESIGHT (and everything it unsets)
Unset CONFIG_DEBUG_LIST
Unset CONFIG_DEBUG_EXCEPTION_STACK
Unset CONFIG_TIMER_STATS
Unset CONFIG_DEBUG_NOTIFIERS_PRINT_ELAPSED_TIME
Unset CONFIG_CGROUP_DEBUG
Unset CONFIG_MMC_DW_DEBUG
Unset CONFIG_SEC_DEBUG_TSP_LOG
Unset CONFIG_PHY_EXYNOS_DEBUGFS
Suppressed additional minor logging
V2.0.2
Linux 4.9.159
Unset CONFIG_KSM
Unset CONFIG_SDFAT_DEBUG
Unset CONFIG_SCHED_DEBUG
Fixed SD Card issue on AOSP ROMs
Maybe fixed vibration issue on AOSP ROMs
Oreo, GSI and AOSP Current Build Changelog
V1.2.33
Linux 4.9.190
Previous Changelogs
V1.2.32
Linux 4.9.186
Removed various unneeded drivers
V1.2.31
Linux 4.9.185
Reverted Simple LMK on AOSP builds as it doesn't appear to be making reclaims correctly atm.
V1.2.30
Linux 4.9.184
Introduced the latest stable Simple LMK from Sultanxda in AOSP kernels
V1.2.29
Linux 4.9.183
Addressed some regressions from the previous build
I forgot to update the kernel version lol
V1.2.28
Linux 4.9.182
Several improvements to ashmem, binder, SELinux dynamic memory allocation, IRQs & qos from Sultanxda
V1.2.27
Linux 4.9.180
V1.2.26
Linux 4.9.179
Cross compiled with GCC 9.1
Fixed instability in 4.9.178
V1.2.25
Linux 4.9.177
V1.2.24
Linux 4.9.176
Cleaned up defconfigs
Unset CONFIG_DEBUG_KERNEL (and all it's dependencies)
Optimised F2FS configuration
Fixed issues with unofficial TWRP (hopefully)
V1.2.23
Linux 4.9.175
Fixed F2FS
V1.2.22
Linux 4.9.174
F2FS support
V1.2.21
Linux 4.9.173
V1.2.20
Linux 4.9.172
Updated Gator driver to v6.9
V1.2.19
Linux 4.9.171
Unset CONFIG_AUDIT (reduce SELinux overhead)
Updated Gator driver to 6.8
V1.2.18
Linux 4.9.170
V1.2.17
Linux 4.9.169
V1.2.16
Linux 4.9.168
V1.2.15
Linux 4.9.166
Fixed 4.9.165 performance regression
V1.2.14
Linux 4.9.165
Unset CONFIG_ION_EXYNOS_STAT_LOG
V1.2.13
Linux 4.9.164
V1.2.12
Linux 4.9.163
V1.2.11
Linux 4.9.162
Unset CONFIG_FIVE_PA_FEATURE
V1.2.10
Linux 4.9.161
V1.2.9
Linux 4.9.160
Suppressed additional minor logging
FAQ
A FAQ section will be established as kernel development progresses. If you have any explicit unanswered questions, feel free to ask away. If you must contact me due to an issue, please report your device variant, ROM, firmware, vendor and previous kernel.
1. I can’t unlock / boot my phone! What do I do?
If you're stuck in a lockscreen loop, make sure you're on a firmware with a matching ramdisk to the kernel. Do not mix a CSC1 kernel ramdisk with a CSA2 ROM for example. Anytime the ramdisk is changed, it will be listed in the changelog. Are you on the correct firmware and vendor? If not, you can always flash this zip or revert back to previous versions through the Android File Host folder. Can anyone else successfully flash the kernel? If yes, verify the MD5 sum by referencing and ensuring a matching MD5 sum between the local file and the Android File Host file. Is it isolated to one device variant? (G960F / G965F) Did I just push an update? If yes, contact me on Telegram in the Endurance Kernel group for a faster response, and XDA for an eventual response. Does your ROM require a permissive SELinux status to boot? If yes, use the 'Magisk SELinux Manager' module to adjust your SELinux status. If none of this can solve your problem, contact me through the Endurance Kernel group.​
2. Why doesn't my camera work after flashing the kernel?
Verify that you are on the correct firmware, vendor and a ROM that supports the current kernels sources. If you are still encountering issues after verifying this is correct, then let me know! If you do not wish to update, you can maintain a version of the kernel that does support your ROM by reading the relevant changelog for your OS and downloading the previous version from the Android File Host folder​
3. Why doesn't my Bluetooth work after flashing the kernel?
Are you on an Oreo ROM that does not patch libsecure_storage, such as DevBase? If your Bluetooth is broken, the answer is probably. Instead you can use ianmacd's Magisk module 'libsecure_storage companion for rooted Samsung (Oreo) devices' or you can manually flash a zip to patch it yourself, without the need for Magisk.​
4. Should I use the permissive or enforcing SELinux status?
The decision is yours. There is plenty of documentation available online outlining their differences. I strongly recommend enforcing, hence why permissive is not officially supported. Permissive is far less secure, and hence I do not condone the use of permissive. If you are using permissive, you should either have to due to a dependency or have another specific reason for doing so. eg. ROM requires disabled signature check. For most users, unless directed otherwise, use the default enforcing build.​
5. When will you update the kernel?
Once ELS is updated and the kernel is ready! This is just a side hobby and I do have a life outside of kernel development. Be patient, the update will arrive within a few days if not ASAP.​
6. Does this kernel support 9.0 AOSP GSI's?
Yes! Anything that's currently working on the Pixel Experience YEET kernel (lol) such as dual audio and MTP should also be working there too, plus some extra relevant changes.​
7. Does the 8.1 AOSP kernel work with Lineage OS?
As of the Lineage OS 20181112 release, the kernel will no longer boot at all on Lineage OS due to the merging of Note 9 sources and the dependency on the incompatible Note 9 vendor. Albeit, Lineage previously wasn't recommended regardless due to the outdated vendor and kernel sources, which breaks the camera.​
8. Will you add CPU undervolting?
No, EAS (Energy Aware Scheduling) has mostly made undervolting mostly irrelevant. Google EAS if you would like it find out more information as to why it is the case. I've included a detailed YouTube video outlining the scheduling mechanisms of EAS here.​
9. Does this kernel support Note 9 ROM ports?
Not at this point in time but perhaps in the future. Almost certainly not within Oreo's lifespan anyway.​
10. Do I need to install Magisk?
Nope, Magisk is entirely optional with this kernel.​
11. Why when I flash the kernel, do I get a Magisk zip not found error?
Unfortunately, that means your Magisk distribution is not supported by the Magisk chaining feature. The kernel should have still installed despite not finding the Magisk zip, so you'll just have to flash Magisk manually afterwards. Personally I use ianmacd's nightly builds for S9 and have 0 issues with the chaining feature.​
12. Why does this kernel offer no additional governors?
Because most of them are unstable and cause the device to crash, as well as EAS' integration with schedutil and EHMP.​
13. Why does this kernel makes my device crash / battery poor / performance poor?
Because this kernel is still in beta. At this point, these should hopefully not be issues due to me and several others testing this kernel for several months. If this is the case, report it on the XDA thread or Telegram group.​
14. Why is my WiFi performance worse when using this kernel?
This may be the case for some people. This kernel uses the Westwood+ TCP algorithm for enhanced WiFi speeds on certain networks. However there may be scenarios on poor signal networks, this TCP algorithm may cause packet loss at a greater rate than is default. This should hopefully not be an issue for anyone, however if it is, try using bic as default and contact me.​
15. Why is my battery still terrible?
Are you in an area with poor signal reception? Unfortunately that is one thing a custom kernel cannot compensate for due to the device modem having restricted access and also legal issues. That leaves us with optimizations that can only be done to the SOC of the device. How you use your device can also greatly lead to variation in battery stats. If you are in need of further battery, 'underclocking' is available and is explained in OP. If you want the best battery life, I advise you try out that build.​
16. Does the kernel support Samsung's Pie beta program?
Not yet, we still have to wait for sources to be released. Once sources are available, I'll begin work!​
17. Why doesn't Bluetooth work on Pixel Experience with the 8.1 AOSP kernel?
Due to SELinux interfering with Bluetooth's functioning, you will need to set the kernel to a permissive SELinux status through the 'Magisk SELinux Manager' module.​
18. Why does SafetyNet fail on the AOSP kernels?
This is a minor issue I don't believe I can address on my end. This can be worked around however to allow SafetyNet to pass. You will need the 'MagiskHideProps' module installed. After rebooting, using a Terminal Emulator app enter the following commands in the order listed without quotation marks.
Type 'su'
Type 'props'
Type '1' to edit the device fingerprint
Type 'f'
Type '13' to select Samsung
Type '23' if you have a Galaxy S9 (G960X) or '24' if you have a Galaxy S9+ (G965X)
Reboot
19. How do I overclock / underclock?
I can't believe I need this as a FAQ still. If you've been redirected here, read the OP! In order to use overclocking or underclocking, simply rename 'Endurance-Kernel-1.x.x' to 'Endurance-Kernel-1.x.x_oc' or 'Endurance-Kernel-1.x.x_uc'. If the kernel has '_uc' or '_oc' in the name of the zip file, it will flash the selected build of the kernel.​
20. How can I use F2FS?
To use F2FS, you must erase your data and format your data partition (and optionally cache partition) to F2FS using the N9 TWRP available here, even if you are on S9. From there you should be able to reboot your device and restore your data through a backup.​
21. Where can I donate?
I used to not accept donations but while I'm undertaking my degree, a small donation could go a long way. You can donate through my PayPal link here.​
Installed and testing. Look good so far. No lags in PUBG ...
Battery life we will see
Thanks for this kernel!
Oel said:
Installed and testing. Look good so far. No lags in PUBG ...
Battery life we will see
Thanks for this kernel!
Click to expand...
Click to collapse
Great, future builds should allow for increased frequency usage when I enable overclocking. Stay tuned for that for an even better experience
Will install it today and test it
Just a note, I didn't port the GPU stuff, flar2 did.
djb77 said:
Just a note, I didn't port the GPU stuff, flar2 did.
Click to expand...
Click to collapse
Updated the post. Thanks!
support 960/965n?
Cosis1 said:
support 960/965n?
Click to expand...
Click to collapse
I personally haven't tested an N device yet. Feel free to try it out though. I think it should work
I've been eagerly awaiting on the sidelines to try your kernel. I have heard you mention it many times in different groups and now it has finally arrived. Many thanks and greatly appreciated. I'll let you know how I get on cheers eamon your a star.:good:
@Eamo5
hi, one question.
what exactly does the boeffla wakelock blocker patch?
greetings
emphazer said:
@Eamo5
hi, one question.
what exactly does the boeffla wakelock blocker patch?
greetings
Click to expand...
Click to collapse
It allows the blocking of default kernel wakelock which can in return give better battery due to less time being awoken from deep sleep, but should only be used if you know what you're doing
Eamo5 said:
It allows the blocking of default kernel wakelock which can in return give better battery due to less time being awoken from deep sleep, but should only be used if you know what you're doing
Click to expand...
Click to collapse
im asking because i noticed that the clock timer for ringing up on custom roms with android 5-7 didnt work correctly.
It didn't start to ring because the device was in a deep sleep. I just wanted to know if this behavior maybe has something to do with a kernel patch like that.
normally I say blocking of wakelocks are really good but if it blocks the wrong stuff then it can easy result in really bad sidechain effects.
edit: found a good descrption.
so its just a optional feature.
V1.0.1 Changelog
- ELS 4.9.131
- Frequency cap at 1794MHz removed to compensate for Samsung's updated scheduling mechanisms. (Should not reduce battery)
- Added Magisk chaining support.
- Overclocking and 'underclocking' support (Explained further in OP)
- Added unofficial N device support (Untested)
- Fixed LED adjustment at the source in original commit. Thanks flar2.
- Fixed dual audio on Pie GSIs (Untested)
- Remove GPU voltage control due to it's current broken state. (Will return when fixed)
- Improve kernel source
Download link is updated in OP!
V1.0
- Initial Release
Cosis1 said:
support 960/965n?
Click to expand...
Click to collapse
Can you try out that please? ^^
Eamo5 said:
Can you try out that please? ^^
Click to expand...
Click to collapse
I can use now. Thx :good:
Very good beginning!
Eamo5 said:
V1.0.1 Changelog
- ELS 4.9.131
- Frequency cap at 1794MHz removed to compensate for Samsung's updated scheduling mechanisms. (Should not reduce battery)
- Added Magisk chaining support.
- Overclocking and 'underclocking' support (Explained further in OP)
- Added unofficial N device support (Untested)
- Fixed LED adjustment at the source in original commit. Thanks flar2.
- Fixed dual audio on Pie GSIs (Untested)
- Remove GPU voltage control due to it's current broken state. (Will return when fixed)
- Improve kernel source
Download link is updated in OP!
V1.0
- Initial Release
Click to expand...
Click to collapse
Hi
@Eamo5 Thank you for your hard work.
I started with overclock, and the kernel is pretty good, performance is ok snappy system and battery life seems to be good even with overclocking.
I noticed that CPU never reach 2900 neither 2700 mhz even in heavy use. Maybe it is the ELS that have a better management of cores. I will continu testing and give feedback.
Have a nice day all
Sorry for my bad English
Phahec said:
Hi
@Eamo5 Thank you for your hard work.
I started with overclock, and the kernel is pretty good, performance is ok snappy system and battery life seems to be good even with overclocking.
I noticed that CPU never reach 2900 neither 2700 mhz even in heavy use. Maybe it is the ELS that have a better management of cores. I will continu testing and give feedback.
Have a nice day all
Sorry for my bad English
Click to expand...
Click to collapse
Great, glad to hear performance and battery are great. The very limited usage of those frequencies is due to how the hotplugging driver works after the BRE5 update I believe, where it will only use those frequencies in single threaded workloads ie. not very often, hence there will be very little regression in battery. I'm thinking of making some adjustments to the quad, dual and single frequencies next build to allow for greater usage of these frequencies and potentially an entire overhaul of the underclock build. Thanks for your testing, and your english is pretty good btw

Categories

Resources