转:chmod in init.rc

Copy自:http://groups.google.com/group/android-porting/browse_thread/thread/b6f1a0a2a153cb9e

问题:

I have added a new kernel module in my Android Eclair 2.1 which is
loaded in init.rc and makes a device node at /dev/mynode.

My problem is about setting the permission of this node:

If I do it by myself: "chmod 0777 /dev/mynode" the rights will be set,
till next reboot - but if I do this in init.rc it changes nothing?!

I also tried some kind of hack with service:
service setPermission /system/bin/chmod 0777 /dev/mynode
    oneshot

The same result --> no effect...

I don't wanna make to deeply changes, like in core elements at "system/
core/init/devices.c" ...

Any ideas for solving this bug?

解决:

create a script somewhere, for example, /system/bin/mymod.rc
#!/system/bin/sh
   chmod 0777 /dev/mynode

- add the following in /init.rc:
  service mymod /system/bin/mymod.rc
    oneshot

posted on 2011-10-22 05:04  bye_passer  阅读(1282)  评论(0编辑  收藏  举报

导航