Maybe this:
It will remove only the first line with dtoverlay=
So if you keep all the custom dtoverlay after the dtoverlay from device, it should be good.
Before:
After:
Code:
sed '0,/^dtoverlay=/{/^dtoverlay=/d}' /boot/config.txt
It will remove only the first line with dtoverlay=
So if you keep all the custom dtoverlay after the dtoverlay from device, it should be good.
Before:
Code:
disable_splash=1
disable_overscan=1
hdmi_drive=2
hdmi_blanking=1
hdmi_force_edid_audio=1
hdmi_force_hotplug=1
hdmi_group=0
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=i-sabre-q2m
#dtoverlay=disable-wifi
#dtoverlay=disable-bt
dtparam=spi=on
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
arm_64bit=1
#---------------------------
# CUSTOM OVERLAYS AFTER HERE
#---------------------------
dtoverlay=gpio-ir,gpio_pin=4
After:
Code:
disable_splash=1
disable_overscan=1
hdmi_drive=2
hdmi_blanking=1
hdmi_force_edid_audio=1
hdmi_force_hotplug=1
hdmi_group=0
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
#dtoverlay=disable-wifi
#dtoverlay=disable-bt
dtparam=spi=on
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
arm_64bit=1
#---------------------------
# CUSTOM OVERLAYS AFTER HERE
#---------------------------
dtoverlay=gpio-ir,gpio_pin=4