linux_install.sh 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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/qmkfirmware -- 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. SLACKWARE_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."
  5. SOLUS_INFO="Your tools are now installed. To start using them, open new terminal or source these scripts:\n\t/usr/share/defaults/etc/profile.d/50-arm-toolchain-path.sh\n\t/usr/share/defaults/etc/profile.d/50-avr-toolchain-path.sh"
  6. util_dir=$(dirname "$0")
  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. clang \
  17. dfu-util \
  18. dfu-programmer \
  19. diffutils \
  20. git \
  21. gcc \
  22. glibc-headers \
  23. kernel-devel \
  24. kernel-headers \
  25. make \
  26. perl \
  27. python3 \
  28. unzip \
  29. wget \
  30. zip
  31. elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
  32. DEBIAN_FRONTEND=noninteractive
  33. DEBCONF_NONINTERACTIVE_SEEN=true
  34. export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
  35. sudo apt-get update
  36. sudo apt-get -yq install \
  37. build-essential \
  38. avr-libc \
  39. binutils-arm-none-eabi \
  40. binutils-avr \
  41. clang-format \
  42. dfu-programmer \
  43. dfu-util \
  44. diffutils \
  45. gcc \
  46. gcc-arm-none-eabi \
  47. gcc-avr \
  48. git \
  49. libnewlib-arm-none-eabi \
  50. python3 \
  51. unzip \
  52. wget \
  53. zip
  54. elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
  55. sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz
  56. sudo pacman -S \
  57. arm-none-eabi-binutils \
  58. arm-none-eabi-gcc \
  59. arm-none-eabi-newlib \
  60. avrdude \
  61. avr-binutils \
  62. avr-libc \
  63. avr-gcc \
  64. base-devel \
  65. clang \
  66. dfu-util \
  67. diffutils \
  68. gcc \
  69. git \
  70. python \
  71. unzip \
  72. wget \
  73. zip
  74. git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
  75. cd /tmp/dfu-programmer || exit 1
  76. makepkg -sic
  77. rm -rf /tmp/dfu-programmer/
  78. elif grep ID /etc/os-release | grep -q gentoo; then
  79. echo "$GENTOO_WARNING" | fmt
  80. printf "\nProceed (y/N)? "
  81. read -r answer
  82. if echo "$answer" | grep -iq "^y"; then
  83. sudo touch /etc/portage/package.use/qmkfirmware
  84. # tee is used here since sudo doesn't apply to >>
  85. echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
  86. sudo emerge -auN \
  87. app-arch/unzip \
  88. app-arch/zip \
  89. app-mobilephone/dfu-util \
  90. dev-embedded/avrdude \
  91. dev-lang/python:3.5 \
  92. net-misc/wget \
  93. sys-devel/clang \
  94. sys-devel/gcc \
  95. sys-devel/crossdev
  96. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  97. echo "Done!"
  98. else
  99. echo "Quitting..."
  100. fi
  101. elif grep ID /etc/os-release | grep -q sabayon; then
  102. sudo equo install \
  103. app-arch/unzip \
  104. app-arch/zip \
  105. app-mobilephone/dfu-util \
  106. dev-embedded/avrdude \
  107. dev-lang/python \
  108. net-misc/wget \
  109. sys-devel/clang \
  110. sys-devel/gcc \
  111. sys-devel/crossdev
  112. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  113. echo "Done!"
  114. elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
  115. CROSS_AVR_GCC=cross-avr-gcc8
  116. CROSS_ARM_GCC=cross-arm-none-gcc8
  117. if grep ID /etc/os-release | grep -q "15."; then
  118. CROSS_AVR_GCC=cross-avr-gcc7
  119. CROSS_ARM_GCC=cross-arm-none-gcc7
  120. fi
  121. sudo zypper install \
  122. avr-libc \
  123. clang \
  124. $CROSS_AVR_GCC \
  125. $CROSS_ARM_GCC \
  126. cross-avr-binutils \
  127. cross-arm-none-newlib-devel \
  128. cross-arm-binutils cross-arm-none-newlib-devel \
  129. dfu-tool \
  130. dfu-programmer \
  131. gcc \
  132. python3 \
  133. unzip \
  134. wget \
  135. zip
  136. elif grep ID /etc/os-release | grep -q slackware; then
  137. printf "$SLACKWARE_WARNING\n"
  138. printf "\nProceed (y/N)? "
  139. read -r answer
  140. if echo "$answer" | grep -iq "^y" ;then
  141. sudo sboinstall \
  142. avr-binutils \
  143. avr-gcc \
  144. avr-libc \
  145. avrdude \
  146. dfu-programmer \
  147. dfu-util \
  148. arm-binutils \
  149. arm-gcc \
  150. newlib \
  151. python3
  152. echo "Done!"
  153. else
  154. echo "Quitting..."
  155. fi
  156. elif grep ID /etc/os-release | grep -q solus; then
  157. sudo eopkg ur
  158. sudo eopkg it \
  159. -c system.devel \
  160. arm-none-eabi-gcc \
  161. arm-none-eabi-binutils \
  162. arm-none-eabi-newlib \
  163. avr-libc \
  164. avr-binutils \
  165. avr-gcc \
  166. avrdude \
  167. dfu-util \
  168. dfu-programmer \
  169. python3 \
  170. git \
  171. wget \
  172. zip \
  173. unzip
  174. printf "\n$SOLUS_INFO\n"
  175. else
  176. echo "Sorry, we don't recognize your OS. Help us by contributing support!"
  177. echo
  178. echo "https://docs.qmk.fm/#/contributing"
  179. fi
  180. # Global install tasks
  181. pip3 install -r ${util_dir}/../requirements.txt