-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·37 lines (29 loc) · 755 Bytes
/
build.sh
File metadata and controls
executable file
·37 lines (29 loc) · 755 Bytes
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
#!/bin/bash
set -e
if [ ! -f "/usr/include/libudev.h" ]; then
apt-get install libudev-dev
fi
if [ ! -d "host" ]; then
echo "Run this script in the folder containing build.sh" >&2
exit 1
fi
if [ ! -d "build" ]; then
mkdir build
fi
cd build
cmake ../host
make
cat << EOF > /etc/systemd/system/zynthian-stm32controller-host.service
[Unit]
Description=I/O expander for Zynthian using USB connected STM32 microcontroller
[Service]
Environment=HOME=/root
WorkingDirectory=/root
ExecStart=/zynthian/zynthian-stm32controller/build/zynthian-stm32controller-host
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
EOF
systemctl start zynthian-stm32controller-host.service
systemctl enable zynthian-stm32controller-host.service