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 revisionPrevious revision
Next revision
Previous revision
linux:udev [2019/10/16 08:56] โ€“ [Getting info] niziaklinux: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 ====
Line 24: Line 26:
 </file> </file>
  
 +<code bash>
 +udevadm control --log-priority=debug
 +
 +</code>
  
 ==== Rules ==== ==== Rules ====
Line 95: 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 102: 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 ===