Hi,

I'm trying to add a loadable driver into my development board
(Eclair).
This module doesn't do too much at this moment: only register/
unregister itself as a char device using register_chrdev()
I put it into /system/lib/modules as mydev.ko and added the following
into inint.rc:
   insmod /system/lib/modules/mydev.ko
After reboot I see a message on the console "Inserting module mydev"
and a new entry in /dev folder appeared.
Looks great so far.

However /dev/mydev has only root permissions:
  crw------- root root 253 0 /dev/mydev
Not a problem, right ? Modify init.rc:
   insmod /system/lib/modules/mydev.ko
   chown system system /dev/mydev.ko
   chmod 0777 /dev/mydev
Reboot...
Same result - only root can access /dev/mydev :( Yes, I checked all my
steps for obvious spelling errors, get a copy of init.rc from device
to make sure it has all these changes - everything looks nice except
the permissions weren't changed.
Note: I can change permissions and ownership using adb shell or device
console but does not work to me because this driver has to be
available for a JNI module called upon startup.

On a "normal" Linux device I would use /etc/udev/ rules to create a
symbolic link to this device entry with proper permissions but Android
doesn't have it and according to some comments "You have to use
init.rc instead of /etc/udev"

I use changing permissions on other devices in init.rc without any
problem. But all those devices are included into kernel therefore it
looks like loadable module has some special rules there.

Can anybody tell me how to change permissions on loadable device
driver from init.rc ?

Thanks
ip332

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to