From 5dd8da13731c6b7cc229f10787a7ef6834c08262 Mon Sep 17 00:00:00 2001 From: Alexandre Bezroutchko Date: Wed, 10 Oct 2012 21:53:20 +0200 Subject: [PATCH] dvp/qvm-usb: reworked installation scripts for usbvm and added one for appvms --- install-pvusb-backend.sh | 25 +++++++++++++++++++++++++ install-pvusb-frontend.sh | 8 ++++++++ install_pvusb_hacks.sh | 22 ---------------------- 3 files changed, 33 insertions(+), 22 deletions(-) create mode 100755 install-pvusb-backend.sh create mode 100755 install-pvusb-frontend.sh delete mode 100755 install_pvusb_hacks.sh diff --git a/install-pvusb-backend.sh b/install-pvusb-backend.sh new file mode 100755 index 0000000..9ce29c5 --- /dev/null +++ b/install-pvusb-backend.sh @@ -0,0 +1,25 @@ +#!/bin/sh -xe + +## +## Run this script in usbvm as root. +## FIXME: this has to be done after each reboot +## + +# Copy files +for f in usb_add_change usb_remove xl-qvm-usb-attach.py ; do + cp misc/$f /usr/lib/qubes/$f +done + +cp dom0/qvm-core/qubesutils.py /usr/lib64/python2.6/site-packages/qubes/qubesutils.py +cp dom0/qvm-tools/qvm-usb /usr/bin/qvm-usb + +cp misc/qubes_usb.rules /etc/udev/rules.d/99-qubes_usb.rules + +# Reload PVUSB backend and cleanup xenstore +rmmod xen-usbback || true +modprobe xen-usbback +xenstore-rm qubes-usb-devices + +# Configure udevd and make it re-populate xenstore +udevadm control --reload-rules +udevadm trigger --action=change diff --git a/install-pvusb-frontend.sh b/install-pvusb-frontend.sh new file mode 100755 index 0000000..14e6586 --- /dev/null +++ b/install-pvusb-frontend.sh @@ -0,0 +1,8 @@ +#!/bin/sh -xe + +## +## Run this script in appvm as root +## FIXME: now this has to be done after each reboot +## + +modprobe xen-usbfront diff --git a/install_pvusb_hacks.sh b/install_pvusb_hacks.sh deleted file mode 100755 index 4fd853c..0000000 --- a/install_pvusb_hacks.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -x - -d=/home/abb/qubes-core - -# Install -cp $d/misc/qubes_usb.rules /etc/udev/rules.d/99-qubes_usb.rules - -for f in usb_add_change usb_remove xl-qvm-usb-attach.py ; do - cp $d/misc/$f /usr/lib/qubes/$f -done - -cp $d/dom0/qvm-core/qubesutils.py /usr/lib64/python2.6/site-packages/qubes/qubesutils.py -cp $d/dom0/qvm-tools/qvm-usb /usr/bin/qvm-usb - -udevadm control --reload-rules - -# Rerun -xenstore-rm qubes-usb-devices -udevadm trigger --action=change -#sleep 1 -#xenstore-ls -f qubes-usb-devices -