Udev 阻止 iPhone

Udev 阻止 iPhone

我试图在连接 iPhone 时阻止其被使用,以便将其传递到虚拟机。到目前为止,我已经有了这个 udev 规则,但每当我尝试传递它时,我仍然会收到有关正在使用的设备的错误。

blacklist ipheth
blacklist apple-mfi-fastcharge
install ipheth /bin/false
install apple-mfi-fastcharge /bin/false
SUBSYSTEM=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="12a8", ATTR{authorized}="0"

正如您所看到的,我尝试使用供应商和产品 ID 进行解除身份验证,并禁用 dmesg 中提到的两个模块。

这就是我现在从 dmesg 得到的全部信息。这表明我所拥有的至少在一定程度上可以工作,因为没有 ipheth 或快速充电。

Jan 21 19:56:44 carbon-14 kernel: usb 1-3: new high-speed USB device number 11 using xhci_hcd
Jan 21 19:56:45 carbon-14 kernel: usb 1-3: New USB device found, idVendor=05ac, idProduct=12a8, bcdDevice=16.01
Jan 21 19:56:45 carbon-14 kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 21 19:56:45 carbon-14 kernel: usb 1-3: Product: iPhone
Jan 21 19:56:45 carbon-14 kernel: usb 1-3: Manufacturer: Apple Inc.
Jan 21 19:56:45 carbon-14 kernel: usb 1-3: SerialNumber: xxx

我错过了什么?

答案1

你可能已经错过了usbmuxd

systemd基于 的发行版中,它现在被配置为静态服务,并且 udev 配置为使用TAG+="systemd"和标记任何 Apple iDevices ENV{SYSTEMD_WANTS}="usbmuxd.service",这会导致每当插入此类设备时systemd就会启动。usbmuxd.service

由于它是静态服务,因此systemctl disable不执行任何操作。你会想要的systemctl mask usbmuxd.service

相关内容