[openAOS-android] How chmod and chown work?

ilya korchemkin
Mon Jan 3 18:47:56 CET 2011


Hi everyone.
I'm trying to make sensors library for froyo. When I boot the device
accelerometer control file /dev/accel_ctrl is
# ls -l /dev/accel_ctrl
crw-------    1 0        0          10, 250 Jan  3 17:38 /dev/accel_ctrl

so my library can't open it (read only):
E/Sensors (  944): Couldn't open /dev/accel_ctrl (Permission denied)

I put the following lines into init.rc after "Owners, Modes for Bluetooth" part
    # Mode for accel_ctrl
    chown system system /dev/accel_ctrl
    chmod 0666 /dev/accel_ctrl

no result though.
With root privileges I can change mode but not owner (it says 'unknown
user/group system').

My questions are:
1. Does this stuff in init.rc really work?
2. How to make this file readable on boot?
3. How to change owners from command line? Seems there isn't defined
any link between user name and uid


More information about the openAOS-android mailing list