[Kernel][5.x][carcosa-kernel][Stock kernel with cherry-picked features][2015/03/20]

Search This thread

jfmcbrayer

Senior Member
May 9, 2011
211
110
1. Motivation/overview

This is a kernel for the 2012 Nexus 7 (grouper/tilapia) which sticks as closely as possible to the stock/released kernel sources, while incorporating the features I want from other popular alternative kernels. I've built it because my Nexus 7 3G (tilapia) has trouble with all of the non-stock kernels I've tried -- something causing USB resets in a tight loop. I rebuilt the stock kernel and started adding my favorite features in order to rule out what was causing the problem, but ended up with a kernel I preferred for day-to-day use.

You might like it, too.

Note that there is very little original content in this kernel: see the credits below and the github repository for the sources of the included features.

2. Features

IO Schedulers
  1. bfq
  2. row
  3. SIO

CPU Governors
  1. smartmax
  2. wheatley

Misc
  1. Build with -Os (optimize for size)
  2. GPU overclock
  3. Experimental: remove baseband_xmm_power wakelock
  4. f2fs driver (see note in second post)
  5. ntfs r/w (see note in second post)
  6. CPU voltage control
  7. Mount slave namespace workaround
  8. CPU overclock (against my better judgement).

3. Instructions

This kernel is intended primarily for use with the stock ROM. The first releases (mr1 and a20) were built with a stock ramdisk, and will generally not work on other ROMs. Later releases use an AnyKernel updater and may work on other ROMs. I am only able/willing to test on stock, however, so non-stock users, use at your own risk (even more than usual).

To install, boot into your custom recovery of choice and install one of the zips below. Or use Flashify. Be sure to make a backup with your recovery first.

4. Warning and disclaimer

I am not responsible for any harm caused to you, your tablet, or the integrity of the space-time continuum by this kernel. In the words of the GNU Public License:


NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


5. Downloads

Milestone releases:
mr1: carcosa-kernel-mr1.zip

Alpha releases:
a20: carcosa-kernel-a20.zip
Includes experimental patch removing baseband_xmm_power wakelock.
a22: carcosa-a22-anykernel.zip
Includes changes to governor defaults, ntfs r/w support, and the f2fs driver.
a23: carcosa-a23-anykernel.zip
Includes voltage control (undervolting) interface.
a25: carcosa-kernel-a25.zip carcosa-a25-anykernel.zip
Includes mount slave namespace workaround, CPU overclocking (against my better judgement)
a27: carcosa-a27-anykernel.zip
4.4.3 update
a28: carcosa-a28-anykernel.zip
Remove baseband_xmm_power wakelock again, rather than making it time out.
a29: carcosa-a29-anykernel.zip
Add configurable baseband_xmm_power wakelock timeout
a33: carcosa-a33-lp-anykernel.zip
Lollipop update; adds SIO IO scheduler.
a35: carcosa-a35-lp-anykernel.zip
Lollipop 5.1 update (still works with 5.0.2). Adds hardware acceleration for kernel encryption routines.
6. Source

Sources are on github, which is also your best source for changelogs.

7. Credits

This kernel contains precious little original work -- it builds on the stock kernel release and applies cherry-picked patches from various sources, principally M-Kernel (Metallice) Franco-kernel (Francisco Franco), and Oxydo (Sgt. Meow), but also Faux123, Ezekeel, Maxwen, and many others. My main contributions have been picking the things I wanted, and resolving the occasional hairy merge. I have attempted to maintain the original authorship information in my git logs as much as possible; I apologize for any cases where the attribution of a particular patch has been lost.
 
Last edited:

jfmcbrayer

Senior Member
May 9, 2011
211
110
Notes

F2FS support

While this kernel (from a22 on) includes the f2fs driver, it does not include any of the ramdisk or init tweaks that you would need to use f2fs. This is because I am not in a position to test f2fs myself. That said, the a22 (and later) kernel installer will not disturb any changes you have already made to your ramdisk or ROM to support f2fs, so if you have already got f2fs working on your device, it should continue to work after installing this kernel. Don't forget to do a nand backup in your recovery before installing, though. Seriously.

NTFS R/W support

This kernel (from a22 on) includes RW support for NTFS. However, in KitKat, NTFS USB drives mounted with StickMount are not writable due to SELinux policy. To write to an NTFS USB drive, you need to (from a root shell) 'setenforce off', then 'setenforce on' when you're done using it. I do not recommend that you put SELinux in permissive mode permanently. It's there for a reason, and this is just a workaround for a policy error in KitKat. The SELinux SetEnforce Toggle app is a convenient way to turn it off and on for this.

Mount slave namespace workaround

Android apps that mount filesystems (e.g. CIFS, Lil'Debi's loopback fs), mount them in a private namespace that is not shared with other apps (as explained by mkasick). There is a rom-based workaround applied in CM-based roms, and probably many others, but not in stock. Instead, I am applying his kernel/ramdisk based workaround. If you are on stock and need this workaround, do not use the anykernel build; use the one with the full disk image.

Configurable baseband_xmm_power wakelock timeout

This is based on work by Sgt. Meow, with some tweaks. It is controlled by the module param /sys/modules/baseband_xmm_power/bb_timeout, which defaults to 10, and represents the time, in 10ths of a second, that the baseband_xmm_power wakelock should be acquired for before timing out. 0 will disable the wakelock completely as in earlier versions of carcosa-kernel. These semantics are not the same as those for the same parameter in Oxydo, so be aware.

-------------------------------------------------------------------------------------------------------
Camilla: You, sir, should unmask.
Stranger: Indeed?
Cassilda: Indeed, it's time. We all have laid aside disguise but you.
Stranger: I wear no mask.
Camilla: (Terrified, aside to Cassilda) No mask? No mask!
– from Act 1, Scene 2 of The King In Yellow
 
Last edited:

bjcrj

Senior Member
Sep 25, 2012
420
188
Kernel rocks! Thanks!
 

Attachments

  • uploadfromtaptalk1393561832190.jpg
    uploadfromtaptalk1393561832190.jpg
    25.9 KB · Views: 3,623
  • uploadfromtaptalk1393561844296.jpg
    uploadfromtaptalk1393561844296.jpg
    20.1 KB · Views: 3,449

gremlin89

New member
Oct 14, 2007
4
0
Hi, I'm using the newest CM Release and after flashing the kernel i got a com.android.phone has stopped error. I cleared the cache and the dalvik before restart.
 

jfmcbrayer

Senior Member
May 9, 2011
211
110
Hi, I'm using the newest CM Release and after flashing the kernel i got a com.android.phone has stopped error. I cleared the cache and the dalvik before restart.

The boot.img in the zips I've provided us built with a stock ramdisk, and CM needs its own ramdisk. Perhaps I could build an AnyKernel zip for non stock users.
 

adrman

Senior Member
Jul 17, 2012
1,595
632
NYC
Just flashed mr1 on bshiznit’s stock ROM earlier today. So far it's running nice and smooth. Nice work!

Sent from my Nexus 7 using Tapatalk
 

jfmcbrayer

Senior Member
May 9, 2011
211
110
Thank you very much for your work! Without your kernel my battery was empty within one or two days due to the annoying wakelocks, now my N7 runs since 7 days and I still have 40%! Awesome!

I'm glad to hear it. Am I correct in assuming that you have a tilapia device, and are running the alpha version of the kernel?
 

ispukan

Member
Oct 31, 2012
49
4
Just a question

What is the difference between Milestone and Alpha ? btw i am using nexus 7 wi-fi only model
 

sudipt123

Senior Member
Apr 27, 2010
97
13
OnePlus Nord
Hi, can I use this kernel on PA 4.1 beta on my tilapia? Currently using the Franco r77 kernel and still get massive baseband wakelocks! If this kernel doesn't work on the said ROM, how do I revert to the stock kernel? Using the FKA app and have a backup of stock kernel. Thanks

Sent from my Nexus 7 using XDA Premium HD app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    1. Motivation/overview

    This is a kernel for the 2012 Nexus 7 (grouper/tilapia) which sticks as closely as possible to the stock/released kernel sources, while incorporating the features I want from other popular alternative kernels. I've built it because my Nexus 7 3G (tilapia) has trouble with all of the non-stock kernels I've tried -- something causing USB resets in a tight loop. I rebuilt the stock kernel and started adding my favorite features in order to rule out what was causing the problem, but ended up with a kernel I preferred for day-to-day use.

    You might like it, too.

    Note that there is very little original content in this kernel: see the credits below and the github repository for the sources of the included features.

    2. Features

    IO Schedulers
    1. bfq
    2. row
    3. SIO

    CPU Governors
    1. smartmax
    2. wheatley

    Misc
    1. Build with -Os (optimize for size)
    2. GPU overclock
    3. Experimental: remove baseband_xmm_power wakelock
    4. f2fs driver (see note in second post)
    5. ntfs r/w (see note in second post)
    6. CPU voltage control
    7. Mount slave namespace workaround
    8. CPU overclock (against my better judgement).

    3. Instructions

    This kernel is intended primarily for use with the stock ROM. The first releases (mr1 and a20) were built with a stock ramdisk, and will generally not work on other ROMs. Later releases use an AnyKernel updater and may work on other ROMs. I am only able/willing to test on stock, however, so non-stock users, use at your own risk (even more than usual).

    To install, boot into your custom recovery of choice and install one of the zips below. Or use Flashify. Be sure to make a backup with your recovery first.

    4. Warning and disclaimer

    I am not responsible for any harm caused to you, your tablet, or the integrity of the space-time continuum by this kernel. In the words of the GNU Public License:


    NO WARRANTY

    11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

    12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


    5. Downloads

    Milestone releases:
    mr1: carcosa-kernel-mr1.zip

    Alpha releases:
    a20: carcosa-kernel-a20.zip
    Includes experimental patch removing baseband_xmm_power wakelock.
    a22: carcosa-a22-anykernel.zip
    Includes changes to governor defaults, ntfs r/w support, and the f2fs driver.
    a23: carcosa-a23-anykernel.zip
    Includes voltage control (undervolting) interface.
    a25: carcosa-kernel-a25.zip carcosa-a25-anykernel.zip
    Includes mount slave namespace workaround, CPU overclocking (against my better judgement)
    a27: carcosa-a27-anykernel.zip
    4.4.3 update
    a28: carcosa-a28-anykernel.zip
    Remove baseband_xmm_power wakelock again, rather than making it time out.
    a29: carcosa-a29-anykernel.zip
    Add configurable baseband_xmm_power wakelock timeout
    a33: carcosa-a33-lp-anykernel.zip
    Lollipop update; adds SIO IO scheduler.
    a35: carcosa-a35-lp-anykernel.zip
    Lollipop 5.1 update (still works with 5.0.2). Adds hardware acceleration for kernel encryption routines.
    6. Source

    Sources are on github, which is also your best source for changelogs.

    7. Credits

    This kernel contains precious little original work -- it builds on the stock kernel release and applies cherry-picked patches from various sources, principally M-Kernel (Metallice) Franco-kernel (Francisco Franco), and Oxydo (Sgt. Meow), but also Faux123, Ezekeel, Maxwen, and many others. My main contributions have been picking the things I wanted, and resolving the occasional hairy merge. I have attempted to maintain the original authorship information in my git logs as much as possible; I apologize for any cases where the attribution of a particular patch has been lost.
    5
    Notes

    F2FS support

    While this kernel (from a22 on) includes the f2fs driver, it does not include any of the ramdisk or init tweaks that you would need to use f2fs. This is because I am not in a position to test f2fs myself. That said, the a22 (and later) kernel installer will not disturb any changes you have already made to your ramdisk or ROM to support f2fs, so if you have already got f2fs working on your device, it should continue to work after installing this kernel. Don't forget to do a nand backup in your recovery before installing, though. Seriously.

    NTFS R/W support

    This kernel (from a22 on) includes RW support for NTFS. However, in KitKat, NTFS USB drives mounted with StickMount are not writable due to SELinux policy. To write to an NTFS USB drive, you need to (from a root shell) 'setenforce off', then 'setenforce on' when you're done using it. I do not recommend that you put SELinux in permissive mode permanently. It's there for a reason, and this is just a workaround for a policy error in KitKat. The SELinux SetEnforce Toggle app is a convenient way to turn it off and on for this.

    Mount slave namespace workaround

    Android apps that mount filesystems (e.g. CIFS, Lil'Debi's loopback fs), mount them in a private namespace that is not shared with other apps (as explained by mkasick). There is a rom-based workaround applied in CM-based roms, and probably many others, but not in stock. Instead, I am applying his kernel/ramdisk based workaround. If you are on stock and need this workaround, do not use the anykernel build; use the one with the full disk image.

    Configurable baseband_xmm_power wakelock timeout

    This is based on work by Sgt. Meow, with some tweaks. It is controlled by the module param /sys/modules/baseband_xmm_power/bb_timeout, which defaults to 10, and represents the time, in 10ths of a second, that the baseband_xmm_power wakelock should be acquired for before timing out. 0 will disable the wakelock completely as in earlier versions of carcosa-kernel. These semantics are not the same as those for the same parameter in Oxydo, so be aware.

    -------------------------------------------------------------------------------------------------------
    Camilla: You, sir, should unmask.
    Stranger: Indeed?
    Cassilda: Indeed, it's time. We all have laid aside disguise but you.
    Stranger: I wear no mask.
    Camilla: (Terrified, aside to Cassilda) No mask? No mask!
    – from Act 1, Scene 2 of The King In Yellow
    5
    Lolipop update is here: carcosa-a33-lp-anykernel.zip. It rebases on the released sources for 5.0.2 and adds the SIO IO scheduler.

    At some point, I want to tag my last (unreleased) KK kernel as milestone release 2, but I'm pretty limited on time right now.
    3
    The latest build is compatible with 5.1 stock. By default it eliminates the baseband_xmm_power wakelock completely, but you may have intermittent connectivity issues -- adjust the timeout to something other than 0 if you do (I'm currently setting it to 300 on my n7).
    2
    Are we still expecting this release?

    Yes, sorry about that. I meant to get it up the same day, but life interfered. A28 is up.