2012-10-12 20:36:01 +02:00
|
|
|
#!/bin/sh -xe
|
|
|
|
|
2012-10-12 23:52:02 +02:00
|
|
|
dom0_usbvm=y
|
|
|
|
usbvms="usbvm"
|
2012-10-12 22:03:54 +02:00
|
|
|
appvms="netvm qdvp"
|
2012-10-12 20:36:01 +02:00
|
|
|
|
|
|
|
# --- Copy files ---------------------------------------------------------
|
2012-10-12 23:52:02 +02:00
|
|
|
for vm in $usbvms $appvms ; do
|
2012-10-12 20:36:01 +02:00
|
|
|
(cd .. && tar c qubes-core) | qvm-run -p $vm 'tar x'
|
|
|
|
done
|
|
|
|
|
|
|
|
# --- Init dom0 ----------------------------------------------------------
|
|
|
|
sudo ./install-pvusb-dom0.sh
|
|
|
|
|
2012-10-12 23:52:02 +02:00
|
|
|
# --- Init dom0 as usbvm -------------------------------------------------
|
|
|
|
if [ "$dom0_usbvm" = "y" ] ; then
|
2012-10-12 20:36:01 +02:00
|
|
|
sudo ./install-pvusb-backend.sh
|
2012-10-12 23:52:02 +02:00
|
|
|
fi
|
2012-10-12 20:36:01 +02:00
|
|
|
|
2012-10-12 23:52:02 +02:00
|
|
|
# --- Init usbvms --------------------------------------------------------
|
|
|
|
for usbvm in $usbvms ; do
|
2012-10-12 20:36:01 +02:00
|
|
|
usbvm_xid=`xl list | awk "(\\$1==\"$usbvm\"){print \\$2}"`
|
|
|
|
if [ -z "$usbvm_xid" ] ; then
|
2012-10-12 23:52:02 +02:00
|
|
|
echo "Can't determine xid for $usbvm"
|
2012-10-12 20:36:01 +02:00
|
|
|
else
|
|
|
|
xenstore-write /local/domain/${usbvm_xid}/qubes-usb-devices ''
|
|
|
|
xenstore-chmod /local/domain/${usbvm_xid}/qubes-usb-devices n0 b${usbvm_xid}
|
|
|
|
fi
|
2012-10-12 23:52:02 +02:00
|
|
|
|
|
|
|
qvm-run -p $usbvm 'script -qc "cd qubes-core && sudo ./install-pvusb-backend.sh" /dev/null'
|
|
|
|
done
|
2012-10-12 20:36:01 +02:00
|
|
|
|
|
|
|
# --- Init appvm ---------------------------------------------------------
|
2012-10-12 22:03:54 +02:00
|
|
|
for appvm in $appvms ; do
|
|
|
|
qvm-run -p $appvm 'script -qc "cd qubes-core && sudo ./install-pvusb-frontend.sh" /dev/null'
|
|
|
|
done
|
|
|
|
|