]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/linux_install.sh
Make linux_install.sh work with openSUSE Leap 15.0 (#4218)
[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 if grep ID /etc/os-release | grep -qE "fedora"; then
8         sudo dnf install \
9                 arm-none-eabi-binutils-cs \
10                 arm-none-eabi-gcc-cs \
11                 arm-none-eabi-newlib \
12                 avr-binutils \
13                 avr-gcc \
14                 avr-libc \
15                 binutils-avr32-linux-gnu \
16                 dfu-util \
17                 dfu-programmer \
18                 diffutils \
19                 git \
20                 gcc \
21                 glibc-headers \
22                 kernel-devel \
23                 kernel-headers \
24                 make \
25                 perl \
26                 unzip \
27                 wget \
28                 zip
29
30 elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
31         DEBIAN_FRONTEND=noninteractive
32         DEBCONF_NONINTERACTIVE_SEEN=true
33         export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
34         sudo apt-get update
35         sudo apt-get install \
36                 build-essential \
37                 avr-libc \
38                 binutils-arm-none-eabi \
39                 binutils-avr \
40                 dfu-programmer \
41                 dfu-util \
42                 diffutils \
43                 gcc \
44                 gcc-arm-none-eabi \
45                 gcc-avr \
46                 git \
47                 libnewlib-arm-none-eabi \
48                 unzip \
49                 wget \
50                 zip
51
52 elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
53         # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug.
54         sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz
55         sudo pacman -S \
56                 arm-none-eabi-binutils \
57                 arm-none-eabi-gcc \
58                 arm-none-eabi-newlib \
59                 avr-binutils \
60                 avr-libc \
61                 avr-gcc \
62     base-devel \
63                 dfu-util \
64                 diff-utils \
65                 gcc \
66                 git \
67                 unzip \
68                 wget \
69                 zip
70         git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
71         cd /tmp/dfu-programmer
72         makepkg -sic
73         rm -rf /tmp/dfu-programmer/
74
75 elif grep ID /etc/os-release | grep -q gentoo; then
76         echo GENTOO_WARNING | fmt
77         echo -n "Proceed (y/N)? "
78         old_stty_cfg=$(stty -g)
79         stty raw -echo
80         answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
81         stty $old_stty_cfg
82         if echo "$answer" | grep -iq "^y" ;then
83                 sudo touch /etc/portage/package.use/qmkfirmware
84                 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null
85                 sudo emerge -auN \
86                         app-arch/unzip \
87                         app-arch/zip \
88                         app-mobilephone/dfu-util \
89                         net-misc/wget \
90                         sys-devel/gcc \
91                         sys-devel/crossdev dev-embedded/avrdude
92                 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
93                 echo Done!
94         else
95                 echo "Quitting..."
96         fi
97
98 elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
99         CROSS_AVR_GCC=cross-avr-gcc8
100         if grep ID /etc/os-release | grep -q "15.0"; then
101                 CROSS_AVR_GCC=cross-avr-gcc7
102         fi
103         sudo zypper install \
104                 avr-libc \
105                 $CROSS_AVR_GCC \
106                 cross-avr-binutils \
107                 cross-arm-none-newlib-devel \
108                 cross-arm-binutils cross-arm-none-newlib-devel \
109                 dfu-tool \
110                 dfu-programmer \
111                 gcc \
112                 unzip \
113                 wget \
114                 zip
115
116 else
117         echo "Sorry, we don't recognize your OS. Help us by contributing support!"
118         echo
119         echo "https://docs.qmk.fm/#/contributing"
120 fi