udev rules

Restoring a little note

Discover device’s info

Check out the information of devices, using this command:

$ udevadm info --query=all --name=input/mouse0

from output, get the SUBSYSTEM and ID_PATH environment variable – the unique value – we need it when creating the udev rules.

Writing the rules

Create a /etc/udev/rules.d/70-input.rules file, put the line on it:

SUBSYSTEM=="input", ENV{ID_PATH}=="platform-sunxi-ohci.4-usb-0:1:1.0", SYMLINK+="usb1mouse"

Finally, I re-insert my usb mouse, and see a symlink named usb1mouse on /dev/usb1mouse.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章