diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/1-setup-path-win.bat | 61 | ||||
-rw-r--r-- | util/2-setup-environment-win.bat | 63 | ||||
-rw-r--r-- | util/avr_setup.sh | 72 | ||||
-rw-r--r-- | util/elevate.exe | bin | 0 -> 79360 bytes | |||
-rwxr-xr-x | util/new_project.sh | 26 |
5 files changed, 222 insertions, 0 deletions
diff --git a/util/1-setup-path-win.bat b/util/1-setup-path-win.bat new file mode 100644 index 0000000000..92e91be3e2 --- /dev/null +++ b/util/1-setup-path-win.bat @@ -0,0 +1,61 @@ +@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +@ECHO OFF +SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe + +CD UTIL +DEL add-paths.log > NUL 2>&1 +DEL add-paths-detail.log > NUL 2>&1 +DEL UPDATE > NUL 2>&1 + +ELEVATE -wait %cd%\add-paths.bat > NUL 2>&1 + +IF ERRORLEVEL 1 ( + ECHO You denied admin access. Rerun the script, and be sure to press the yes button this time. +) ELSE ( + TYPE add-paths.log 2> NUL +) +ECHO. + +:: Branch to UpdateEnv if we need to update +IF EXIST UPDATE ( + DEL UPDATE + GOTO UpdateEnv +) + +GOTO ExitBatch + +:: ----------------------------------------------------------------------------- + +:UpdateEnv +ECHO Making updated PATH go live . . . +REG delete HKCU\Environment /F /V TEMPVAR > NUL 2>&1 +setx TEMPVAR 1 > NUL +REG delete HKCU\Environment /F /V TEMPVAR > NUL 2>&1 +IF NOT !cmdcmdline! == !CMDLINERUNSTR! (CALL :KillExplorer) +GOTO ExitBatch + +:: ----------------------------------------------------------------------------- + +:ExitBatch +ENDLOCAL +PAUSE +EXIT /b + +:: ----------------------------------------------------------------------------- + +:KillExplorer +ECHO Your desktop will be restarted. +ECHO All file explorer windows except for the one you launched this script from WILL BE CLOSED. +ECHO Press enter when ready, or close this window if you would rather do a full restart of your computer at a later time. +PAUSE +ping -n 5 127.0.0.1 > NUL 2>&1 +ECHO Killing process Explorer.exe. . . +ECHO. +taskkill /f /im explorer.exe > NUL +ECHO. +ECHO Your desktop is now loading. . . +ECHO. +ping -n 5 127.0.0.1 > NUL 2>&1 +START explorer.exe +START explorer.exe %CD%\.. +EXIT /b
\ No newline at end of file diff --git a/util/2-setup-environment-win.bat b/util/2-setup-environment-win.bat new file mode 100644 index 0000000000..905338087a --- /dev/null +++ b/util/2-setup-environment-win.bat @@ -0,0 +1,63 @@ +@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +@ECHO OFF + +SET STARTINGDIR=%CD% + +:: Check for admin privilages +SETX /M test test > nul 2>&1 +IF NOT ["%ERRORLEVEL%"]==["0"] ( + ECHO FAILED. Rerun with administrator privileges. + GOTO ExitBatch +) + +:: Make sure path to MinGW exists - if so, CD to it +SET MINGWPATH="C:\MinGW\bin" +IF NOT EXIST !MINGWPATH! (ECHO Path not found: %MINGWPATH% && GOTO ExitBatch) +CD /D %MINGWPATH% + + +ECHO ------------------------------------------ +ECHO Installing wget and unzip +ECHO ------------------------------------------ +mingw-get install msys-wget-bin msys-unzip-bin + +MKDIR temp +CD temp + +ECHO ------------------------------------------ +ECHO Installing dfu-programmer. +ECHO ------------------------------------------ +wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip +unzip dfu-programmer-win-0.7.2.zip +COPY dfu-programmer.exe .. + +ECHO ------------------------------------------ +ECHO Downloading driver +ECHO ------------------------------------------ +wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip +unzip libusb-win32-bin-1.2.6.0.zip +COPY libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll + +ECHO ------------------------------------------ +ECHO Installing driver. Accept prompt. +ECHO ------------------------------------------ +IF EXIST "%WinDir%\System32\PnPUtil.exe" (%WinDir%\System32\PnPUtil.exe -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf && GOTO PNPUTILFOUND) +IF EXIST "%WinDir%\Sysnative\PnPUtil.exe" (%WinDir%\Sysnative\PnPUtil.exe -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf && GOTO PNPUTILFOUND) + +ECHO FAILED. Could not find PnPUtil.exe in "%WinDir%\System32" or "%WinDir%\Sysnative". + +:PNPUTILFOUND + +:: Wait then delete directory +ping -n 5 127.0.0.1 > NUL 2>&1 +CD .. +RD /s /q temp + +ECHO ------------------------------------------ +ECHO Finished! + +:ExitBatch +CD /D %STARTINGDIR% +ENDLOCAL +PAUSE +EXIT /b
\ No newline at end of file diff --git a/util/avr_setup.sh b/util/avr_setup.sh new file mode 100644 index 0000000000..34a8a3281b --- /dev/null +++ b/util/avr_setup.sh @@ -0,0 +1,72 @@ +#!/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 + # 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 + # 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 \ + 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 \ + avr-binutils \ + avr-gcc \ + avr-libc \ + dfu-util + +elif [[ -n "$(type -P zypper)" ]]; then + # openSUSE + zypper --non-interactive refresh && zypper --non-interactive update + zypper --non-interactive install \ + git \ + make \ + gcc \ + kernel-devel \ + patch \ + wget \ + dfu-programmer + +fi diff --git a/util/elevate.exe b/util/elevate.exe Binary files differnew file mode 100644 index 0000000000..fc6180ec92 --- /dev/null +++ b/util/elevate.exe diff --git a/util/new_project.sh b/util/new_project.sh new file mode 100755 index 0000000000..7def543188 --- /dev/null +++ b/util/new_project.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Script to make a new quantum project +# Jack Humbert 2015 + +if [ -z "$1" ]; then + echo "Usage: $0 <keyboard_name>" + exit 1 +fi + +KEYBOARD=$1 +KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') + +mkdir keyboard/$1 +mkdir keyboard/$1/keymaps +sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboard/$KEYBOARD/$KEYBOARD.h +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboard/$KEYBOARD/$KEYBOARD.c +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboard/$KEYBOARD/config.h +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboard/$KEYBOARD/README.md +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboard/$KEYBOARD/Makefile +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default.c > keyboard/$KEYBOARD/keymaps/default.c + +echo "######################################################" +echo "# keyboard/$KEYBOARD project created. To start" +echo "# working on things, use the following command:" +echo "# cd keyboard/$KEYBOARD" +echo "######################################################" |