aboutsummaryrefslogtreecommitdiff
path: root/util/linux_install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/linux_install.sh')
-rwxr-xr-xutil/linux_install.sh176
1 files changed, 146 insertions, 30 deletions
diff --git a/util/linux_install.sh b/util/linux_install.sh
index 0703db8f1..d6e6b86cd 100755
--- a/util/linux_install.sh
+++ b/util/linux_install.sh
@@ -1,40 +1,156 @@
1#!/bin/sh 1#!/bin/sh
2if grep ID /etc/os-release | grep -q rhel; then 2
3 # RPM based OS 3# Note: This file uses tabs to indent. Please don't mix tabs and spaces.
4 sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc \ 4
5 avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs \ 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/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 arm-none-eabi-binutils-cs arm-none-eabi-newlib 6
7elif grep ID /etc/os-release | grep -q debian; then 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
9if 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 unzip \
29 wget \
30 zip
31
32elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
33 DEBIAN_FRONTEND=noninteractive
34 DEBCONF_NONINTERACTIVE_SEEN=true
35 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
8 sudo apt-get update 36 sudo apt-get update
9 sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc \ 37 sudo apt-get install \
10 dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \ 38 build-essential \
11 libnewlib-arm-none-eabi 39 avr-libc \
12elif grep ID /etc/os-release | grep -q arch; then 40 binutils-arm-none-eabi \
13 sudo pacman -S gcc unzip wget zip avr-gcc avr-binutils avr-libc \ 41 binutils-avr \
14 dfu-util arm-none-eabi-gcc arm-none-eabi-binutils \ 42 dfu-programmer \
15 arm-none-eabi-newlib 43 dfu-util \
44 diffutils \
45 gcc \
46 gcc-arm-none-eabi \
47 gcc-avr \
48 git \
49 libnewlib-arm-none-eabi \
50 unzip \
51 wget \
52 zip
53
54elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
55 # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug.
56 sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz
57 sudo pacman -S \
58 arm-none-eabi-binutils \
59 arm-none-eabi-gcc \
60 arm-none-eabi-newlib \
61 avr-binutils \
62 avr-libc \
63 avr-gcc \
64 base-devel \
65 dfu-util \
66 diffutils \
67 gcc \
68 git \
69 unzip \
70 wget \
71 zip
16 git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer 72 git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
17 cd /tmp/dfu-programmer 73 cd /tmp/dfu-programmer || exit 1
18 makepkg -sic 74 makepkg -sic
19 rm -rf /tmp/dfu-programmer/ 75 rm -rf /tmp/dfu-programmer/
76
20elif grep ID /etc/os-release | grep -q gentoo; then 77elif grep ID /etc/os-release | grep -q gentoo; then
21 echo "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." 78 echo "$GENTOO_WARNING" | fmt
22 echo -n "Proceed (y/N)? " 79 printf "\nProceed (y/N)? "
23 old_stty_cfg=$(stty -g) 80 read -r answer
24 stty raw -echo 81 if echo "$answer" | grep -iq "^y"; then
25 answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) 82 sudo touch /etc/portage/package.use/qmkfirmware
26 stty $old_stty_cfg 83 # tee is used here since sudo doesn't apply to >>
27 if echo "$answer" | grep -iq "^y" ;then 84 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
28 sudo touch /etc/portage/package.use/qmkfirmware 85 sudo emerge -auN \
29 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null 86 app-arch/unzip \
30 sudo emerge -auN sys-devel/gcc app-arch/unzip app-arch/zip net-misc/wget app-mobilephone/dfu-util sys-devel/crossdev dev-embedded/avrdude 87 app-arch/zip \
31 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr 88 app-mobilephone/dfu-util \
32 echo Done! 89 dev-embedded/avrdude \
33 else 90 net-misc/wget \
34 echo "Quitting..." 91 sys-devel/gcc \
35fi 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
99elif 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
111elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
112 CROSS_AVR_GCC=cross-avr-gcc8
113 CROSS_ARM_GCC=cross-arm-none-gcc8
114 if grep ID /etc/os-release | grep -q "15.0"; then
115 CROSS_AVR_GCC=cross-avr-gcc7
116 CROSS_ARM_GCC=cross-arm-none-gcc7
117 fi
118 sudo zypper install \
119 avr-libc \
120 $CROSS_AVR_GCC \
121 $CROSS_ARM_GCC \
122 cross-avr-binutils \
123 cross-arm-none-newlib-devel \
124 cross-arm-binutils cross-arm-none-newlib-devel \
125 dfu-tool \
126 dfu-programmer \
127 gcc \
128 unzip \
129 wget \
130 zip
131
132elif grep ID /etc/os-release | grep -q slackware; then
133 printf "$SLACKWARE_WARNING\n"
134 printf "\nProceed (y/N)? "
135 read -r answer
136 if echo "$answer" | grep -iq "^y" ;then
137 sudo sboinstall \
138 avr-binutils \
139 avr-gcc \
140 avr-libc \
141 avrdude \
142 dfu-programmer \
143 dfu-util \
144 arm-binutils \
145 arm-gcc \
146 newlib
147 echo "Done!"
148 else
149 echo "Quitting..."
150 fi
151
36else 152else
37 echo "Sorry, we don't recognize your OS. Help us by contributing support!" 153 echo "Sorry, we don't recognize your OS. Help us by contributing support!"
38 echo 154 echo
39 echo "https://docs.qmk.fm/contributing.html" 155 echo "https://docs.qmk.fm/#/contributing"
40fi 156fi