How to link a device to udev?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a microcontroller with a few "strange" devices.
One of these is an embedded Ethernet switch.
Cable connections and disconnections are captured by driver which dutifully prints a log message:
[ 260.740000] rt305x-esw 10110000.esw: link changed 0x01
[ 2542.440000] rt305x-esw 10110000.esw: link changed 0x00
[ 2544.390000] rt305x-esw 10110000.esw: link changed 0x01
The driver also registers in sysfs:
# ls -l /sys/devices/10110000.esw/
total 0
lrwxrwxrwx 1 root root 0 Jan 1 01:05 driver -> ../../bus/platform/drivers/rt305x-esw
-rw-r--r-- 1 root root 4096 Jan 1 01:05 driver_override
-r--r--r-- 1 root root 4096 Jan 1 01:05 modalias
lrwxrwxrwx 1 root root 0 Jan 1 01:05 subsystem -> ../../bus/platform
-rw-r--r-- 1 root root 4096 Jan 1 01:00 uevent
but its uevent is rather cryptic to me:
# cat /sys/devices/10110000.esw/uevent
DRIVER=rt305x-esw
OF_NAME=esw
OF_FULLNAME=/esw@10110000
OF_COMPATIBLE_0=ralink,rt3050-esw
OF_COMPATIBLE_N=1
MODALIAS=of:NeswT<NULL>Cralink,rt3050-esw
Now the question:
I should connect a uevent rule to "link changed" events; how can I do that?
I was unable to find any (relevant) documentation; can someone point me in the right direction, please?
linux udev sysfs
add a comment |Â
up vote
0
down vote
favorite
I have a microcontroller with a few "strange" devices.
One of these is an embedded Ethernet switch.
Cable connections and disconnections are captured by driver which dutifully prints a log message:
[ 260.740000] rt305x-esw 10110000.esw: link changed 0x01
[ 2542.440000] rt305x-esw 10110000.esw: link changed 0x00
[ 2544.390000] rt305x-esw 10110000.esw: link changed 0x01
The driver also registers in sysfs:
# ls -l /sys/devices/10110000.esw/
total 0
lrwxrwxrwx 1 root root 0 Jan 1 01:05 driver -> ../../bus/platform/drivers/rt305x-esw
-rw-r--r-- 1 root root 4096 Jan 1 01:05 driver_override
-r--r--r-- 1 root root 4096 Jan 1 01:05 modalias
lrwxrwxrwx 1 root root 0 Jan 1 01:05 subsystem -> ../../bus/platform
-rw-r--r-- 1 root root 4096 Jan 1 01:00 uevent
but its uevent is rather cryptic to me:
# cat /sys/devices/10110000.esw/uevent
DRIVER=rt305x-esw
OF_NAME=esw
OF_FULLNAME=/esw@10110000
OF_COMPATIBLE_0=ralink,rt3050-esw
OF_COMPATIBLE_N=1
MODALIAS=of:NeswT<NULL>Cralink,rt3050-esw
Now the question:
I should connect a uevent rule to "link changed" events; how can I do that?
I was unable to find any (relevant) documentation; can someone point me in the right direction, please?
linux udev sysfs
First see if the driver is sending out a event to udev when the status change. Dosudo udevadm monitor -k -p
to print the events as they occur.
â meuh
Oct 15 '17 at 15:07
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a microcontroller with a few "strange" devices.
One of these is an embedded Ethernet switch.
Cable connections and disconnections are captured by driver which dutifully prints a log message:
[ 260.740000] rt305x-esw 10110000.esw: link changed 0x01
[ 2542.440000] rt305x-esw 10110000.esw: link changed 0x00
[ 2544.390000] rt305x-esw 10110000.esw: link changed 0x01
The driver also registers in sysfs:
# ls -l /sys/devices/10110000.esw/
total 0
lrwxrwxrwx 1 root root 0 Jan 1 01:05 driver -> ../../bus/platform/drivers/rt305x-esw
-rw-r--r-- 1 root root 4096 Jan 1 01:05 driver_override
-r--r--r-- 1 root root 4096 Jan 1 01:05 modalias
lrwxrwxrwx 1 root root 0 Jan 1 01:05 subsystem -> ../../bus/platform
-rw-r--r-- 1 root root 4096 Jan 1 01:00 uevent
but its uevent is rather cryptic to me:
# cat /sys/devices/10110000.esw/uevent
DRIVER=rt305x-esw
OF_NAME=esw
OF_FULLNAME=/esw@10110000
OF_COMPATIBLE_0=ralink,rt3050-esw
OF_COMPATIBLE_N=1
MODALIAS=of:NeswT<NULL>Cralink,rt3050-esw
Now the question:
I should connect a uevent rule to "link changed" events; how can I do that?
I was unable to find any (relevant) documentation; can someone point me in the right direction, please?
linux udev sysfs
I have a microcontroller with a few "strange" devices.
One of these is an embedded Ethernet switch.
Cable connections and disconnections are captured by driver which dutifully prints a log message:
[ 260.740000] rt305x-esw 10110000.esw: link changed 0x01
[ 2542.440000] rt305x-esw 10110000.esw: link changed 0x00
[ 2544.390000] rt305x-esw 10110000.esw: link changed 0x01
The driver also registers in sysfs:
# ls -l /sys/devices/10110000.esw/
total 0
lrwxrwxrwx 1 root root 0 Jan 1 01:05 driver -> ../../bus/platform/drivers/rt305x-esw
-rw-r--r-- 1 root root 4096 Jan 1 01:05 driver_override
-r--r--r-- 1 root root 4096 Jan 1 01:05 modalias
lrwxrwxrwx 1 root root 0 Jan 1 01:05 subsystem -> ../../bus/platform
-rw-r--r-- 1 root root 4096 Jan 1 01:00 uevent
but its uevent is rather cryptic to me:
# cat /sys/devices/10110000.esw/uevent
DRIVER=rt305x-esw
OF_NAME=esw
OF_FULLNAME=/esw@10110000
OF_COMPATIBLE_0=ralink,rt3050-esw
OF_COMPATIBLE_N=1
MODALIAS=of:NeswT<NULL>Cralink,rt3050-esw
Now the question:
I should connect a uevent rule to "link changed" events; how can I do that?
I was unable to find any (relevant) documentation; can someone point me in the right direction, please?
linux udev sysfs
asked Oct 14 '17 at 17:06
ZioByte
17117
17117
First see if the driver is sending out a event to udev when the status change. Dosudo udevadm monitor -k -p
to print the events as they occur.
â meuh
Oct 15 '17 at 15:07
add a comment |Â
First see if the driver is sending out a event to udev when the status change. Dosudo udevadm monitor -k -p
to print the events as they occur.
â meuh
Oct 15 '17 at 15:07
First see if the driver is sending out a event to udev when the status change. Do
sudo udevadm monitor -k -p
to print the events as they occur.â meuh
Oct 15 '17 at 15:07
First see if the driver is sending out a event to udev when the status change. Do
sudo udevadm monitor -k -p
to print the events as they occur.â meuh
Oct 15 '17 at 15:07
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%2f398136%2fhow-to-link-a-device-to-udev%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
First see if the driver is sending out a event to udev when the status change. Do
sudo udevadm monitor -k -p
to print the events as they occur.â meuh
Oct 15 '17 at 15:07