From ab7d6dca4106bae6876b46f06fe157478a62ecda Mon Sep 17 00:00:00 2001 From: dragon788 Date: Sun, 3 Jan 2016 22:21:30 -0600 Subject: Adding Vagrantfile for easier compile environment setup --- avr_setup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 avr_setup.sh (limited to 'avr_setup.sh') diff --git a/avr_setup.sh b/avr_setup.sh new file mode 100644 index 000000000..ff4153ba3 --- /dev/null +++ b/avr_setup.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# This script will attempt to setup the Linux dependencies for compiling QMK/TMK + +# This could probably go much lower, but since we are including an Arch vagrant, +# making it the first match makes sense + +if [[ -n "$(type -P pacman )" ]]; then + # Arch linux and derivatives like Apricity + pacman -S --needed --noconfirm base-devel avr-gcc avr-binutils avr-libc dfu-utils + +elif [[ -n "$(type -P apt-get)" ]]; then + # Debian and derivatives + apt-get install -y build-essential gcc unzip wget zip gcc-avr binutils-avr avr-libc + +elif [[ -n "$(type -P yum)" ]]; then + # Fedora, CentOS or RHEL and derivatives + yum -y install gcc glibc-headers kernel-devel kernel-headers make perl git wget + +elif [[ -n "$(type -P zypper)" ]]; then + # openSUSE + zypper --non-interactive install git make gcc kernel-devel patch wget + +fi -- cgit v1.2.3-70-g09d2 From ee424f86081c538fc74c3e9b50c7b1eb595b6e58 Mon Sep 17 00:00:00 2001 From: dragon788 Date: Tue, 5 Jan 2016 22:39:49 -0600 Subject: Adding update of vagrant VM every time it is booted --- Vagrantfile | 50 +++++++++++++++++++++++++++++++++++++------------- avr_setup.sh | 10 +++++++++- 2 files changed, 46 insertions(+), 14 deletions(-) (limited to 'avr_setup.sh') diff --git a/Vagrantfile b/Vagrantfile index e1082a08d..788e014de 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,8 +2,25 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| + # You can only have one config.vm.box uncommented at a time + + # Comment this and uncomment another if you don't want to use the minimal Arch box config.vm.box = "dragon788/arch-ala-elasticdog" + # VMware/Virtualbox 64 bit + # config.vm.box = "phusion/ubuntu-14.04-amd64" + # + # VMware/Virtualbox 64 bit + # config.vm.box = "puphpet/centos65-x64" + # + # VMware/Virtualbox 64 bit + # config.vm.box = "bento/opensuse-13.2-x86_64" + # + # Virtualbox only + # config.vm.box = "bento/opensuse-13.2-i386" + # config.vm.box = "" + # config.vm.box = "" + # This section allows you to customize the Virtualbox VM # settings, ie showing the GUI or upping the memory # or cores if desired @@ -21,25 +38,32 @@ Vagrant.configure(2) do |config| config.vm.provider "vmware" do |vmw| # Hide the VMware GUI when booting the machine vmw.gui = false - + # Customize the amount of memory on the VM: vmw.memory = "512" end - # This ensures the system always gets the latest updates when powered on + # This script ensures the required packages for AVR programming are installed + # It also ensures the system always gets the latest updates when powered on # If this causes issues you can run a 'vagrant destroy' and then - # comment out these three lines and run 'vagrant up' to get a working - # non-updated box and then attempt to troubleshoot after it has started - # - config.vm.provision "shell", run: "always", inline: <<-SHELL - sudo pacman -Syu --needed --noconfirm - SHELL + # add a # before ,args: and run 'vagrant up' to get a working + # non-updated box and then attempt to troubleshoot or open a Github issue - # Allow user to speed up package installs using powerpill/wget tweaks - # Always run the pacman mirror update script if possible when vagrant comes up - # This will ensure that users never get stalled on a horribly slow mirror + config.vm.provision "shell", run: "always", path: "avr_setup.sh", args: "-update" + + config.vm.post_up_message = """ + Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) + or 'vagrant ssh-config' and Putty or another SSH tool - config.vm.provision "shell", path: "avr_setup.sh" + Change directory to the keyboard you wish to program + optionally and modify your layout, + then run 'make clean' + and then 'make' to compile the .eep and .hex files. + + Or you can copy and paste the line below. + + cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make + - config.vm.post_up_message = """Change directory to the keyboard you wish to program and modify your layout, then run 'make clean' and 'make' to compile the .eep and .hex files.""" + """ end diff --git a/avr_setup.sh b/avr_setup.sh index ff4153ba3..cd7412d74 100644 --- a/avr_setup.sh +++ b/avr_setup.sh @@ -6,18 +6,26 @@ if [[ -n "$(type -P pacman )" ]]; then # Arch linux and derivatives like Apricity - pacman -S --needed --noconfirm base-devel avr-gcc avr-binutils avr-libc dfu-utils + # Future improvements: + # Allow user to speed up package installs using powerpill/wget tweaks + # Always run the pacman mirror update script if possible when vagrant comes up + # This will ensure that users never get stalled on a horribly slow mirror + pacman -Syyu --needed --noconfirm + pacman -S --needed --noconfirm base-devel avr-gcc avr-binutils avr-libc dfu-util elif [[ -n "$(type -P apt-get)" ]]; then # Debian and derivatives + apt-get update -y && apt-get upgrade -y apt-get install -y build-essential gcc unzip wget zip gcc-avr binutils-avr avr-libc elif [[ -n "$(type -P yum)" ]]; then # Fedora, CentOS or RHEL and derivatives + yum -y makecache && yum -y update yum -y install gcc glibc-headers kernel-devel kernel-headers make perl git wget elif [[ -n "$(type -P zypper)" ]]; then # openSUSE + zypper refresh --non-interactive && zypper update --non-interactive zypper --non-interactive install git make gcc kernel-devel patch wget fi -- cgit v1.2.3-70-g09d2 From 71ee3eb2e7fdddbfac4443c5f8522a2f620f86e2 Mon Sep 17 00:00:00 2001 From: dragon788 Date: Tue, 12 Jan 2016 21:41:43 -0600 Subject: All dfu dependencies in place, multi-line syntax to make it easy to add/read --- avr_setup.sh | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'avr_setup.sh') diff --git a/avr_setup.sh b/avr_setup.sh index cd7412d74..15f3118c0 100644 --- a/avr_setup.sh +++ b/avr_setup.sh @@ -11,21 +11,54 @@ if [[ -n "$(type -P pacman )" ]]; then # Always run the pacman mirror update script if possible when vagrant comes up # This will ensure that users never get stalled on a horribly slow mirror pacman -Syyu --needed --noconfirm - pacman -S --needed --noconfirm base-devel avr-gcc avr-binutils avr-libc dfu-util + pacman -S --needed --noconfirm \ + base-devel \ + avr-gcc \ + avr-binutils \ + avr-libc \ + dfu-util elif [[ -n "$(type -P apt-get)" ]]; then # Debian and derivatives apt-get update -y && apt-get upgrade -y - apt-get install -y build-essential gcc unzip wget zip gcc-avr binutils-avr avr-libc + apt-get install -y \ + build-essential \ + gcc \ + unzip \ + wget \ + zip \ + gcc-avr \ + binutils-avr \ + avr-libc \ + dfu-util elif [[ -n "$(type -P yum)" ]]; then # Fedora, CentOS or RHEL and derivatives yum -y makecache && yum -y update - yum -y install gcc glibc-headers kernel-devel kernel-headers make perl git wget + yum -y install \ + gcc \ + glibc-headers \ + kernel-devel \ + kernel-headers \ + make \ + perl \ + git \ + wget \ + avr-binutils \ + avr-gcc \ + avr-libc \ + dfu-util elif [[ -n "$(type -P zypper)" ]]; then # openSUSE zypper refresh --non-interactive && zypper update --non-interactive - zypper --non-interactive install git make gcc kernel-devel patch wget + zypper --non-interactive install \ + git \ + make \ + gcc \ + kernel-devel \ + patch \ + wget \ + dfu-util fi -- cgit v1.2.3-70-g09d2 From 987ac16afde0539dca1f158c1f2186bcb3f26c76 Mon Sep 17 00:00:00 2001 From: dragon788 Date: Sat, 16 Jan 2016 11:44:27 -0600 Subject: Updated avr script and added notes to Vagrantfile --- Vagrantfile | 21 ++++++++++++++++----- avr_setup.sh | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'avr_setup.sh') diff --git a/Vagrantfile b/Vagrantfile index 788e014de..a2059cb80 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -13,6 +13,9 @@ Vagrant.configure(2) do |config| # VMware/Virtualbox 64 bit # config.vm.box = "puphpet/centos65-x64" # + # The opensuse boxes don't have dfu-util in their default repositories + # + # The virtualbox version has tools issues # VMware/Virtualbox 64 bit # config.vm.box = "bento/opensuse-13.2-x86_64" # @@ -35,7 +38,7 @@ Vagrant.configure(2) do |config| # This section allows you to customize the VMware VM # settings, ie showing the GUI or upping the memory # or cores if desired - config.vm.provider "vmware" do |vmw| + config.vm.provider "vmware_workstation" do |vmw| # Hide the VMware GUI when booting the machine vmw.gui = false @@ -43,6 +46,14 @@ Vagrant.configure(2) do |config| vmw.memory = "512" end + config.vm.provider "vmware_fusion" do |vmf| + # Hide the vmfare GUI when booting the machine + vmf.gui = false + + # Customize the amount of memory on the VM: + vmf.memory = "512" + end + # This script ensures the required packages for AVR programming are installed # It also ensures the system always gets the latest updates when powered on # If this causes issues you can run a 'vagrant destroy' and then @@ -53,14 +64,14 @@ Vagrant.configure(2) do |config| config.vm.post_up_message = """ Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) - or 'vagrant ssh-config' and Putty or another SSH tool + or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool - Change directory to the keyboard you wish to program - optionally and modify your layout, + Change directory (cd) to the keyboard you wish to program + (Optionally) modify your layout, then run 'make clean' and then 'make' to compile the .eep and .hex files. - Or you can copy and paste the line below. + Or you can copy and paste the example line below. cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make diff --git a/avr_setup.sh b/avr_setup.sh index 15f3118c0..4b2528085 100644 --- a/avr_setup.sh +++ b/avr_setup.sh @@ -51,7 +51,7 @@ elif [[ -n "$(type -P yum)" ]]; then elif [[ -n "$(type -P zypper)" ]]; then # openSUSE - zypper refresh --non-interactive && zypper update --non-interactive + zypper --non-interactive refresh && zypper --non-interactive update zypper --non-interactive install \ git \ make \ @@ -59,6 +59,6 @@ elif [[ -n "$(type -P zypper)" ]]; then kernel-devel \ patch \ wget \ - dfu-util + dfu-programmer fi -- cgit v1.2.3-70-g09d2 From 67f7507d7c8e9db8f1bb135a272a03fd4619b288 Mon Sep 17 00:00:00 2001 From: dragon788 Date: Sun, 17 Jan 2016 13:12:37 -0600 Subject: Fixing Debian/Ubuntu updates to be completely non-interactive --- avr_setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'avr_setup.sh') diff --git a/avr_setup.sh b/avr_setup.sh index 4b2528085..34a8a3281 100644 --- a/avr_setup.sh +++ b/avr_setup.sh @@ -20,7 +20,15 @@ if [[ -n "$(type -P pacman )" ]]; then elif [[ -n "$(type -P apt-get)" ]]; then # Debian and derivatives - apt-get update -y && apt-get upgrade -y + # This block performs completely non-interactive updates {{ + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_NONINTERACTIVE_SEEN=true + echo "grub-pc hold" | dpkg --set-selections + apt-get -y update + apt-get -y --allow-unauthenticated upgrade \ + -o Dpkg::Options::="--force-confdef" \ + -o Dpkg::Options::="--force-confold" + # }} apt-get install -y \ build-essential \ gcc \ -- cgit v1.2.3-70-g09d2