dvp/qvm-usb: fixed global install script

This commit is contained in:
Alexandre Bezroutchko 2012-10-12 20:36:01 +02:00
parent 2741201e24
commit d52a7774d4
3 changed files with 34 additions and 1 deletions

View File

@ -11,7 +11,9 @@ cp misc/usb_remove /usr/lib/qubes/usb_remove
cp misc/vusb-ctl.py /usr/lib/qubes/vusb-ctl.py
cp misc/qubes_usb.rules /etc/udev/rules.d/99-qubes_usb.rules
# FIXME: /usr/lib64/python2.6/site-packages/xen
# FIXME: need better way to deploy libraries needed by xen.vusb_util
[ -d /usr/lib64/python2.7/site-packages ] &&
tar xzf install-pvusb-xen.tgz -C /usr/lib64/python2.7/site-packages
# Load PVUSB backend
modprobe xen-usbback

BIN
install-pvusb-xen.tgz Normal file

Binary file not shown.

31
install-pvusb.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh -xe
#usbvm=usbvm
usbvm=
appvm=netvm
# --- Copy files ---------------------------------------------------------
for vm in $usbvm $appvm ; do
(cd .. && tar c qubes-core) | qvm-run -p $vm 'tar x'
done
# --- Init dom0 ----------------------------------------------------------
sudo ./install-pvusb-dom0.sh
# --- Init usbvm (or dom0) -----------------------------------------------
if [ -z "$usbvm" ] ; then
sudo ./install-pvusb-backend.sh
else
qvm-run -p $usbvm 'script -qc "cd qubes-core && sudo ./install-pvusb-backend.sh" /dev/null'
usbvm_xid=`xl list | awk "(\\$1==\"$usbvm\"){print \\$2}"`
if [ -z "$usbvm_xid" ] ; then
echo "Can't determine usbvm_xid"
else
xenstore-write /local/domain/${usbvm_xid}/qubes-usb-devices ''
xenstore-chmod /local/domain/${usbvm_xid}/qubes-usb-devices n0 b${usbvm_xid}
fi
fi
# --- Init appvm ---------------------------------------------------------
qvm-run -p $appvm 'script -qc "cd qubes-core && sudo ./install-pvusb-frontend.sh" /dev/null'