1

I know we can assign permission to device driver to run on root/group/user mode using udev config scripts but I am not sure how to run program which is using driver in Android HAL to run in specific user mode? I could execute program only after I executed chmod 777 on /dev/ttyOx.

I saw Bluetooth module in udev config in Android scripts using like this

chmod 0660 /dev/ttyO1 chown system system /dev/ttyS0

My question is , how can program using specific driver can be registered to specific group or user permission such as Bluetooth in above scripts and make only that specific program to use device driver?

Rajesh SO
  • 183
  • 1
  • 3
  • 16
  • Same problem here, have you found the solution yet? Now I have to manually chmod the device driver to 777 each time the kernel is loaded, so annoying.... – Max May 02 '13 at 02:44

1 Answers1

0

Disclaimer:: I am not a Android programmer. I use Linux kernels only.

But I still believe, the drivers can be loaded in to kernel only by privileged user.i.e super user/ root.

/dev/ttyO1 and /dev/ttyS0 are device files only. which will be opened by user space applications. so setting permission to these device files is possible.

It is not possible to assign a particular driver to a specific group/user. All drivers are LKM(Loadable Kernel Modules) i.e inserted in to kernel.

Kernel runs in privileged mode. User has no direct dealing with kernel. It is restricted by space(User space/Kernel space).

In script you can check the current user and decide whether allow or not to load the blue-tooth driver.

Jeyaram
  • 9,158
  • 7
  • 41
  • 63