- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我运行docker容器并在容器中使用udevadm
列出某些设备的属性时,只有有关该设备的基本信息。当我在主机上执行相同的操作时,我可以看到更多。我该怎么做才能在容器中获取所有信息?
host$ udevadm info --query=property /dev/bus/usb/004/008
BUSNUM=004
DEVNAME=/dev/bus/usb/004/008
DEVNUM=008
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=MCP2210_USB-to-SPI_Master
ID_MODEL_ENC=MCP2210 USB-to-SPI Master
ID_MODEL_ID=00de
ID_REVISION=0002
ID_SERIAL=Microchip_Technology_Inc._MCP2210_USB-to-SPI_Master_0000267472
ID_SERIAL_SHORT=0000267472
ID_USB_INTERFACES=:030000:
ID_VENDOR=Microchip_Technology_Inc.
ID_VENDOR_ENC=Microchip Technology Inc.
ID_VENDOR_FROM_DATABASE=Microchip Technology, Inc.
ID_VENDOR_ID=04d8
MAJOR=189
MINOR=391
PRODUCT=4d8/de/2
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=176769529274
host$ docker run -ti -v /dev/bus/usb/:/dev/bus/usb alpine sh
container# apk update
container# apk add eudev
container# udevadm info --query=property /dev/bus/usb/004/008
BUSNUM=004
DEVNAME=/dev/bus/usb/004/008
DEVNUM=008
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1
DEVTYPE=usb_device
DRIVER=usb
MAJOR=189
MINOR=391
PRODUCT=4d8/de/2
SUBSYSTEM=usb
TYPE=0/0/0
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
udevadm control --reload
重新加载了配置。现在我明白了:
calling: info
P: /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.2
N: bus/usb/004/016
no db file to read /run/udev/data/c189:399: No such file or directory
E: BUSNUM=004
E: DEVNAME=/dev/bus/usb/004/016
E: DEVNUM=016
E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.2
E: DEVTYPE=usb_device
E: DRIVER=usb
E: MAJOR=189
E: MINOR=399
E: PRODUCT=4d8/de/2
E: SUBSYSTEM=usb
E: TYPE=0/0/0
host$ udevadm monitor --environment
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[183757.837879] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1 (usb)
ACTION=add
BUSNUM=004
DEVNAME=/dev/bus/usb/004/034
DEVNUM=034
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1
DEVTYPE=usb_device
MAJOR=189
MINOR=417
PRODUCT=4d8/de/2
SEQNUM=5985
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[183757.838467] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0
DEVTYPE=usb_interface
INTERFACE=3/0/0
MODALIAS=usb:v04D8p00DEd0002dc00dsc00dp00ic03isc00ip00in00
PRODUCT=4d8/de/2
SEQNUM=5986
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[183757.840044] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F
HID_ID=0003:000004D8:000000DE
HID_NAME=Microchip Technology Inc. MCP2210 USB-to-SPI Master
HID_PHYS=usb-0000:00:1d.0-1.1/input0
HID_UNIQ=0000267472
MODALIAS=hid:b0003g0001v000004D8p000000DE
SEQNUM=5987
SUBSYSTEM=hid
KERNEL[183757.840586] add /class/usbmisc (class)
ACTION=add
DEVPATH=/class/usbmisc
SEQNUM=5988
SUBSYSTEM=class
KERNEL[183757.840891] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0 (usbmisc)
ACTION=add
DEVNAME=/dev/usb/hiddev0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0
MAJOR=180
MINOR=0
SEQNUM=5989
SUBSYSTEM=usbmisc
KERNEL[183757.841219] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0
MAJOR=244
MINOR=0
SEQNUM=5990
SUBSYSTEM=hidraw
UDEV [183757.842324] add /class/usbmisc (class)
ACTION=add
DEVPATH=/class/usbmisc
SEQNUM=5988
SUBSYSTEM=class
USEC_INITIALIZED=183757842069
UDEV [183758.395467] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1 (usb)
ACTION=add
BUSNUM=004
DEVNAME=/dev/bus/usb/004/034
DEVNUM=034
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=MCP2210_USB-to-SPI_Master
ID_MODEL_ENC=MCP2210\x20USB-to-SPI\x20Master
ID_MODEL_ID=00de
ID_REVISION=0002
ID_SERIAL=Microchip_Technology_Inc._MCP2210_USB-to-SPI_Master_0000267472
ID_SERIAL_SHORT=0000267472
ID_USB_INTERFACES=:030000:
ID_VENDOR=Microchip_Technology_Inc.
ID_VENDOR_ENC=Microchip\x20Technology\x20Inc.
ID_VENDOR_FROM_DATABASE=Microchip Technology, Inc.
ID_VENDOR_ID=04d8
MAJOR=189
MINOR=417
PRODUCT=4d8/de/2
SEQNUM=5985
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=183757852027
UDEV [183758.396989] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0
DEVTYPE=usb_interface
DRIVER=usbhid
ID_VENDOR_FROM_DATABASE=Microchip Technology, Inc.
INTERFACE=3/0/0
MODALIAS=usb:v04D8p00DEd0002dc00dsc00dp00ic03isc00ip00in00
PRODUCT=4d8/de/2
SEQNUM=5986
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=183758396448
UDEV [183758.398096] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0 (usbmisc)
ACTION=add
DEVNAME=/dev/usb/hiddev0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0
MAJOR=180
MINOR=0
SEQNUM=5989
SUBSYSTEM=usbmisc
USEC_INITIALIZED=183758397905
UDEV [183758.398728] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F
HID_ID=0003:000004D8:000000DE
HID_NAME=Microchip Technology Inc. MCP2210 USB-to-SPI Master
HID_PHYS=usb-0000:00:1d.0-1.1/input0
HID_UNIQ=0000267472
MODALIAS=hid:b0003g0001v000004D8p000000DE
SEQNUM=5987
SUBSYSTEM=hid
USEC_INITIALIZED=183758398168
UDEV [183758.399920] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0
MAJOR=244
MINOR=0
SEQNUM=5990
SUBSYSTEM=hidraw
USEC_INITIALIZED=183758399726
KERNEL[183758.400685] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0 (usbmisc)
ACTION=remove
DEVNAME=/dev/usb/hiddev0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0
MAJOR=180
MINOR=0
SEQNUM=5991
SUBSYSTEM=usbmisc
KERNEL[183758.400766] remove /usbmisc (class)
ACTION=remove
DEVPATH=/usbmisc
SEQNUM=5992
SUBSYSTEM=class
KERNEL[183758.400956] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0 (hidraw)
ACTION=remove
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0
MAJOR=244
MINOR=0
SEQNUM=5993
SUBSYSTEM=hidraw
KERNEL[183758.401068] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F (hid)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F
HID_ID=0003:000004D8:000000DE
HID_NAME=Microchip Technology Inc. MCP2210 USB-to-SPI Master
HID_PHYS=usb-0000:00:1d.0-1.1/input0
HID_UNIQ=0000267472
MODALIAS=hid:b0003g0001v000004D8p000000DE
SEQNUM=5994
SUBSYSTEM=hid
UDEV [183758.403532] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0 (usbmisc)
ACTION=remove
DEVNAME=/dev/usb/hiddev0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0
MAJOR=180
MINOR=0
SEQNUM=5991
SUBSYSTEM=usbmisc
USEC_INITIALIZED=183758400806
UDEV [183758.404020] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0 (hidraw)
ACTION=remove
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F/hidraw/hidraw0
MAJOR=244
MINOR=0
SEQNUM=5993
SUBSYSTEM=hidraw
USEC_INITIALIZED=183758402106
UDEV [183758.404380] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F (hid)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.001F
HID_ID=0003:000004D8:000000DE
HID_NAME=Microchip Technology Inc. MCP2210 USB-to-SPI Master
HID_PHYS=usb-0000:00:1d.0-1.1/input0
HID_UNIQ=0000267472
MODALIAS=hid:b0003g0001v000004D8p000000DE
SEQNUM=5994
SUBSYSTEM=hid
USEC_INITIALIZED=183758402790
UDEV [183758.405108] remove /usbmisc (class)
ACTION=remove
DEVPATH=/usbmisc
SEQNUM=5992
SUBSYSTEM=class
USEC_INITIALIZED=183758401553
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[183877.777776] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1 (usb)
ACTION=add
BUSNUM=004
DEVNAME=/dev/bus/usb/004/035
DEVNUM=035
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1
DEVTYPE=usb_device
MAJOR=189
MINOR=418
PRODUCT=4d8/de/2
SEQNUM=5999
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[183877.778115] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0
DEVTYPE=usb_interface
INTERFACE=3/0/0
MODALIAS=usb:v04D8p00DEd0002dc00dsc00dp00ic03isc00ip00in00
PRODUCT=4d8/de/2
SEQNUM=6000
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[183877.779627] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020 (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020
HID_ID=0003:000004D8:000000DE
HID_NAME=Microchip Technology Inc. MCP2210 USB-to-SPI Master
HID_PHYS=usb-0000:00:1d.0-1.1/input0
HID_UNIQ=0000267472
MODALIAS=hid:b0003g0001v000004D8p000000DE
SEQNUM=6001
SUBSYSTEM=hid
KERNEL[183877.780178] add /class/usbmisc (class)
ACTION=add
DEVPATH=/class/usbmisc
SEQNUM=6002
SUBSYSTEM=class
KERNEL[183877.780314] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0 (usbmisc)
ACTION=add
DEVNAME=/dev/usb/hiddev0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0
MAJOR=180
MINOR=0
SEQNUM=6003
SUBSYSTEM=usbmisc
KERNEL[183877.780413] add /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020/hidraw/hidraw0 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020/hidraw/hidraw0
MAJOR=244
MINOR=0
SEQNUM=6004
SUBSYSTEM=hidraw
KERNEL[183878.337362] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0 (usbmisc)
ACTION=remove
DEVNAME=/dev/usb/hiddev0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/usbmisc/hiddev0
MAJOR=180
MINOR=0
SEQNUM=6005
SUBSYSTEM=usbmisc
KERNEL[183878.337467] remove /usbmisc (class)
ACTION=remove
DEVPATH=/usbmisc
SEQNUM=6006
SUBSYSTEM=class
KERNEL[183878.337521] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020/hidraw/hidraw0 (hidraw)
ACTION=remove
DEVNAME=/dev/hidraw0
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020/hidraw/hidraw0
MAJOR=244
MINOR=0
SEQNUM=6007
SUBSYSTEM=hidraw
KERNEL[183878.337584] remove /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020 (hid)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/0003:04D8:00DE.0020
HID_ID=0003:000004D8:000000DE
HID_NAME=Microchip Technology Inc. MCP2210 USB-to-SPI Master
HID_PHYS=usb-0000:00:1d.0-1.1/input0
HID_UNIQ=0000267472
MODALIAS=hid:b0003g0001v000004D8p000000DE
SEQNUM=6008
SUBSYSTEM=hid
最佳答案
如果您只想从udev数据库中获取信息,则可以将主机的udev数据库挂载到docker容器中,例如,
-v /run/udev:/run/udev:ro
ID_
时仍会获得所有
udevadm info
属性。对于在Debian主机上运行的Debian docker容器,这为我工作。
/dev
,以便您的Docker容器将知道设备文件的任何更改。
关于docker - udevadm不会在docker容器中显示所有属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41753218/
尝试使用集成到 QTCreator 的表单编辑器,但即使我将插件放入 QtCreator.app/Contents/MacOS/designer 也不会显示。不过,相同的 dylib 文件确实适用于独
在此代码示例中。 “this.method2();”之后会读到什么?在返回returnedValue之前会跳转到method2()吗? public int method1(int returnedV
我的项目有通过gradle配置的依赖项。我想添加以下依赖项: compile group: 'org.restlet.jse', name: 'org.restlet.ext.apispark', v
我将把我们基于 Windows 的客户管理软件移植到基于 Web 的软件。我发现 polymer 可能是一种选择。 但是,对于我们的使用,我们找不到 polymer 组件具有表格 View 、下拉菜单
我的项目文件夹 Project 中有一个文件夹,比如 ED 文件夹,当我在 Eclipse 中指定在哪里查找我写入的文件时 File file = new File("ED/text.txt"); e
这是奇怪的事情,这个有效: $('#box').css({"backgroundPosition": "0px 250px"}); 但这不起作用,它只是不改变位置: $('#box').animate
这个问题在这里已经有了答案: Why does OR 0 round numbers in Javascript? (3 个答案) 关闭 5 年前。 Mozilla JavaScript Guide
这个问题在这里已经有了答案: Is the function strcmpi in the C standard libary of ISO? (3 个答案) 关闭 8 年前。 我有一个问题,为什么
我目前使用的是共享主机方案,我不确定它使用的是哪个版本的 MySQL,但它似乎不支持 DATETIMEOFFSET 类型。 是否存在支持 DATETIMEOFFSET 的 MySQL 版本?或者有计划
研究 Seam 3,我发现 Seam Solder 允许将 @Named 注释应用于包 - 在这种情况下,该包中的所有 bean 都将自动命名,就好像它们符合条件一样@Named 他们自己。我没有看到
我知道 .append 偶尔会增加数组的容量并形成数组的新副本,但 .removeLast 会逆转这种情况并减少容量通过复制到一个新的更小的数组来改变数组? 最佳答案 否(或者至少如果是,则它是一个错
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
noexcept 函数说明符是否旨在 boost 性能,因为生成的对象中可能没有记录异常的代码,因此应尽可能将其添加到函数声明和定义中?我首先想到了可调用对象的包装器,其中 noexcept 可能会产
我正在使用 Angularjs 1.3.7,刚刚发现 Promise.all 在成功响应后不会更新 angularjs View ,而 $q.all 会。由于 Promises 包含在 native
我最近发现了这段JavaScript代码: Math.random() * 0x1000000 10.12345 10.12345 >> 0 10 > 10.12345 >>> 0 10 我使用
我正在编写一个玩具(物理)矢量库,并且遇到了 GHC 坚持认为函数应该具有 Integer 的问题。是他们的类型。我希望向量乘以向量以及标量(仅使用 * ),虽然这可以通过仅使用 Vector 来实现
PHP 的 mail() 函数发送邮件正常,但 Swiftmailer 的 Swift_MailTransport 不起作用! 这有效: mail('user@example.com', 'test
我尝试通过 php 脚本转储我的数据,但没有命令行。所以我用 this script 创建了我的 .sql 文件然后我尝试使用我的脚本: $link = mysql_connect($host, $u
使用 python 2.6.4 中的 sqlite3 标准库,以下查询在 sqlite3 命令行上运行良好: select segmentid, node_t, start, number,title
我最近发现了这段JavaScript代码: Math.random() * 0x1000000 10.12345 10.12345 >> 0 10 > 10.12345 >>> 0 10 我使用
我是一名优秀的程序员,十分优秀!