]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/linux_install.sh
0e4e26fd96a70ea1bb083b1acd23fed1a965a2fc
[qmk_firmware.git] / util / linux_install.sh
1 #!/bin/sh
2 if grep ID /etc/os-release | grep -qE "rhel|fedora"; then
3         # RPM based OS
4         sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc \
5             avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs \
6             arm-none-eabi-binutils-cs arm-none-eabi-newlib
7 elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
8         sudo apt-get update
9         sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc \
10             dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \
11             libnewlib-arm-none-eabi
12 elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
13   # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug.
14   sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz
15         sudo pacman -S gcc unzip wget zip avr-binutils avr-libc \
16             dfu-util arm-none-eabi-gcc arm-none-eabi-binutils \
17             arm-none-eabi-newlib
18         git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
19         cd /tmp/dfu-programmer
20         makepkg -sic
21         rm -rf /tmp/dfu-programmer/
22 elif grep ID /etc/os-release | grep -q gentoo; then
23   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."
24   echo -n "Proceed (y/N)? "
25   old_stty_cfg=$(stty -g)
26   stty raw -echo
27   answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
28   stty $old_stty_cfg
29     if echo "$answer" | grep -iq "^y" ;then
30       sudo touch /etc/portage/package.use/qmkfirmware
31       echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null
32       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
33       sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
34       echo Done!
35     else
36     echo "Quitting..."
37 fi
38 else
39         echo "Sorry, we don't recognize your OS. Help us by contributing support!"
40         echo
41         echo "https://docs.qmk.fm/#/contributing"
42 fi