What are the rules to use insmod in init.rc

5,344 views
Skip to first unread message

neeloor2004

unread,
Nov 8, 2010, 10:43:02 AM11/8/10
to android-platform
I am really straggling to load a kernel module module.ko in init.rc
What I did
1) I copied the module.ko to /etc
2) then in the init.rc I added the following line
insmod /etc/ module.ko (Or should I copy to /lib/modules ?)

it is not loading [I don't know how to debugg !]

but if I go to command line and type insmod module.ko is working
fine !

is there any way programetticly I can load module

Please help

Thanks

Arun Kumar SINGH

unread,
Nov 9, 2010, 12:27:59 AM11/9/10
to android-...@googlegroups.com, bluezdis...@zavux009.zav.st.com
Try checking the kernel syslog messages to decode the error[may be via dmesg] and also enable Android logs via logcat to see what really happened...


Best Regards,
Arun Kumar Singh

Please help

Thanks

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

palai neeloor2004

unread,
Nov 9, 2010, 6:13:26 AM11/9/10
to android-...@googlegroups.com
with dmesg I am getting init: command 'insmod' r=-1, I don't know

Arun Kumar SINGH

unread,
Nov 9, 2010, 6:17:14 AM11/9/10
to android-...@googlegroups.com
Ok, I think you may have to copy your modules to /lib/modules/'uname -r'/kernel/drivers folders for insmod to work. It works for me from /lib folder.
 

Best Regards,
Arun Kumar Singh

www.crazydaks.com

 

 


From: android-...@googlegroups.com [mailto:android-...@googlegroups.com] On Behalf Of palai neeloor2004
Sent: Tuesday, November 09, 2010 4:43 PM
To: android-...@googlegroups.com
Subject: Re: What are the rules to use insmod in init.rc

palai neeloor2004

unread,
Nov 9, 2010, 6:57:09 AM11/9/10
to android-...@googlegroups.com
Thanks a lot for the reply,
How you copy files to /lib/modules, which script I have to modify [I can use adb push but, I want to know how to copy files at build time]

 

Thanks

Amit Pundir

unread,
Nov 9, 2010, 1:30:57 AM11/9/10
to android-...@googlegroups.com

How I have done is:

in init.rc --->
---------------------------
service module_name /system/bin/module_name/rc.module
oneshot
---------------------------

where /system/bin/module_name/rc.module is --->
---------------------------
#!/system/bin/sh
insmod /system/bin/module/module.ko
---------------------------

don't forget to add execute permissions to /system/bin/module_name/rc.module

Regards,
Amit Pundir

palai neeloor2004

unread,
Nov 10, 2010, 5:51:08 AM11/10/10
to android-...@googlegroups.com
Hi Amit ,
That did the trick, insmod in a script file is with execute permissions is working fine
 
Thanks a lot

S Tung

unread,
Jul 8, 2014, 1:36:06 AM7/8/14
to android-...@googlegroups.com, pundi...@gmail.com
I am not work.
I am using imx6 sabresd_6dq android 4.3. I add a echo in rc.module. Do not print out.
module_name is a folder?

my code:
init.freescale.rc
-------------------->
service helloworld /system/bin/helloworld/rc.module
oneshot

rc.module
----------------->
#!/system/bin/sh
insmod /system/lib/modules/hello.ko
echo -e "~~~~debug insmod hello.ko~~~~~~ \a \n"

Thanks


Amit Pundir於 2010年11月9日星期二UTC+8下午2時30分57秒寫道:
Reply all
Reply to author
Forward
0 new messages