-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·39 lines (33 loc) · 1.14 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
#Check if script is running as root
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}Script needs to be run as root!${NC}"
exit 1
fi
#Installing required prerequisites
echo -e "${RED}Installing required prerequisites...${NC}"
apt-get update
apt-get -y install jackd2 libjack-jackd2-dev git
if [ $? -ne 0 ]; then
echo -e "${RED}apt-get failed (Are you connected to the internet?)${NC}"
fi
#Sound card/HW setup
echo -e "${RED}Configuring Hardware...${NC}"
echo -e "${RED}Disabling internal sound card...${NC}"
sed -i "s:dtparam=audio=on:#dtparam=audio=on:" /boot/config.txt
echo -e "${RED}Enable WM8731 sound card...${NC}"
if [ $(grep -c audioinjector-wm8731-audio /boot/config.txt) -eq "0" ]; then
echo "dtoverlay=audioinjector-wm8731-audio" >> /boot/config.txt
fi
echo -e "${RED}Enable spidev...${NC}"
sed -i "s:#dtparam=spi=on:dtparam=spi=on:" /boot/config.txt
#Download git submodules
echo -e "${RED}Downloading submodules...${NC}"
git submodule update --init
#Build software
echo -e "${RED}Building software...${NC}"
make -C ./Software/
#Ask to reboot
echo -e "${RED}Reboot for changes to take effect.${NC}"