udev rule with KERNELS argument does not work
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm using a USB <-> Serial box and would like to have a custom symlink for the serial ports.
Based on the output of udevadm
I know each port has a different KERNELS value:
KERNELS=="1-3:1.0" (this is labeled as port 1 on the box)
KERNELS=="1-3:1.1" (port 2)
KERNELS=="1-3:1.2" (port 3)
KERNELS=="1-3:1.3" (port 4)
I tried the following rule:
ATTRSidVendor=="0403", ATTRSidProduct=="6011", KERNELS=="1-3:1.3", SYMLINK+="my_port"
which did not work. If, however, I use KERNELS=="1-3"
instead of KERNELS=="1-3:1.3"
, the symlink is created.
How can I rewrite the rule to be able to differentiate between the various serial ports?
$ udevadm info --path=/sys/bus/usb-serial/devices/ttyUSB19 --attribute-walk
looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/ttyUSB19':
KERNEL=="ttyUSB19"
SUBSYSTEM=="usb-serial"
DRIVER=="ftdi_sio"
ATTRlatency_timer=="16"
ATTRport_number=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3':
KERNELS=="1-3:1.3"
SUBSYSTEMS=="usb"
DRIVERS=="ftdi_sio"
ATTRSauthorized=="1"
ATTRSbAlternateSetting==" 0"
ATTRSbInterfaceClass=="ff"
ATTRSbInterfaceNumber=="03"
ATTRSbInterfaceProtocol=="ff"
ATTRSbInterfaceSubClass=="ff"
ATTRSbNumEndpoints=="02"
ATTRSinterface=="USB <-> Serial Cable"
ATTRSsupports_autosuspend=="1"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
KERNELS=="1-3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="00"
ATTRSbDeviceProtocol=="00"
ATTRSbDeviceSubClass=="00"
ATTRSbMaxPacketSize0=="64"
ATTRSbMaxPower=="100mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 4"
ATTRSbcdDevice=="0800"
ATTRSbmAttributes=="80"
ATTRSbusnum=="1"
ATTRSconfiguration==""
ATTRSdevnum=="65"
ATTRSdevpath=="3"
ATTRSidProduct=="6011"
ATTRSidVendor=="0403"
ATTRSltm_capable=="no"
ATTRSmanufacturer=="FTDI"
[...]
usb udev serial-port
add a comment |Â
up vote
0
down vote
favorite
I'm using a USB <-> Serial box and would like to have a custom symlink for the serial ports.
Based on the output of udevadm
I know each port has a different KERNELS value:
KERNELS=="1-3:1.0" (this is labeled as port 1 on the box)
KERNELS=="1-3:1.1" (port 2)
KERNELS=="1-3:1.2" (port 3)
KERNELS=="1-3:1.3" (port 4)
I tried the following rule:
ATTRSidVendor=="0403", ATTRSidProduct=="6011", KERNELS=="1-3:1.3", SYMLINK+="my_port"
which did not work. If, however, I use KERNELS=="1-3"
instead of KERNELS=="1-3:1.3"
, the symlink is created.
How can I rewrite the rule to be able to differentiate between the various serial ports?
$ udevadm info --path=/sys/bus/usb-serial/devices/ttyUSB19 --attribute-walk
looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/ttyUSB19':
KERNEL=="ttyUSB19"
SUBSYSTEM=="usb-serial"
DRIVER=="ftdi_sio"
ATTRlatency_timer=="16"
ATTRport_number=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3':
KERNELS=="1-3:1.3"
SUBSYSTEMS=="usb"
DRIVERS=="ftdi_sio"
ATTRSauthorized=="1"
ATTRSbAlternateSetting==" 0"
ATTRSbInterfaceClass=="ff"
ATTRSbInterfaceNumber=="03"
ATTRSbInterfaceProtocol=="ff"
ATTRSbInterfaceSubClass=="ff"
ATTRSbNumEndpoints=="02"
ATTRSinterface=="USB <-> Serial Cable"
ATTRSsupports_autosuspend=="1"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
KERNELS=="1-3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="00"
ATTRSbDeviceProtocol=="00"
ATTRSbDeviceSubClass=="00"
ATTRSbMaxPacketSize0=="64"
ATTRSbMaxPower=="100mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 4"
ATTRSbcdDevice=="0800"
ATTRSbmAttributes=="80"
ATTRSbusnum=="1"
ATTRSconfiguration==""
ATTRSdevnum=="65"
ATTRSdevpath=="3"
ATTRSidProduct=="6011"
ATTRSidVendor=="0403"
ATTRSltm_capable=="no"
ATTRSmanufacturer=="FTDI"
[...]
usb udev serial-port
AtKERNELS=="1-3"
, you probably get a symlink to the raw USB device instead of the tty. You need to match onSUBSYSTEM=="usb-serial"
(or whatever subsystem actually produces the tty). This question is a duplicate, and has been asked before in several variants, but I don't have the time to find the old question(s) right now.
â dirkt
Jun 6 at 11:50
@dirkt I am aware of that. But matching with subsystem is not enough because all the serial ports have the same, "1-3". I was suspecting that the colon is the source of trouble: why does it work for "1-3" but not for "1-3:1.3"?
â Sparkler
Jun 6 at 12:37
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm using a USB <-> Serial box and would like to have a custom symlink for the serial ports.
Based on the output of udevadm
I know each port has a different KERNELS value:
KERNELS=="1-3:1.0" (this is labeled as port 1 on the box)
KERNELS=="1-3:1.1" (port 2)
KERNELS=="1-3:1.2" (port 3)
KERNELS=="1-3:1.3" (port 4)
I tried the following rule:
ATTRSidVendor=="0403", ATTRSidProduct=="6011", KERNELS=="1-3:1.3", SYMLINK+="my_port"
which did not work. If, however, I use KERNELS=="1-3"
instead of KERNELS=="1-3:1.3"
, the symlink is created.
How can I rewrite the rule to be able to differentiate between the various serial ports?
$ udevadm info --path=/sys/bus/usb-serial/devices/ttyUSB19 --attribute-walk
looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/ttyUSB19':
KERNEL=="ttyUSB19"
SUBSYSTEM=="usb-serial"
DRIVER=="ftdi_sio"
ATTRlatency_timer=="16"
ATTRport_number=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3':
KERNELS=="1-3:1.3"
SUBSYSTEMS=="usb"
DRIVERS=="ftdi_sio"
ATTRSauthorized=="1"
ATTRSbAlternateSetting==" 0"
ATTRSbInterfaceClass=="ff"
ATTRSbInterfaceNumber=="03"
ATTRSbInterfaceProtocol=="ff"
ATTRSbInterfaceSubClass=="ff"
ATTRSbNumEndpoints=="02"
ATTRSinterface=="USB <-> Serial Cable"
ATTRSsupports_autosuspend=="1"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
KERNELS=="1-3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="00"
ATTRSbDeviceProtocol=="00"
ATTRSbDeviceSubClass=="00"
ATTRSbMaxPacketSize0=="64"
ATTRSbMaxPower=="100mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 4"
ATTRSbcdDevice=="0800"
ATTRSbmAttributes=="80"
ATTRSbusnum=="1"
ATTRSconfiguration==""
ATTRSdevnum=="65"
ATTRSdevpath=="3"
ATTRSidProduct=="6011"
ATTRSidVendor=="0403"
ATTRSltm_capable=="no"
ATTRSmanufacturer=="FTDI"
[...]
usb udev serial-port
I'm using a USB <-> Serial box and would like to have a custom symlink for the serial ports.
Based on the output of udevadm
I know each port has a different KERNELS value:
KERNELS=="1-3:1.0" (this is labeled as port 1 on the box)
KERNELS=="1-3:1.1" (port 2)
KERNELS=="1-3:1.2" (port 3)
KERNELS=="1-3:1.3" (port 4)
I tried the following rule:
ATTRSidVendor=="0403", ATTRSidProduct=="6011", KERNELS=="1-3:1.3", SYMLINK+="my_port"
which did not work. If, however, I use KERNELS=="1-3"
instead of KERNELS=="1-3:1.3"
, the symlink is created.
How can I rewrite the rule to be able to differentiate between the various serial ports?
$ udevadm info --path=/sys/bus/usb-serial/devices/ttyUSB19 --attribute-walk
looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/ttyUSB19':
KERNEL=="ttyUSB19"
SUBSYSTEM=="usb-serial"
DRIVER=="ftdi_sio"
ATTRlatency_timer=="16"
ATTRport_number=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3':
KERNELS=="1-3:1.3"
SUBSYSTEMS=="usb"
DRIVERS=="ftdi_sio"
ATTRSauthorized=="1"
ATTRSbAlternateSetting==" 0"
ATTRSbInterfaceClass=="ff"
ATTRSbInterfaceNumber=="03"
ATTRSbInterfaceProtocol=="ff"
ATTRSbInterfaceSubClass=="ff"
ATTRSbNumEndpoints=="02"
ATTRSinterface=="USB <-> Serial Cable"
ATTRSsupports_autosuspend=="1"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
KERNELS=="1-3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="00"
ATTRSbDeviceProtocol=="00"
ATTRSbDeviceSubClass=="00"
ATTRSbMaxPacketSize0=="64"
ATTRSbMaxPower=="100mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 4"
ATTRSbcdDevice=="0800"
ATTRSbmAttributes=="80"
ATTRSbusnum=="1"
ATTRSconfiguration==""
ATTRSdevnum=="65"
ATTRSdevpath=="3"
ATTRSidProduct=="6011"
ATTRSidVendor=="0403"
ATTRSltm_capable=="no"
ATTRSmanufacturer=="FTDI"
[...]
usb udev serial-port
asked Jun 5 at 21:40
Sparkler
2871311
2871311
AtKERNELS=="1-3"
, you probably get a symlink to the raw USB device instead of the tty. You need to match onSUBSYSTEM=="usb-serial"
(or whatever subsystem actually produces the tty). This question is a duplicate, and has been asked before in several variants, but I don't have the time to find the old question(s) right now.
â dirkt
Jun 6 at 11:50
@dirkt I am aware of that. But matching with subsystem is not enough because all the serial ports have the same, "1-3". I was suspecting that the colon is the source of trouble: why does it work for "1-3" but not for "1-3:1.3"?
â Sparkler
Jun 6 at 12:37
add a comment |Â
AtKERNELS=="1-3"
, you probably get a symlink to the raw USB device instead of the tty. You need to match onSUBSYSTEM=="usb-serial"
(or whatever subsystem actually produces the tty). This question is a duplicate, and has been asked before in several variants, but I don't have the time to find the old question(s) right now.
â dirkt
Jun 6 at 11:50
@dirkt I am aware of that. But matching with subsystem is not enough because all the serial ports have the same, "1-3". I was suspecting that the colon is the source of trouble: why does it work for "1-3" but not for "1-3:1.3"?
â Sparkler
Jun 6 at 12:37
At
KERNELS=="1-3"
, you probably get a symlink to the raw USB device instead of the tty. You need to match on SUBSYSTEM=="usb-serial"
(or whatever subsystem actually produces the tty). This question is a duplicate, and has been asked before in several variants, but I don't have the time to find the old question(s) right now.â dirkt
Jun 6 at 11:50
At
KERNELS=="1-3"
, you probably get a symlink to the raw USB device instead of the tty. You need to match on SUBSYSTEM=="usb-serial"
(or whatever subsystem actually produces the tty). This question is a duplicate, and has been asked before in several variants, but I don't have the time to find the old question(s) right now.â dirkt
Jun 6 at 11:50
@dirkt I am aware of that. But matching with subsystem is not enough because all the serial ports have the same, "1-3". I was suspecting that the colon is the source of trouble: why does it work for "1-3" but not for "1-3:1.3"?
â Sparkler
Jun 6 at 12:37
@dirkt I am aware of that. But matching with subsystem is not enough because all the serial ports have the same, "1-3". I was suspecting that the colon is the source of trouble: why does it work for "1-3" but not for "1-3:1.3"?
â Sparkler
Jun 6 at 12:37
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448085%2fudev-rule-with-kernels-argument-does-not-work%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
At
KERNELS=="1-3"
, you probably get a symlink to the raw USB device instead of the tty. You need to match onSUBSYSTEM=="usb-serial"
(or whatever subsystem actually produces the tty). This question is a duplicate, and has been asked before in several variants, but I don't have the time to find the old question(s) right now.â dirkt
Jun 6 at 11:50
@dirkt I am aware of that. But matching with subsystem is not enough because all the serial ports have the same, "1-3". I was suspecting that the colon is the source of trouble: why does it work for "1-3" but not for "1-3:1.3"?
â Sparkler
Jun 6 at 12:37