-
how to acceess udev rule parameterComputer/linux 2017. 8. 25. 22:36
Sometime, one needs to access all attribute on a device in order to create the udev rule for this device.
$ udevadm info --query=all -n /dev/EtherCAT0 --attribute-walk
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/virtual/EtherCAT/EtherCAT0':
KERNEL=="EtherCAT0"
SUBSYSTEM=="EtherCAT"
DRIVER==""So, based on this output, we can create the udev rules in /etc/udev/rules.d/99-ethercat.rules as follows:
KERNEL=="EtherCAT*", SUBSYSTEM=="EtherCAT", MODE="0666"
'Computer > linux' 카테고리의 다른 글
Combine multiple PDF files to a pdf file (0) 2017.08.28 How to get only the mac address (Linux) (0) 2017.08.25 Exact copy a huge directory into the different one in linux (0) 2017.03.15