好。raspi-config实际上有点bash,因此很容易看到它的作用:
# $1 is 0 to disable camera, 1 to enable it
set_camera() {
# Stop if /boot is not a mountpoint
if ! mountpoint -q /boot; then
return 1
fi
[ -e /boot/config.txt ] || touch /boot/config.txt
if [ "$1" -eq 0 ]; then # disable camera
set_config_var start_x 0 /boot/config.txt
sed /boot/config.txt -i -e "s/^startx/#startx/"
sed /boot/config.txt -i -e "s/^start_file/#start_file/"
sed /boot/config.txt -i -e "s/^fixup_file/#fixup_file/"
else # enable camera
set_config_var start_x 1 /boot/config.txt
CUR_GPU_MEM=$(get_config_var gpu_mem /boot/config.txt)
if [ -z "$CUR_GPU_MEM" ] || [ "$CUR_GPU_MEM" -lt 128 ]; then
set_config_var gpu_mem 128 /boot/config.txt
fi
sed /boot/config.txt -i -e "s/^startx/#startx/"
sed /boot/config.txt -i -e "s/^fixup_file/#fixup_file/"
fi
}
显然,/ boot / config.txt中有一个名为start_x的条目,需要将其设置为1才能启用相机。gpu(gpu_mem)至少还需要128 MB内存。仔细检查似乎可以确认这一点。