Udev rule for syfs classdevice attributes - Stack Overflow
I have a driver that exposes class and device attributes under sysfs. I'm using udev to make the devices that appear in /dev
read/writable by a certain group, but I can't figure out how to make the attributes read/writable by the same group without a shell script.
ls -l /dev/foobar
crw-rw---- 1 root my_group 241, 0 Jan 4 21:57 /dev/foobar # ownership fixed by udev
ls -l /sys/class/my_class/rw_attribute
--w--w---- 1 root root 4096 Jan 4 22:02 rw_attribute # still owned by root group :/
ls -l /sys/class/my_class/foobar/rw_attribute
-rw-rw-r-- 1 root root 4096 Jan 4 22:13 rw_attribute # ditto
I've tried using udevadm info
to match the KERNEL and SUBSYSTEM keys of the sysfs path to no effect. I've also found the udev_event
and get_ownership
fields of struct class
; I haven't had luck with the former and the latter works for device attributes, but I have to hard code my_group
's gid which is not ideal.
Does udev only work with devices under /dev
, or is there a way to apply the rules to sysfs attributes?
最新文章
- 又是一场数码盛宴 台北电脑展展品预热
- 移动互联网屡败屡战 鲍尔默打通微软墙
- visual studio 2017 - C++ build errors with wxWidgets 3.1.2 and Connect method - Stack Overflow
- android - No recomposition called when State Holder class modified - Stack Overflow
- grpc - In gNMI, What's the difference between the "Origin" that can be specified in a path and &qu
- Any way to open an SSIS project with a newer version of Visual Studio? - Stack Overflow
- node.js - Cookies Blocked in Cross-Origin Requests Between Netlify Frontend(Reactjs) and Railway Backend (Node ts) - Stack Overf
- javascript - Why does every object in BabylonJS require a name? - Stack Overflow
- python - Azure Cognitive Vector search query and index creation - Stack Overflow
- Why is my bot not able to detect when a user leaves in Telegram? - Stack Overflow
- python - Multi-level list with each level number included - Stack Overflow
- python - mecab-python3 AWS lambda "circular import" error - Stack Overflow
- javascript - Why does the iterator close after a break in a for...of loop? - Stack Overflow
- Cannot open DocumentPicker window in React Native app, Android platform - Stack Overflow
- c++ - Vscode doesn't pass args to program when debugging - Stack Overflow
- volttron - POSTMAN REST Call Results in RPC Timed Out: 5 Seconds - Stack Overflow
- reactjs - TypeError: The "payload" argument must be of type object. Received null on Next.js with Prisma and M