agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
532 stars 410 forks source link

Should change /dev/vchiq etc ownership / permission by a udev rule? #502

Closed sprhawk closed 2 years ago

sprhawk commented 5 years ago

raspberry pi driver will create several devices: /dev/vchiq /dev/vcsm /dev/vcio

which are with root:root 0600 ownership.

Due to this, if user will use raspistill or raspivid application, it will require root permission.

There is solution to include a udev rules with contents:

SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
SUBSYSTEM=="vc-sm",GROUP="video",MODE="0660"
SUBSYSTEM=="bcm2708_vcio",GROUP="video",MODE="0660"

and add command to extra_user_params with: usermod -a -G video pi

then user can use those camera related commands without root permission.

I added them with my own layer for my own project, but I think it is better to be put inside meta-raspberrypi ( raspbian has that rules I think)

agherzan commented 5 years ago

@sprhawk I'm tempted to say that this sounds like a distro configuration. It very much depends on how you want to name your groups, users or if at all. From the perspective of a BSP layer, I'd say that it provides all the primitives for you to build on top. This is a user management "feature" at the core. What do you think?

sprhawk commented 5 years ago

@agherzan I understand these ( in fact there is another eth0 network similar issue ) are a bit specific, however I think there are still reasons to setup them up

  1. easy to get up with. if there were some default settings for these that provided by meta-raspberrypi, it would be easy for beginner to get up with. ( Or maybe some documents about it for beginner to either yocto or raspberrypi bsp)
  2. changes of permission of these devices should be better than root:root permission assignment, I think this should be recommended as default IMO

Or, I think just put them inside to some documentation would be better and time saver.

agherzan commented 5 years ago

I'm up for a doc PR for this @sprhawk

agherzan commented 2 years ago

Closing due to inactivity.