[Kernel] Sultanxda CAF kernel mod [F2FS-OTG-Y]

Search This thread

Phoenix Wright

Senior Member
Feb 19, 2009
270
326
new kernel incoming? :p

edit: (CM 12.1) BTW i didnt notice that you have updated your kernel on 28 but it's a first time that when i move to a new version im not able to pass fastboot screen. it's stuck on oneplus one logo. coming from 11-18 version to 11-28 with a wipe of cache and dalvik. i had to revert to 11-18. im using latest Phils Recovery to avoid any Firmware upgrade issue. please let me know what im wrong.
Thank You
The CM12.1 11/28 version replaced a configuration file in the ramdisk because of the updated CPU logic in the kernel (it needs configuration on boot). Maybe that recovery had issues with this. Now Sultan merged the changes in today's release, so it's no longer needed.:)
I wouldn't recommend having two different versions of F2FS handling the data though (I'm not sure about which code is bundled in the kernel used by Philz)... this TWRP build doesn't have issues with firmware flashing anyway: it's based on the latest unofficial build which fixed it. I updated the firmware successfully to the latest H2OS one yesterday:eek:
 
  • Like
Reactions: AL2000EX

manup85cupra

Senior Member
Dec 18, 2010
473
64
Brno
The CM12.1 11/28 version replaced a configuration file in the ramdisk because of the updated CPU logic in the kernel (it needs configuration on boot). Maybe that recovery had issues with this. Now Sultan merged the changes in today's release, so it's no longer needed.:)
I wouldn't recommend having two different versions of F2FS handling the data though (I'm not sure about which code is bundled in the kernel used by Philz)... this TWRP build doesn't have issues with firmware flashing anyway: it's based on the latest unofficial build which fixed it. I updated the firmware successfully to the latest H2OS one yesterday:eek:
Thanks for the reply. Can you please share latest twrp that you are using?

Inviato dal mio A0001 utilizzando Tapatalk
 

manup85cupra

Senior Member
Dec 18, 2010
473
64
Brno


---------- Post added at 11:25 PM ---------- Previous post was at 11:08 PM ----------

Formatting fo f2fs takes a long time

and were you able to wipe it in the end?
ok in the end im reporting all the issue metioned in the previous posts:

-lost root access in /system
-2 minutes time to get cache wiped.

i have flashed rootrestore.zip and it i get system rw back. flashed the rom, kernel and xposed but when i restarted the phone TWRP was saying that no root was installed. now im checking if everything went well anyway and i will report

edit2: first boot fail. after pin i got google play service FC and after phone when on boot loop (CM). i guess a full wipe will be needed at this point...

---------- Post added at 11:56 PM ---------- Previous post was at 11:25 PM ----------

Try to change the filesystem to ext4 and then back to F2FS just once (wipe menu, change FS), I think they mentioned that this fixes it earlier in the thread.:)

this should wipe everything in anycase right? btw im already performing a full wipe. i just started with data but it's taking already 5 minutes... not sure if it will never end... :(
 

Phoenix Wright

Senior Member
Feb 19, 2009
270
326


---------- Post added at 11:25 PM ---------- Previous post was at 11:08 PM ----------



and were you able to wipe it in the end?
ok in the end im reporting all the issue metioned in the previous posts:

-lost root access in /system
-2 minutes time to get cache wiped.

i have flashed rootrestore.zip and it i get system rw back. flashed the rom, kernel and xposed but when i restarted the phone TWRP was saying that no root was installed. now im checking if everything went well anyway and i will report

edit2: first boot fail. after pin i got google play service FC and after phone when on boot loop (CM). i guess a full wipe will be needed at this point...

---------- Post added at 11:56 PM ---------- Previous post was at 11:25 PM ----------



this should wipe everything in anycase right? btw im already performing a full wipe. i just started with data but it's taking already 5 minutes... not sure if it will never end... :(
I think this is the result of the new F2FS code since 11/28. I warned that a backup/format (a proper Data format, the one which has you type "yes" in TWRP) and restore would be probably needed...
Sadly there's no way around this, as the upstream F2FS branch has issues, and the Motorola driver is technically 4 months older...:(
 

nitishp7890

Senior Member
Nov 26, 2015
164
30
@Pheonix Wright can you please add controls for thermal control in sultans kernel because whenever i play heavy games like modern combat 5 device becomes hot and due to thermal driver it cpu frequency starts throttling because of this gaming performance is laggy can you please add this feature
 

Phoenix Wright

Senior Member
Feb 19, 2009
270
326
@Pheonix Wright can you please add controls for thermal control in sultans kernel because whenever i play heavy games like modern combat 5 device becomes hot and due to thermal driver it cpu frequency starts throttling because of this gaming performance is laggy can you please add this feature

You can already do that... I don't think there's any automated app to do it though, and I'm no programmer:silly:
I took this from the configuration files:
" write /sys/kernel/msm_thermal/low_thresh "1574400 40 37"
write /sys/kernel/msm_thermal/mid_thresh "1267200 46 43"
write /sys/kernel/msm_thermal/high_thresh "1190400 52 48"
write /sys/kernel/msm_thermal/sampling_ms 10000"
This is what it means: check the temperature every 10000 ms (10 seconds?). If it reaches 40°C, lower the frequency to 1574400 kHz until the temperature is down to 37°C (again, it checks it every 10s).
If it reaches 46°C, lower the frequency to 1267200 kHz until the temperature is down to 43°C
If it reaches 52°C, lower the frequency to 1190400 kHz until the temperature is down to 48°C
You would need to change those parameters. A terminal emulator or adb should do, or you could make an init.d script to automate it. However it's at your own risk:p
I can tell you that when it's "optimizing apps" (like after a ROM update) it sets these values to increase the performance:
" write /sys/kernel/msm_thermal/low_thresh "1728000 45 43"
write /sys/kernel/msm_thermal/mid_thresh "1574400 50 47"
write /sys/kernel/msm_thermal/high_thresh "1267200 55 53" "
 
Last edited:

nitishp7890

Senior Member
Nov 26, 2015
164
30
You can already do that... I don't think there's any automated app to do it though, and I'm no programmer:silly:
I took this from the configuration files:
" write /sys/kernel/msm_thermal/low_thresh "1574400 40 37"
write /sys/kernel/msm_thermal/mid_thresh "1267200 46 43"
write /sys/kernel/msm_thermal/high_thresh "1190400 52 48"
write /sys/kernel/msm_thermal/sampling_ms 10000"
This is what it means: check the temperature every 10000 ms (10 seconds?). If it reaches 40°C, lower the frequency to 1574400 MHz until the temperature is down to 37°C (again, it checks it every 10s).
If it reaches 46°C, lower the frequency to 1267200 MHz until the temperature is down to 43°C
If it reaches 52°C, lower the frequency to 1190400 MHz until the temperature is down to 48°C
You would need to change those parameters. A terminal emulator or adb should do, or you could make an init.d script to automate it. However it's at your own risk:p
I can tell you that when it's "optimizing apps" (like after a ROM update) it sets these values to increase the performance:
" write /sys/kernel/msm_thermal/low_thresh "1728000 45 43"
write /sys/kernel/msm_thermal/mid_thresh "1574400 50 47"
write /sys/kernel/msm_thermal/high_thresh "1267200 55 53" "
Actually i tried this thing using es file explorer sys/kernel/msmthermal i edited this values but when i reboot my device it again comes back to original value so can you tell me how to create a init.d script and how to run it at each reboot
 

DerRomtester

Senior Member
Aug 20, 2012
2,899
5,824
27
Neumarkt
Actually i tried this thing using es file explorer sys/kernel/msmthermal i edited this values but when i reboot my device it again comes back to original value so can you tell me how to create a init.d script and how to run it at each reboot

Of course you must do it again after a reboot. And editing with the file explorer isnt the right methode to do that. You could type these commands with the terminal emulator or you copy and paste them into a script that loads every time you start the system.
 
  • Like
Reactions: Phoenix Wright

Phoenix Wright

Senior Member
Feb 19, 2009
270
326
Actually i tried this thing using es file explorer sys/kernel/msmthermal i edited this values but when i reboot my device it again comes back to original value so can you tell me how to create a init.d script and how to run it at each reboot
Try the attached zip. Then verify that it works after a reboot.
 

Attachments

  • thermal.zip
    175.4 KB · Views: 20

nitishp7890

Senior Member
Nov 26, 2015
164
30
Thanks mate it worked first I just just flashed thermal.zip with my modifications in values then it didn't worked but after changing permissions its working thanks for help

---------- Post added at 08:49 PM ---------- Previous post was at 08:48 PM ----------

Yes, sure... Be careful though...
Thanks mate it worked first I just just flashed thermal.zip with my modifications in values then it didn't worked but after changing permissions its working thanks for help
 

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    This is a small mod for Sultanxda's CAF kernel. It's intended to ONLY be used with his CM 12.1 and his CM13, but it *might* work with other CAF ROMs.
    The zip also replaces the fstab in the ramdisk to support the F2FS filesystem in /data and /cache (both ext4 and f2fs are supported for these, like the official CM builds), and the fsck.f2fs binary in /system/bin to the latest version (1.5.0).
    The only kernel changes are:
    - Added F2FS filesystem code. I keep it up-to-date with the Motorola github (right now the latest code is from the Moto X 2014 6.0 release): https://github.com/MotorolaMobilityLLC/motorola-kernel/tree/marshmallow-6.0.0-release-victara.
    - Added and improved @sollapse's OTG-Y support patch.
    - Eventual cherry picked commits from @sultanxda's Marshmallow branch.
    - Updated CIFS/NFS code to the latest 3.4 version.
    - Improved support for HIDs (joysticks, keyboards, etc.)
    I compiled with GCC 4.8 (the same toolchain @sultanxda uses).
    All the mods have been tested and I'm using them personally.
    To install, you just need to flash his ROM, and then my zip. Then format /data and /cache to F2FS with TWRP if you wish to use F2FS.

    I also made a recovery based on the 2.8.7.0-4 unofficial TWRP, it's rebased on the Sultan CM12.1 ROM and this kernel mod, plus it has:
    - updated TWRP code (from the 5.1 branch)
    - mounts /data and /cache as F2FS by default, with the same mount options as the fstab in my kernel mod
    - theme replaced with the "Materialised Play" one
    - updated mkfs.f2fs and fsck.f2fs to 1.5.0.

    I included all the source code for the kernel changes, you only need to replace the GCC directory in the bash script and then execute it.

    Changelogs:
    01/13:
    - Updated Sultan's kernel sources for CM13 and CM12.1.
    - Updated NFS driver to the latest 3.4 code.
    - Merged Sultan's charger improvements to the CM12.1 kernel.
    - Enabled support for Force Feedback for a lot of controllers - you can enable this in Input.
    - Enabled LED and Force Feedback support for the Xbox controllers (fixes the LED blinking forever).
    - Fixed Wiimote support - sadly we can't have support for newer Wii Remotes (the "MotionPlus" ones) with a 3.4 kernel, but older ones are working.
    - Cherry picked HID commits from the official CyanogenMod kernel, this improves the Wiimote support (Classic Controllers, Nunchucks etc. are supported) and adds/improves support for a lot of joysticks/keyboards/mice/etc.
    01/05:
    - Updated Sultan's kernel sources for CM13 and CM12.1.
    12/30:
    - Updated the F2FS driver with the one from Motorola's 6.0.0 release for Moto X 2014 (it's a couple months newer).
    - Updated the fstab accordingly, the "nobarrier" option should bring a small performance improvement.
    12/29:
    - Actually fixed reboots when inserting OTG-Y devices in deep sleep.
    - Fixed OTG-Y not starting when the charger is detected *prior* to the USB device (rare cases in which a charger/OTG-Y setup is disconnected and the driver takes a bit to detect that, and an OTG-Y setup is inserted before that).
    12/23:
    - Updated Sultan's kernel sources for CM13 (fixes inserting OTG devices in deep sleep and being unable to use USB again).
    - Fixed reboots when inserting OTG-Y devices in deep sleep (thanks to the above patch!).
    - Further clean-up of the OTG-Y patch code.
    12/21:
    - OTG-Y improvements and general clean-up. Code is cleaner, some race conditions and corner cases when toggling the parameter are handled better, low power mode is enabled when it's possible, and the charging notification going off, on and off again very fast sometimes after unplugging an OTG-Y setup has been fixed.
    - Updated Sultan's kernel sources for CM13 and CM12.1
    12/16:
    - Overhaul of the OTG-Y patch. Now it's less "hacky" and it detects the charger properly. This removes the false charging notifications when connecting a regular OTG cable+device, makes it possible to use OTG again if charging is stopped and restarted, allows for faster charging rates, and fixes kernel panics when the OTG-Y cable/device are removed *after* charging was stopped.
    - Updated Sultan's kernel sources for CM13 and CM12.1 (slow charging fixed)
    12/12:
    - Improved the OTG-Y patch (again): if you mistakenly connected a regular OTG cable+device when OTG-Y was set to Yes, a charging notification would be shown, and it wouldn't go away after disconnection. Now it properly disappears after the device has been disconnected.
    12/10;
    - Updated Sultan's kernel sources for CM13 and CM12.1 (including a couple changes still not present in the 12/1 CM12.1)
    - Merged some changes from the CM13 kernel into the CM12.1 one: 1 2
    - Improved the OTG-Y patch. It's now possible to charge the phone normally in AC mode while the OTG-Y parameter is set to Yes, and there are no more kernel panics or inability to use OTG up to the following reboot when you use OTG-Y inappropriately (disconnecting the OTG devices after changing the parameter status).
    - Updated f2fs.fsck in the CM12.1 version and the init.rc in the CM13 version.
    12/01:
    - Updated Sultan's kernel sources for CM13 and CM12.1
    11/28:
    - Switched the F2FS code to the Motorola Moto G 5.1.1 F2FS branch: https://github.com/MotorolaMobilityLLC/motorola-kernel/tree/lollipop-5.0.2-release-falcon
    - Updated Sultan's kernel sources for CM13
    - Merged the new touchscreen fixes and CPU boosting logic to the CM12.1 kernel from the CM13 one.
    Important: I'd recommend making a nandroid backup, formatting and restoring. This driver is technically older than upstream, and it might have issues with inlined dentries (the new fstab reflects the mount point configuration of the Moto X 2014 - so no inline_dentry).
    11/25:
    - Bug fix for F2FS from the dev-test branch
    - Updated Sultan's kernel sources for CM13
    - Included the touch screen bugfix from Sultan from the CM13 branch in the CM12.1 one.
    11/18:
    - Added other bug fix commits for F2FS from the dev-test branch
    - Updated Sultan's kernel sources for both CM12.1 and CM13
    - CM13 build should actually be functional now (thanks to @DerRomtester for the init.rc)
    - Recovery has been rebuilt from sources, it now uses the Sultan CM12.1 kernel mod and source tree for his ROM.
    11/10:
    - Added two bug fix commits for F2FS from the dev-test branch (one of them is a fix to potential data corruption)
    - Switched to CM's version of Google GCC

    XDA:DevDB Information
    Mod for Sultanxda's CAF kernel, Kernel for the OnePlus One

    Contributors
    Phoenix Wright
    Kernel Special Features:

    Version Information
    Status: Stable
    Current Stable Version: 01/13
    Stable Release Date: 2016-01-13

    Created 2015-11-07
    Last Updated 2016-01-13
    3
    New version, some improvements/fixes and a lot of code clean-up for the OTG-Y patch (I hope I'm done for real, this time...), and updated sources from Sultan.
    Also, I haven't had a single case of corruption since formatting and switching to the Motorola driver. :)
    3
    Always looking forward to a new update to go along with the latest Sultan build. Anyhow, you're great work here & keep it up!

    Thank you! Sorry about the delay, but I messed with controllers/HIDs and I wanted to get things right :eek:
    Changes in this release are improvements to HID support (mostly controllers; you can now have force feedback, use wii remotes and things like that). Also, I updated the NFS driver to the latest 3.4 code (as I saw there were several critical fixes).
    3
    This kernel has been an absolute godsend. Running sultan's Rom and this kernel has given me the best marshmallow experience of any combination I've tried, and it's enabled me to keep my phone as f2fs. Thanks so much for your work Phoenix Wright.

    Sent from my A0001 using Tapatalk

    Thank you! The only performance improvements you see compared to Sultan's stock are due to F2FS anyway. His kernel is amazing :eek:
    By the way, I uploaded a new release (sorry for the two releases in a row, but I noticed Motorola released kernel sources for the Moto X 2014 marshmallow update, and obviously the F2FS driver is newer - by a couple months). There should be no issues with just updating (as it's the same for Moto X owners).:D
    They added a new mount option, "nobarrier", which (as far as I could see) has a slight performance improvement and is safe for battery-powered devices. So the fstab has been updated accordingly.
    3
    Hello @Phoenix Wright. have you in mind to update latest Sultan kernel with F2FS? Thank You
    I posted an update:
    - Added other bug fix commits for F2FS from the dev-test branch
    - Updated Sultan's kernel sources for both CM12.1 and CM13
    - CM13 build should actually be functional now (thanks to @DerRomtester for the init.rc)
    - Recovery has been rebuilt from sources, it now uses the Sultan CM12.1 kernel mod and source tree for his ROM (this is because I'm lazy and I didn't want to build 3 kernels each time lol)
    By the way, the previous version only missed the prima bug-fix commit from the latest Sultan CM12.1. The other changes were already merged or were in the dtb (which this doesn't replace).:D