Remove force_eeprom_read after initial boot
@@ -66,6 +66,16 @@ function detect_card {
fi
}
+FORCEEEPROM=`cat /boot/config.txt | grep force_eeprom_read`
+if [ "$FORCEEEPROM" != "" ]; then
+ echo "Detected force_eeprom_read, removing it" >> /var/log/hifiberry.log
+ mount -o remount,rw /boot
+ cat /boot/config.txt | grep -v force_eeprom_read > /tmp/config.txt
+ cp /boot/config.txt /boot/config.txt.bak
+ cp /tmp/config.txt /boot/config.txt
+ sync
+fi
+
if [ "$FOUND" == "" ]; then
echo "No HiFiBerry card configured, try to probe using I2C" >> /var/log/hifiberry.log
@@ -76,15 +86,6 @@ if [ "$FOUND" == "" ]; then
exit 1
fi
- echo "Detecting force_eeprom_read"
- FORCEEEPROM=`cat /boot/config.txt | grep force_eeprom_read`
- if [ "$FORCEEEPROM" != "" ]; then
- cat /boot/config.txt | grep -v force_eeprom_read > /tmp/config.txt
- cp /boot/config.txt /boot/config.txt.bak
- cp /tmp/config.txt /boot/config.txt
- sync
- fi
-
echo "Detecting using I2C"
check_i2c
card=$(detect_card)
