• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [LINARO] AWEstruck v1.04 12/14/14 | [3.4.107] v1.05b6 5/30/15

spock1104

Android Expert
Jul 9, 2013
1,038
905
Introducing the AWEstruck kernel. I've taken the stock kernel source from and compiled it with Linaro 4.9.3, with cortex-a15 optimization. The result from benching seems to be better I/O and memory performance. My goal is to continue adding updates and customizations, this is just a start. As such, I'm taking feature requests.

Features:
Linaro O3 compilation
CPU overclocking up to 2 GHz (Try clocks 1 step at a time or you may break your phone)
CPU voltage controls
Extra CPU governors
Extra GPU governor
Built-in thermal control
Built-in mpdecision
Dynamic readahead
Common code base for JellyBean and KitKat

Beta Features:
UHID
Kernel 3.4.107
exFAT/SDXC
Prevent entropy depletion

To tweak the kernel (such as governors, schedulers, mpdecision) the use of 3C Toolbox is highly recommended. Trickster Mod is a simpler option but is prone to busybox issues. These are the only two verified to have full support. I'm in the process of validating Kernel Adiutor, looks promising.

**Disclaimer** I take no responsibility for a broken phone. Make sure you have backups.

Your WiFi MAC will change on first boot of this kernel! JellyBean versions will say JB in the file name, KitKat will say KK.
AWEStruck_JB_v1.04.zip - 9.34 MB

Feel a little more daring? Try a beta!
http://www.mediafire.com/download/d7qs9j7ui9u6v8i/AWEStruck_JB_v1.05_beta6.zip
MD5: 9A1D422F9388F8478AF58DF9B319E61D

http://www.mediafire.com/download/5h9jr69vuy3k75d/AWEstruck_KK_v1.05_beta6.zip
MD5: 6FC16EC3ADE220589EB12CBA62106E16

Recommended CPU settings are 162MHz - 1.35GHz, defaults are 162MHz - 1.18GHz (manufacturer low was 384MHz). 162MHz will squeeze a little more battery life out of the phone on low loads, and 1.35GHz has the same voltage as 1.18GHz so more bang for your power. For great I/O, use the SIO scheduler with a cache size of 2048 or the FIOPS scheduler with a cache size of 3072.

*** Overclocking is luck of the draw, not all processors can overclock and some can overclock better than others. DO NOT set an overclock on boot until you have stability tested that clock, otherwise you will end up in a boot loop ***

If you encounter a stability issue please collect a logcat and a dmesg/last_kmsg for me so I can investigate. I stability test on my phone and generally don't have issues when I release. [HOW TO] - [Post Kernel last_kmsg] - [make Nova Launcher fully expand(desktop mode)] - xda-developers for more detail on last_kmsg

Switch back to stock: http://androidforums.com/awe-all-things-root/848066-dev-kernel-linaro-awestruck.html#post6572619 - Thanks brittnearl!

Source code here: https://github.com/spock1104/android_kernel_zte_nex
If you make use of this code please try to fork or at least cherry-pick to facilitate code sharing. If you build this code or any subset into a binary you must make your source code available at the same time, per GPL.

Loading instructions:
To perform a one-off test:
Make sure you have ADB working. Extract the boot.img from the zip and place in your ADB directory.

adb reboot-bootloader

wait for the phone to boot to the blank bootloader screen

fastboot boot boot.img

The phone will then reboot using the new kernel. This can be verified in the about phone menu, svn10896 will no longer appear in the version. WiFi likely won't work until you flash the zip.

To permanently load the kernel, flash the zip in recovery. This WILL overwrite system files, make sure you have a backup!

See post #2 for tips on reducing battery drain

See post #3 for a guide on compiling your own kernel

Code:
CHANGELOG:
AWEstruck v.105 beta6 5/30/15
Linaro 4.9.3 2015.03
Port audio drivers from n9520 (hopefully fix sound reboots)
patched up to 3.4.107

AWEstruck v1.05 beta5 1/24/15
Linaro 4.9.3 2015.01
fix UHID

AWEstruck v1.05 beta4 1/16/15
Linaro 4.9.3 2014.12
disabled HID battery and hidraw
voltage corrections for clocking beyond 1.83GHz

AWEstruck v1.05 beta3
add UHID support (thanks PhenomX4)
enable HID battery and hidraw

AWEstruck v1.05 beta2
patched the kernel up to 3.4.105
add exFAT support (should enable the use of SDXC)

AWEstruck v1.05 beta 1
readahead tweaks
prevent entropy depletion
patched the kernel up to 3.4.86

[B]AWEstruck v1.04 12/14/14[/B]
Switch to Linaro 4.9.3
unify KitKat and JellyBean code (Thanks PhenomX4)
Switch to LZO compression for faster boots
Remove GPU OC, it didn't actually work
Fix CPU overclock table, add new clocks up to 2 GHz
Add CPU voltage tuning
Set minimum clock to 162MHz
Add Intelliactive, Intellidemand, and Lionheart governors (Thanks PhenomX4)
Add dynamic readahead (Thanks rbheromax)
Add compilation of zram/zcache/zsmalloc modules (not included by default) (thanks rbheromax)


[B]AWEstruck v1.03c 6/25/14[/B]
Modify mpdecision for two cores and re-enable

[B]AWEstruck v1.03a 6/24/14[/B]
Fix an error in init.qcom.post_boot.sh

[B]AWEstruck v1.03 6/22/14[/B]
Revise [B]CPU [/B]overclocks based on jimsmith80's tables. 1.512GHz and 1.674GHz have replaced 1.566GHz and 1.62GHz.
Enable [B]GPU[/B] 450, 487.5, 504, 545, 600, and 627MHz overclocks
Add faux123's simple GPU governor
thermald replaced with kernel based thermal throttling and shutdown (thermald caused the CPU to exceed the user set max)
Remove CPU frequency jumps when coming back from suspend
Update CPU frequency handling
Disabled kernel MPdecision for the time being
Reduce size of init.qcom.post_boot.sh

[B]AWEstruck v1.02 5/30/14[/B]
Update Prima to 3.2.2.17b
Add kernel based mpdecision from showp1984(updater deletes ROM based mpdecision)
Enable [B]CPU [/B]162, 270, and 378MHz underclocks
Enable [B]CPU [/B]1.242, 1.296, 1.350, 1.404, 1.458, 1.566, 1.62, and 1.728GHz overclocks
Add VR, ZEN, SIO, and FIOPS I/O Schedulers
Add Wheatley and Conservative CPU governors

[B]AWEstruck v1.01a[/B]
Fix the updater script.  This is why editing files at 1:30AM isn't always a great idea.

[B]AWEstruck v1.01[/B]
Update WCNSS WiFi, add Prima kernel module v3.2.2.6 from CM11 MAKO (WiFi fix)
Remove some debug
Switched from Ofast to O3, some programs won't like ffast-math

[B]AWEstruck v1.0[/B]
Downloaded source from ZTE
Pulled defconfig from phone
Linaro optimized
I appreciate any feedback, testing, and development help I can get.

Thanks to brittnearl, starkraving, DysMnapTic, and dragonhart6505 for being willing and eager guinea pigs testers

Thanks for the source:
aosp
cyanogenmod
codeaurora
rbheromax
phenomx4
jimsmith80
showp1984
faux123
dorimanx
f4k
DooMLoRD
franciscofranco
Grarak
And a HUGE thanks to Christopher83 for his Linaro binaries


Enjoy!

To Do:
OTG support
Add color controls
cleanup unnecessary code
update drivers
init.d support
anykernel updater for full KitKat support
 
Last edited:
Helping you and me reduce battery drain

In order to reduce battery drain, we need to know what on the phone is actually draining it. We can accomplish this via Better Battery Stats. Download and install the app, and give it root permissions.

What can you do to reduce your own battery use?
Monitor the partial wakelocks, which will come from apps waking the phone up to do their thing. Some apps just like to be greedy about their CPU usage. If it's an app you can do without, uninstall it. If it's a system app you can do without, I recommend using ES File Explorer to force an uninstall (BUT BE VERY CAREFUL ABOUT WHAT YOU REMOVE). Make a backup first, either nandroid or with Titanium Backup. If you want or need to keep the app, I recommend using Greenify to hibernate the app.

What can you do to help me reduce battery use?
Monitor the kernel wakelocks tab. If it looks like the kernel has gone wild:

  • Open the BetterBatteryStats settings
  • Open Advanced
  • Open Sharing Options
  • Select Text, Logcat, and dmesg
  • Go back to the main screen
  • Select the share button in the top right
  • Select save
  • Grab the dated BetterBatteryStats, dmesg, and logcat files from your sdcard
 
Upvote 0
This is a work in progress and open source. I have limited time to work on it and would rather not do so alone. So, here's the basics to get started. The environment will also set you up for ROM building for the eventuality we get full ROM builds from source.

Environment
This can be done on either a dedicated box or a virtual machine. I've seen recommendations of 50-100GB of space, but I recommend 150 for managing several build directories at once. Follow most of the instructions on Initializing a Build Environment | Android Developers . Also don't mind the RAM requirements, I run my virtual machine with 4GB and its fine.

and to install git

sudo apt-get update sudo apt-get install git git-core
use the instructions at Downloading the Source | Android Developers to install Repo

You'll also need a toolchain. The source provided by ZTE will not boot with a 4.8 or later GNU-based toolchain, but I've since fixed this. I'm using a custom Linaro 4.9.2 build from [LINARO GCC] Cross Compiler Toolchains [Linaro GCC 4.9 2014.05, 4.8 and 4.7 2014.04][17/05/2014] - xda-developers
Make a directory in your home folder called toolchains, and unzip the toolchain in this directory.

Lastly, you'll need the tool for building boot images

sudo apt-get install abootimg

Downloading the source
Decide on a directory structure for yourself on where you want to put your builds. I recommend ~/nex/

Sign up for an account on GitHub, and then go to https://github.com/spock1104/android_kernel_zte_nex and click the Fork button. This will duplicate the source code on GitHub to an area where you can make your own changes, and hopefully lead to collaboration. On the webpage for your fork, on the right side there will be an HTTPS Clone URL. Copy this URL.

Back to the terminal, go to your working directory and type
git clone <clone_url>

This will download the source to your computer so that you can begin working on it.

now open the android_kernel_zte_nex directory and do a

git checkout

Build the code!
First we'll set up variables that tell the system what we're building and how to do it

export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=~/toolchain/arm-cortex_a15-linux-gnueabihf-linaro_4.9.2-2014.09/bin/arm-gnueabi-

Next many more variables that tell the system what kernel options we want

make nex_defconfig

And lastly building the code

make

*Or if you are set up with multiple processors and want to run a faster build, add a -j# where the # is one above the number of processors you're using. Ex. for two processors run

make -j3

You'll see a lot of compiler messages scroll by. With any luck, you'll get no errors and the magical words at the end:

"Kernel: arch/arm/boot/zImage is ready"

Create a bootable image
The zImage is what you need from the compilation but it's not enough to run with. Now you need to piece together a full boot image. Download the stock boot that britnearl provided and extract the boot.img from the zip into your kernel directory. Copy to a new name, like test.img. Then do:

abootimg -u test.img -k arch/arm/boot/zImage

this will likely result in an error message that the image is too big, like this one:

test.img: updated is too big for the Boot Image (7712768 vs 6828032 bytes)

The solution to this is going to seem far too easy but it works, and will work so long as your boot image doesn't exceed 16MB. Copy the size it is complaining about and feed it back to the tool.

abootimg -u test.img -k arch/arm/boot/zImage -c "bootsize=7712768"

You now have a usable boot image that you can run through the bootloader or directly flash. You will also need to copy ./drivers/staging/prima/wlan.ko to /system/lib/modules/prima/prima_wlan.ko for WiFi to work.

If you want to make a flashable zip, copy the latest AWEstruck zip and extract. copy your boot.img over mine with the same name, and do the same for prima_wlan.ko. Zip it back up.


Let me know what information you'd like to see added or improved in this guide. Thanks, and happy compiling!
 
  • Like
Reactions: A android B
Upvote 0
Not bad at all..
nazyra4e.jpg
 
Upvote 0
Is it currently at default clock speed? My major feature requests would be undervolting, I/O and governor options. Thanks will give this initial build a go. :D

Another +1 I've been dying for an under volt. Phone gets too hot to charge sometimes. I think its more a ram clearing issue, but under volting would definitely drop temps. Downloading now to test. :)
 
Upvote 0
For documentation's sake, it looks like we have the Prima wcnss wifi module

Little confused right now. The default configuration compiled the driver into the kernel instead of as a module, but the logcats show it thinks it can't get a signal. To top it off, the code as-is won't compile as a module.

Sorry guys, no quick fix. I'll look into undervolting once I do get the wifi going to make up for it.
 
Upvote 0
Little confused right now. The default configuration compiled the driver into the kernel instead of as a module, but the logcats show it thinks it can't get a signal. To top it off, the code as-is won't compile as a module.

Sorry guys, no quick fix. I'll look into undervolting once I do get the wifi going to make up for it.

No worries I think you did a nice job for an initial build. I'm wondering if for our device like so many other ZTE sources is incomplete? If there could be drivers etc missing from source? I say this because even in the theming and modding of xmls, smali and images for various system level apks there's lots extraneous code, xhdpi, mdpi drawable folders that serve no apparent purpose because they're not being called by anything... Looking at the stock ROM as a whole it seems very sloppily made and a lot of things seem like after thoughts.
 
Upvote 0
No worries I think you did a nice job for an initial build. I'm wondering if for our device like so many other ZTE sources if it is incomplete? If there could be drivers etc missing from source? I say this because even in the theming and modding of xmls, smali and images for various system level apks there's lots extraneous code, xhdpi, mdpi drawable folders that serve no apparent purpose because they're not being called by anything... Looking at the stock ROM as a whole it seems very sloppily made and a lot of things seem like after thoughts.

Agreed lots of obsolete code from previous devices eg: lock screen, also theres code for sim eg: network controller, so probably incomplete or obsolete kernel source
 
  • Like
Reactions: starkraving
Upvote 0
Another +1 I've been dying for an under volt. Phone gets too hot to charge sometimes. I think its more a ram clearing issue, but under volting would definitely drop temps. Downloading now to test. :)

Yeah definitely one of the hottest on charge handsets I've ever had. Even powered off it can get warm to the touch. I'm guessing its battery/hardware...But anything that helps is a positive.
 
Upvote 0
I've actually had better temps with an after market charger and I keep airplane mode on and GPS off, auto syncing off and rotation off.

Wow...well we shouldn't have to shut every feature of the device off to charge. Its ridiculous imo...and the manufacturer doesn't care because its not a big 4 device and aren't going to do a maintenance update or a HW revision. I guess that's where the dev community steps in.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones