Guest User

prepare.sh

a guest
Dec 13th, 2020
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2.  
  3. set -e
  4.  
  5. # Deny non-root run
  6. if [ "$EUID" -ne 0 ]
  7.   then echo "ERROR: Please run as root"
  8.   exit
  9. fi
  10.  
  11. SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
  12.  
  13. # TODO: move vendorId and deviceId to variables
  14. echo 0000:09:00.0 > /sys/bus/pci/devices/0000:09:00.0/driver/unbind
  15. echo 144d a804 > /sys/bus/pci/drivers/vfio-pci/new_id
  16. chown alex:alex /dev/input/qemu-virtual-*
  17. chown alex:alex /dev/vfio/*
  18. chmod ugo+rw /dev/bus/usb/001/*
  19.  
  20. # Configure TAP for host-vm network
  21. ${SCRIPT_PATH}/setup-tap.sh
  22.  
  23. # Remove all cset policies
  24. cset set -d / --recurse --force
RAW Paste Data