FORUMS
Remove All Ads from XDA

[MOD] Disable system write protection on stock kernel

17,815 posts
Thanks Meter: 86,526
 
By flar2, Recognized Developer on 11th April 2013, 12:24 PM
Post Reply Email Thread
This module will disable system write protection on the stock HTC One kernel.


To make /system writeable, you must install the module and then remount /system as rw.

For example:

insmod /system/lib/modules/wp_mod.ko
mount -o remount,rw /system


You can make an init.d script to load it, or add it to the boot.img. Either way will work, but it's important that this is loaded at boot, as attempting to make changes to /system and then installing this module could corrupt the partition.


This is mainly for devs, who are free to incorporate it into their ROMs.
Unless you are an advanced user, I would wait for it to be included in your favourite ROM.


A credit and a link here so people can thank me in the OP would be much appreciated


Download:
wp_mod.ko


Source code: wp_mod.c
The Following 69 Users Say Thank You to flar2 For This Useful Post: [ View ]
11th April 2013, 12:36 PM |#2  
:No-Frost:'s Avatar
Senior Member
Flag Santiago
Thanks Meter: 448
 
More
Awesome mate... Thanks a lot
11th April 2013, 01:59 PM |#3  
Senior Member
Flag London
Thanks Meter: 512
 
More
Thanks!
Quick question, do we need to install the module manually first before I create the init script?
11th April 2013, 02:57 PM |#4  
Isotopes's Avatar
Senior Member
Thanks Meter: 230
 
More
Info 2 wp_mod.ko for 3.4.10-gddcfb8c kernel version
wow ... new version from this mod ... thx

ok ... installed wp_mod.ko to system/lib/modules ... make a new boot.img ... restart ... modified a file in system ... restart ... but changed file back original

ok ... next try ... i found the mod is kernel depends ... hexedit the mod to my kernel version ... installed ... modified a file ... restart ... and it works now, the file is well modified

thx @flar2

attached my modified wp_mod.ko only for 3.4.10-gddcfb8c kernel-version

use the attached with cwm-recovery, its only the modified wp_mod.ko file
The Following 6 Users Say Thank You to Isotopes For This Useful Post: [ View ] Gift Isotopes Ad-Free
11th April 2013, 03:00 PM |#5  
The module should be placed somewhere on your /system partition, because that is what is mounted early in the boot process.

Kernel modules are usually located in /system/lib/modules/ but you can put it anywhere on /system

Then you can load it with an init script using the commands I posted above. Or you can put those commands in init.rc in the boot.img. Obviously the command has to be modified to reflect the location where you copied wp_mod.ko

You have to make sure that the boot.img is set to run init.d scripts, this is also done in init.rc.
The Following User Says Thank You to flar2 For This Useful Post: [ View ]
11th April 2013, 03:02 PM |#6  
Quote:
Originally Posted by Isotopes

wow ... new version from this mod ... thx

ok ... installed wp_mod.ko to system/lib/modules ... make a new boot.img ... restart ... modified a file in system ... restart ... but changed file back original

ok ... next try ... i found the mod is kernel depends ... hexedit the mod to my kernel version ... installed ... modified a file ... restart ... and it works now, the file is well modified

Yes, it will only load if the version info matches.


If people don't know what that means, check your kernel:

uname -a

And make sure the module has the same string:

modinfo wp_mod.ko

You can change it with a hex editor as above, make sure you only change the characters of the version string and nothing else.
The Following User Says Thank You to flar2 For This Useful Post: [ View ]
11th April 2013, 03:03 PM |#7  
torxx's Avatar
Senior Member
Thanks Meter: 21,661
 
Donate to Me
More
Good job mate
11th April 2013, 07:45 PM |#8  
Member
Thanks Meter: 17
 
More
Quote:
Originally Posted by torxx

Good job mate

Really good job can you do the same file for the kernel? Thanks in advance
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2013-04-11-20-37-03.jpg
Views:	3729
Size:	19.1 KB
ID:	1876297  
11th April 2013, 08:18 PM |#9  
Isotopes's Avatar
Senior Member
Thanks Meter: 230
 
More
Info 2 wp_mod.ko for 3.4.10-g87f8d97 kernel version
Quote:
Originally Posted by nikotine81

Really good job can you do the same file for the kernel? Thanks in advance

and now, here the wp_mod.ko for 3.4.10-g87f8d97 kernel version

use the attached with cwm-recovery, its only the modified wp_mod.ko file
The Following 5 Users Say Thank You to Isotopes For This Useful Post: [ View ] Gift Isotopes Ad-Free
11th April 2013, 09:23 PM |#10  
Member
Thanks Meter: 17
 
More
Quote:
Originally Posted by Isotopes

and now, here the wp_mod.ko for 3.4.10-g87f8d97 kernel version

use the attached with cwm-recovery, its only the modified wp_mod.ko file

Thanks i will test
11th April 2013, 10:53 PM |#11  
Senior Member
Flag London
Thanks Meter: 512
 
More
Quote:
Originally Posted by Isotopes

and now, here the wp_mod.ko for 3.4.10-g87f8d97 kernel version

use the attached with cwm-recovery, its only the modified wp_mod.ko file

Works fine
Thanks
The Following 2 Users Say Thank You to Nekromantik For This Useful Post: [ View ] Gift Nekromantik Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes