aboutsummaryrefslogtreecommitdiff
path: root/util/qmk_install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/qmk_install.sh')
-rwxr-xr-xutil/qmk_install.sh93
1 files changed, 70 insertions, 23 deletions
diff --git a/util/qmk_install.sh b/util/qmk_install.sh
index 714ee9144..5076e980a 100755
--- a/util/qmk_install.sh
+++ b/util/qmk_install.sh
@@ -1,27 +1,74 @@
1#!/bin/sh 1#!/bin/bash
2# Pick the correct install script based on the current OS
3 2
4util_dir=$(dirname "$0") 3QMK_FIRMWARE_DIR=$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)
4QMK_FIRMWARE_UTIL_DIR=$QMK_FIRMWARE_DIR/util
5 5
6case $(uname -a) in 6case $(uname -a) in
7 *Darwin*) 7 *Darwin*)
8 exec "${util_dir}/macos_install.sh" 8 . "$QMK_FIRMWARE_UTIL_DIR/install/macos.sh";;
9 ;; 9 *FreeBSD*)
10 *FreeBSD*) 10 . "$QMK_FIRMWARE_UTIL_DIR/install/freebsd.sh";;
11 exec "${util_dir}/freebsd_install.sh" 11 *MINGW64_NT*)
12 ;; 12 . "$QMK_FIRMWARE_UTIL_DIR/install/msys2.sh";;
13 *Linux*) 13 *MSYS_NT*|*MINGW32_NT*)
14 exec "${util_dir}/linux_install.sh" 14 echo "Please open a MinGW64 terminal window and re-run this script."
15 ;; 15 exit 1;;
16 MINGW64_NT*) 16 *Linux*)
17 exec "${util_dir}/msys2_install.sh" 17 . "$QMK_FIRMWARE_UTIL_DIR/install/linux_shared.sh"
18 ;; 18
19 MSYS_NT*|MINGW32_NT*) 19 case $(grep ID /etc/os-release) in
20 echo "Please open a MinGW 64-bit terminal window and re-run this script." 20 *arch*|*manjaro*)
21 exit 1 21 . "$QMK_FIRMWARE_UTIL_DIR/install/arch.sh";;
22 ;; 22 *debian*|*ubuntu*)
23 *) 23 . "$QMK_FIRMWARE_UTIL_DIR/install/debian.sh";;
24 echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." 24 *fedora*)
25 exit 1 25 . "$QMK_FIRMWARE_UTIL_DIR/install/fedora.sh";;
26 ;; 26 *gentoo*)
27 . "$QMK_FIRMWARE_UTIL_DIR/install/gentoo.sh";;
28 *opensuse*|*tumbleweed*)
29 . "$QMK_FIRMWARE_UTIL_DIR/install/opensuse.sh";;
30 *sabayon*)
31 . "$QMK_FIRMWARE_UTIL_DIR/install/sabayon.sh";;
32 *slackware*)
33 . "$QMK_FIRMWARE_UTIL_DIR/install/slackware.sh";;
34 *solus*)
35 . "$QMK_FIRMWARE_UTIL_DIR/install/solus.sh";;
36 *void*)
37 . "$QMK_FIRMWARE_UTIL_DIR/install/void.sh";;
38 *)
39 echo "Sorry, we don't recognize your distribution. Help us by contributing support!"
40 echo
41 echo "https://docs.qmk.fm/#/contributing"
42 exit 1;;
43 esac
44
45 if uname -a | grep -qi microsoft; then
46 echo "********************************************************************************"
47 echo "* Detected Windows Subsystem for Linux. *"
48 echo "* Currently, WSL has no access to USB devices and so flashing from within the *"
49 echo "* WSL terminal will not work. *"
50 echo "* *"
51 echo "* Please install the QMK Toolbox instead: *"
52 echo "* https://github.com/qmk/qmk_toolbox/releases *"
53 echo "* Then, map your WSL filesystem as a network drive: *"
54 echo "* \\\\\\\\wsl$\\<distro> *"
55 echo "********************************************************************************"
56 echo
57 fi
58 ;;
59 *)
60 echo "Sorry, we don't recognize your environment. Help us by contributing support!"
61 echo
62 echo "https://docs.qmk.fm/#/contributing"
63 exit 1;;
27esac 64esac
65
66if type _qmk_install_prepare &>/dev/null; then
67 _qmk_install_prepare || exit 1
68fi
69
70_qmk_install
71
72if type _qmk_install_bootloadhid &>/dev/null; then
73 _qmk_install_bootloadhid
74fi