[Kernel][6.0][Identity Crisis][UberTC 4.9] KaminariKernel R7 [2 January 2017]

Search This thread

lost101

Inactive Recognized Contributor
May 30, 2008
7,417
9,305
Guys I'm gonna need your help.
I'm gonna do an experiment here.
I'll format the three core partitions (cache, data*, system) to f2fs and see how the device performs after that. (Cache and system are formatted to ext4 by default).
Of course this will require ramdisk mods but i can take care of that.
My request is: can someone here build me a custom TWRP that supports both /cache and /system on f2fs?

*Data is already formatted to f2fs on non-GPE phones (which is my phone's case) so i wont format it.

@h2o64 - have you any thoughts on this concept?
 

h2o64

Senior Member
Aug 13, 2012
2,320
6,746
Paris
@h2o64 - have you any thoughts on this concept?
It's possible (some bacon roms do it) if you refer to the twrp patch I'll post one this afternoon.
If you refer to ramdisk changes, just make sure that all partition are mounted through fstab (and not manually)
If you refer to benchmark, you should use bionic benchmark or classic Linux memcpy ones (goal is to benchmark i/o)

---------- Post added at 10:54 AM ---------- Previous post was at 10:18 AM ----------

@h2o64 - have you any thoughts on this concept?

Here is my suggestion for the TWRP edit : https://github.com/h2o64/android_de...mmit/02997e6cb9a5fb8e45b9803fa917bbde5ca43663

Code:
From 02997e6cb9a5fb8e45b9803fa917bbde5ca43663 Mon Sep 17 00:00:00 2001
From: Louis Popi <theh2o64@gmail.com>
Date: Sat, 3 Sep 2016 10:48:18 +0200
Subject: [PATCH] falcon: Add a script to detect if cache or system are f2fs

---
 recovery/root/f2fs-changer          | 21 +++++++++++++++++++++
 recovery/root/init.recovery.qcom.rc |  6 ++++++
 2 files changed, 27 insertions(+)
 create mode 100755 recovery/root/f2fs-changer

diff --git a/recovery/root/f2fs-changer b/recovery/root/f2fs-changer
new file mode 100755
index 0000000..b6b2ce8
--- /dev/null
+++ b/recovery/root/f2fs-changer
@@ -0,0 +1,21 @@
+#!/sbin/sh
+
+function change_fs() {
+
+BDEV=`/sbin/busybox readlink /dev/block/platform/msm_sdcc.1/by-name/$1`
+FSTYPE=`/sbin/busybox blkid $BDEV | /sbin/busybox cut -d ' ' -f3 | /sbin/busybox cut -d '"' -f2`
+
+  if [ "$FSTYPE" == "ext4" ] then
+    sed -i '/'$1'/s/f2fs/ext4/g' /etc/recovery.fstab;
+    sed -i '/'$1'/s/f2fs/ext4/g' /etc/twrp.fstab;
+  fi
+
+}
+
+# Change to f2fs for system and cache
+# as userdata is already handled by 
+# gpe-detect
+
+change_fs system
+change_fs cache
+
diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc
index 5208b3f..c0ff43a 100644
--- a/recovery/root/init.recovery.qcom.rc
+++ b/recovery/root/init.recovery.qcom.rc
@@ -13,6 +13,12 @@ on init
     wait /dev/block/platform/msm_sdcc.1/by-name/userdata
     exec /sbin/detect-gpe
 
+    # Change system or cache to f2fs
+    wait /dev/block/platform/msm_sdcc.1/by-name/system
+    wait /dev/block/platform/msm_sdcc.1/by-name/cache
+    chmod 755 /f2fs-changer
+    exec /f2fs-changer
+
 on boot
     write /sys/module/lpm_levels/enable_low_power/l2 3
     write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
 

Biz92k

Senior Member
Oct 18, 2015
109
14
Bologna
Moto G
Moto G5S Plus
Installed the R5 (regular) over the R5beta1 (permissive) this morning, no issues so far.

Just no dt2w showing up in Kernel Adiutor for me! :(

As always thanks for your awesome work! :D
 
Last edited:
  • Like
Reactions: xenas
It's possible (some bacon roms do it) if you refer to the twrp patch I'll post one this afternoon.
If you refer to ramdisk changes, just make sure that all partition are mounted through fstab (and not manually)
If you refer to benchmark, you should use bionic benchmark or classic Linux memcpy ones (goal is to benchmark i/o)

---------- Post added at 10:54 AM ---------- Previous post was at 10:18 AM ----------



Here is my suggestion for the TWRP edit : https://github.com/h2o64/android_de...mmit/02997e6cb9a5fb8e45b9803fa917bbde5ca43663

Code:
From 02997e6cb9a5fb8e45b9803fa917bbde5ca43663 Mon Sep 17 00:00:00 2001
From: Louis Popi <theh2o64@gmail.com>
Date: Sat, 3 Sep 2016 10:48:18 +0200
Subject: [PATCH] falcon: Add a script to detect if cache or system are f2fs

---
 recovery/root/f2fs-changer          | 21 +++++++++++++++++++++
 recovery/root/init.recovery.qcom.rc |  6 ++++++
 2 files changed, 27 insertions(+)
 create mode 100755 recovery/root/f2fs-changer

diff --git a/recovery/root/f2fs-changer b/recovery/root/f2fs-changer
new file mode 100755
index 0000000..b6b2ce8
--- /dev/null
+++ b/recovery/root/f2fs-changer
@@ -0,0 +1,21 @@
+#!/sbin/sh
+
+function change_fs() {
+
+BDEV=`/sbin/busybox readlink /dev/block/platform/msm_sdcc.1/by-name/$1`
+FSTYPE=`/sbin/busybox blkid $BDEV | /sbin/busybox cut -d ' ' -f3 | /sbin/busybox cut -d '"' -f2`
+
+  if [ "$FSTYPE" == "ext4" ] then
+    sed -i '/'$1'/s/f2fs/ext4/g' /etc/recovery.fstab;
+    sed -i '/'$1'/s/f2fs/ext4/g' /etc/twrp.fstab;
+  fi
+
+}
+
+# Change to f2fs for system and cache
+# as userdata is already handled by 
+# gpe-detect
+
+change_fs system
+change_fs cache
+
diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc
index 5208b3f..c0ff43a 100644
--- a/recovery/root/init.recovery.qcom.rc
+++ b/recovery/root/init.recovery.qcom.rc
@@ -13,6 +13,12 @@ on init
     wait /dev/block/platform/msm_sdcc.1/by-name/userdata
     exec /sbin/detect-gpe
 
+    # Change system or cache to f2fs
+    wait /dev/block/platform/msm_sdcc.1/by-name/system
+    wait /dev/block/platform/msm_sdcc.1/by-name/cache
+    chmod 755 /f2fs-changer
+    exec /f2fs-changer
+
 on boot
     write /sys/module/lpm_levels/enable_low_power/l2 3
     write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1

The problem is that i dont know how to build twrp :( . And i would like this patch to be tested against the latest official twrp release for falcon (which is 3.0.2-0 as of now).
 

h2o64

Senior Member
Aug 13, 2012
2,320
6,746
Paris
The problem is that i dont know how to build twrp :( . And i would like this patch to be tested against the latest official twrp release for falcon (which is 3.0.2-0 as of now).

Here are the steps :
Code:
# Setup a working dir
$ mkdir OMNIROM
$ cd OMNIROM
# Sync OmniROM Marshmallow
$ repo init -u git://github.com/omnirom/android.git -b android-6.0
$ repo sync -c -j8
# Download falcon tree
$ git clone https://github.com/TeamWin/android_device_motorola_falcon -b android-6.0 device/motorola/falcon
# Apply my patch
$ cd device/motorola/falcon
$ git fetch https://github.com/h2o64/android_device_motorola_falcon android-6.0-f2fs
$ git cherry-pick 02997e6cb9a5fb8e45b9803fa917bbde5ca43663
$ cd ../../..
# Lunch and build
$ . build/envsetup.sh
$ lunch omni_falcon-userdebug
$ make -j8 recoveryimage
 

Haggster66

Senior Member
Feb 23, 2013
241
108
flashed the new one on top of the beta, from /sdcard/.

Both versions, old and new, are/were enforced in regards to SELinux

Working without the slightest of issues, mega smooth.

So the new one has HZ=300? If it does than this is great, should make things more responsive.

As always, keep it up! And btw, great idea regarding f2fs on system and cache. I think it should make a small difference if cache is formatted as f2fs, /system not so much, but then again, it would make more sense to format all partitions with the same fs.

Most likely the speed gains won't be huge though, because obviously most writes happen on the data partition. I strongly assume that this is also why on stock, only that partition is formatted with f2fs.

BTW, I was wondering, you've got commit 2dd9976e1fadaaee320239a4a671032374f8a869 , but that is only one patch out of the three-piece patch set from here: https://lkml.org/lkml/2011/5/11/144 . In order to make SLUB work nicely, all three patches would be required (the patches for page_alloc.c are optional). I'm using all three patches for my own kernel and it works/compiles without issues. Otherwise I would consider switching to SLAB, which is known to work better on low-mem devices such as ours.

Anyway, soon I'll be using this kernel (well, the codebase has totally changed, lol) for a year and they're not getting worse, so keep them coming ;)
 
Here are the steps :
Code:
# Setup a working dir
$ mkdir OMNIROM
$ cd OMNIROM
# Sync OmniROM Marshmallow
$ repo init -u git://github.com/omnirom/android.git -b android-6.0
$ repo sync -c -j8
# Download falcon tree
$ git clone https://github.com/TeamWin/android_device_motorola_falcon -b android-6.0 device/motorola/falcon
# Apply my patch
$ cd device/motorola/falcon
$ git fetch https://github.com/h2o64/android_device_motorola_falcon android-6.0-f2fs
$ git cherry-pick 02997e6cb9a5fb8e45b9803fa917bbde5ca43663
$ cd ../../..
# Lunch and build
$ . build/envsetup.sh
$ lunch omni_falcon-userdebug
$ make -j8 recoveryimage

Nevermind :p . I havent enough disk space to download the whole android source code...
 
  • Like
Reactions: Wyneg
flashed the new one on top of the beta, from /sdcard/.

Both versions, old and new, are/were enforced in regards to SELinux

Working without the slightest of issues, mega smooth.

So the new one has HZ=300? If it does than this is great, should make things more responsive.

As always, keep it up! And btw, great idea regarding f2fs on system and cache. I think it should make a small difference if cache is formatted as f2fs, /system not so much, but then again, it would make more sense to format all partitions with the same fs.

Most likely the speed gains won't be huge though, because obviously most writes happen on the data partition. I strongly assume that this is also why on stock, only that partition is formatted with f2fs.

BTW, I was wondering, you've got commit 2dd9976e1fadaaee320239a4a671032374f8a869 , but that is only one patch out of the three-piece patch set from here: https://lkml.org/lkml/2011/5/11/144 . In order to make SLUB work nicely, all three patches would be required (the patches for page_alloc.c are optional). I'm using all three patches for my own kernel and it works/compiles without issues. Otherwise I would consider switching to SLAB, which is known to work better on low-mem devices such as ours.

Anyway, soon I'll be using this kernel (well, the codebase has totally changed, lol) for a year and they're not getting worse, so keep them coming ;)

Could you please link me those patches?

Edit: Yeah, new codebase (CM this time :p ). And thanks!
 
  • Like
Reactions: Wyneg
For those who want CPU overclock... Here goes a TEST build. This time with a 1.73 GHz (!!!) overclock.

This build has:
* MSM Hotplug (mpdecision is gone)
* Kwoktopus' simplified msm-thermal driver
* Forced permissive selinux (custom thermal driver causes denials all the damn time)
* Usb fast charge

Fast charge might eventually make it to the stable builds.
 

Attachments

  • Kaminari_OCtesting2_Falcon_OCReady.zip
    6.1 MB · Views: 53
  • Like
Reactions: xenas and lost101

himu_joy

Senior Member
Sep 11, 2011
596
149
BD
Moto G
Xiaomi Redmi 4X
For those who want CPU overclock... Here goes a TEST build. This time with a 1.73 GHz (!!!) overclock.

This build has:
* MSM Hotplug (mpdecision is gone)
* Kwoktopus' simplified msm-thermal driver
* Forced permissive selinux (custom thermal driver causes denials all the damn time)
* Usb fast charge

Fast charge might eventually make it to the stable builds.

so u guys does not letting our MoTo G old? everything possible on this cutee? Impossible machine....impossible developer all there.....
thanks all.

NB: fast charge, mean now can get charge over 2A.? normally I got 1.2A max.
 
Last edited:

Haggster66

Senior Member
Feb 23, 2013
241
108
Could you please link me those patches?

Edit: Yeah, new codebase (CM this time :p ). And thanks!
there you go (you already got the second one);
https://lkml.org/lkml/diff/2011/5/11/46/1
https://lkml.org/lkml/diff/2011/5/11/228/1
https://lkml.org/lkml/diff/2011/5/11/143/1

The first one might or might not cause problems when trying to patch page_alloc.c - but that part can be omitted without problems, so you can remove that part from the patch but apply the rest which modifies SLUB itself.

This should make things smoother when memory is low (which is basically all of the time on a 1GB device).
 
so u guys does not letting our MoTo G old? everything possible on this cutee? Impossible machine....impossible developer all there.....
thanks all.

NB: fast charge, mean now can get charge over 2A.? normally I got 1.2A max.

Funny, isnt it? This little damn phone simply refuses to die! :p
About the charging current, i never measured it myself, so i cant tell...
 

h2o64

Senior Member
Aug 13, 2012
2,320
6,746
Paris
For those who want CPU overclock... Here goes a TEST build. This time with a 1.73 GHz (!!!) overclock.

This build has:
* MSM Hotplug (mpdecision is gone)
* Kwoktopus' simplified msm-thermal driver
* Forced permissive selinux (custom thermal driver causes denials all the damn time)
* Usb fast charge

Fast charge might eventually make it to the stable builds.
Lol, happy to see that my oc never gets old.

PS : Be aware when you're touching those cpu corner dt, moto modified msm8x26 a bit and porting dt from other devices isn't very great (on long term)
 
  • Like
Reactions: lost101

xenas

Senior Member
Jun 30, 2013
192
30
I'm testing the latest kaminari kernel with OC, on the latest finest Rom provided by the master lost, and for now everything is running smoothly.
Thanks for the excellent work and keep it up buddy.
 

Penemue

Senior Member
Mar 2, 2015
63
26
I'm very happy with R5 for now. Biggest change I noticed is that navigating in the phone, using the drawer and recents are feeling much more smoother somehow. Especially with recents, there was always a little lag for me before.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    KaminariKernel

    Code:
    #include "std_disclaimer.h"
    
    /*
     * Your warranty is now (even more) void.
     *
     * I am not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this KERNEL
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at me for messing up your device, I will simply grab my popcorn and laugh at you.
     *
     * Tl;dr: if your device crashes and burns, and if you get screwed up because of that, it's entirely your fault.
     */

    Hiya fellas.

    I suppose yall know that there's a ported rom from titan/thea (IDCrisis) for our Moto G. And I've ported a rom myself (but I don't plan on releasing it >.<). And this kernel is designed to work with any stock-based (read: ported from titan) rom for our device (especially IDCrisis).

    But fair warning: don't even think about flashing it on Lollipop.


    Features:
    Sources & Optimizations
    - Based on CM13's shared falcon/peregrine/titan/thea sources
    - Compiled with Uber Toolchain 4.9.4
    - Compiled with -O3 optimization & some more flags (e.g. Pipe flag)
    - Optimized ARM RWSEM & Square Root algorithms
    - Kernel-side NEON mode
    - Some miscellaneous armv7 tweaks

    Hotplugging Drivers
    - Ye Olde MPDecision
    - AutoSMP


    Extra CPU Governors
    - Bioshock
    - Dancedance
    - Impulse
    - Lionheart
    - Smartmax
    - Yankactive
    - Yankdemand
    - Zzmoove
    No more!!!

    Extra I/O Schedulers
    - Bfq
    - Fiops
    - Sio
    - Vr
    - Zen (Default)

    Sound
    - Faux's Sound Control
    - Headset High Performance Mode

    Screen/GPU
    - Kcal Screen Control
    - Dt2w/s2w Nicht mehr!
    - State Notifier driver
    - Adreno Idler
    - GPU overclock & underclock (533MHz/100MHz)
    No more!!!

    Extra Sh*t
    - Simplified msm-thermal driver by @kwoktopus Was causing trouble
    - Disabled gentle fair sleepers
    - USB Fast Charge
    - Extra TCP Congestion Controllers
    - Compass & Accelerometer drivers now use State Notifier Was causing trouble too
    - Fsync enabled by default
    - Kexec-hardboot patch (for multirom compatibility)
    - Power-efficient workqueues


    Downloads:

    For Falcon:
    Standard Version
    Permissive Version (Flash this only if you're having major SELinux-related issues)

    For Peregrine:
    Standard Version
    Permissive Version (Flash this only if you're having major SELinux-related issues)



    Flashing Instructions (Follow this very carefully!!!):
    - Place the zip at the root of your phone's internal storage, i.e. /sdcard (This is very important! If you flash the zip from a subfolder, you'll be left without wi-fi!!! This is a bug on the install script's side. I'll be looking into it.)
    - Reboot into recovery
    - Flash the zip
    (Another way: Reboot into recovery without copying the zip, and flash it via adb sideload)
    - Reboot again and have fun!

    Coming from another kernel which isn't mine? Don't worry, no need to dirty flash the ROM/kernel anymore. The install script now does all the dirty work for you.

    If you wanna tweak stuff, use Kernel Adiutor! (Synapse is NOT supported!)

    Want some info on what this kernel offers you?
    Then go here! (Credits to @AssToast for suggesting and to @gsstudios for creating the site!)

    "Thank You" Section
    - Motorola/Lenovo, for putting up them sources
    - The CyanogenMod team
    - @Flashhhh, his work kinda inspired me to do this
    - @lost101, for creating IDCrisis
    - @Aayushya, he provided the initial cherry-picks
    - @faux123, for Sound Control & Intellithermal
    - @savoca, for Kcal Screen Control
    - @hurtsky, a huge load of cherry-picks came from his sources
    - @Alberto97, for the Linux version bumps (.43 up to .109)
    - @kwoktopus, for some more stuff
    - Some more fellas whose names I can't remember

    XDA:DevDB Information
    KaminariKernel (IDCrisis), Kernel for the Moto G

    Contributors
    kingkaminari
    Source Code: https://github.com/Kamin4ri/KaminariKernel/tree/idcrisis

    Kernel Special Features: Read above!!!

    Version Information
    Status: Stable
    Current Stable Version: R7
    Stable Release Date: 2017-01-02
    Current Beta Version: R6 Beta 2
    Beta Release Date: 2016-11-01

    Created 2016-03-26
    Last Updated 2017-01-02
    17
    I will pause development of all kernel variants (CM and this one), for all devices, for some time. No ETA for coming back. I just dont feel like continuing to do this right now. And before you ask, it has nothing to do with money/donations. Its because im having a quite busy life these days. I hope you understand.
    13
    R4 is now ready!

    It has been based on the previous test builds (the adapted CM13 kernels) with a few more commits (unaligned access).

    I'll think about re-adding dt2w & overclock in future builds. Cpu-boost hasn't been added yet, it still needs to be tested.

    Downloads:
    - Falcon
    - Peregrine
    - [Bonus] Titan/Thea

    If you have a spare 2nd gen Moto G (running 6.0 of course), feel free to try the titan test build! Works on the LTE model too.
    12
    The second R6 beta is out. Changes:

    - New codebase (built from the CM14.1 kernel tree)
    - A load of patches from CM, me & kwoktopus
    - Reverted a CM commit which is the possible cause of wi-fi being broken (I hope...)

    Permissive version is back by popular demand. But you shouldnt' flash it except in case of major SELinux-related issues.

    Downloads:
    1. Falcon:
    - Regular
    - Permissive

    2. Peregrine:
    - Regular
    - Permissive
    12
    R1 is ready! After days and days and days...

    Note: This build has selinux force-set to permissive so you can use system mode supersu w/o any problems.

    Download (Falcon)
    Download (Peregrine)