-
Notifications
You must be signed in to change notification settings - Fork 0
/
openhd_sys_utils.sh
79 lines (63 loc) · 2.14 KB
/
openhd_sys_utils.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
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
#!/bin/bash
# This script handles initial configuation, updates and misc features which aren't included in the main OpenHD executable (yet)
# debug mode (shows journaldctl on the screen when logged in)
wall <<EOF
####### ######## ######## ## ## ## ## ########
## ## ## ## ## ### ## ## ## ## ##
## ## ## ## ## #### ## ## ## ## ##
## ## ######## ###### ## ## ## ######### ## ##
## ## ## ## ## #### ## ## ## ##
## ## ## ## ## ### ## ## ## ##
####### ## ######## ## ## ## ## ########
----------------------- SysUtils -----------------------
Started!
EOF
debug_file="/boot/openhd/debug.txt"
if [ -e "$debug_file" ]; then
echo "debug mode selected"
echo "sudo journalctl -f" >> /root/.bashrc
fi
# initialise functions
if [ -f "/external/openhd/hardware_vtx_v20.txt" ]; then
sudo bash /usr/local/bin/initX20.sh
#rm /boot/openhd/hardware_vtx_v20.txt
fi
if [ -f "/boot/openhd/openhd/x86.txt" ]; then
sudo mv /boot/openhd/openhd/* /boot/openhd
fi
if [[ "$(lsb_release -cs)" == "noble" ]]; then
if [ -f "/opt/setup" ]; then
depmod -a
rm /opt/setup
sudo bash /usr/local/bin/openhd_resize_util.sh 404f7966-7c54-4170-8523-ed6a2a8da9bd 3
reboot
fi
fi
if [ -f "/boot/openhd/openhd/x86.txt" ]; then
sudo mv /boot/openhd/openhd/* /boot/openhd
fi
if [ -f "/boot/openhd/x86.txt" ]; then
sudo bash /usr/local/bin/initX86.sh
touch /usr/local/share/executed
rm /boot/openhd/x86.txt
fi
if [ -f "/boot/openhd/rock-5a.txt" ]; then
sudo bash /usr/local/bin/initRock.sh
rm /boot/openhd/rock-5a.txt
fi
if [ -f "/boot/openhd/rock-5b.txt" ]; then
sudo bash /usr/local/bin/initRock.sh
rm /boot/openhd/rock-5b.txt
fi
if [ -f "/config/openhd/rock-rk3566.txt" ]; then
echo "detected rk3566 device"
sudo bash /usr/local/bin/initRock.sh > /boot/debug.txt
if [ -f "/config/openhd/clearEMMC.txt" ]; then
bash /usr/local/bin/openhd_emmc_util clear
whiptail --msgbox "EMMC cleared Please reboot your system now" 10 40
fi
fi
if [ -f "/boot/openhd/rpi.txt" ]; then
sudo bash /usr/local/bin/initPi.sh
rm /boot/openhd/rpi.txt
fi