diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..78167ae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.vagrant +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..24ee3c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:latest +LABEL maintainer="David Manouchehri" + +RUN useradd -m lglaf +WORKDIR /home/lglaf +ENV HOME /home/lglaf + +RUN apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install git python-pip usbutils udev && \ + pip install --upgrade pip && \ + pip install pyusb && \ + su - lglaf -c "git clone https://github.com/Lekensteyn/lglaf.git" && \ + cp -v ~/lglaf/rules.d/42-usb-lglaf.rules /etc/udev/rules.d/ && \ + udevadm control --reload-rules || true && \ + udevadm trigger + +# udev is sadly broken.. +# USER lglaf +ENV PATH /home/lglaf/lglaf:$PATH + +CMD ["/bin/bash"] diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..01cff45 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,30 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +# Author: David Manouchehri + +Vagrant.configure("2") do |config| + config.vm.box = "bento/ubuntu-16.04" + + # config.vm.synced_folder ".", "/vagrant", disabled: true + + config.vm.provision "docker" do |d| + d.build_image '/vagrant/.', args: "-t lglaf" + d.run "lglaf", + args: "--privileged -it -v '/dev/bus/usb:/dev/bus/usb'" + end + + %w(vmware_fusion vmware_workstation vmware_appcatalyst).each do |provider| + config.vm.provider provider do |v| + # v.vmx["memsize"] = "2048" + v.vmx['ethernet0.virtualDev'] = 'vmxnet3' + v.vmx["usb.vbluetooth.startConnected"] = "FALSE" + v.vmx["usb.present"] = "TRUE" + v.vmx["usb_xhci.present"] = "FALSE" + v.vmx["usb.generic.autoconnect"] = "FALSE" + v.vmx["usb.autoConnect.device0"] = "0x1004:0x633E" + v.vmx["usb.autoConnect.device1"] = "0x1004:0x627F" + v.vmx["usb.autoConnect.device2"] = "0x1004:0x6298" + v.vmx["usb.autoConnect.device3"] = "0x1004:0x633A" + end + end +end