Require SD card or >4MB flash (#545)

This commit is contained in:
Ken Van Hoeylandt
2026-07-03 23:56:03 +02:00
committed by GitHub
parent 90afba647e
commit 05720821f8
106 changed files with 403 additions and 603 deletions
@@ -15,9 +15,9 @@
namespace tt::service::webserver {
static const auto LOGGER = tt::Logger("AssetVersion");
constexpr auto* DATA_VERSION_FILE = "/data/webserver/version.json";
constexpr auto* DATA_VERSION_FILE = "/system/app/WebServer/version.json";
constexpr auto* SD_VERSION_FILE = "/sdcard/tactility/webserver/version.json";
constexpr auto* DATA_ASSETS_DIR = "/data/webserver";
constexpr auto* DATA_ASSETS_DIR = "/system/app/WebServer";
constexpr auto* SD_ASSETS_DIR = "/sdcard/tactility/webserver";
static bool loadVersionFromFile(const char* path, AssetVersion& version) {
@@ -349,17 +349,6 @@ bool syncAssets() {
return true;
}
// POST-FLASH RECOVERY: Data empty but SD card exists
if (!dataExists) {
LOGGER.info("Data partition empty - copying from SD card (recovery mode)");
if (!copyDirectory(SD_ASSETS_DIR, DATA_ASSETS_DIR)) {
LOGGER.error("Failed to copy assets from SD card to Data");
return false;
}
LOGGER.info("Recovery complete - assets restored from SD card");
return true;
}
// NORMAL OPERATION: Both exist - compare versions
AssetVersion dataVersion, sdVersion;
bool hasDataVer = loadDataVersion(dataVersion);