How to generate SPIFFS image externally?



We would like to generate spiffs image for ESP8266 out of mos build. We tried to use from ESP-IDF and but in both casess mount failed.

We need it for device manufacturing - firmware will be the same for every device but filesystem must differ (will contain diffrent keys and configuration). How can we achieve that?

Thanks in advance.


We have managed it with following command:

docker run -v $(pwd):/mnt/data -t mgos/esp8266-build:2.2.1-1.5.0-r4 mkspiffs -s 262144 /mnt/data/fs -f /mnt/data/fs.bin

Is this the correct approach? I am asking because I think it is common to build firmware and filesystem separatley (exclusively) in the production. Please correct me if I am wrong.