[HTC Desire 526] BigCountry907:
wp_mod.ko Module Patch

Well not so good news.

I put together the kernel source for the Desire 526 and compiled it.

After I fixed some things up anyway.

I got the Source for the wp_mod from here.

https://github.com/flar2/wp_mod

I compiled the module with the kernel to make sure the versions were correct.

I loaded the module and it runs however the system partition still wont mount RW.

Here's my Terminal

/home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/arch/arm/boot/dts/Makefile:228: warning: overriding commands for target `dtbs'
/home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/arch/arm/boot/dts/Makefile:228: warning: ignoring old commands for target `dtbs'
OBJCOPY arch/arm/boot/Image
Building modules, stage 2.
MODPOST 25 modules
Kernel: arch/arm/boot/Image is ready
CC arch/arm/mach-msm/dma_test.mod.o
CC crypto/ansi_cprng.mod.o
CC drivers/gud/mcDrvModule.mod.o
CC drivers/gud/mcKernelApi.mod.o
CC drivers/input/evbug.mod.o
CC drivers/input/misc/gpio_axis.mod.o
AS arch/arm/boot/compressed/head.o
CC drivers/input/misc/gpio_event.mod.o
CC drivers/input/misc/gpio_input.mod.o
CC drivers/input/misc/gpio_matrix.mod.o
GZIP arch/arm/boot/compressed/piggy.gzip
CC drivers/input/misc/gpio_output.mod.o
CC drivers/media/radio/radio-iris-transport.mod.o
CC drivers/mtd/tests/mtd_nandbiterrs.mod.o
CC drivers/mtd/tests/mtd_nandecctest.mod.o
CC arch/arm/boot/compressed/misc.o
CC drivers/mtd/tests/mtd_oobtest.mod.o
CC drivers/mtd/tests/mtd_pagetest.mod.o
CC drivers/mtd/tests/mtd_readtest.mod.o
CC drivers/mtd/tests/mtd_speedtest.mod.o
CC arch/arm/boot/compressed/decompress.o
CC drivers/mtd/tests/mtd_stresstest.mod.o
CC arch/arm/boot/compressed/string.o
CC drivers/mtd/tests/mtd_subpagetest.mod.o
CC drivers/mtd/tests/mtd_torturetest.mod.o
CC drivers/platform/msm/msm_bus/msm-buspm-dev.mod.o
CC drivers/soc/qcom/msm_core_ctl.mod.o
CC drivers/spi/spidev.mod.o
CC drivers/usb/host/ice40-hcd.mod.o
CC fs/ecryptfs/ecryptfs.mod.o
LD [M] arch/arm/mach-msm/dma_test.ko
LD [M] crypto/ansi_cprng.ko
LD [M] drivers/gud/mcDrvModule.ko
SHIPPED arch/arm/boot/compressed/hyp-stub.S
LD [M] drivers/gud/mcKernelApi.ko
LD [M] drivers/input/evbug.ko
LD [M] drivers/input/misc/gpio_axis.ko
SHIPPED arch/arm/boot/compressed/lib1funcs.S
LD [M] drivers/input/misc/gpio_event.ko
SHIPPED arch/arm/boot/compressed/ashldi3.S
LD [M] drivers/input/misc/gpio_output.ko
LD [M] drivers/input/misc/gpio_input.ko
LD [M] drivers/input/misc/gpio_matrix.ko
LD [M] drivers/media/radio/radio-iris-transport.ko
LD [M] drivers/mtd/tests/mtd_nandbiterrs.ko
LD [M] drivers/mtd/tests/mtd_nandecctest.ko
LD [M] drivers/mtd/tests/mtd_pagetest.ko
LD [M] drivers/mtd/tests/mtd_oobtest.ko
AS arch/arm/boot/compressed/hyp-stub.o
LD [M] drivers/mtd/tests/mtd_readtest.ko
LD [M] drivers/mtd/tests/mtd_speedtest.ko
LD [M] drivers/mtd/tests/mtd_stresstest.ko
LD [M] drivers/mtd/tests/mtd_subpagetest.ko
LD [M] drivers/mtd/tests/mtd_torturetest.ko
LD [M] drivers/soc/qcom/msm_core_ctl.ko
LD [M] drivers/platform/msm/msm_bus/msm-buspm-dev.ko
AS arch/arm/boot/compressed/lib1funcs.o
LD [M] drivers/spi/spidev.ko
LD [M] drivers/usb/host/ice40-hcd.ko
AS arch/arm/boot/compressed/ashldi3.o
LD [M] fs/ecryptfs/ecryptfs.ko
AS arch/arm/boot/compressed/piggy.gzip.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
bigcountry@bigcountry-G551JW:~/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab$ cd /home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod
bigcountry@bigcountry-G551JW:~/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod$ make all
make -C /home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/ CROSS_COMPILE=~/android/Toolchains/prebuilts/arm-eabi-4.8/bin/arm-eabi- M=/home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod modules
make[1]: Entering directory `/home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab'
CC [M] /home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod/wp_mod.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod/wp_mod.mod.o
LD [M] /home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod/wp_mod.ko
make[1]: Leaving directory `/home/bigcountry/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab'
bigcountry@bigcountry-G551JW:~/Desktop/HTC-526-Build/g45b1dab/SRC-g45b1dab/drivers/staging/wp_mod$

bigcountry@bigcountry-G551JW:~$ adb devices
List of devices attached
FA61VSX04416	device

bigcountry@bigcountry-G551JW:~$ adb shell
shell@htc_a13wlpp:/ $ su
root@htc_a13wlpp:/ # insmod /sdcard/wp_mod.ko

root@htc_a13wlpp:/ # lsmod
wp_mod 12576 0 [permanent], Live 0x00000000 (O)
ecryptfs 74602 0 - Live 0x00000000 (O)
wlan 3921292 0 - Live 0x00000000 (O)
texfat 191279 0 - Live 0x00000000 (PO)
moc_crypto_api_tmpl 13014 0 - Live 0x00000000 (O)
moc_crypto 407130 2 ecryptfs,moc_crypto_api_tmpl, Live 0x00000000 (PO)
moc_platform_mod 12871 1 moc_crypto, Live 0x00000000 (O)
mcKernelApi 18842 1 - Live 0x00000000
mcDrvModule 32690 5 mcKernelApi, Live 0x00000000

root@htc_a13wlpp:/ # mount -o rw -t ext4 /dev/block/mmcblk0p62 /system
mount: Device or resource busy
255|root@htc_a13wlpp:/ # mount -o rw,remount,rw /system
mount: Operation not permitted
255|root@htc_a13wlpp:/ #

bigcountry@bigcountry-G551JW:~$ cd /home/bigcountry/Desktop/HTC-526-Build/
bigcountry@bigcountry-G551JW:~/Desktop/HTC-526-Build$ modinfo wp_mod.ko
filename: /home/bigcountry/Desktop/HTC-526-Build/wp_mod.ko
license: GPL
version: 4.1
description: Defeat system write protect
author: flar2
srcversion: 31E8A648005F10F46BB49F8
depends:
vermagic: 3.10.49-perf-g45b1dab SMP preempt mod_unload modversions ARMv7 p2v8
bigcountry@bigcountry-G551JW:~/Desktop/HTC-526-Build$ adb push wp_mod.ko /sdcard/wp_mod.ko
492 KB/s (34462 bytes in 0.068s)
bigcountry@bigcountry-G551JW:~/Desktop/HTC-526-Build$

I don't think it will allow the system to be R/W unless the Bootloader is unlocked.

The device I tested is Bootloader Locked + S-ON.

And it is fully rooted with SU installed correctly.

I installed Superuser when everything was unlocked and locked it back up so I at least have good Root.

So this is not because of the Temp-Root / it is because of the bootloader being locked.

I have no trouble mount -o rw,remount,rw /system on my boot loader unlocked device.

I have attached the module in case you want to test it.

To load the module

adb push wp_mod.ko /sdcard/wp_mod.ko
adb shell
su
insmod /sdcard/wp_mod.ko
lsmod

I will post my Kernel Source soon as i push it to gethub