FORUMS
Remove All Ads from XDA

[EOL] [20170906] Pulsar Kernel r23 for One X+ International

877 posts
Thanks Meter: 612
 
Post Reply Email Thread
Disclaimer
Use this kernel at your own risk.
Even though it seems pretty stable at the moment, there might still be some bugs waiting to introduce themselves.
I am in no way responsible for any harm that may come to your device during your use of this software.

Use Kernel Adiutor to change kernel settings.

Features
  • Compiled with Linaro Toolchain 7.2.1-2017.08
  • Optimized and tuned for Cortex-A9
  • Android security updates merged up to September 2017
  • Governors: interactive (default), ondemand (2-phase capable), userspace, performance, powersave, conservative
  • I/O schedulers: zen (default), sio, bfq, noop, cfq, row, deadline
  • TCP congestion algorithms: westwood (default), reno, bic, cubic, highspeed, hybla, htcp, vegas, veno, scalable, lp, yeah, illinois
  • Low Power core overdrive
  • Undervolting
  • Intelliplug CPU hotplug (by @faux123)
  • Zram, kernel samepage merging
  • S2W/S2S (swipe on capacitive buttons) & DT2W
  • F2FS, NTFS read/write
  • Disabled GENTLE_FAIR_SLEEPERS
  • Included SafetyNet patch (please see this post)
  • Lots of under-the-hood patches and fixes

Known Issues
  • Occasional reboots
  • Bluetooth audio stutters on device wake

Download
cm-12.1
cm-11.0
carbon-5.1.1

Installation
Extract the downloaded kernel ZIP and run flash.bat if you're on Windows or flash.sh if you're on Linux or macOS.
OR
Manually flash boot.img using fastboot, and replace all files in /system/lib/modules with the files inside the included modules folder.

Changelogs
Quote:

r23 (2017/09/06)

  • Merged Android security kernel patches for 2017/09/05
  • Revert default cpu governor to interactive
  • Update intelliactive cpu governor and intelliplug cpu hotplug to latest sources
  • Optimized square root algorithm
  • Low Power core overdrive: maximize the power of the Tegra 3 low power core
  • Over a hundred fixes from Lineage 14.1 kernel for Nexus 7 2012 (list here)

Important note: Not all security updates are included in this build due to incompatibility issues. The missing updates are...

Quote:

r22 (2017/08/22)
- Use performance cpu governor by default to speed up boot
- Major update to interactive cpu governor
- Remove the other cpu governors (smartass, wheatley, etc) - they weren't used that much anyway
- Updates and fixes to cpu freq handling (from @franciscofranco's Nexus 7 2012 kernel)
- Add touchboost driver

r21 (2017/08/13)
- Add zen iosched
- Merged Android kernel security patches for 2017/08/05

r20 (2017/06/13)
- Re-enable SELinux in preparation for Marshmallow
- Enable xt_qtaguid module to make cellular data work again
- Make dt2w configurable via Kernel Adiutor & co.
- Disabled tegra mpdecision hotplug

r19 (2017/06/12)
- Build with HyperToolchain UBERTCxLinaro (GCC version 6.1.1)
- Fixes for all applicable CVEs as outlined in the Android Security Bulletin (2015 - 2017/06)

r18 (2017/06/10)
- Enabled all TCP congestion algorithms: westwood (default), reno, bic, cubic, highspeed, hybla, htcp, vegas, veno, scalable, lp, yeah, illinois
- Included SafetyNet patch
- Lots of updates from @Lloir's lineage-13.0 branch

r17 (2016/12/20)
- UBERTC 6.2.1 (I finally figured out how to compile UBERTC 6.x on Mac!!!)
- Lots, and I mean lots, of fixes to the kernel from @Andy.Lavr (Linux 3.1.12)
- add governors: badass, smartassH3, wheatley

r16 (2016/11/27)
- Just UBERTC 4.8.5 this time
- Remove fast charging code, it never worked anyway
- Patch for Dirty CoW vulnerability
- Disable SELinux by default
- Allow SELinux mode changing

r15 (2016/04/30)
- tried compiling with SaberMod 4.9 and UBERTC 6.0
- make dt2w work on the entire screen, for real
- Graphite!

r14 (2016/04/18)
- re-enable tegra_mpdecision

r13 (2016/04/10)
- enable support for FiiO DAC
- f2fs: enable security labels and consistency checking
- don't turn off flashlight on screen off
r12 (2016/04/02)
- add support for FiiO DAC (Cyanogen, Inc.)
- add 2A fastcharge

r11 (2016/03/28)
- add lulzactive, pegasusq, and touchdemand governors

r10 (2016/03/26)
- now dt2w works on the entire screen
- changes to default values for smartmax(_eps)
- re-add smartassv2 and lagfree

r9 (2016/03/24)
- successfully compile with UBER Toolchain 4.8.5

r8 (2016/03/19)
- patches to android/binder
- patches to baseband code
- add 'extra free kbytes' tunable to sysctl
- increase max volume (unknown if placebo)

r7 (2016/03/13)
- arm: make return_address available for ARM_UNWIND
- remove all traces of nVidia hotplug
- reduced dmesg log spam
- more compiler flags

r6 (2016/03/12)
- removed cpuquiet
- disabled mpdecision and nvidia hotplug
- added @faux123's intelliplug, set it as default
- added smartmax_eps governor
- enabled cgroups
- disabled gentle fair sleepers

r5 (2016/03/10)
- patches to low memory killer
- add tegra mpdecision
- remove smartassv2 and lagfree

r4 (2016/03/09)
- patches to s2w/dt2w
- add smartassv2 and lagfree (untested)

r3 (2016/03/08)
- added intelliactive governor
- patches to BFQ scheduler

r2 (2016/03/07)
- integrated a few modules into kernel
- use performance as default governor

r1 (2016/03/06)
- initial release



Credits
Kernel Information
  • Source: GitHub
  • Compiler: GitHub
  • Branch: master
  • Linux kernel version: 3.1.12
  • Defconfig: enrc2b_defconfig
The Following 5 Users Say Thank You to aureljared For This Useful Post: [ View ] Gift aureljared Ad-Free
 
 
6th March 2016, 11:33 AM |#2  
aureljared's Avatar
OP Senior Member
Flag Quezon City
Thanks Meter: 612
 
More
Screenshots

Sample kernel settings








Benchmarks
I know benchmarks mean nothing, but I ran five benchmarks on this phone using Pulsar. You know, for posterity

Kernel settings etc. used during benchmarking

Quote:

  • Governor: smartmax (with intelliplug enabled)
  • Min/Max Freq: 51/1700 MHz
  • I/O Sched: sio (with 1280KB readahead)
  • Memory: KSM enabled, Aggressive LMK settings
  • Undervolt: (in order from 475-1700MHz) 700, 750, 825, 875, 925, 975, 1000, 1050, 1100, 1150 mV



Screenshots of scores

AnTuTu


3DMark



Geekbench 3


Vellamo
Note: The WebView Library installed on the device during benchmarking is NOT the one included in CM (old); rather, it's Google's version (new).




Quadrant

6th March 2016, 11:34 AM |#3  
aureljared's Avatar
OP Senior Member
Flag Quezon City
Thanks Meter: 612
 
More

Frequently Asked Questions (FAQ)
This post will be constantly updated.


My device won't boot after flashing this kernel / I have no reception.

Make sure you flashed boot.img via fastboot AND copied the .ko files inside the zip onto the "/system/lib/modules" folder inside your device.

Remember, this kernel only works on the ROMs outlined in the downloads section.

My SIM card disconnects at random.


http://forum.xda-developers.com/show...37&postcount=6

SetCPU/No-frills/etc won't work!

Use Kernel Adiutor. (It's free.)

How to build on Linux?


There are already lots of tutorials on this, just use Google.

How to build on Mac OS X?

Setting up a working build environment on Mac proved difficult as there aren't that many tutorials available on the internet, and the ones that did exist didn't help me solve the weird errors I got when building. This stumped me for a good two weeks, but finally figured it out.

So here goes:


Get the XCode commandline tools.

If you already have XCode installed, good for you. You can skip this step.

If you don't have XCode, there's no need to waste hours of your time on downloading this 6GB app when all you need is 200MB of it. Open Terminal and enter

Code:
xcode-select --install
If that takes too long, you can also try downloading the XCode Command Line Developer Tools from here (log in with your Apple ID first).

Once you have that installed, proceed to the next step.

Install build dependencies using Homebrew

Homebrew is a very important tool for developers on Mac. If you don't have it yet, install it by entering this in Terminal.

Code:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
When that's done, enter this:

Code:
brew update
brew install findutils gnu-sed gnupg xz ccache android-platform-tools libmpc
brew install homebrew/dupes/ncurses
Once it's done, proceed.

Make a disk image

The default filesystem in OS X isn't case-sensitive, and the Linux kernel source doesn't like that. Enter this in Terminal:

Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 15g -volname "enrc2b" -attach ~/Desktop/Android
You can change "15g" to any size you want, but at least 20 GB is recommended.
You can also change "enrc2b" to any volume name you want. Just make sure you remember it!

Download the kernel source and toolchain

Replace "enrc2b" below with your chosen name if you used something else.

Code:
cd /Volumes/enrc2b
git clone https://github.com/jareddantis/pulsar-kernel_enrc2b -b master kernel
git clone https://android.googlesource.com/platform/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8 toolchain
git clone https://github.com/CyanogenMod/android_external_elfutils.git elfutils
If that takes too long, hit Ctrl+C to stop the Git processes as needed. Repeat this step, but use "git clone --depth 1" instead of "git clone".

Use ccache

ccache greatly speeds up subsequent compilations by caching compiled code files in a specified directory. Make that directory by

Code:
cd /Volumes/enrc2b
mkdir ccache
To enable ccache, go to the next step.

Prepare environment

Edit your Bash variables by

Code:
nano ~/.bash_profile
Insert these lines at the end of the file:

Code:
export LANG=C
export LC_CTYPE=C
export ARCH=arm
export SUBARCH=arm
export KBUILD_BUILD_USER="YourNameHere"
export KBUILD_BUILD_HOST="YourComputerCodenameHere"
export CROSS_COMPILE="ccache /Volumes/enrc2b/toolchain/bin/arm-eabi-"
export USE_CCACHE=1
export CCACHE_DIR=/Volumes/enrc2b/ccache
KBUILD_BUILD_USER and KBUILD_BUILD_HOST can be anything you want. Just don't forget the quotes.

Enable ccache by

Code:
source ~/.bash_profile
ccache -M 10G
Cache sizes of at least 5 GB are recommended, but don't forget to leave space for the kernel compilation itself!

Compile

Code:
cd /Volumes/enrc2b/kernel
make clean && make mrproper
make cm_enrc2b_defconfig
make menuconfig                            # Optional - only if you're changing kernel settings
make -j4 HOSTCFLAGS="-I/Volumes/enrc2b/elfutils/libelf"
Replace the "4" in "make -j4" with the number of CPU cores (physical and logical) that your Mac has.

Your kernel should now be compiling. It took about 8 minutes to finish on my 2014 base-model MacBook Air.

Prepare for flashing

Code:
cd /Volumes/enrc2b
mkdir flashing
cd flashing
Download mkbootimg and unmkbootimg from here. Unzip inside the "flashing" folder we just created.

Your just-compiled kernel will be located at kernel/arch/arm/boot/zImage, copy that here by

Code:
cp /Volumes/enrc2b/kernel/arch/arm/boot/zImage ./
Now you'll need a copy of the boot.img in the Lollipop ROM you're currently using. Either extract that from the ROM zip or get "boot.emmc.win" from your TWRP backup.

My boot image is called "boot.img". Assuming I've already copied boot.img inside the "flashing" folder, I do

Code:
unmkbootimg -i boot.img
Two new files, ramdisk.cpio.gz and kernel, will be created. Delete ramdisk.cpio.gz and do this to put together your freshly-built kernel:

Code:
mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x10008000 --ramdisk_offset 0x11000000 --second_offset 0x10f00000 --tags_offset 0x10000100 --kernel zImage --ramdisk ramdisk.cpio.gz -o boot.img.new
Reboot your phone into fastboot, connect it via USB, and do this to test your kernel.

Code:
fastboot flash boot boot.img.new
fastboot reboot
If everything goes right, you should now be booting your very own kernel.

If not, you can just reboot back into fastboot and flash back the original boot.img...

Code:
fastboot flash boot boot.img
fastboot reboot
...and try to see where the kernel went wrong.


How to report bugs?

If it's just the usual lag, don't report it here. The HOX+ is an old device running new software, we have to live with these quirks. Try using apps like Greenify and changing your kernel settings to keep your hardware resources in check. Regularly running fstrim on your partitions also helps.

If it's kernel-specific, like random reboots, make sure you can reproduce the problem.
Once you have reproduced the problem, immediately reboot into recovery and adb pull /proc/last_kmsg. Attach that here and I'll try to take a look at it when I have time.

I can't promise a fix, though - I'm only a high school student, not an expert C developer.
7th March 2016, 10:03 PM |#4  
Recognized Contributor / Recognized Developer
Thanks Meter: 8,066
 
Donate to Me
More
Not sure why your using that kernel...

https://github.com/Lloir/htc_kernel_oxp/commits/cm-12.1

That's the one that was being used in 12.1
7th March 2016, 10:18 PM |#5  
aureljared's Avatar
OP Senior Member
Flag Quezon City
Thanks Meter: 612
 
More
Quote:
Originally Posted by Lloir

Not sure why your using that kernel...

https://github.com/Lloir/htc_kernel_oxp/commits/cm-12.1

That's the one that was being used in 12.1

Cool! I must have missed that somehow. Will try compiling from that tonight. Thanks! 😀

Sent from my One X+ using Tapatalk
8th March 2016, 10:04 AM |#6  
Member
Thanks Meter: 9
 
More
Hello,

Great to hear somebody is working on a custom 5.1 kernel.
Are you open to suggestion?
Do you need beta testers?
I'm here.

I would like to have kernel frequency scaling enabled, in manner I can use SetCPU app to save battery.
I will wait for the new compilation, and then I can help you with the tests.
I've currently installed CarbonROM 5.1.1, so I'm ready to test!

Ciao,
Giovanni
8th March 2016, 11:11 AM |#7  
aureljared's Avatar
OP Senior Member
Flag Quezon City
Thanks Meter: 612
 
More
Quote:
Originally Posted by croccodillo

Hello,

Great to hear somebody is working on a custom 5.1 kernel.
Are you open to suggestion?
Do you need beta testers?
I'm here.

I would like to have kernel frequency scaling enabled, in manner I can use SetCPU app to save battery.
I will wait for the new compilation, and then I can help you with the tests.
I've currently installed CarbonROM 5.1.1, so I'm ready to test!

Ciao,
Giovanni

Suggestions are always welcome, but as I know very little about C/C++, perhaps it'll take a while for suggestions to be completed and included in the kernel.

Anyway, yes, alpha/beta testers are also welcome

If by "kernel frequency scaling" you mean being able to set min/max cpu freq, it's already working in 0.2-a, just use Kernel Adiutor for changing settings. I'm not sure if SetCPU will work.

If you /do/ plan to test, however, could you please send me a copy of the boot.img in Carbon 5.1.1? My internet's quite slow and I'm not sure if the ramdisk in CM (which is what this kernel is using) is the same as the ramdisk in Carbon. Thanks!
8th March 2016, 01:05 PM |#8  
Member
Thanks Meter: 9
 
More
Well,

Here is the Carbon boot.img:
Cabon ROM boot.img

Hope this is what you need.

Ciao,
Giovanni
The Following User Says Thank You to croccodillo For This Useful Post: [ View ] Gift croccodillo Ad-Free
8th March 2016, 01:37 PM |#9  
aureljared's Avatar
OP Senior Member
Flag Quezon City
Thanks Meter: 612
 
More
Quote:
Originally Posted by croccodillo

Well,

Here is the Carbon boot.img:
Cabon ROM boot.img

Hope this is what you need.

Ciao,
Giovanni

Thanks! That was what I needed.

Can you try this kernel? pulsar-enrc2b-0.3beta-CARBONROM-TEST-20160308.zip

Just replace all the .ko files in /system/lib/modules with the .ko files inside the "modules" folder in the ZIP, then flash boot.img with fastboot. Remember to take a nandroid of /system and boot first

Tell me if it boots up.
9th March 2016, 02:45 PM |#10  
Member
Thanks Meter: 9
 
More
OK, here we are.
With your 0.31 version, the phone boots up, seem fine, S2W works, but there's no SIM!
I cannot access the SIM, so no phone calls are possible.
Please find attache last_kmsg.txt file (no last_boot.txtx because the source file is always empty).
I also attached a screenshot, you can see in the status bar a strange icon on the left of battery one; what does it means?

However, all the rest seems to work, the phone seems fast and responsive, no lags, and S2W works like a charm.
Great job!

Just to let you know: even the boot.img shipped with the Carbon ROM I have problems with the sim, I have to insert the pin twice, and sometime, during the day, I have to reinsert the pin again, one or twice a day.

As far as I remember, there was a problem with SeLinux rights. But probably I'm worng.

By the way, WiFi works great.

Now, back to original ROM kernel (this is my daily driver).

Ciao,
Giovanni
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2016-03-09-15-28-06.jpg
Views:	218
Size:	99.4 KB
ID:	3676388  
Attached Files
File Type: txt last_kmsg.txt - [Click for QR Code] (86.6 KB, 20 views)
The Following User Says Thank You to croccodillo For This Useful Post: [ View ] Gift croccodillo Ad-Free
9th March 2016, 04:01 PM |#11  
aureljared's Avatar
OP Senior Member
Flag Quezon City
Thanks Meter: 612
 
More
Quote:
Originally Posted by croccodillo

OK, here we are.
With your 0.31 version, the phone boots up, seem fine, S2W works, but there's no SIM!
I cannot access the SIM, so no phone calls are possible.
Please find attache last_kmsg.txt file (no last_boot.txtx because the source file is always empty).
I also attached a screenshot, you can see in the status bar a strange icon on the left of battery one; what does it means?

However, all the rest seems to work, the phone seems fast and responsive, no lags, and S2W works like a charm.
Great job!

Just to let you know: even the boot.img shipped with the Carbon ROM I have problems with the sim, I have to insert the pin twice, and sometime, during the day, I have to reinsert the pin again, one or twice a day.

As far as I remember, there was a problem with SeLinux rights. But probably I'm worng.

By the way, WiFi works great.

Now, back to original ROM kernel (this is my daily driver).

Ciao,
Giovanni

Did you use "pulsar-enrc2b-0.3beta-CARBONROM-TEST-20160308.zip" or "pulsar-enrc2b-0.3.1beta-20160309.zip"? Because the two have different ramdisks (and therefore different SELinux contexts).

The last_kmsg you attached was from a previous boot, meaning it was from the time when you were using the original kernel (Linux version 3.1.10-gb1789b5 lloir@BlackBear). You have to reboot twice before the correct logs appear (Linux version 3.1.10-pulsar+ aureljared@thegrid), sorry

If you can, try the zip I linked to in post #9 OR this newer zip.

P.S. Yeah, I also have the issue where I have to reinsert the SIM, it's quite annoying. But recently the issue hasn't occurred, so I'm happy
Post Reply Subscribe to Thread

Tags
enrc2b, kernel

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

Advanced Search
Display Modes