将设备插入计算机后如何自动运行"sudo modprobe -r ftdi_sio" [英] How to automatically run 'sudo modprobe -r ftdi_sio' whenever the device is plugged into my computer

查看:74
本文介绍了将设备插入计算机后如何自动运行"sudo modprobe -r ftdi_sio"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用的USB设备,并且正在使用带有Google Chrome的WebUSB开发应用程序.关键是,每当我将USB设备插入Linux计算机时,都必须手动运行 sudo modprobe -r ftdi_sio 来卸载它.

I have a USB device that I'm using and I'm developing an application using WebUSB with Google Chrome. The thing is whenever I plug the USB device into my Linux computer, I have to manually run sudo modprobe -r ftdi_sio to unload it.

我希望将设备插入计算机后自动卸载,而不必每次手动键入.

I want it to be unloaded automatically whenever I plug that device into my computer instead of having to type it manually every single time.

有关如何实施的任何想法?帮助将不胜感激

Any ideas on how this could be implemented ? Help would be much appreciated

推荐答案

一种选择是将ftdi_sio模块列入黑名单",以阻止其自动加载.为此,请创建以下文件:

One option would be to "blacklist" the ftdi_sio module to stop it being loaded automatically. To do that create the following file:

/etc/modprobe.d/ftdi_sio-blacklist.conf

# This is a comment. Change it if you want.
blacklist ftdi_sio

这篇关于将设备插入计算机后如何自动运行"sudo modprobe -r ftdi_sio"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆