fix: fixes error in detect_legacy (#217)
This will fix issue on Raspberry Pi5, which doesnt generate cam list, because 'vcgencmd get_camera' exits with an error. If all conditions fail it will always return '0' Signed-off-by: Stephan Wendel <me@stephanwe.de>
This commit is contained in:
parent
43a1ee3bc0
commit
61421f5148
@ -86,13 +86,16 @@ get_libcamera_path() {
|
|||||||
# Determine connected "legacy" device
|
# Determine connected "legacy" device
|
||||||
function detect_legacy {
|
function detect_legacy {
|
||||||
local avail
|
local avail
|
||||||
if [[ -f /proc/device-tree/model ]] &&
|
if [[ "$(is_raspberry_pi)" = "1" ]] &&
|
||||||
grep -q "Raspberry" /proc/device-tree/model; then
|
command -v vcgencmd &> /dev/null; then
|
||||||
avail="$(vcgencmd get_camera | awk -F '=' '{ print $3 }' | cut -d',' -f1)"
|
if vcgencmd get_camera &> /dev/null ; then
|
||||||
else
|
avail="$(vcgencmd get_camera \
|
||||||
avail="0"
|
| awk -F '=' '{ print $3 }' \
|
||||||
|
| cut -d',' -f1 \
|
||||||
|
)"
|
||||||
fi
|
fi
|
||||||
echo "${avail}"
|
fi
|
||||||
|
echo "${avail:-0}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function dev_is_legacy {
|
function dev_is_legacy {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user