summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-10-18 02:45:21 +1100
committerGitHub <noreply@github.com>2020-10-18 02:45:21 +1100
commitf0a1ab5488425857987e94c883fd13cc661a92a8 (patch)
tree8691394ba36f3f56820f72dd9f3abe789e7b44fd /util
parent1a2a838bc204d0b287366d9518b0d222cbb33049 (diff)
MSYS and WSL installation improvements (#10593)
Diffstat (limited to 'util')
-rwxr-xr-xutil/activate_msys2.sh8
-rwxr-xr-xutil/activate_wsl.sh8
-rwxr-xr-xutil/linux_install.sh14
-rwxr-xr-xutil/msys2_install.sh31
-rwxr-xr-xutil/qmk_install.sh10
-rwxr-xr-xutil/win_shared_install.sh63
-rwxr-xr-xutil/wsl_install.sh80
7 files changed, 28 insertions, 186 deletions
diff --git a/util/activate_msys2.sh b/util/activate_msys2.sh
deleted file mode 100755
index b37bee8597..0000000000
--- a/util/activate_msys2.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-function export_variables {
-    local util_dir=~/qmk_utils
-    export PATH=$PATH:$util_dir
-}
-
-export_variables
diff --git a/util/activate_wsl.sh b/util/activate_wsl.sh
deleted file mode 100755
index 45cd945efb..0000000000
--- a/util/activate_wsl.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-function export_variables {
-    local util_dir=~/qmk_utils
-    local download_dir=$util_dir/wsl_downloaded
-}
-
-export_variables
diff --git a/util/linux_install.sh b/util/linux_install.sh
index 0343b07e6f..fb8968386b 100755
--- a/util/linux_install.sh
+++ b/util/linux_install.sh
@@ -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
diff --git a/util/msys2_install.sh b/util/msys2_install.sh
index c223e52fae..5abe4a597b 100755
--- a/util/msys2_install.sh
+++ b/util/msys2_install.sh
@@ -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"
@@ -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 "******************************************************************************"
diff --git a/util/qmk_install.sh b/util/qmk_install.sh
index 76ecf5fc01..714ee91445 100755
--- a/util/qmk_install.sh
+++ b/util/qmk_install.sh
@@ -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
diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh
deleted file mode 100755
index f45ca35170..0000000000
--- a/util/win_shared_install.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-
-function install_utils {
-    rm -f -r "$download_dir"
-    mkdir "$download_dir"
-
-    pushd "$download_dir"
-
-    echo "Downloading the QMK driver installer"
-    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 -
-
-    rm -f *.zip
-
-    popd > /dev/null
-}
-
-function install_drivers {
-    pushd "$download_dir"
-    cp -f "$dir/drivers.txt" .
-    echo
-    cmd.exe //c "qmk_driver_installer.exe $1 $2 drivers.txt"
-    popd > /dev/null
-}
-
-pushd "$dir"
-
-if [ ! -d "$download_dir" ]; then
-    install_utils
-else
-    while true; do
-        echo
-        echo "The utils seem to already be downloaded."
-        read -p "Do you want to re-download them and update to the newest version (Y/N) " res
-        case $res in
-            [Yy]* ) install_utils; break;;
-            [Nn]* ) break;;
-            * ) echo "Invalid answer";;
-        esac
-    done
-fi
-
-while true; do
-    echo
-    echo "Which USB drivers do you want to install?"
-    echo "(A)ll - All supported drivers will be installed"
-    echo "(C)onnected - Only drivers for connected keyboards (in bootloader/flashing mode)"
-    echo "              will be installed"
-    echo "(F)orce - Like all, but will also override existing drivers for connected"
-    echo "           keyboards"
-    echo "(N)one - No drivers will be installed,"
-    echo "         flashing your keyboard will most likely not work"
-    read -p "(a/c/f/N)? " res
-    case $res in
-        [AaYy]* ) install_drivers --all; break;;
-        [Cc]* ) install_drivers; break;;
-        [Ff]* ) install_drivers --all --force; break;;
-        [Nn]* | "" ) break;;
-        * ) echo "Invalid answer";;
-    esac
-done
-
-
-popd > /dev/null
diff --git a/util/wsl_install.sh b/util/wsl_install.sh
deleted file mode 100755
index 8ed177ca3e..0000000000
--- a/util/wsl_install.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-
-util_dir=$(dirname "$0")
-dir=$(cd -P -- "$util_dir" && pwd -P)
-pushd "$dir";
-
-if [[ $dir != /mnt/* ]];
-then
-    echo
-    echo "You need to clone the qmk_firmware repository outside the linux filesystem."
-    echo "Otherwise the windows executables can't be run."
-    exit 1
-fi
-
-
-while true; do
-    echo
-    echo "Do you want to install all toolchain dependencies needed for compiling QMK?"
-    echo "If you don't want that, you can install the dependencies manually."
-    read -p "(Y/N) " res
-    case $res in
-        [Yy]* ) ./linux_install.sh; break;;
-        [Nn]* ) break;;
-        * ) echo "Invalid answer";;
-    esac
-done
-
-download_dir=wsl_downloaded
-
-source "$dir/win_shared_install.sh"
-
-pip3 install -r ${util_dir}/../requirements.txt
-
-echo 
-echo "Creating a softlink to the utils directory as ~/qmk_utils."
-echo "This is needed so that the the make system can find all utils it need."
-read -p "Press enter to continue (ctrl-c to abort)"
-ln -sfn "$dir" ~/qmk_utils
-
-if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc
-then
-    echo
-    echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc"
-    echo "Not adding it twice"
-else
-    while true; do
-        echo
-        echo "Do you want to add 'source ~/qmk_utils/activate_wsl.sh' to the end of your"
-        echo ".bashrc file? Without this make won't find the needed utils, so if you don't"
-        echo "want to do it automatically, then you have to do it manually later."
-        read -p "(Y/N)? " res
-        case $res in
-            [Yy]* ) echo "source ~/qmk_utils/activate_wsl.sh" >> ~/.bashrc; break;;
-            [Nn]* ) break;;
-            * ) echo "Invalid answer";;
-        esac
-    done
-fi
-
-while true; do
-    echo
-    echo "Do you want to add a symlink to the QMK repository in your home directory for"
-    echo "convenience? This will create a folder 'qmk_firmware' in your home directory."
-    echo "In the future you can use this folder instead of the full path on your Windows"
-    echo "file system."
-    read -p "(Y/N)? " res
-    case $res in
-        [Yy]* ) ln -sfn "$dir/.." ~/qmk_firmware; break;;
-        [Nn]* ) break;;
-        * ) echo "Invalid answer";;
-    esac
-done
-
-echo
-echo "******************************************************************************"
-echo "Installation completed!"
-echo "You need to open a new bash command prompt for all the utils to work properly"
-echo "******************************************************************************"
-
-popd > /dev/null