Skip to content

Instantly share code, notes, and snippets.

@m33m33
Last active March 5, 2021 13:21
Show Gist options
  • Save m33m33/22c4bbebb56aaf07021b2cb2ff1b753b to your computer and use it in GitHub Desktop.
Save m33m33/22c4bbebb56aaf07021b2cb2ff1b753b to your computer and use it in GitHub Desktop.
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/soc/1c1b000.usb/usb2/2-1':
KERNEL=="2-1"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{authorized}=="1"
ATTR{avoid_reset_quirk}=="1"
ATTR{bConfigurationValue}=="1"
ATTR{bDeviceClass}=="ef"
ATTR{bDeviceProtocol}=="01"
ATTR{bDeviceSubClass}=="02"
ATTR{bMaxPacketSize0}=="64"
ATTR{bMaxPower}=="500mA"
ATTR{bNumConfigurations}=="1"
ATTR{bNumInterfaces}==" 5"
ATTR{bcdDevice}=="0318"
ATTR{bmAttributes}=="a0"
ATTR{busnum}=="2"
ATTR{configuration}==""
ATTR{devnum}=="14"
ATTR{devpath}=="1"
ATTR{devspec}=="(null)"
ATTR{idProduct}=="0125"
ATTR{idVendor}=="2c7c"
ATTR{ltm_capable}=="no"
ATTR{manufacturer}=="Quectel"
ATTR{maxchild}=="0"
ATTR{power/active_duration}=="65880"
ATTR{power/autosuspend}=="3"
ATTR{power/autosuspend_delay_ms}=="3000"
ATTR{power/connected_duration}=="220384"
ATTR{power/control}=="auto"
ATTR{power/level}=="auto"
ATTR{power/persist}=="0"
ATTR{power/runtime_active_time}=="66059"
ATTR{power/runtime_status}=="active"
ATTR{power/runtime_suspended_time}=="154039"
ATTR{power/wakeup}=="enabled"
ATTR{power/runtime_suspended_time}=="154039" [62/1809]
ATTR{power/wakeup}=="enabled"
ATTR{power/wakeup_abort_count}=="0"
ATTR{power/wakeup_active}=="0"
ATTR{power/wakeup_active_count}=="6"
ATTR{power/wakeup_count}=="0"
ATTR{power/wakeup_expire_count}=="0"
ATTR{power/wakeup_last_time_ms}=="58068198"
ATTR{power/wakeup_max_time_ms}=="0"
ATTR{power/wakeup_prevent_sleep_time_ms}=="0"
ATTR{power/wakeup_total_time_ms}=="0"
ATTR{product}=="EG25-G"
ATTR{quirks}=="0x10"
ATTR{removable}=="unknown"
ATTR{rx_lanes}=="1"
ATTR{speed}=="480"
ATTR{tx_lanes}=="1"
ATTR{urbnum}=="1811"
ATTR{version}==" 2.00"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment