在输入时echo 1 > /sys/bus/pci/slots/$4/power
,我收到此错误:
bash: /sys/bus/pci/slots//power: Permission denied
lscpi -vv
以下是我的系统上的输出:
02:00.0 Multimedia controller: Digital Devices GmbH Octopus DVB Adapter
Subsystem: Digital Devices GmbH Cine S2 V6.5 DVB adapter
Physical Slot: 4
Flags: fast devsel, IRQ 46
Memory at c7400000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [50] Power Management version 3
Capabilities: [70] MSI: Enable+ Count=2/2 Maskable- 64bit+
Capabilities: [90] Express Endpoint, MSI 00
Capabilities: [100] Vendor Specific Information: ID=0000 Rev=0 Len=00c <?>
Kernel driver in use: ddbridge
06:00.0 Multimedia controller: Digital Devices GmbH Max
Subsystem: Digital Devices GmbH Max S8 4/8
Physical Slot: 3
Flags: fast devsel, IRQ 49
Memory at c7300000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [50] Power Management version 3
Capabilities: [70] MSI: Enable+ Count=2/2 Maskable- 64bit+
Capabilities: [90] Express Endpoint, MSI 00
Capabilities: [100] Vendor Specific Information: ID=0000 Rev=0 Len=00c <?>
Kernel driver in use: ddbridge
答案1
echo
不会这样工作。
您需要sudo tee
像这样使用来允许权限:
echo 1 | sudo tee /sys/bus/pci/slots/4/power
另外,我认为您可能想要指定插槽 4,也就是 4 而不是 $4。