-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·69 lines (57 loc) · 2.26 KB
/
setup.sh
File metadata and controls
executable file
·69 lines (57 loc) · 2.26 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
ALPINE_URL=https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/armhf/
ALPINE_VERSION=alpine-minirootfs-3.20.3-armhf.tar.gz
#cd ./buildroot-simpleaudio
# Clone Simple Audio HifiberryOS external configuration only if the folder doesn't exist
if [ ! -d "./hifiberry-os-simpleaudio" ]; then
echo "Cloning Simple Audio HifiberryOS external configuration"
git clone https://github.com/LarsGrootkarzijn/hifiberry-os-simpleaudio.git
fi
if [ ! -d "./output" ]; then
echo "Create output directory"
mkdir ./output
fi
# Run get-buildroot only if the buildroot folder does not exist
if [ ! -d "./buildroot" ]; then
echo "Run get-buildroot from HifiberryOS, as we need a compatible version with HifiberryOS"
cd ./hifiberry-os-simpleaudio
./get-buildroot
cd ..
fi
# Create symbolic link only if it doesn't already exist
if [ ! -L "./hifiberry-os" ]; then
ln -s hifiberry-os-simpleaudio hifiberry-os
fi
if [ ! -d "./ti-sdk" ]; then
echo "Getting TI-SDK"
mkdir ./ti-sdk
cd ./ti-sdk
wget https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-1BUptXj3op/09.01.00.001/ti-processor-sdk-linux-am335x-evm-09.01.00.001-Linux-x86-Install.bin
chmod a+x ./ti-processor-sdk-linux-am335x-evm-09.01.00.001-Linux-x86-Install.bin
./ti-processor-sdk-linux-am335x-evm-09.01.00.001-Linux-x86-Install.bin --prefix ./ --mode unattended
cd ..
fi
if [ ! -d "./initramfs" ]; then
echo "Getting initramfs Alpine"
mkdir ./initramfs
cd ./initramfs
wget $ALPINE_URL$ALPINE_VERSION
tar -xf ./$ALPINE_VERSION
rm ./$ALPINE_VERSION
find . -print0 | cpio --null -ov --format=newc | gzip -9 > initramfs.cpio.gz
fi
echo "Set Simple Audio Kernel config"
cp ./configs/kernel/.config ./ti-sdk/board-support/ti-linux-kernel-6.1.46+gitAUTOINC+1d4b5da681-g1d4b5da681/.config
if [ $? -ne 0 ]; then
echo "Failed to copy kernel config."
fi
echo "Placing Roomplayer DTS in DTS boot folder."
cp ./device-trees/kernel/roomplayer.dts ./ti-sdk/board-support/ti-linux-kernel-6.1.46+gitAUTOINC+1d4b5da681-g1d4b5da681/arch/arm/boot/dts/
if [ $? -ne 0 ]; then
echo "Failed to copy roomplayer.dts to the boot folder."
fi
echo "Set Simple Audio Buildroot config"
cp ./configs/buildroot/.config ./buildroot/.config
if [ $? -ne 0 ]; then
echo "Failed to copy Buildroot config."
fi