meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:udev [2017/06/09 11:28]
niziak
linux:udev [2023/12/13 16:31] (current)
niziak
Line 6: Line 6:
 === Testing rules === === Testing rules ===
 <code bash>​udevadm test /​sys/​class/​tty/​ttyACM0</​code>​ <code bash>​udevadm test /​sys/​class/​tty/​ttyACM0</​code>​
 +
 +NOTE: This program is for debugging only, it does not run any program specified by a RUN key. It may show incorrect results, because some values may be different, or not available at a simulation run.
  
 ==== Getting info ==== ==== Getting info ====
 <code bash> <code bash>
 udevadm info --attribute-walk --path=/​sys/​class/​tty/​ttyACM0 udevadm info --attribute-walk --path=/​sys/​class/​tty/​ttyACM0
 +udevadm info --attribute-walk --name=/​dev/​ttyUSB0
 </​code>​ </​code>​
  
Line 23: Line 26:
 </​file>​ </​file>​
  
 +<code bash>
 +udevadm control --log-priority=debug
 +
 +</​code>​
  
 ==== Rules ==== ==== Rules ====
Line 94: Line 101:
 ''​link_priority'':​ higher has higher priority ''​link_priority'':​ higher has higher priority
  
 +Define symlink name in device tree (add property ''​symlink''​) i.e:
 +<​code>​
 +&pwm4 {
 + pinctrl-names = "​default";​
 + pinctrl-0 = <&​pinctrl_pwm4>;​
 + status = "​okay";​
 + symlink = "​buzzer";​
 +};
 +</​code>​
 +
 +<​code>​
 +ATTR{device/​of_node/​symlink}!="",​ ENV{DEVNAME}!="",​ SYMLINK+="​%s{device/​of_node/​symlink}"​
 +</​code>​
 +
 +See:
 +  - [[https://​github.com/​mvduin/​py-uio/​blob/​master/​dts/​pwmss2.dtsi#​L122|pwmss2.dtsi]]
 +  - [[https://​github.com/​mvduin/​py-uio/​blob/​master/​etc/​udev/​rules.d/​10-of-symlink.rules|10-of-symlink.rules]]
 +  - [[https://​github.com/​mvduin/​py-uio/​blob/​master/​dts/​pwmss2.dtsi|pwmss2.dtsi]]
  
 === Triggering systemd === === Triggering systemd ===
Line 101: Line 126:
 SUBSYSTEM=="​printer",​ TAG+="​systemd",​ ENV{SYSTEMD_WANTS}="​printer.target"​ SUBSYSTEM=="​printer",​ TAG+="​systemd",​ ENV{SYSTEMD_WANTS}="​printer.target"​
 </​code>​ </​code>​
 +
 +More info about systemd interactions:​ [[https://​www.freedesktop.org/​software/​systemd/​man/​latest/​systemd.device.html|systemd.device — Device unit configuration]]
  
 === Prevent ModemManager === === Prevent ModemManager ===