avr_setup.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/env bash
  2. # This script will attempt to setup the Linux dependencies for compiling QMK/TMK
  3. # This could probably go much lower, but since we are including an Arch vagrant,
  4. # making it the first match makes sense
  5. if [[ -n "$(type -P pacman )" ]]; then
  6. # Arch linux and derivatives like Apricity
  7. # Future improvements:
  8. # Allow user to speed up package installs using powerpill/wget tweaks
  9. # Always run the pacman mirror update script if possible when vagrant comes up
  10. # This will ensure that users never get stalled on a horribly slow mirror
  11. pacman -Syyu --needed --noconfirm
  12. pacman -S --needed --noconfirm \
  13. base-devel \
  14. avr-gcc \
  15. avr-binutils \
  16. avr-libc \
  17. dfu-util
  18. elif [[ -n "$(type -P apt-get)" ]]; then
  19. # Debian and derivatives
  20. # This block performs completely non-interactive updates {{
  21. export DEBIAN_FRONTEND=noninteractive
  22. export DEBCONF_NONINTERACTIVE_SEEN=true
  23. echo "grub-pc hold" | dpkg --set-selections
  24. apt-get -y update
  25. apt-get -y --allow-unauthenticated upgrade \
  26. -o Dpkg::Options::="--force-confdef" \
  27. -o Dpkg::Options::="--force-confold"
  28. # }}
  29. apt-get install -y \
  30. build-essential \
  31. gcc \
  32. unzip \
  33. wget \
  34. zip \
  35. gcc-avr \
  36. binutils-avr \
  37. avr-libc \
  38. dfu-programmer \
  39. dfu-util
  40. elif [[ -n "$(type -P yum)" ]]; then
  41. # Fedora, CentOS or RHEL and derivatives
  42. yum -y makecache && yum -y update
  43. yum -y install \
  44. gcc \
  45. glibc-headers \
  46. kernel-devel \
  47. kernel-headers \
  48. make \
  49. perl \
  50. git \
  51. wget \
  52. avr-binutils \
  53. avr-gcc \
  54. avr-libc \
  55. dfu-programmer \
  56. dfu-util
  57. elif [[ -n "$(type -P zypper)" ]]; then
  58. # openSUSE
  59. zypper --non-interactive refresh && zypper --non-interactive update
  60. zypper --non-interactive install \
  61. git \
  62. make \
  63. gcc \
  64. kernel-devel \
  65. patch \
  66. wget \
  67. dfu-programmer
  68. fi