Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSYS and WSL installation improvements #10593

Merged
merged 3 commits into from
Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

12 changes: 12 additions & 0 deletions util/linux_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ SOLUS_INFO="Your tools are now installed. To start using them, open new terminal

util_dir=$(dirname "$0")

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 "********************************************************************************"
echo
fi

# For those distros that do not package bootloadHID
install_bootloadhid() {
if ! command -v bootloadHID >/dev/null; then
Expand Down
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.