Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add better dietpi support to installer #204

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,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
Expand Down
20 changes: 20 additions & 0 deletions tools/libs/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -244,3 +252,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
}
Loading