[DEV] Loadable Modules for Gingersense Incredible [Updated 9/18 - Support for OTA]

Search This thread

tiny4579

Inactive Recognized Developer
Jan 15, 2011
9,327
5,060
HTC released gingerbread via OTA but they did not support additional modules. This thread has flashable zips for both the leaked kernel and the one from the "OTA".

Added flashable modules to attachments that are flashable in recovery.

I have created a zip of some of the more useful modules for our device:
Code:
cpufreq_conservative.ko
cpufreq_smartass.ko (thanks Chad for the help here)
ext4.ko
jbd2.ko (necessary for me to load ext4)
tun.ko
perflock_disable.ko (I actually compiled this one a little different but confirmed it would load and not get the exec format error)

Update: Smartass is working now with assistance from chad in resolving those errors. Decided to not worry about interactive for now.

Further information:

If you don't use the CWM flashable zip you will need to load perflock_disable a special way as it needs to be called with a special parameter to make it work correctly. Try adding below to a script. Credit to Calkulin for the script.


Code:
if [ -e /system/lib/modules/perflock_disable.ko ]; then
    insmod /system/lib/modules/perflock_disable.ko
    if [ $? -eq 0 ]; then
	echo "Perflock DISABLED"
    else
	addr=`awk '$3 == "perflock_notifier_call" { print "0x"$1; }' /proc/kallsyms`
	if [ -n "$addr" ]; then
	    insmod /system/lib/modules/perflock_disable.ko "perflock_notifier_call_addr=$addr"
	    if [ $? -eq 0 ]; then
	    	echo "Perflock DISABLED"
    	    else
	    	echo "ERROR!!! Perflock could NOT be DISABLED"
	    fi
	fi
    fi
fi

Credits:
Conap (for BootManager and helping me test ext4 on an SD ROM)
XDA (for teaching me so much about Android)
HTC (for the kernel source)
Chad0989 (for assistance in getting smartass CPU governor working)
Coolbho3000 (perflock_disable)
Calkulin for the module load script
anyone else who inspired me (apologize if I forgot)

I have attached a zip file to this. If you are not a dev you can still use the modules here but some basic ADB/terminal knowledge would be needed. The modules are open for testing though.

Attached zip files and CWM-flashable zip files for both OTA and leak-based ROMs.

inc_modules.zip - Just the loadable modules.
inc_modules_ota.zip - just the loadable modules - OTA-based ROMS (August leak)
inc_modules_ota_091811.zip - just the loadable modules - OTA-based ROMS (actual OTA from September)
inc_modules_CWM_flashable.zip - flashable zip that will also autoload modules at boot.
inc_modules_ota_CWM_flashable.zip - flashable zip that will also autoload modules at boot - OTA-based ROMS (August leak)
inc_modules_ota_091811_CWM_flashable.zip - flashable zip that will also autoload modules at boot - OTA-based ROMS (Actual OTA from September)
 

Attachments

  • inc_modules.zip
    1.4 MB · Views: 126
  • inc_modules_ota.zip
    1.5 MB · Views: 92
  • inc_modules_ota_CWM_flashable.zip
    1.7 MB · Views: 258
  • inc_modules_CWM_flashable.zip
    1.6 MB · Views: 238
  • inc_modules_ota_091811.zip
    1.5 MB · Views: 60
  • inc_modules_ota_091811_CWM_flashable.zip
    1.7 MB · Views: 130
Last edited:

kzoodroid

Senior Member
Jun 27, 2010
1,355
264
Kalamazoo
I'm glad some one took this up I had been wondering the same thing since HTC opened the dev section. I had found another site that had a more extensive write up on how to build kernels but I'm not very fluent in linux and was a little intimidated at trying. At least I now know that it can be done. Maybe we can get Chad to try and port it over?
 
Last edited:

tiny4579

Inactive Recognized Developer
Jan 15, 2011
9,327
5,060
Good job Tiny! I know someone was just asking for a tun.ko module and now I can't remember who it was. Hopefully they see your post.

Thanks!

I'm trying to add more existing modules but my compiler treats warnings as errors so it won't build. Chad, if you see this post, any advice here?
 

jskolm

Senior Member
Jun 21, 2010
660
167
Cleveland, OH
Google Pixel 6 Pro
This is awesome. I was hoping for a tun.ko module! Now, do I just grab these and drop then in system/lib/modules and they should just work? Or are there steps I need to take to make them work? (I am honestly only concerned with the tun.ko)
 
  • Like
Reactions: tiny4579

renzo.olivares

Inactive Recognized Developer
Jan 6, 2011
9,231
16,142
oh wow this is incredible great job tiny!!! and the reason you probably cant get those other governors to work is because htc released an uncomplete source :(
 

tiny4579

Inactive Recognized Developer
Jan 15, 2011
9,327
5,060
This is awesome. I was hoping for a tun.ko module! Now, do I just grab these and drop then in system/lib/modules and they should just work? Or are there steps I need to take to make them work? (I am honestly only concerned with the tun.ko)

Just drop in the ones you want and run insmod /system/lib/modules/tun.ko for tun.ko. You will have to do it at boot each time or get the dev to write an init.d script to load it.
 

tiny4579

Inactive Recognized Developer
Jan 15, 2011
9,327
5,060
would i need to make one for every module?

Joel,

No, just one script should work. I believe Synergy ROM already has the init.d script for some of them. See 00cpufreq_modules in /system/etc/init.d

All,

Updated OP with latest zip file. If you have downloaded previously, redownload to get the latest.
 

renzo.olivares

Inactive Recognized Developer
Jan 6, 2011
9,231
16,142
The first line should be:
Code:
#!/system/bin/sh

and it needs to have execute permissions or it won't execute. Also make sure to save it in UNIX format. I would also add the smartass module as it is quite popular. To test type lsmod from adb or terminal after boot. Hope this helps.

eeh im not good with init.d scripts lol
 

renzo.olivares

Inactive Recognized Developer
Jan 6, 2011
9,231
16,142
ok i think i got it would it be like this?
Code:
#!/system/bin/sh

/system/bin/insmod /system/lib/modules/tun.ko
 

tiny4579

Inactive Recognized Developer
Jan 15, 2011
9,327
5,060
ok i think i got it would it be like this?
Code:
#!/system/bin/sh

/system/bin/insmod /system/lib/modules/tun.ko

Exactly!

Then just make a line for each module.

EDIT: Though you could just write it like this:
Code:
#!/system/bin/sh

insmod /system/lib/modules/tun.ko

Though to be safe and to make sure you are running that particular insmod command you can leave it the way you have it.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    HTC released gingerbread via OTA but they did not support additional modules. This thread has flashable zips for both the leaked kernel and the one from the "OTA".

    Added flashable modules to attachments that are flashable in recovery.

    I have created a zip of some of the more useful modules for our device:
    Code:
    cpufreq_conservative.ko
    cpufreq_smartass.ko (thanks Chad for the help here)
    ext4.ko
    jbd2.ko (necessary for me to load ext4)
    tun.ko
    perflock_disable.ko (I actually compiled this one a little different but confirmed it would load and not get the exec format error)

    Update: Smartass is working now with assistance from chad in resolving those errors. Decided to not worry about interactive for now.

    Further information:

    If you don't use the CWM flashable zip you will need to load perflock_disable a special way as it needs to be called with a special parameter to make it work correctly. Try adding below to a script. Credit to Calkulin for the script.


    Code:
    if [ -e /system/lib/modules/perflock_disable.ko ]; then
        insmod /system/lib/modules/perflock_disable.ko
        if [ $? -eq 0 ]; then
    	echo "Perflock DISABLED"
        else
    	addr=`awk '$3 == "perflock_notifier_call" { print "0x"$1; }' /proc/kallsyms`
    	if [ -n "$addr" ]; then
    	    insmod /system/lib/modules/perflock_disable.ko "perflock_notifier_call_addr=$addr"
    	    if [ $? -eq 0 ]; then
    	    	echo "Perflock DISABLED"
        	    else
    	    	echo "ERROR!!! Perflock could NOT be DISABLED"
    	    fi
    	fi
        fi
    fi

    Credits:
    Conap (for BootManager and helping me test ext4 on an SD ROM)
    XDA (for teaching me so much about Android)
    HTC (for the kernel source)
    Chad0989 (for assistance in getting smartass CPU governor working)
    Coolbho3000 (perflock_disable)
    Calkulin for the module load script
    anyone else who inspired me (apologize if I forgot)

    I have attached a zip file to this. If you are not a dev you can still use the modules here but some basic ADB/terminal knowledge would be needed. The modules are open for testing though.

    Attached zip files and CWM-flashable zip files for both OTA and leak-based ROMs.

    inc_modules.zip - Just the loadable modules.
    inc_modules_ota.zip - just the loadable modules - OTA-based ROMS (August leak)
    inc_modules_ota_091811.zip - just the loadable modules - OTA-based ROMS (actual OTA from September)
    inc_modules_CWM_flashable.zip - flashable zip that will also autoload modules at boot.
    inc_modules_ota_CWM_flashable.zip - flashable zip that will also autoload modules at boot - OTA-based ROMS (August leak)
    inc_modules_ota_091811_CWM_flashable.zip - flashable zip that will also autoload modules at boot - OTA-based ROMS (Actual OTA from September)
    4
    Ok, good news guys. I figured out how to edit the modules so they would work on the OTA kernel (2.6.35.13). The files are attached to the OP. Enjoy!

    If you're unsure of which modules to use, ask the ROM dev. FYI, it's working great with the .13 kernel in Nils' new Sense 3.5 ROM.
    2
    I might have something MUCH BETTER on the way.

    :D
    1
    Good job Tiny! I know someone was just asking for a tun.ko module and now I can't remember who it was. Hopefully they see your post.
    1
    Tiny,
    Do you have any plans on adding smartass2 to these loadable modules for the ota kernel?

    Sent from my ADR6300 using xda premium

    Eventually possibly but I make no promises. I think the custom kernel is smooth and stable enough that I prefer users to use it. And if an issue is reported with stock kernel and is module related, it may be harder to pinpoint.

    What I'm trying to say is that this project was meant to be temporary initially until the source was available or a port. Since we have the port, there's less need for the loadable modules that are tricky to autoload if you don't have the ROM set up for it.

    Going along with the previous poster, why use stock with modules when there is a good custom kernel? Maybe certain issues that I can try to resolve if I can?

    Also, the CPU modules won't work correctly unless you have perflock_disable loaded correctly (like the included script has it).

    I also am temporarily picking up and assisting with incredikernel which takes more time away to do stuff like this. I also lost my build environment. I have two hard drives and the Linux one died recently so I had to start over. Fortunately most of it was on github or I may have stopped working on the kernel. I have it rebuilt with both my fork of incredikernel and gingertiny but the modules build may take some time to get up. I may have time to build it tomorrow but can't promise anything and these loadable modules won't necessarily run as smooth as they do built into the custom kernel.