chore: add better dietpi support to installer (#204)

This commit is contained in:
Patrick Gehrsitz 2023-11-13 21:21:33 +01:00 committed by GitHub
parent 2d53cc4922
commit 5a67110c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -161,6 +161,13 @@ main() {
set_gpu_mem
fi
if [[ "$(is_dietpi)" = "1" ]]; then
msg "\nDietPi detected!"
msg "Adjust settings for camera-streamer ...\n"
dietpi_cs_settings
status_msg "Adjust settings for camera-streamer ..." "0"
fi
if [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
ask_update_entry
fi

View File

@ -48,6 +48,14 @@ is_raspbian() {
fi
}
is_dietpi() {
if [[ -f /boot/config.txt ]] && [[ -d /boot/dietpi ]]; then
echo "1"
else
echo "0"
fi
}
is_raspberry_pi() {
if [[ -f /proc/device-tree/model ]] &&
grep -q "Raspberry" /proc/device-tree/model; then
@ -262,3 +270,15 @@ add_group_video() {
msg "\t==> User ${BASE_USER} is already in group 'video'"
fi
}
dietpi_cs_settings() {
sudo /boot/dietpi/func/dietpi-set_hardware rpi-codec enable
sudo /boot/dietpi/func/dietpi-set_hardware rpi-camera enable
if [[ "$(is_buster)" = "0" ]]; then
if ! grep -q "camera_auto_detect=1" /boot/config.txt; then
msg "\nAdd camera_auto_detect=1 to /boot/config.txt ...\n"
echo "camera_auto_detect=1" >> /boot/config.txt
fi
fi
}