-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·124 lines (91 loc) · 2.74 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·124 lines (91 loc) · 2.74 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
echo
echo "Installing display by WEEE Open"
# Check for root privileges
if [ "$EUID" -ne 0 ]; then
echo "This script needs to run with sudo."
exec sudo "$0" "$@" # Re-run the script with sudo
exit 1
fi
echo "Installing git, MPlayer, fbi and rpd-plym-splash"
apt update && apt upgrade -y && apt install -y git mplayer fbi rpd-plym-splash
echo "Creating /opt/display"
mkdir /opt/display
cd /opt/display
echo "Cloning"
git clone https://github.com/WEEE-Open/display.git /opt/display
chmod +x *
echo "Enabling HDMI hotplug"
echo "hdmi_force_hotplug=1" >> /boot/firmware/config.txt
echo "Enabling TC35873"
echo "dtoverlay=tc358743" >> /boot/firmware/config.txt
echo "Setting resolution"
sed -i '1s/$/ video=HDMI-A-1:800x480M@25/' /boot/firmware/cmdline.txt
echo "Enabling autologin"
raspi-config nonint do_boot_behaviour B2
AUTOLOGIN_HOME=$(getent passwd $(grep -oP '(?<=--autologin\s)\w+' /etc/systemd/system/getty@tty1.service.d/autologin.conf) | cut -d: -f6)
echo "Copying systemd service"
cp display.service /etc/systemd/system/
echo "Enabling systemd service"
systemctl daemon-reload
systemctl enable display
echo "Adding splash screen"
cp splashscreen.png /usr/share/plymouth/themes/pix/splash.png
raspi-config nonint do_boot_splash 0
echo "sudo fbi -T 1 -d /dev/fb0 -noverbose -a /opt/display/novideo.png" >> "$AUTOLOGIN_HOME/.bashrc"
touch "$AUTOLOGIN_HOME/.hushlogin"
read -p "Would you like to disable non-essential proceses (including networking)? [y/n]: " choice
case "${choice,,}" in
y|yes)
echo "Disabling non-essential proceses"
systemctl disable avahi-daemon
systemctl disable bluetooth
systemctl disable ModemManager
systemctl disable NetworkManager
systemctl disable NetworkManager-wait-online.service
systemctl disable dphys-swapfile
systemctl disable rpi-eeprom-update
systemctl disable ssh
systemctl disable triggerhappy
systemctl disable cron
systemctl disable polkit
systemctl disable systemd-journal-flush
systemctl disable systemd-timesyncd
;;
n|no)
echo "Skipping"
;;
*)
echo "Invalid input. Please enter y or n."
;;
esac
read -p "Would you like to lock the filesystem to preven overwrite? [y/n]: " choice
case "${choice,,}" in
y|yes)
echo "Locking file system"
raspi-config nonint do_overlayfs 0
sudo reboot
;;
n|no)
;;
*)
echo "Invalid input. Please enter y or n."
;;
esac
echo
echo
echo "Everything is configured and will work at next boot"
read -p "Would you like to reboot the system now? [y/n]: " choice
case "${choice,,}" in
y|yes)
echo "Rebooting the system..."
sudo reboot
;;
n|no)
;;
*)
echo "Invalid input. Please enter y or n."
;;
esac
echo "Everything done, goodbye."
#ASD