FlashStore: fall back to "spiffs" partition label

bmorcelli/Launcher labels its user-app data partition "spiffs"; ours
is "littlefs". Subtype is identical in both layouts, so try littlefs
first and fall back to spiffs to coexist with Launcher installs.
This commit is contained in:
drkhsh committed 2026-04-27 19:54:19 +02:00
1 parent 37b536ea7f
commit 3d38d7cde4
1 file changed
+13 -8
+13 -8
View File
@@ -1,16 +1,21 @@
#include "FlashStore.h"
bool FlashStore::begin() {
// Partition label must match partitions_16MB.csv ("littlefs")
// Arduino ESP32 LittleFS defaults to "spiffs" label, so we must specify it
if (!LittleFS.begin(true, "/littlefs", 10, "littlefs")) {
Serial.println("[FLASH] LittleFS mount failed, formatting...");
LittleFS.format();
if (!LittleFS.begin(false, "/littlefs", 10, "littlefs")) {
Serial.println("[FLASH] LittleFS failed after format!");
return false;
// Standalone ratdeck labels this partition "littlefs"; bmorcelli/Launcher
// labels the equivalent partition "spiffs". Try ours first, fall back.
const char* labels[] = { "littlefs", "spiffs" };
bool mounted = false;
for (const char* label : labels) {
if (LittleFS.begin(true, "/littlefs", 10, label)) {
Serial.printf("[FLASH] LittleFS mounted on partition '%s'\n", label);
mounted = true;
break;
}
}
if (!mounted) {
Serial.println("[FLASH] LittleFS mount failed on all known labels!");
return false;
}
_ready = true;
ensureDir("/identity");