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