Gean Santos
Gean Santos

Reputation: 63

Set file permissions in Android source code

In my Android 10 image I have the file (of type character) /dev/i2c-1:

crw ------- 1 root root 89, 1 2021-05-26 11:51 /dev/i2c-1

I have the source code for this Android and I would like this file to have read and write permission for any user, that is, it would be as follows:

crw-rw-rw- 1 root root 89, 1 2021-05-26 11:51 /dev/i2c-1

Otherwise, I have to run the chmod command every time the device is restarted.

Upvotes: 0

Views: 875

Answers (1)

Yong
Yong

Reputation: 1998

You can change the access permissions in two places:

  1. where your create the file
  2. in init rc files. See examples
on init
   chmod 666 /dev/i2c-1

Upvotes: 1

Related Questions