-
Notifications
You must be signed in to change notification settings - Fork 14
/
getvbit2
executable file
·69 lines (54 loc) · 2.15 KB
/
getvbit2
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
if [ ! -f /etc/rpi-issue ]; then
echo "This installer is intended for Raspberry Pi OS only"
exit 1
fi
# install required packages
sudo apt update
sudo apt -y install git subversion dialog python3-dialog
if (( $(lsb_release -r | tr -dc '0-9') > 11 )); then
# bookworm
sudo apt -y install libraspberrypi-dev
# Disable the KMS graphics driver
sudo sed -i s/dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/ /boot/firmware/config.txt
if ! grep -q "sdtv_mode" /boot/firmware/config.txt; then
sudo sed -i -e $'$a\\\nsdtv_mode=2' /boot/firmware/config.txt
fi
if ! grep -q "enable_tvout" /boot/firmware/config.txt; then
sudo sed -i -e $'$a\\\nenable_tvout=1' /boot/firmware/config.txt
fi
else
# System sets SD video on bootup
sudo sed -i s/#sdtv_mode/sdtv_mode/ /boot/config.txt
# Disable the new KMS graphics driver in bullseye
sudo sed -i s/dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/ /boot/config.txt
fi
# download the raspi-teletext git repository and compile it
git clone https://github.com/ali1234/raspi-teletext.git $HOME/raspi-teletext
cd $HOME/raspi-teletext
make
# download the vbit2 git repository
git clone https://github.com/peterkvt80/vbit2.git $HOME/vbit2
cd $HOME/vbit2
# switch to the latest release branch and compile it
latestTag=`curl --silent "https://api.github.com/repos/peterkvt80/vbit2/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'`
git checkout $latestTag
make
# create links
mkdir -p $HOME/.local/bin
ln -s -f `pwd`/vbit2 $HOME/.local/bin/
ln -s -f `pwd`/scripts/runvbit2.py $HOME/.local/bin/runvbit2
ln -s -f `pwd`/scripts/teletext-update.py $HOME/.local/bin/teletext-update
ln -s -f `pwd`/scripts/vbit-config.py $HOME/.local/bin/vbit-config
# install systemd user scripts
mkdir -p $HOME/.local/share/systemd/user
cp vbit2.service $HOME/.local/share/systemd/user
cp teletext-update.timer $HOME/.local/share/systemd/user
cp teletext-update.service $HOME/.local/share/systemd/user
mkdir -p $HOME/.config/systemd/user/
systemctl --user daemon-reload
loginctl enable-linger
if [[ ! $PATH =~ "$HOME/.local/bin" ]]; then
PATH="$HOME/.local/bin:$PATH"
fi
vbit-config