-
Notifications
You must be signed in to change notification settings - Fork 0
/
usbipd.txt
39 lines (28 loc) · 1.06 KB
/
usbipd.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
sudo apt-get install usbip
sudo su root
echo 'usbip_host' >> /etc/modules
modprobe usbip_host
exit
sudo nano /usr/bin/usbip-bindall
usbip list -p -l | grep -v '0424:ec00#'| grep -v '0424:7800#'| grep -v '10c4:8a2a#'| grep -v '0b95:772a#' | cut '-d=' -f2 | cut '-d#' -f1 | xargs -L 1 -r bash -c 'usbip bind -b"$0" '
sudo nano /usr/bin/usbip-unbindall
usbip list -p -l | grep -v '0424:ec00#'| grep -v '0424:7800#'| grep -v '10c4:8a2a#'| grep -v '0b95:772a#' | cut '-d=' -f2 | cut '-d#' -f1 | xargs -L 1 -r bash -c 'usbip unbind -b"$0" '
sudo nano /etc/udev/rules.d/bindall.rules
ACTION=="add", RUN+="/bin/bash /usr/bin/usbip-bindall"
sudo udevadm control --reload
sudo nano /lib/systemd/system/usbipd.service
[Unit]
Description=usbip host daemon
After=network.target
[Service]
Restart=on-failure
RestartSec=5s
Type=forking
ExecStart=/usr/sbin/usbipd -D
ExecStartPost=/bin/sh -c "usbip-bindall"
ExecStop=/bin/sh -c "usbip-unbindall; killall usbipd"
[Install]
WantedBy=multi-user.target
sudo systemctl --system daemon-reload
sudo systemctl enable usbipd.service
sudo reboot