#! /bin/bash set -ex # add stuff we want to config.txt add = <<-END dtparam=spi=on # we can adjust these values as needed dtparam=cooling_fan=on,fan_temp0=62000,fan_temp0_hyst=8000,fan_temp0_speed=80,fan_temp1=70000,fan_temp1_hyst=5000,fan_temp1_speed=100,fan_temp2=76000,fan_temp2_hyst=4000,fan_temp2_speed=170,fan_temp3=80000,fan_temp3_hyst=3000,fan_temp3_speed=250 # enable i2s for audio dtparam=i2s=on # use an external antenna instead of the pcb antenna on the CM dtparam=ant2 # load our audio driver dtoverlay=toesaudio # enable gpio12 which we use to reset the audio codec gpio=12=op,dh END sed -i "s/dtparam=spi=on/$add" mnt/boot/config.txt # we don't need fancy graphics. we don't have a screen. echo "\ngpu_mem=16" >>mnt/boot/config.txt