linux_install.sh 3.1 KB

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