udevadm 测试网络设备

udevadm 测试网络设备

我正在尝试转储udev env以查看我的%M%m%k值(我不满意udevadm info -a

为此,RUN我写入了如下文件tmp/https://stackoverflow.com/questions/12818987/pass-attridvendor-as-argument-in-udev-script.但我没看到它被创造出来。

此外udevadm test不会调用RUN。我udevadm trigger也尝试过,但没有看到文件被创建。

我需要不断重启我的盒子吗?有什么建议吗?

文件名为020-persistent-net.rules,放置在etc/udev/rules.d文件夹(initrd.gz 存档)下,内容如下:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="0000:04:00.0", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="ethGi1"

udevadm info -a输出如下:

~$ sudo udevadm info -a /sys/class/net/ethGi1

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/pci0000:00/0000:00:03.3/0000:05:00.1/net/ethGi1':
    KERNEL=="ethGi1"
    SUBSYSTEM=="net"
    DRIVER==""
    ATTR{mtu}=="1500"
    ATTR{type}=="1"
    ATTR{netdev_group}=="0"
    ATTR{flags}=="0x1003"
    ATTR{speed}=="1000"
    ATTR{dormant}=="0"
    ATTR{addr_assign_type}=="0"
    ATTR{dev_id}=="0x0"
    ATTR{duplex}=="full"
    ATTR{iflink}=="4"
    ATTR{addr_len}=="6"
    ATTR{address}=="0c:c4:7a:34:20:21"
    ATTR{operstate}=="up"
    ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
    ATTR{tx_queue_len}=="1000"
    ATTR{ifalias}==""
    ATTR{ifindex}=="4"
    ATTR{link_mode}=="0"
    ATTR{carrier}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:03.3/0000:05:00.1':
    KERNELS=="0000:05:00.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="igb"
    ATTRS{irq}=="44"
    ATTRS{subsystem_vendor}=="0x15d9"
    ATTRS{broken_parity_status}=="0"
    ATTRS{sriov_numvfs}=="0"
    ATTRS{class}=="0x020000"
    ATTRS{index}=="2"
    ATTRS{label}==" Intel Ethernet i350 #2"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{sriov_totalvfs}=="7"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000ffff"
    ATTRS{device}=="0x1521"
    ATTRS{enable}=="1"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-15"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x1521"
    ATTRS{numa_node}=="0"
    ATTRS{d3cold_allowed}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:03.3':
    KERNELS=="0000:00:03.3"
    SUBSYSTEMS=="pci"
    DRIVERS=="pcieport"
    ATTRS{irq}=="40"
    ATTRS{subsystem_vendor}=="0x15d9"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x060400"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000ffff"
    ATTRS{device}=="0x2f0b"
    ATTRS{enable}=="1"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-15"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x0834"
    ATTRS{numa_node}=="0"
    ATTRS{d3cold_allowed}=="0"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

相关内容