aboutsummaryrefslogtreecommitdiff
path: root/util/linux_install.sh
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-11-27 01:37:54 +1100
committerGitHub <noreply@github.com>2020-11-26 14:37:54 +0000
commitc21d5a09735e84412ee5b3efb4c3f5d3fc734393 (patch)
treec2b8405f45fb6f00b063561056fca4c5aad28bf8 /util/linux_install.sh
parent3afe0ea9b9f67ae33f54c1393b15d988764241a2 (diff)
downloadqmk_firmware-c21d5a09735e84412ee5b3efb4c3f5d3fc734393.tar.gz
qmk_firmware-c21d5a09735e84412ee5b3efb4c3f5d3fc734393.zip
Refactor qmk_install.sh (#10681)
Diffstat (limited to 'util/linux_install.sh')
-rwxr-xr-xutil/linux_install.sh251
1 files changed, 0 insertions, 251 deletions
diff --git a/util/linux_install.sh b/util/linux_install.sh
deleted file mode 100755
index fb8968386..000000000
--- a/util/linux_install.sh
+++ /dev/null
@@ -1,251 +0,0 @@
1#!/bin/sh
2
3# Note: This file uses tabs to indent. Please don't mix tabs and spaces.
4
5GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmkfirmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki."
6
7SLACKWARE_WARNING="You will need the following packages from slackbuilds.org:\n\tarm-binutils\n\tarm-gcc\n\tavr-binutils\n\tavr-gcc\n\tavr-libc\n\tavrdude\n\tdfu-programmer\n\tdfu-util\n\tnewlib\nThese packages will be installed with sudo and sboinstall, so ensure that your user is added to sudoers and that sboinstall is configured."
8
9SOLUS_INFO="Your tools are now installed. To start using them, open new terminal or source these scripts:\n\t/usr/share/defaults/etc/profile.d/50-arm-toolchain-path.sh\n\t/usr/share/defaults/etc/profile.d/50-avr-toolchain-path.sh"
10
11util_dir=$(dirname "$0")
12
13# For those distros that do not package bootloadHID
14install_bootloadhid() {
15 if ! command -v bootloadHID >/dev/null; then
16 wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp
17 cd /tmp/bootloadHID.2012-12-08/commandline/
18 if make; then
19 sudo cp bootloadHID /usr/local/bin
20 fi
21 cd -
22 fi
23}
24
25if grep ID /etc/os-release | grep -qE "fedora"; then
26 sudo dnf install \
27 arm-none-eabi-binutils-cs \
28 arm-none-eabi-gcc-cs \
29 arm-none-eabi-newlib \
30 avr-binutils \
31 avr-gcc \
32 avr-libc \
33 binutils-avr32-linux-gnu \
34 clang \
35 avrdude \
36 dfu-util \
37 dfu-programmer \
38 diffutils \
39 git \
40 gcc \
41 glibc-headers \
42 kernel-devel \
43 kernel-headers \
44 libusb-devel \
45 make \
46 perl \
47 python3 \
48 unzip \
49 wget \
50 zip
51
52elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
53 DEBIAN_FRONTEND=noninteractive
54 DEBCONF_NONINTERACTIVE_SEEN=true
55 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
56 sudo apt-get update
57 sudo apt-get -yq install \
58 build-essential \
59 avr-libc \
60 binutils-arm-none-eabi \
61 binutils-avr \
62 clang-format \
63 dfu-programmer \
64 dfu-util \
65 diffutils \
66 gcc \
67 gcc-arm-none-eabi \
68 gcc-avr \
69 git \
70 libnewlib-arm-none-eabi \
71 avrdude \
72 libusb-dev \
73 python3 \
74 python3-pip \
75 unzip \
76 wget \
77 zip
78
79elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
80 sudo pacman --needed -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz
81 sudo pacman -S --needed \
82 arm-none-eabi-binutils \
83 arm-none-eabi-gcc \
84 arm-none-eabi-newlib \
85 avrdude \
86 avr-binutils \
87 avr-libc \
88 base-devel \
89 clang \
90 dfu-programmer \
91 dfu-util \
92 diffutils \
93 gcc \
94 git \
95 libusb-compat \
96 python \
97 python-pip \
98 unzip \
99 wget \
100 zip
101
102elif grep ID /etc/os-release | grep -q gentoo; then
103 echo "$GENTOO_WARNING" | fmt
104 printf "\nProceed (y/N)? "
105 read -r answer
106 if echo "$answer" | grep -iq "^y"; then
107 sudo touch /etc/portage/package.use/qmkfirmware
108 # tee is used here since sudo doesn't apply to >>
109 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
110 sudo emerge -auN sys-devel/gcc
111 sudo emerge -au --noreplace \
112 app-arch/unzip \
113 app-arch/zip \
114 app-mobilephone/dfu-util \
115 dev-embedded/dfu-programmer \
116 dev-embedded/avrdude \
117 net-misc/wget \
118 sys-devel/clang \
119 sys-devel/crossdev
120 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr
121 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi
122 echo "Done!"
123 else
124 echo "Quitting..."
125 fi
126
127elif grep ID /etc/os-release | grep -q sabayon; then
128 sudo equo install \
129 app-arch/unzip \
130 app-arch/zip \
131 app-mobilephone/dfu-util \
132 dev-embedded/dfu-programmer \
133 dev-embedded/avrdude \
134 dev-lang/python \
135 net-misc/wget \
136 sys-devel/clang \
137 sys-devel/gcc \
138 sys-devel/crossdev
139 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr
140 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi
141 echo "Done!"
142
143elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
144 CROSS_AVR_GCC=cross-avr-gcc8
145 CROSS_ARM_GCC=cross-arm-none-gcc8
146 if grep ID /etc/os-release | grep -q "15."; then
147 CROSS_AVR_GCC=cross-avr-gcc7
148 CROSS_ARM_GCC=cross-arm-none-gcc7
149 fi
150 sudo zypper install \
151 avr-libc \
152 clang \
153 $CROSS_AVR_GCC \
154 $CROSS_ARM_GCC \
155 cross-avr-binutils \
156 cross-arm-none-newlib-devel \
157 cross-arm-binutils cross-arm-none-newlib-devel \
158 avrdude \
159 dfu-util \
160 dfu-programmer \
161 gcc \
162 libusb-devel \
163 python3 \
164 unzip \
165 wget \
166 zip
167
168elif grep ID /etc/os-release | grep -q slackware; then
169 printf "$SLACKWARE_WARNING\n"
170 printf "\nProceed (y/N)? "
171 read -r answer
172 if echo "$answer" | grep -iq "^y" ;then
173 sudo sboinstall \
174 avr-binutils \
175 avr-gcc \
176 avr-libc \
177 avrdude \
178 dfu-programmer \
179 dfu-util \
180 arm-binutils \
181 arm-gcc \
182 newlib \
183 python3
184 echo "Done!"
185 else
186 echo "Quitting..."
187 fi
188
189elif grep ID /etc/os-release | grep -q solus; then
190 sudo eopkg ur
191 sudo eopkg it \
192 -c system.devel \
193 arm-none-eabi-gcc \
194 arm-none-eabi-binutils \
195 arm-none-eabi-newlib \
196 avr-libc \
197 avr-binutils \
198 avr-gcc \
199 avrdude \
200 dfu-util \
201 dfu-programmer \
202 libusb-devel \
203 python3 \
204 git \
205 wget \
206 zip \
207 unzip
208 printf "\n$SOLUS_INFO\n"
209
210elif grep ID /etc/os-release | grep -q void; then
211 sudo xbps-install \
212 avr-binutils \
213 avr-gcc \
214 avr-libc \
215 cross-arm-none-eabi-binutils \
216 cross-arm-none-eabi-gcc \
217 cross-arm-none-eabi-newlib \
218 avrdude \
219 dfu-programmer \
220 dfu-util \
221 gcc \
222 git \
223 libusb-compat-devel \
224 make \
225 wget \
226 unzip \
227 zip
228
229else
230 echo "Sorry, we don't recognize your OS. Help us by contributing support!"
231 echo
232 echo "https://docs.qmk.fm/#/contributing"
233fi
234
235# Global install tasks
236install_bootloadhid
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