qmk

QMK Firmware
git clone git://git.z3bra.org/qmk.git
Log | Files | Refs | Submodules | LICENSE

linux_install.sh (5135B)


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