aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/driver_installation_zadig.md2
-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
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
5There 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. 5There 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
7We 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. 7We 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
3function export_variables {
4 local util_dir=~/qmk_utils
5 export PATH=$PATH:$util_dir
6}
7
8export_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
3function export_variables {
4 local util_dir=~/qmk_utils
5 local download_dir=$util_dir/wsl_downloaded
6}
7
8export_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
236install_bootloadhid 236install_bootloadhid
237pip3 install --user -r ${util_dir}/../requirements.txt 237pip3 install --user -r ${util_dir}/../requirements.txt
238
239if 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
251fi
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
3dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4download_dir=~/qmk_utils
5util_dir=$(dirname "$0") 3util_dir=$(dirname "$0")
6 4
7echo "Installing dependencies needed for the installation" 5echo "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
15source "$dir/win_shared_install.sh" 13echo "Installing drivers"
14tmpdir=$(mktemp -d)
15cp "${util_dir}/drivers.txt" $tmpdir
16pushd $tmpdir > /dev/null
17wget "https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe"
18cmd.exe //c "qmk_driver_installer.exe --all --force drivers.txt"
19popd > /dev/null
20rm -r $tmpdir
16 21
17pip3 install -r "${util_dir}/../requirements.txt" 22pip3 install -r "${util_dir}/../requirements.txt"
18
19cp -f "$dir/activate_msys2.sh" "$download_dir/"
20
21if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc
22then
23 echo
24 echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc"
25 echo "Not adding it twice!"
26else
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;
31fi
32
33echo
34echo "******************************************************************************"
35echo "Installation completed!"
36echo "Please close this Window and restart MSYS2 MinGW"
37echo "******************************************************************************"
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 ;;
25esac 27esac
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
3function 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
17function 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
25pushd "$dir"
26
27if [ ! -d "$download_dir" ]; then
28 install_utils
29else
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
40fi
41
42while 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
60done
61
62
63popd > /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
3util_dir=$(dirname "$0")
4dir=$(cd -P -- "$util_dir" && pwd -P)
5pushd "$dir";
6
7if [[ $dir != /mnt/* ]];
8then
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
13fi
14
15
16while 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
26done
27
28download_dir=wsl_downloaded
29
30source "$dir/win_shared_install.sh"
31
32pip3 install -r ${util_dir}/../requirements.txt
33
34echo
35echo "Creating a softlink to the utils directory as ~/qmk_utils."
36echo "This is needed so that the the make system can find all utils it need."
37read -p "Press enter to continue (ctrl-c to abort)"
38ln -sfn "$dir" ~/qmk_utils
39
40if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc
41then
42 echo
43 echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc"
44 echo "Not adding it twice"
45else
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
58fi
59
60while 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
72done
73
74echo
75echo "******************************************************************************"
76echo "Installation completed!"
77echo "You need to open a new bash command prompt for all the utils to work properly"
78echo "******************************************************************************"
79
80popd > /dev/null