diff options
| -rw-r--r-- | docs/driver_installation_zadig.md | 2 | ||||
| -rwxr-xr-x | util/activate_msys2.sh | 8 | ||||
| -rwxr-xr-x | util/activate_wsl.sh | 8 | ||||
| -rwxr-xr-x | util/linux_install.sh | 14 | ||||
| -rwxr-xr-x | util/msys2_install.sh | 31 | ||||
| -rwxr-xr-x | util/qmk_install.sh | 10 | ||||
| -rwxr-xr-x | util/win_shared_install.sh | 63 | ||||
| -rwxr-xr-x | util/wsl_install.sh | 80 |
8 files changed, 29 insertions, 187 deletions
diff --git a/docs/driver_installation_zadig.md b/docs/driver_installation_zadig.md index 403b78da0..4519a21e6 100644 --- a/docs/driver_installation_zadig.md +++ b/docs/driver_installation_zadig.md | |||
| @@ -4,7 +4,7 @@ QMK presents itself to the host as a regular HID keyboard device, and as such re | |||
| 4 | 4 | ||
| 5 | There are two notable exceptions: the Caterina bootloader, usually seen on Pro Micros, and the HalfKay bootloader shipped with PJRC Teensys, appear as a serial port and a generic HID device respectively, and so do not require a driver. | 5 | There are two notable exceptions: the Caterina bootloader, usually seen on Pro Micros, and the HalfKay bootloader shipped with PJRC Teensys, appear as a serial port and a generic HID device respectively, and so do not require a driver. |
| 6 | 6 | ||
| 7 | We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have set up the development environment with MSYS2 or WSL, the `qmk_install.sh` script will have asked if you want it to install the drivers for you. | 7 | We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have set up the development environment with MSYS2, the `qmk_install.sh` script will have already installed the drivers for you. |
| 8 | 8 | ||
| 9 | ## Installation | 9 | ## Installation |
| 10 | 10 | ||
diff --git a/util/activate_msys2.sh b/util/activate_msys2.sh deleted file mode 100755 index b37bee859..000000000 --- a/util/activate_msys2.sh +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | function export_variables { | ||
| 4 | local util_dir=~/qmk_utils | ||
| 5 | export PATH=$PATH:$util_dir | ||
| 6 | } | ||
| 7 | |||
| 8 | export_variables | ||
diff --git a/util/activate_wsl.sh b/util/activate_wsl.sh deleted file mode 100755 index 45cd945ef..000000000 --- a/util/activate_wsl.sh +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | function export_variables { | ||
| 4 | local util_dir=~/qmk_utils | ||
| 5 | local download_dir=$util_dir/wsl_downloaded | ||
| 6 | } | ||
| 7 | |||
| 8 | export_variables | ||
diff --git a/util/linux_install.sh b/util/linux_install.sh index 0343b07e6..fb8968386 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh | |||
| @@ -235,3 +235,17 @@ fi | |||
| 235 | # Global install tasks | 235 | # Global install tasks |
| 236 | install_bootloadhid | 236 | install_bootloadhid |
| 237 | pip3 install --user -r ${util_dir}/../requirements.txt | 237 | pip3 install --user -r ${util_dir}/../requirements.txt |
| 238 | |||
| 239 | if uname -a | grep -qi microsoft; then | ||
| 240 | echo "********************************************************************************" | ||
| 241 | echo "* Detected Windows Subsystem for Linux. *" | ||
| 242 | echo "* Currently, WSL has no access to USB devices and so flashing from within the *" | ||
| 243 | echo "* WSL terminal will not work. *" | ||
| 244 | echo "* *" | ||
| 245 | echo "* Please install the QMK Toolbox instead: *" | ||
| 246 | echo "* https://github.com/qmk/qmk_toolbox/releases *" | ||
| 247 | echo "* Then, map your WSL filesystem as a network drive: *" | ||
| 248 | echo "* \\\\\\\\wsl$\\<distro> *" | ||
| 249 | echo "********************************************************************************" | ||
| 250 | echo | ||
| 251 | fi | ||
diff --git a/util/msys2_install.sh b/util/msys2_install.sh index c223e52fa..5abe4a597 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | ||
| 4 | download_dir=~/qmk_utils | ||
| 5 | util_dir=$(dirname "$0") | 3 | util_dir=$(dirname "$0") |
| 6 | 4 | ||
| 7 | echo "Installing dependencies needed for the installation" | 5 | echo "Installing dependencies needed for the installation" |
| @@ -12,26 +10,13 @@ pacman --needed --noconfirm --disable-download-timeout -Sy \ | |||
| 12 | mingw-w64-x86_64-arm-none-eabi-binutils mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-arm-none-eabi-newlib \ | 10 | mingw-w64-x86_64-arm-none-eabi-binutils mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-arm-none-eabi-newlib \ |
| 13 | mingw-w64-x86_64-avrdude mingw-w64-x86_64-bootloadhid mingw-w64-x86_64-dfu-programmer mingw-w64-x86_64-dfu-util mingw-w64-x86_64-teensy-loader-cli | 11 | mingw-w64-x86_64-avrdude mingw-w64-x86_64-bootloadhid mingw-w64-x86_64-dfu-programmer mingw-w64-x86_64-dfu-util mingw-w64-x86_64-teensy-loader-cli |
| 14 | 12 | ||
| 15 | source "$dir/win_shared_install.sh" | 13 | echo "Installing drivers" |
| 14 | tmpdir=$(mktemp -d) | ||
| 15 | cp "${util_dir}/drivers.txt" $tmpdir | ||
| 16 | pushd $tmpdir > /dev/null | ||
| 17 | wget "https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe" | ||
| 18 | cmd.exe //c "qmk_driver_installer.exe --all --force drivers.txt" | ||
| 19 | popd > /dev/null | ||
| 20 | rm -r $tmpdir | ||
| 16 | 21 | ||
| 17 | pip3 install -r "${util_dir}/../requirements.txt" | 22 | pip3 install -r "${util_dir}/../requirements.txt" |
| 18 | |||
| 19 | cp -f "$dir/activate_msys2.sh" "$download_dir/" | ||
| 20 | |||
| 21 | if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc | ||
| 22 | then | ||
| 23 | echo | ||
| 24 | echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc" | ||
| 25 | echo "Not adding it twice!" | ||
| 26 | else | ||
| 27 | echo | ||
| 28 | echo "Adding 'source ~/qmk_utils/activate_msys2.sh' to the end of your" | ||
| 29 | echo ".bashrc file. Without this make won't find the needed utils." | ||
| 30 | echo "source ~/qmk_utils/activate_msys2.sh" >> ~/.bashrc; | ||
| 31 | fi | ||
| 32 | |||
| 33 | echo | ||
| 34 | echo "******************************************************************************" | ||
| 35 | echo "Installation completed!" | ||
| 36 | echo "Please close this Window and restart MSYS2 MinGW" | ||
| 37 | echo "******************************************************************************" | ||
diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 76ecf5fc0..714ee9144 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh | |||
| @@ -7,19 +7,21 @@ case $(uname -a) in | |||
| 7 | *Darwin*) | 7 | *Darwin*) |
| 8 | exec "${util_dir}/macos_install.sh" | 8 | exec "${util_dir}/macos_install.sh" |
| 9 | ;; | 9 | ;; |
| 10 | *Linux*Microsoft*) | ||
| 11 | exec "${util_dir}/wsl_install.sh" | ||
| 12 | ;; | ||
| 13 | *FreeBSD*) | 10 | *FreeBSD*) |
| 14 | exec "${util_dir}/freebsd_install.sh" | 11 | exec "${util_dir}/freebsd_install.sh" |
| 15 | ;; | 12 | ;; |
| 16 | *Linux*) | 13 | *Linux*) |
| 17 | exec "${util_dir}/linux_install.sh" | 14 | exec "${util_dir}/linux_install.sh" |
| 18 | ;; | 15 | ;; |
| 19 | MSYS_NT*|MINGW64_NT*|MINGW32_NT*) | 16 | MINGW64_NT*) |
| 20 | exec "${util_dir}/msys2_install.sh" | 17 | exec "${util_dir}/msys2_install.sh" |
| 21 | ;; | 18 | ;; |
| 19 | MSYS_NT*|MINGW32_NT*) | ||
| 20 | echo "Please open a MinGW 64-bit terminal window and re-run this script." | ||
| 21 | exit 1 | ||
| 22 | ;; | ||
| 22 | *) | 23 | *) |
| 23 | echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." | 24 | echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." |
| 25 | exit 1 | ||
| 24 | ;; | 26 | ;; |
| 25 | esac | 27 | esac |
diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh deleted file mode 100755 index f45ca3517..000000000 --- a/util/win_shared_install.sh +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | function install_utils { | ||
| 4 | rm -f -r "$download_dir" | ||
| 5 | mkdir "$download_dir" | ||
| 6 | |||
| 7 | pushd "$download_dir" | ||
| 8 | |||
| 9 | echo "Downloading the QMK driver installer" | ||
| 10 | wget -qO- https://api.github.com/repos/qmk/qmk_driver_installer/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 | wget -i - | ||
| 11 | |||
| 12 | rm -f *.zip | ||
| 13 | |||
| 14 | popd > /dev/null | ||
| 15 | } | ||
| 16 | |||
| 17 | function install_drivers { | ||
| 18 | pushd "$download_dir" | ||
| 19 | cp -f "$dir/drivers.txt" . | ||
| 20 | echo | ||
| 21 | cmd.exe //c "qmk_driver_installer.exe $1 $2 drivers.txt" | ||
| 22 | popd > /dev/null | ||
| 23 | } | ||
| 24 | |||
| 25 | pushd "$dir" | ||
| 26 | |||
| 27 | if [ ! -d "$download_dir" ]; then | ||
| 28 | install_utils | ||
| 29 | else | ||
| 30 | while true; do | ||
| 31 | echo | ||
| 32 | echo "The utils seem to already be downloaded." | ||
| 33 | read -p "Do you want to re-download them and update to the newest version (Y/N) " res | ||
| 34 | case $res in | ||
| 35 | [Yy]* ) install_utils; break;; | ||
| 36 | [Nn]* ) break;; | ||
| 37 | * ) echo "Invalid answer";; | ||
| 38 | esac | ||
| 39 | done | ||
| 40 | fi | ||
| 41 | |||
| 42 | while true; do | ||
| 43 | echo | ||
| 44 | echo "Which USB drivers do you want to install?" | ||
| 45 | echo "(A)ll - All supported drivers will be installed" | ||
| 46 | echo "(C)onnected - Only drivers for connected keyboards (in bootloader/flashing mode)" | ||
| 47 | echo " will be installed" | ||
| 48 | echo "(F)orce - Like all, but will also override existing drivers for connected" | ||
| 49 | echo " keyboards" | ||
| 50 | echo "(N)one - No drivers will be installed," | ||
| 51 | echo " flashing your keyboard will most likely not work" | ||
| 52 | read -p "(a/c/f/N)? " res | ||
| 53 | case $res in | ||
| 54 | [AaYy]* ) install_drivers --all; break;; | ||
| 55 | [Cc]* ) install_drivers; break;; | ||
| 56 | [Ff]* ) install_drivers --all --force; break;; | ||
| 57 | [Nn]* | "" ) break;; | ||
| 58 | * ) echo "Invalid answer";; | ||
| 59 | esac | ||
| 60 | done | ||
| 61 | |||
| 62 | |||
| 63 | popd > /dev/null | ||
diff --git a/util/wsl_install.sh b/util/wsl_install.sh deleted file mode 100755 index 8ed177ca3..000000000 --- a/util/wsl_install.sh +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | util_dir=$(dirname "$0") | ||
| 4 | dir=$(cd -P -- "$util_dir" && pwd -P) | ||
| 5 | pushd "$dir"; | ||
| 6 | |||
| 7 | if [[ $dir != /mnt/* ]]; | ||
| 8 | then | ||
| 9 | echo | ||
| 10 | echo "You need to clone the qmk_firmware repository outside the linux filesystem." | ||
| 11 | echo "Otherwise the windows executables can't be run." | ||
| 12 | exit 1 | ||
| 13 | fi | ||
| 14 | |||
| 15 | |||
| 16 | while true; do | ||
| 17 | echo | ||
| 18 | echo "Do you want to install all toolchain dependencies needed for compiling QMK?" | ||
| 19 | echo "If you don't want that, you can install the dependencies manually." | ||
| 20 | read -p "(Y/N) " res | ||
| 21 | case $res in | ||
| 22 | [Yy]* ) ./linux_install.sh; break;; | ||
| 23 | [Nn]* ) break;; | ||
| 24 | * ) echo "Invalid answer";; | ||
| 25 | esac | ||
| 26 | done | ||
| 27 | |||
| 28 | download_dir=wsl_downloaded | ||
| 29 | |||
| 30 | source "$dir/win_shared_install.sh" | ||
| 31 | |||
| 32 | pip3 install -r ${util_dir}/../requirements.txt | ||
| 33 | |||
| 34 | echo | ||
| 35 | echo "Creating a softlink to the utils directory as ~/qmk_utils." | ||
| 36 | echo "This is needed so that the the make system can find all utils it need." | ||
| 37 | read -p "Press enter to continue (ctrl-c to abort)" | ||
| 38 | ln -sfn "$dir" ~/qmk_utils | ||
| 39 | |||
| 40 | if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc | ||
| 41 | then | ||
| 42 | echo | ||
| 43 | echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc" | ||
| 44 | echo "Not adding it twice" | ||
| 45 | else | ||
| 46 | while true; do | ||
| 47 | echo | ||
| 48 | echo "Do you want to add 'source ~/qmk_utils/activate_wsl.sh' to the end of your" | ||
| 49 | echo ".bashrc file? Without this make won't find the needed utils, so if you don't" | ||
| 50 | echo "want to do it automatically, then you have to do it manually later." | ||
| 51 | read -p "(Y/N)? " res | ||
| 52 | case $res in | ||
| 53 | [Yy]* ) echo "source ~/qmk_utils/activate_wsl.sh" >> ~/.bashrc; break;; | ||
| 54 | [Nn]* ) break;; | ||
| 55 | * ) echo "Invalid answer";; | ||
| 56 | esac | ||
| 57 | done | ||
| 58 | fi | ||
| 59 | |||
| 60 | while true; do | ||
| 61 | echo | ||
| 62 | echo "Do you want to add a symlink to the QMK repository in your home directory for" | ||
| 63 | echo "convenience? This will create a folder 'qmk_firmware' in your home directory." | ||
| 64 | echo "In the future you can use this folder instead of the full path on your Windows" | ||
| 65 | echo "file system." | ||
| 66 | read -p "(Y/N)? " res | ||
| 67 | case $res in | ||
| 68 | [Yy]* ) ln -sfn "$dir/.." ~/qmk_firmware; break;; | ||
| 69 | [Nn]* ) break;; | ||
| 70 | * ) echo "Invalid answer";; | ||
| 71 | esac | ||
| 72 | done | ||
| 73 | |||
| 74 | echo | ||
| 75 | echo "******************************************************************************" | ||
| 76 | echo "Installation completed!" | ||
| 77 | echo "You need to open a new bash command prompt for all the utils to work properly" | ||
| 78 | echo "******************************************************************************" | ||
| 79 | |||
| 80 | popd > /dev/null | ||
