I am trying to modify the init.rc file on Nexus 7 device which is rooted. I want to insmod a simple hello world module before my /userdata/ partition is mounted. Things I have tried:
Extracted the boot.img from the device, extracted the ramdisk, made changes to the init.rc (which do not work), recreated the boot.img (using mkbootimg tool) and then flashed it on the device again
I have placed my hello.ko compiled for the kernel at 2 places: one is the current directory in which init.rc is placed, so that I can do something like insmod hello.ko and it will find it. Secondly, I created /lib/modules/ directory and placed it inside that
In my init.rc I have placed the insmod /lib/modules/hello.ko right after on_boot. I have also changed the init.flo.rc and placed the insmod before and after ./mount_all which mounts the file system. However, I do not see my module loading at all. The permissions set were 0644 ( I tried with 0777 too)
I created init.d inside /etc/folder and placed a loadmodule.sh which does an insmod /lib/modules/hello.ko and that module loads but once the boot process has completed.
I ideally want to do it right before mounting the /userdata/ partition.
Can someone help me with this?
My device is a Nexus 7, with flo_kernel and rooted, busybox installed, etc.