]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/linux_install.sh
Add distro support for sabayon (#4320)
[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                         dev-embedded/avrdude \
90                         net-misc/wget \
91                         sys-devel/gcc \
92                         sys-devel/crossdev
93                 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
94                 echo "Done!"
95         else
96                 echo "Quitting..."
97         fi
98
99 elif grep ID /etc/os-release | grep -q sabayon; then
100         sudo equo install \
101                 app-arch/unzip \
102                 app-arch/zip \
103                 app-mobilephone/dfu-util \
104                 dev-embedded/avrdude \
105                 net-misc/wget \
106                 sys-devel/gcc \
107                 sys-devel/crossdev
108         sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
109         echo "Done!"
110
111 elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
112         CROSS_AVR_GCC=cross-avr-gcc8
113         if grep ID /etc/os-release | grep -q "15.0"; then
114                 CROSS_AVR_GCC=cross-avr-gcc7
115         fi
116         sudo zypper install \
117                 avr-libc \
118                 $CROSS_AVR_GCC \
119                 cross-avr-binutils \
120                 cross-arm-none-newlib-devel \
121                 cross-arm-binutils cross-arm-none-newlib-devel \
122                 dfu-tool \
123                 dfu-programmer \
124                 gcc \
125                 unzip \
126                 wget \
127                 zip
128
129 else
130         echo "Sorry, we don't recognize your OS. Help us by contributing support!"
131         echo
132         echo "https://docs.qmk.fm/#/contributing"
133 fi