Skip to content

Commit

Permalink
MSYS and WSL installation improvements (qmk#10593)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Oct 17, 2020
1 parent 1a2a838 commit f0a1ab5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 187 deletions.
2 changes: 1 addition & 1 deletion docs/driver_installation_zadig.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ QMK presents itself to the host as a regular HID keyboard device, and as such re

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.

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.
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.

## Installation

Expand Down
8 changes: 0 additions & 8 deletions util/activate_msys2.sh

This file was deleted.

8 changes: 0 additions & 8 deletions util/activate_wsl.sh

This file was deleted.

14 changes: 14 additions & 0 deletions util/linux_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,17 @@ fi
# Global install tasks
install_bootloadhid
pip3 install --user -r ${util_dir}/../requirements.txt

if uname -a | grep -qi microsoft; then
echo "********************************************************************************"
echo "* Detected Windows Subsystem for Linux. *"
echo "* Currently, WSL has no access to USB devices and so flashing from within the *"
echo "* WSL terminal will not work. *"
echo "* *"
echo "* Please install the QMK Toolbox instead: *"
echo "* https://github.com/qmk/qmk_toolbox/releases *"
echo "* Then, map your WSL filesystem as a network drive: *"
echo "* \\\\\\\\wsl$\\<distro> *"
echo "********************************************************************************"
echo
fi
31 changes: 8 additions & 23 deletions util/msys2_install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
download_dir=~/qmk_utils
util_dir=$(dirname "$0")

echo "Installing dependencies needed for the installation"
Expand All @@ -12,26 +10,13 @@ pacman --needed --noconfirm --disable-download-timeout -Sy \
mingw-w64-x86_64-arm-none-eabi-binutils mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-arm-none-eabi-newlib \
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

source "$dir/win_shared_install.sh"
echo "Installing drivers"
tmpdir=$(mktemp -d)
cp "${util_dir}/drivers.txt" $tmpdir
pushd $tmpdir > /dev/null
wget "https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe"
cmd.exe //c "qmk_driver_installer.exe --all --force drivers.txt"
popd > /dev/null
rm -r $tmpdir

pip3 install -r "${util_dir}/../requirements.txt"

cp -f "$dir/activate_msys2.sh" "$download_dir/"

if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc
then
echo
echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc"
echo "Not adding it twice!"
else
echo
echo "Adding 'source ~/qmk_utils/activate_msys2.sh' to the end of your"
echo ".bashrc file. Without this make won't find the needed utils."
echo "source ~/qmk_utils/activate_msys2.sh" >> ~/.bashrc;
fi

echo
echo "******************************************************************************"
echo "Installation completed!"
echo "Please close this Window and restart MSYS2 MinGW"
echo "******************************************************************************"
10 changes: 6 additions & 4 deletions util/qmk_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ case $(uname -a) in
*Darwin*)
exec "${util_dir}/macos_install.sh"
;;
*Linux*Microsoft*)
exec "${util_dir}/wsl_install.sh"
;;
*FreeBSD*)
exec "${util_dir}/freebsd_install.sh"
;;
*Linux*)
exec "${util_dir}/linux_install.sh"
;;
MSYS_NT*|MINGW64_NT*|MINGW32_NT*)
MINGW64_NT*)
exec "${util_dir}/msys2_install.sh"
;;
MSYS_NT*|MINGW32_NT*)
echo "Please open a MinGW 64-bit terminal window and re-run this script."
exit 1
;;
*)
echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually."
exit 1
;;
esac
63 changes: 0 additions & 63 deletions util/win_shared_install.sh

This file was deleted.

80 changes: 0 additions & 80 deletions util/wsl_install.sh

This file was deleted.

0 comments on commit f0a1ab5

Please sign in to comment.