为什么我的 udev 规则不起作用?

为什么我的 udev 规则不起作用?

/etc/udev/rules.d/60.alsa.rules我创建了一个包含以下内容的文件:

KERNEL=="0000:00:1b.0", SUBSYSTEM=="pci", ATTR{label}=="Realtek High Definition Audio Device", ATTR{vendor}=="0x8086", SYMLINK+="jumanji"

/dev/jumanji然后我使用 init.d 重新启动 udev 但未创建符号链接。

我应该怎么办?

附加信息:

udevadm info -a -n /dev/snd/by-path/pci-0000\:00\:1b.0

looking at device '/devices/pci0000:00/0000:00:1b.0/sound/card0/controlC0':
    KERNEL=="controlC0"
    SUBSYSTEM=="sound"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1b.0/sound/card0':
    KERNELS=="card0"
    SUBSYSTEMS=="sound"
    DRIVERS==""
    ATTRS{id}=="PCH"
    ATTRS{number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:1b.0':
    KERNELS=="0000:00:1b.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="snd_hda_intel"
    ATTRS{irq}=="45"
    ATTRS{subsystem_vendor}=="0x8086"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x040300"
    ATTRS{index}=="1"
    ATTRS{label}=="Realtek High Definition Audio Device"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{local_cpus}=="ff"
    ATTRS{device}=="0x1c20"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-7"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x2042"
    ATTRS{d3cold_allowed}=="1"

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

答案1

ATTR在inATTR{vendor}和的末尾ATTR{label}以及 的末尾需要有一个“S” SUBSYSTEM

这是一个很容易犯的错误,我自己都被烧伤了。

相关内容