Skip to content

Commit

Permalink
v7.1
Browse files Browse the repository at this point in the history
+ DietPi-Set_hardware | RPi: When disabling the camera features, additionally blacklist the bcm2835_isp kernel module, which is automatically loaded since kernel 5.X and pulls in the whole camera module stack.
  • Loading branch information
MichaIng authored Mar 15, 2021
1 parent c161efe commit 422e66f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dietpi/func/dietpi-set_hardware
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,22 @@ $FP_SCRIPT rpi-eeprom
if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then

# Remove modules blacklist
[[ -f '/etc/modprobe.d/dietpi-disable_rpi_camera.conf' ]] && rm /etc/modprobe.d/dietpi-disable_rpi_camera.conf
[[ -f '/etc/modprobe.d/dietpi-disable_rpi_camera.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_rpi_camera.conf

# Enable video devices via extended start
G_CONFIG_INJECT 'start_x=' 'start_x=1' /boot/config.txt

# Requires 128 MiB memory split at least
local gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem[_0-9]*=/{s/^[^=]*=//p;q}' /boot/config.txt)
(( ${gpu_mem:-0} < 128 )) && INPUT_DEVICE_VALUE=128 Gpu_Memory_Split_Main
(( ${gpu_mem:-64} < 128 )) && INPUT_DEVICE_VALUE=128 Gpu_Memory_Split_Main

elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then

# Comment extended start setting
sed -i '/^[[:blank:]]*start_x=/c\#start_x=1' /boot/config.txt
G_EXEC sed -i '/^[[:blank:]]*start_x=/c\#start_x=1' /boot/config.txt

# Add modules blacklist, which are otherwise loaded by default since kernel 4.19
echo -e 'blacklist bcm2835_codec\nblacklist bcm2835_v4l2' > /etc/modprobe.d/dietpi-disable_rpi_camera.conf
echo -e 'blacklist bcm2835_codec\nblacklist bcm2835_v4l2\nblacklist bcm2835_isp' > /etc/modprobe.d/dietpi-disable_rpi_camera.conf

else

Expand Down

0 comments on commit 422e66f

Please sign in to comment.