-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy path02-run-chroot.sh
36 lines (31 loc) · 1.39 KB
/
02-run-chroot.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
#!/bin/bash
# This runs in context if the image (CHROOT)
# Any native compilation can be done here
# Do not use log here, it will end up in the image
# Here we do simple platform detection for OpenHD with creating a few folders
rm -Rf /opt/additionalFiles
echo "alias led='led_sys.sh'" | sudo tee -a /etc/bash.bashrc >/dev/null
if [[ "${OS}" == "radxa-debian-rock5a" ]]; then
mkdir -p /usr/local/share/openhd_platform/rock/rock5a
touch /boot/openhd/rock-5a.txt
elif [[ "${OS}" == "radxa-debian-rock5b" ]]; then
mkdir -p /usr/local/share/openhd_platform/rock/rock5b
touch /boot/openhd/rock-5b.txt
elif [[ "${OS}" == "radxa-debian-rock-cm3" ]]; then
touch /conf/openhd/rock-rk3566.txt
mkdir -p /usr/local/share/openhd/platform/rock/rk3566
touch /conf/openhd/resize.txt
elif [[ "${OS}" == "radxa-debian-rock-cm3-core3566" ]]; then
touch /conf/openhd/rock-rk3566.txt
touch /conf/openhd/resize.txt
elif [[ "${OS}" == "raspbian" ]]; then
mkdir -p /usr/local/share/openhd_platform/rpi/
echo "options rtl88x2eu_ohd rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0" | sudo tee /etc/modprobe.d/realtek_88x2eu.conf > /dev/null
elif [[ "${OS}" == "debian-X20" ]]; then
mkdir -p /usr/local/share/openhd_platform/x20
mkdir -p /conf/openhd/Videos
touch /conf/openhd/Videos/external_video_part.txt
touch /conf/openhd/hardware_vtx_v20.txt
elif [[ "${OS}" == "ubuntu-x86" ]]; then
mkdir -p /usr/local/share/openhd_platform/x86
fi