From 7396108d38fb86da64e5885feccc33d679120459 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Fri, 10 Nov 2023 16:40:28 -0500 Subject: [PATCH] Re-mount eeprom for signing/backup --- www/api/controllers/cape.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/api/controllers/cape.php b/www/api/controllers/cape.php index 15915fa45..8d765f68d 100644 --- a/www/api/controllers/cape.php +++ b/www/api/controllers/cape.php @@ -48,6 +48,14 @@ function GetEEPROMFilename() if (file_exists("/home/fpp/media/tmp/eeprom_location.txt")) { $eepromLoc = file_get_contents("/home/fpp/media/tmp/eeprom_location.txt"); } + if (!file_exists($eepromFile) && startsWith($eepromFile, "/sys/bus/i2c/devices/")) { + $target = "/sys/bus/i2c/devices/i2c-1/new_device" + if ($settings['Platform'] == "BeagleBone Black") { + $target = "/sys/bus/i2c/devices/i2c-2/new_device" + } + system("sudo bash -c \"echo '24c256 0x50' > $target\""); + } + if (!file_exists($eepromFile) && file_exists("/home/fpp/media/config/cape-eeprom.bin")) { $eepromFile = "/home/fpp/media/config/cape-eeprom.bin"; }