]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/linux_install.sh
[Keymap] Add missing tap dance action and fix RGB hues in personal keymaps (#6312)
[qmk_firmware.git] / util / linux_install.sh
1 #!/bin/sh
2
3 # Note: This file uses tabs to indent. Please don't mix tabs and spaces.
4
5 GENTOO_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
7 SLACKWARE_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
9 SOLUS_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
11 if grep ID /etc/os-release | grep -qE "fedora"; then
12         sudo dnf install \
13                 arm-none-eabi-binutils-cs \
14                 arm-none-eabi-gcc-cs \
15                 arm-none-eabi-newlib \
16                 avr-binutils \
17                 avr-gcc \
18                 avr-libc \
19                 binutils-avr32-linux-gnu \
20                 dfu-util \
21                 dfu-programmer \
22                 diffutils \
23                 git \
24                 gcc \
25                 glibc-headers \
26                 kernel-devel \
27                 kernel-headers \
28                 make \
29                 perl \
30                 python3 \
31                 unzip \
32                 wget \
33                 zip
34
35 elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
36         DEBIAN_FRONTEND=noninteractive
37         DEBCONF_NONINTERACTIVE_SEEN=true
38         export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
39         sudo apt-get update
40         sudo apt-get -yq install \
41                 build-essential \
42                 avr-libc \
43                 binutils-arm-none-eabi \
44                 binutils-avr \
45                 dfu-programmer \
46                 dfu-util \
47                 diffutils \
48                 gcc \
49                 gcc-arm-none-eabi \
50                 gcc-avr \
51                 git \
52                 libnewlib-arm-none-eabi \
53                 python3 \
54                 unzip \
55                 wget \
56                 zip
57
58 elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
59         sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz
60         sudo pacman -S \
61                 arm-none-eabi-binutils \
62                 arm-none-eabi-gcc \
63                 arm-none-eabi-newlib \
64                 avrdude \
65                 avr-binutils \
66                 avr-libc \
67                 avr-gcc \
68                 base-devel \
69                 dfu-util \
70                 diffutils \
71                 gcc \
72                 git \
73                 python \
74                 unzip \
75                 wget \
76                 zip
77         git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
78         cd /tmp/dfu-programmer || exit 1
79         makepkg -sic
80         rm -rf /tmp/dfu-programmer/
81
82 elif grep ID /etc/os-release | grep -q gentoo; then
83         echo "$GENTOO_WARNING" | fmt
84         printf "\nProceed (y/N)? "
85         read -r answer
86         if echo "$answer" | grep -iq "^y"; then
87                 sudo touch /etc/portage/package.use/qmkfirmware
88                 # tee is used here since sudo doesn't apply to >>
89                 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
90                 sudo emerge -auN \
91                         app-arch/unzip \
92                         app-arch/zip \
93                         app-mobilephone/dfu-util \
94                         dev-embedded/avrdude \
95                         dev-lang/python:3.5 \
96                         net-misc/wget \
97                         sys-devel/gcc \
98                         sys-devel/crossdev
99                 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
100                 echo "Done!"
101         else
102                 echo "Quitting..."
103         fi
104
105 elif grep ID /etc/os-release | grep -q sabayon; then
106         sudo equo install \
107                 app-arch/unzip \
108                 app-arch/zip \
109                 app-mobilephone/dfu-util \
110                 dev-embedded/avrdude \
111                 dev-lang/python \
112                 net-misc/wget \
113                 sys-devel/gcc \
114                 sys-devel/crossdev
115         sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
116         echo "Done!"
117
118 elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
119         CROSS_AVR_GCC=cross-avr-gcc8
120         CROSS_ARM_GCC=cross-arm-none-gcc8
121         if grep ID /etc/os-release | grep -q "15."; then
122                 CROSS_AVR_GCC=cross-avr-gcc7
123                 CROSS_ARM_GCC=cross-arm-none-gcc7
124         fi
125         sudo zypper install \
126                 avr-libc \
127                 $CROSS_AVR_GCC \
128                 $CROSS_ARM_GCC \
129                 cross-avr-binutils \
130                 cross-arm-none-newlib-devel \
131                 cross-arm-binutils cross-arm-none-newlib-devel \
132                 dfu-tool \
133                 dfu-programmer \
134                 gcc \
135                 python3 \
136                 unzip \
137                 wget \
138                 zip
139
140 elif grep ID /etc/os-release | grep -q slackware; then
141         printf "$SLACKWARE_WARNING\n"
142         printf "\nProceed (y/N)? "
143         read -r answer
144         if echo "$answer" | grep -iq "^y" ;then
145                 sudo sboinstall \
146                         avr-binutils \
147                         avr-gcc \
148                         avr-libc \
149                         avrdude \
150                         dfu-programmer \
151                         dfu-util \
152                         arm-binutils \
153                         arm-gcc \
154                         newlib \
155                         python3
156                 echo "Done!"
157         else
158                 echo "Quitting..."
159         fi
160
161 elif grep ID /etc/os-release | grep -q solus; then
162         sudo eopkg ur
163         sudo eopkg it \
164                 -c system.devel \
165                 arm-none-eabi-gcc \
166                 arm-none-eabi-binutils \
167                 arm-none-eabi-newlib \
168                 avr-libc \
169                 avr-binutils \
170                 avr-gcc \
171                 avrdude \
172                 dfu-util \
173                 dfu-programmer \
174                 python3 \
175                 git \
176                 wget \
177                 zip \
178                 unzip
179         printf "\n$SOLUS_INFO\n"
180
181 else
182         echo "Sorry, we don't recognize your OS. Help us by contributing support!"
183         echo
184         echo "https://docs.qmk.fm/#/contributing"
185 fi