]> ##&name; ###&version; - Chg Fix Remove USB device from VM for devices not in a shutdown state, was previously only for running. 30.04.2021 - Add Remove USB Device from VM when disconnected. 22.04.2021 - Add Roothub and Hubs to view. - Add Switch to show empty ports. No process added at this time for additional devices. 10.03.2021 - Add VM disconnect option to be used in pre sleep commands to remove USB mappings from VM before sleep. 09.03.2021 - Chg Fix issue introduce as part of port mapping for checking status. 24.02.2021 - Add Support for port-based mappings Auto connecting to a VM when device is connected to a USB port. Only devices being plugged in are supported for Ports at this time. Support for port level will be added in the furture for VM Starts. Precedence is for device level mappings over port. If a device is set to autoconnect no then the auto connect at the port level will be evaluated. 17.02.2021 - Add Dashboard update and refresh. 16.02.2021 - Add USB Dashboard entry. Enable within settings. 14.02.2021 - Add Display host name or IP address for remote USBIP Clients. 13.02.2021 - Add Show remote connection status. Host/IP to follow WIP. 12.02.2021 - Chg Fix for Bind/Unbind Button. 10a.02.2021 - Add Disconnect update function implemented. - Add Auto Connect on VM Start. - Chg Auto Connect on device added checks VM Status - Add Update Status when VM Stops. Note you need to manually add code to /etc/libvirt/hooks/qemu for VM start/stop process to function. See support page. Development yet to be completed. Update of qemu hook file. Add checks before historical info can be removed. Rename Plugin to USB Manager Change to include USBIP package install in the settings page. 08.02.2021 - Add: Autoconnect function. If VM defined and Autoconnect is set to Yes then when usb device is connected device will be connected to VM. If VM is not started Error is show. - Chg: Main USB list is no longer depetant on USBIP. Version change to support 6.8. Error will be seen during install as it trys to install USBIP package which doesnt exist pre kernel 5.10.1, but is ignored. Development yet to be completed. Autoconnect function, check VM status before connecting. utodisconnect function. Will provide log entry but no action taken at present. Add checks before historical info can be removed. Rename Plugin to USB Manager VM Start/Stop process. Change to include USBIP package install in the settings page. 07.02.2021 - Add: VM Mapping functions - Add: Display USBIP function messages if not used. Enable/Disable for USBIP added to settings. Defaults to disable, change to enable if you are upgrading. - Add: Historical Devices added, list includes current devices also which can be removed whilst inuse. - Add: Failure Message for virsh errors. Note, Existing Libvirt plugin cannot be used to connect devices. Development yet to be completed. Autoconnect function. udev Rules exist and process works, but there are timing issues to be resolved. Add checks before historical info can be removed. Rename Plugin to USB Manager VM Start/Stop process. Changes to USB device list not to be depentant on usbip. Once change version pre-6.9.0-rc2 will be available. 31.01.2021 - Add: Revised Load process and addition of loading usbip package from ich777. USBIP package includes all commands and modules required for USBIP 28.01.2021 - Initial beta release. # Remove emhttp files so we can re-install. rm -rf /usr/local/emhttp/plugins/&name;/* 2>/dev/null "&gitURL;/&name;-&version;.txz" &md5; echo "Removing previous versons now upgrade has completed." echo # Remove old 'bundle' files. rm -f $(ls &packages;/*.txz 2>/dev/null | grep -v '&version;') #!/bin/bash # Copy configuration files to tmp file system. /usr/local/emhttp/plugins/&name;/scripts/copy_config.sh 2>/dev/null #Start USBIPD if required. if [ ! -z "$(pidof emhttpd)" ]; then /usr/local/emhttp/plugins/&name;/scripts/rc.&name; check_config 2>/dev/null fi # Remove the background start script. rm -f /tmp/start_usbip 2>/dev/null # Define Functions download() { #Download usbip if wget -q -nc --show-progress --progress=bar:force:noscroll -O "&packages;/${KERNEL_V%%-*}/${PACKAGE}-1.txz" "${DL_URL}/${PACKAGE}-1.txz" ; then if [ "$(md5sum "&packages;/${KERNEL_V%%-*}/${PACKAGE}-1.txz" | cut -d ' ' -f1)" != "$(wget -qO- "${DL_URL}/${PACKAGE}-1.txz.md5" | cut -d ' ' -f1)" ]; then if [ -d &packages;/${KERNEL_V%%-*}/]; then rm -rf &packages;/${KERNEL_V%%-*}/; fi echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR------" echo "--------------------------------CHECKSUM ERROR!---------------------------------" fi echo "-----------------Sucessfully downloaded usbip, please wait...!-----------------" else echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR------" echo "----------------------------Can't download usbip--------------------------------" fi } check() { if [ ! -f "&packages;/${KERNEL_V%%-*}/${PACKAGE}-1.txz" ]; then echo "+==============================================================================" echo "| WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING" echo "|" echo "| Don't close this window with the red 'X' in the top right corner until the 'DONE' button is displayed!" echo "|" echo "| WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING" echo "+==============================================================================" echo "---------------------Downloading usbip, please wait...!------------------------" echo "-----------This could take some time, please don't close this window!----------" download elif [ ! -s "&packages;/${KERNEL_V%%-*}/${PACKAGE}-1.txz" ]; then rm -rf &packages;/${KERNEL_V%%-*}/${PACKAGE}-1.txz echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR-----" echo "-----Download is empty please contact the developer of this plugin if the------" echo "-------plugin has been already built against the current Kernel version--------" else echo echo "-----------------------------usbip found locally!------------------------------" fi } install() { #Install usbip package installpkg "&packages;/${KERNEL_V%%-*}/${PACKAGE}-1.txz" depmod -a > /dev/null } check_usbip_repo() { #Check if usbip is already downloaded if [ ! -z "$(modinfo usbip_host 2>/dev/null)" ]; then echo "--------------------------usbip already installed...!--------------------------" else check echo "-----------------------Installing usbip, please wait...!-----------------------" install fi } #Define Variables KERNEL_V="$(uname -r)" PACKAGE="usbip" DL_URL="https://github.com/ich777/unraid-plugins-repo/releases/download/$KERNEL_V" # Install the plugin bundle. # Create plugin directory mkdir /boot/config/plugins/&name; 2>/dev/null mkdir /usr/local/emhttp/plugins/&name; 2>/dev/null mkdir -p /tmp/&name;/config 2>/dev/null if [ ! -d "&packages;/${KERNEL_V%%-*}" ]; then mkdir -p "&packages;/${KERNEL_V%%-*}" fi # Load Package from ich777 repo for usbip modules and commands. check_usbip_repo # move the rules file cp /usr/local/emhttp/plugins/&name;/99_persistent_usb.rules /etc/udev/rules.d/ chmod 644 -R /etc/udev/rules.d/99_persistent_usb.rules 2>/dev/null # copy the syslog rules config file #cp /usr/local/emhttp/plugins/&name;/99_usbip_syslog.conf /etc/rsyslog.d/ #chmod 644 -R /etc/udev/rules.d/99_persistent_usb.rules 2>/dev/null # Adjust plugin permissions. chmod 755 -R /usr/local/emhttp/plugins/&name; 2>/dev/null # Fix permissions of executable files chmod +x /usr/local/emhttp/plugins/&name;/scripts/* /usr/local/emhttp/plugins/&name;/event/* # Create a symlink to usbip scripts. ln -sf /usr/local/emhttp/plugins/&name;/scripts/rc.unraid.usbip-gui /usr/local/sbin # Copy Config to tmp and load modules. at -M -f /tmp/start_usbip now 2>/dev/null # reload udev rules udevadm control --reload-rules # restart rsyslogd /etc/rc.d/rc.rsyslogd restart echo echo "-----------------------------------------------------------" echo " &name; has been installed." echo " " echo " Copyright 2016-2020, &author;" echo " Version: &version;" echo "" echo "-----------------------------------------------------------" echo #Define Variables KERNEL_V="$(uname -r)" PACKAGE="usbip" # Remove installed packages find "&packages;/" -type f -iname "*.txz" -delete rm -f /tmp/plugins/&name;.plg rm -r /tmp/&name; rm -f /etc/udev/rules.d/99_persistent_usb.rules rm -f /etc/rsyslog.d/99_usbip_syslog.conf modprobe -r usbip_host modprobe -r vhci_hcd killall usbipd # reload udev rules udevadm control --reload-rules # restart rsyslogd /etc/rc.d/rc.rsyslogd restart # Remove all plugin files from emhttp. removepkg &packages;/&name;-&version;.txz removepkg "&packages;/&name;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" depmod -a > /dev/null echo echo "-----------------------------------------------------------" echo " &name; has been uninstalled." echo "-----------------------------------------------------------" echo