[WIP][6.0][LineageOS13] (Marshmallow) Custom Droid 4/RAZR OC Kernel and SDSwap

Search This thread

joojoobee666

Senior Member
Jul 9, 2008
624
504
This is a custom kernel for D4/RAZR based off of the CM13.0 Kernel that was created by @stargo for Marshmallow. Below is the list of features this kernel adds to the Stock CM13 kernel:
  • Over-clocking to 1.3 and 1.4Ghz
  • A special SELinux permissive kernel (here's looking at you @daniel_m)
  • Additional Governors - InteractiveX, KToonservative, Lionheart, SmartassH3 and ZZMove.
  • Additional Schedulers - ROW, SIO, SIO Plus, VR and Zen
  • IntelliPlug driver - Hotplugging while sleeping for all governors (leave governor Hotplug disabled as this overrides)
  • Additional frequency and scaling scaling options:
    • RunNGun - all frequencies between 300Mhz and 1000Mhz removed.
    • Full Scale - all frequencies (in steps of 100Mhz) enabled up to max speed kernel supports
    • *** All are labeled in the downloads section below ****
  • Additional Voltage Options for 1.4Ghz frequency: HV (High Voltage), LV (Low Voltage) and ULV (Ultra-Low Voltage)
  • LMK optomizations thanks to @u.b.o.o.t.

Speeds up to 1.4Ghz. I have no issues with 1.4, but mileage may vary per device. Try the ULV (Low Voltage) first. If this does not work, try the LV. If neither work, try the HV. If it's still not working, you may just have to use one that maxes out at 1.3Ghz.

I've included my SDSwap in separate zip as well here for folks who would like to swap the internal and external SD storage devices around (makes external SD card primary storage as opposed to internal). See links at the bottom. NOTE: You should NOT remove the card while booted when using this as there is no way to safely unmount when booted.

If you need to remove the SDSwap, there are three methods to do so:
  • Boot to recovery and simply reinstall the ROM you are running do NOT reinstall.
  • Upgrade to the latest ROM and do NOT reinstall.
  • Extract the the ramdisk.img file from the current ROM zip from /system/etc/kexec and overwrite the ramdisk.img on your device while either booted in recovery (mount /system first) or booted in the ROM, then reboot.


Kernel Changelog:
  • 2017-10-02: Fixed missing f2fs module.
  • 2017-10-01: Sync to upstream and rebase: 47 fixes, securit patches and cleanup
  • 2017-02-20: Fixed issue causing install to fail.
  • 2017-02-19: Sync to upstream: 10 security fixes and one reversion. *PULLED*
  • 2016-12-11: Sync to upstream: 2 security fixes, one to patch CVE-2016-8655 the other is to patch old ABI handling.
  • 2016-11-30: Sync to upstream: Security fix to disable ION contig heap
  • 2016-11-08: Sync to upstream: 9 patches
    • 3 ALSA security/stability patches
    • 2 Event/Audit log security/statbilty patches
    • 3 Block related stability patches
    • 1 HID stability update
  • 2016-10-30: Sync to upstream: 7 more security patches
  • 2016-10-23: Sync to upstream: patch for CVE-2016-5195
  • 2016-10-11: Sync to Upstream: 2 security fixes
  • 2016-10-10: Updated LMK patches with latest changes from @u.b.o.o.t essentially moving to the 2.2 version.
  • 2016-10-06: Updates
    • Fixed missing modified libthermal-manager.cfg.
    • Added in kernel modules found in /system/lib/modules in the event these get updated but you aren't running the latest CM
  • 2016-10-02: Updates:
    • Sync to upstream: 6 security related updates
    • Added Low Mem Killer (LMK) optimizations from @u.b.o.o.t. See his thread here for more info.
  • 2016-07-15: Sync to upstream: 2 more security fixes
  • 2016-06-28: Sync to upstream: 4 more security fixes.
  • 2016-06-25: Sync to upstream: KSM (Kernel Same-page Merging) fixes to improve power management.
  • 2016-06-05: Sync to upstream: USB-fix potential infoleak in devio
  • 2016-05-17: Sync to upstream: 6 more security/bug fixes dealing with Alsa, networking and input.
  • 2016-05-10: Sync to upstream: one small USB security related fix.
  • 2016-05-08: Sync to upstream: just more security and bug fixes.
  • 2016-05-03: Updates:
    • Sync to upstream:Over 170 small bug fixes, the majority around bluetooth. See full log here.
    • Some minor refactoring of #ifdefs to simplify things a bit for anyone compiling on their own.
  • 2016-03-23: Sync to upstream: poison pointer update to allow lower mmap_min_addr
  • 2016-03-19: Sync to upstream: Memory corruption fix
  • 2016-03-12: Sync to upstream: Security and big fixes
  • 2016-02-15: Sync to upstream:
    • Timekeeping fix: fix 32-bit overflow in get_monotonic_boottime
    • Wifi drop fix: Better handling of transition to NUD_PROBE state
  • 2016-02-14: Fixed compile issues causing incorrect clock speeds
  • 2016-02-13: Update: b0rked and not available
    • Another fuse fixes
    • Added a Low Voltage 1.4Ghz kernel in permissive mode
  • 2016-01-23: Sync with upstream:
    • Update for fuse, fixes issues with deletions
    • AK8975 update to fix compass issues (requires nightly 01-23 or later to benefit)
  • 2016-01-19: Complete removal of zcache.
  • 2016-01-14: Sync with Upstream:
    • Fixes to DSS to enable LiveDisplay/Color calibration.
    • Patch for Zram
  • 2016-01-03: Sync with upstream (block fixes) and set SELinux to enforced.
  • 2016-01-02: Sync with upstream. Just small bugfixes.
  • 2015-12-29: Initial port to CM13. For previous changes, see the cm12.x thread.


SDSwap Changelog:
  • 2017-10-01: updated to latest from device source, changes to init.
  • 2016-11-08: Updated fstab from upstream commit: Added ext4 support for /data partition
  • 2016-06-22: KSM (Kernel Samepage Merging) and ZRAM tweaks
  • 2016-05-05: Fixed issue causing boot-loops on RAZR (thanks @stargo and @jul515)
  • 2016-03-19: Updated just to update?
  • 2016-02-15: Updates:
    • Configure external storage as removable again. Eject at your own peril!
    • fixboot.sh update: add utf8 to mount-options for internal sd
  • 2016-01-23: Zram adjustments and fixes for compass (compass-fix requires nightly 01-23 or later)
  • 2016-01-19: Removal of zcache.
  • 2016-01-14: Allows usage of CM13 on stock slot
  • 2016-01-08: Allows usage of USB storage devices


Downloads:

Special SELinux permissive kernel

SD Card Swapper zip
Older/Archived kernels can be downloaded here if needed: https://droid.cs.fau.de/jjb666/Kernels


Disclaimer: You did it, not me. :cool:

XDA:DevDB Information
Custom 1.3Ghz and 1.4Ghz OC Kernel for Droid 4/RAZR on CM13, Kernel for the Motorola Droid 4

Contributors
joojoobee666, stargo, hashcode
Source Code: https://github.com/JooJooBee666/android_kernel_motorola_omap4-common/tree/cm-13.0

Kernel Special Features: Overclock to 1.3Ghz and 1.4Ghz, additional governors

Version Information
Status: Testing

Created 2015-12-30
Last Updated 2017-10-01


XDA:DevDB Information
Custom 1.3Ghz and 1.4Ghz OC Kernel for Droid 4/RAZR on CM13, Kernel for the Motorola Droid 4

Contributors
joojoobee666, stargo, hashcode
Source Code: https://github.com/JooJooBee666/android_kernel_motorola_omap4-common/tree/cm-13.0

Kernel Special Features: Overclock to 1.3Ghz and 1.4Ghz, additional governors

Version Information
Status: Testing

Created 2015-12-30
Last Updated 2017-10-02
 
Last edited:

Benzino.Gazolini

Senior Member
Aug 12, 2014
59
16
Personally I've used OC Full Scale Lite Kernel or Run 'N Gun Lite Kernel , because all the rest who had frequency more than 1300MHz lead to boot loop on my phone.
 
  • Like
Reactions: chuchipando

Septfox

Senior Member
Knew we could count on you, joojoobee. Thanks for spinning these up!

Could someone please advise on which kernel to use. There are so many, I have no Idea witch one to choose. Thanks.

Try the CM13 OC 1.4ghz LV kernel first. If it freezes or spontaneously reboots, try the HV version. If that freezes or reboots, then you're one of us unfortunates with a less tolerant SoC; run the 1.3ghz kernel.


Other options:

Full-range kernel includes all frequency steps (not just stock ones) which combined with a well-tuned governor can save a bit of power. Literally "a bit" though, most of our power usage is the screen.

Run n Gun has most of the frequency steps removed, leaving idle (300mhz), two intermediate for light work (1ghz/1.2ghz) and full-speed for heavy work (1.3/1.4ghz). Slightly better performance because the governor can skip everything under 1ghz, but this is less of an advantage than it sounds (we can use Touch/Input Boost for the same effect) and there's a hit to battery life because light continous loads can't use under 1ghz.

You also might want to get Kernel Adiutor and configure Touch Boost to pull the speed to 1ghz/500ms, for a bit more responsiveness. This is kernel-independent, even stock can use it.
 

Bobcus Leper

Senior Member
Feb 6, 2014
2,078
1,257
Moto X4
Moto G Stylus
The CM13 OC 1.3Ghz Kernel is working awesome. I took Bobcus' advice and didnt flash any of the 1.4Ghz ones as I too have a razr XT912.
I'm interested in the Full Scale Lite 1.3Ghz Kernel. Do I need to factory wipe If I want to switch to another Kernel? or just wipe cache and dalvik cache?

I don't even wipe cache when i flash a kernel. There is no need to.

Happy New Year!
 
  • Like
Reactions: chuchipando

joojoobee666

Senior Member
Jul 9, 2008
624
504
The CM13 OC 1.3Ghz Kernel is working awesome. I took Bobcus' advice and didnt flash any of the 1.4Ghz ones as I too have a razr XT912.
I'm interested in the Full Scale Lite 1.3Ghz Kernel. Do I need to factory wipe If I want to switch to another Kernel? or just wipe cache and dalvik cache?
@Bobcus Leper is correct; there is no need to wipe for a kernel change. Also, as far as the 1.4's go, no harm in trying. Some SOC's are more tolerant than others so just because the 1.4 doesn't work for some, it doesn't mean it won't work for you. Worst case scenario? Yeah, there really isn't. If the phone doesn't boot or reboots too often on the 1.4, try different voltage levels. If it still gives you trouble, just flash a 1.3 and curse the SOC gods for giving you a less tolerant chipset. I use the 1.4 ULV with no issues here. :good:
 
Last edited:

Septfox

Senior Member
Some SOC's are more tolerant than others so just because the 1.4 doesn't work for some, it doesn't mean it won't work for you.
Yea, about that. I had a rather interesting experience yesterday.

I flashed 1.4ghz, LV. And it ran. It not only ran, it ran beautifully. It also survived several stress tests, a few mixed tests, and just general faffing around. No slowdowns, no microfreezes, nothing.
Then I made the mistake to trying to switch governors to Lionheart, which pretty much instantly locked up the phone. Got it to reboot once, but it wasn't stable, and subsequent reboots simply wouldn't boot at all...even after wiping /system (in case the change caused an unintentional one elsewhere), even after flashing HV.

So, yea. I've looked at your kernel packages, and they very clearly only make changes under /system. I can't see that changing the governor would make changes anywhere else, either. It's utterly baffling to me that it worked perfectly one minute - under both fluctuating and full loads - and wouldn't work even with boosted voltage the next.


Also, does the phone boot at 1.2ghz, or does it automatically peg at the highest available speed until the UI comes up? If the latter, is there any way to have it "safe boot" at 1.2ghz and still have 1.3/1.4 available for configuration once booted?
 

d.casper.b

Senior Member
Jan 7, 2009
857
451
37
Cape Town
Xiaomi Poco F1
After always using the 1.3Ghz OC on both 5.1 and 6.0.1, I finally decided to try 1.4Ghz. So tried in order:

HV - Moto boot logo came on after a while of booting. So probably an endless boot loop.

LV - froze on boot animation.

ULV - got into the system opened an app, used it a bit and then it just froze and the phone restarted. Perhaps I was changing the governor which caused the freeze because I was in Kernel Adiutor. So unless I fiddled, looks like I will have to stick with 1.3Ghz. But maybe I'll give it one last try.

Sent from my Motorola RAZR Maxx (XT910)
 
  • Like
Reactions: Bobcus Leper

Bobcus Leper

Senior Member
Feb 6, 2014
2,078
1,257
Moto X4
Moto G Stylus
After always using the 1.3Ghz OC on both 5.1 and 6.0.1, I finally decided to try 1.4Ghz. So tried in order:

HV - Moto boot logo came on after a while of booting. So probably an endless boot loop.

LV - froze on boot animation.

ULV - got into the system opened an app, used it a bit and then it just froze and the phone restarted. Perhaps I was changing the governor which caused the freeze because I was in Kernel Adiutor. So unless I fiddled, looks like I will have to stick with 1.3Ghz. But maybe I'll give it one last try.

Sent from my Motorola RAZR Maxx (XT910)

Strange. ULV didn't even boot for me at 1.4 GHz. That's good that your chip is a little more OCable.
 

Benzino.Gazolini

Senior Member
Aug 12, 2014
59
16
Happy New Year guys.
Has anybody can explain me how exactly I can use SDSwap on my phone. I've flashed SD Card Swapper and what I should to do further?
Where I can enable and configure it?
 

joojoobee666

Senior Member
Jul 9, 2008
624
504
Yea, about that. I had a rather interesting experience yesterday.

I flashed 1.4ghz, LV. And it ran. It not only ran, it ran beautifully. It also survived several stress tests, a few mixed tests, and just general faffing around. No slowdowns, no microfreezes, nothing.
Then I made the mistake to trying to switch governors to Lionheart, which pretty much instantly locked up the phone. Got it to reboot once, but it wasn't stable, and subsequent reboots simply wouldn't boot at all...even after wiping /system (in case the change caused an unintentional one elsewhere), even after flashing HV.

So, yea. I've looked at your kernel packages, and they very clearly only make changes under /system. I can't see that changing the governor would make changes anywhere else, either. It's utterly baffling to me that it worked perfectly one minute - under both fluctuating and full loads - and wouldn't work even with boosted voltage the next.


Also, does the phone boot at 1.2ghz, or does it automatically peg at the highest available speed until the UI comes up? If the latter, is there any way to have it "safe boot" at 1.2ghz and still have 1.3/1.4 available for configuration once booted?

IIRC, any governor changes are applied at boot with an init script so simply removing that should reset the governor. And currently, there is no "safe" boot but I can add one sometime, don't see why not (i.e. create a file named .safeboot in /system or something and have kernel test for it). Obviously, this would take some time but I could add it to my list of to-dos.

As far as Lionheart goes, I tested it here, no lockups so not sure exactly what happened there. I suspect, that it was simply coincidental.
 

joojoobee666

Senior Member
Jul 9, 2008
624
504
Happy New Year guys.
Has anybody can explain me how exactly I can use SDSwap on my phone. I've flashed SD Card Swapper and what I should to do further?
Where I can enable and configure it?

You should probably delete the /data/system/storage.xml, reboot then choose to use it as removable storage if asked (don't adopt it). After that, there is nothing you need to do, there are no configurable options.

And just an FYI for everyone else, new kernels up, just a small update.
 
  • Like
Reactions: Flash-A-Holic

Benzino.Gazolini

Senior Member
Aug 12, 2014
59
16
joojoobee666, OK, I see. But where I can see what swap is really uses and how many memory it filled?
 
Last edited:

joojoobee666

Senior Member
Jul 9, 2008
624
504
joojoobee666, OK, I see. But where I can see what swap is really uses and how many memory it filled?

You can look and see what's mounted to /sdcard. On marshmallow, you should see that /sdcard is a symlink to /storage/self/primary which is a symlink to /mnt/user/0/primary which is itself a symlink to /storage/xxxx-xxxx where xxxx-xxxx is the UID of your external SD Card. Without the Swap, this normally would point to the UID of the Internal 8GB SD storage. As far as what spaced is use, just use the "Storage & USB" setting to look it over.
 
  • Like
Reactions: Benzino.Gazolini

Benzino.Gazolini

Senior Member
Aug 12, 2014
59
16
joojoobee666, thank you very much for your support. And one more question. If I'll want remove this swap how I can do it?
So, do you have uninstaller or may be something else?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    This is a custom kernel for D4/RAZR based off of the CM13.0 Kernel that was created by @stargo for Marshmallow. Below is the list of features this kernel adds to the Stock CM13 kernel:
    • Over-clocking to 1.3 and 1.4Ghz
    • A special SELinux permissive kernel (here's looking at you @daniel_m)
    • Additional Governors - InteractiveX, KToonservative, Lionheart, SmartassH3 and ZZMove.
    • Additional Schedulers - ROW, SIO, SIO Plus, VR and Zen
    • IntelliPlug driver - Hotplugging while sleeping for all governors (leave governor Hotplug disabled as this overrides)
    • Additional frequency and scaling scaling options:
      • RunNGun - all frequencies between 300Mhz and 1000Mhz removed.
      • Full Scale - all frequencies (in steps of 100Mhz) enabled up to max speed kernel supports
      • *** All are labeled in the downloads section below ****
    • Additional Voltage Options for 1.4Ghz frequency: HV (High Voltage), LV (Low Voltage) and ULV (Ultra-Low Voltage)
    • LMK optomizations thanks to @u.b.o.o.t.

    Speeds up to 1.4Ghz. I have no issues with 1.4, but mileage may vary per device. Try the ULV (Low Voltage) first. If this does not work, try the LV. If neither work, try the HV. If it's still not working, you may just have to use one that maxes out at 1.3Ghz.

    I've included my SDSwap in separate zip as well here for folks who would like to swap the internal and external SD storage devices around (makes external SD card primary storage as opposed to internal). See links at the bottom. NOTE: You should NOT remove the card while booted when using this as there is no way to safely unmount when booted.

    If you need to remove the SDSwap, there are three methods to do so:
    • Boot to recovery and simply reinstall the ROM you are running do NOT reinstall.
    • Upgrade to the latest ROM and do NOT reinstall.
    • Extract the the ramdisk.img file from the current ROM zip from /system/etc/kexec and overwrite the ramdisk.img on your device while either booted in recovery (mount /system first) or booted in the ROM, then reboot.


    Kernel Changelog:
    • 2017-10-02: Fixed missing f2fs module.
    • 2017-10-01: Sync to upstream and rebase: 47 fixes, securit patches and cleanup
    • 2017-02-20: Fixed issue causing install to fail.
    • 2017-02-19: Sync to upstream: 10 security fixes and one reversion. *PULLED*
    • 2016-12-11: Sync to upstream: 2 security fixes, one to patch CVE-2016-8655 the other is to patch old ABI handling.
    • 2016-11-30: Sync to upstream: Security fix to disable ION contig heap
    • 2016-11-08: Sync to upstream: 9 patches
      • 3 ALSA security/stability patches
      • 2 Event/Audit log security/statbilty patches
      • 3 Block related stability patches
      • 1 HID stability update
    • 2016-10-30: Sync to upstream: 7 more security patches
    • 2016-10-23: Sync to upstream: patch for CVE-2016-5195
    • 2016-10-11: Sync to Upstream: 2 security fixes
    • 2016-10-10: Updated LMK patches with latest changes from @u.b.o.o.t essentially moving to the 2.2 version.
    • 2016-10-06: Updates
      • Fixed missing modified libthermal-manager.cfg.
      • Added in kernel modules found in /system/lib/modules in the event these get updated but you aren't running the latest CM
    • 2016-10-02: Updates:
      • Sync to upstream: 6 security related updates
      • Added Low Mem Killer (LMK) optimizations from @u.b.o.o.t. See his thread here for more info.
    • 2016-07-15: Sync to upstream: 2 more security fixes
    • 2016-06-28: Sync to upstream: 4 more security fixes.
    • 2016-06-25: Sync to upstream: KSM (Kernel Same-page Merging) fixes to improve power management.
    • 2016-06-05: Sync to upstream: USB-fix potential infoleak in devio
    • 2016-05-17: Sync to upstream: 6 more security/bug fixes dealing with Alsa, networking and input.
    • 2016-05-10: Sync to upstream: one small USB security related fix.
    • 2016-05-08: Sync to upstream: just more security and bug fixes.
    • 2016-05-03: Updates:
      • Sync to upstream:Over 170 small bug fixes, the majority around bluetooth. See full log here.
      • Some minor refactoring of #ifdefs to simplify things a bit for anyone compiling on their own.
    • 2016-03-23: Sync to upstream: poison pointer update to allow lower mmap_min_addr
    • 2016-03-19: Sync to upstream: Memory corruption fix
    • 2016-03-12: Sync to upstream: Security and big fixes
    • 2016-02-15: Sync to upstream:
      • Timekeeping fix: fix 32-bit overflow in get_monotonic_boottime
      • Wifi drop fix: Better handling of transition to NUD_PROBE state
    • 2016-02-14: Fixed compile issues causing incorrect clock speeds
    • 2016-02-13: Update: b0rked and not available
      • Another fuse fixes
      • Added a Low Voltage 1.4Ghz kernel in permissive mode
    • 2016-01-23: Sync with upstream:
      • Update for fuse, fixes issues with deletions
      • AK8975 update to fix compass issues (requires nightly 01-23 or later to benefit)
    • 2016-01-19: Complete removal of zcache.
    • 2016-01-14: Sync with Upstream:
      • Fixes to DSS to enable LiveDisplay/Color calibration.
      • Patch for Zram
    • 2016-01-03: Sync with upstream (block fixes) and set SELinux to enforced.
    • 2016-01-02: Sync with upstream. Just small bugfixes.
    • 2015-12-29: Initial port to CM13. For previous changes, see the cm12.x thread.


    SDSwap Changelog:
    • 2017-10-01: updated to latest from device source, changes to init.
    • 2016-11-08: Updated fstab from upstream commit: Added ext4 support for /data partition
    • 2016-06-22: KSM (Kernel Samepage Merging) and ZRAM tweaks
    • 2016-05-05: Fixed issue causing boot-loops on RAZR (thanks @stargo and @jul515)
    • 2016-03-19: Updated just to update?
    • 2016-02-15: Updates:
      • Configure external storage as removable again. Eject at your own peril!
      • fixboot.sh update: add utf8 to mount-options for internal sd
    • 2016-01-23: Zram adjustments and fixes for compass (compass-fix requires nightly 01-23 or later)
    • 2016-01-19: Removal of zcache.
    • 2016-01-14: Allows usage of CM13 on stock slot
    • 2016-01-08: Allows usage of USB storage devices


    Downloads:

    Special SELinux permissive kernel

    SD Card Swapper zip
    Older/Archived kernels can be downloaded here if needed: https://droid.cs.fau.de/jjb666/Kernels


    Disclaimer: You did it, not me. :cool:

    XDA:DevDB Information
    Custom 1.3Ghz and 1.4Ghz OC Kernel for Droid 4/RAZR on CM13, Kernel for the Motorola Droid 4

    Contributors
    joojoobee666, stargo, hashcode
    Source Code: https://github.com/JooJooBee666/android_kernel_motorola_omap4-common/tree/cm-13.0

    Kernel Special Features: Overclock to 1.3Ghz and 1.4Ghz, additional governors

    Version Information
    Status: Testing

    Created 2015-12-30
    Last Updated 2017-10-01


    XDA:DevDB Information
    Custom 1.3Ghz and 1.4Ghz OC Kernel for Droid 4/RAZR on CM13, Kernel for the Motorola Droid 4

    Contributors
    joojoobee666, stargo, hashcode
    Source Code: https://github.com/JooJooBee666/android_kernel_motorola_omap4-common/tree/cm-13.0

    Kernel Special Features: Overclock to 1.3Ghz and 1.4Ghz, additional governors

    Version Information
    Status: Testing

    Created 2015-12-30
    Last Updated 2017-10-02
    8
    All, even newer kernels up. Just some fixes from upstream. Check the first post for details. :good:

    Should also note that there is a new SDSwap as well.
    8
    This is why I'm perplexed that they dropped the stock clocks from 1.2 down to 1.0GHz for targa from CM11 to CM13 at whatever point.

    What are you talking about? targa is running at 1.2GHz on CM13.

    Regards,
    Michael, who has spent months of unpaid time to just keep the OMAP4s current on CM. Even with usage testing.
    7
    Hey all, another update. Again, just a couple security fixes. :good:
    7
    Hey all, another kernel and SDSwap update for you. These include the fixes for the compass, but you will need the latest nightly as well, possibly tonight's. :silly:

    Update: Confirmed. Tonight's nightly will have the rest of the compass fixes needed with this update.