FSTAB image file not getting into the fw.zip build

My goal is: To integrate fstab image file into the fw.zip
2. My actions are:I configured my esp32 (4mb flash size) according to this link. I generated an image file named ‘mnt.img’ successfully.
3. The result I see is: I am getting an error while building the code after making changes in mos.yml file regarding the image file. “FileNotFoundError: [Errno 2] No such file or directory: ‘./src/mnt.img’”.
My Build Log Contains:

FS stats : space total=233681, used=118723, free=114958
GEN /data/fwbuild-volumes/latest/apps/test/esp32/build_contexts/build_ctx_560592761/build/objs/fw_temp/manifest.json
Traceback (most recent call last):
File “/data/fwbuild-volumes/latest/apps/test/esp32/build_contexts/build_ctx_560592761/deps/modules/mongoose-os/tools/mgos_fw_meta.py”, line 543, in
File “/data/fwbuild-volumes/latest/apps/test/esp32/build_contexts/build_ctx_560592761/deps/modules/mongoose-os/tools/mgos_fw_meta.py”, line 366, in cmd_create_manifest
for fname in os.listdir(src):
FileNotFoundError: [Errno 2] No such file or directory: ‘./src/mnt.img’
/data/fwbuild-volumes/latest/apps/test/esp32/build_contexts/build_ctx_560592761/deps/modules/mongoose-os/tools/mk/mgos_fw_meta.mk:23: recipe for target ‘/data/fwbuild-volumes/latest/apps/test/esp32/build_contexts/build_ctx_560592761/build/objs/fw_temp/manifest.json’ failed
make: *** [/data/fwbuild-volumes/latest/apps/test/esp32/build_contexts/build_ctx_560592761/build/objs/fw_temp/manifest.json] Error 1
make: Leaving directory ‘/app’
Error: exit status 2
/go/src/github.com/mongoose-os/mos/mos/main.go:194: build failed

  1. My expectation & question is: I think I am not putting the build variables properly in my mos.yml file.

author: mongoose-os
description: A JS-enabled demo Mongoose OS firmware


version: 1.0
manifest_version: 2017-05-18
libs_version: ${mos.version}
modules_version: ${mos.version}
mongoose_os_version: ${mos.version}


  • [“mqtt.server”, “iot.eclipse.org:1883”]
  • [“i2c.enable”, true]
  • [“sys.mount.path”, “/mnt”]
  • [“sys.mount.dev_type”, “esp32part”]
  • [“sys.mount.dev_opts”, “{“label”: “data”}”]
  • [“sys.mount.fs_type”, “LFS”]


  • js


  • fs


build_vars: # Add these
ESP_IDF_EXTRA_PARTITION: fs_ext,data,spiffs,256K # two lines
APP_EXTRA_FW_PARTS: fs_data:type=fs,src=src/mnt.img,ptn=fs_ext

Please help.

1 Like

The error message is pretty clear No such file or directory: ‘./src/mnt.img’ mnt.img is missing in the src folder.

I am not able to figure it out why it is giving that error message. I have the ‘.img’ file in the project folder.

Did I write the build variables in mos.yml file wrong or did i placed the img file in wrong path?

You specified APP_EXTRA_FW_PARTS: fs_data:type=fs,src=src/mnt.img,ptn=fs_ext
If it isn’t in src, modify that line to point to the right place or move the file in src.

@nliviu Thank you , I figured out that I have to store the image file into fs folder. Now that error is no longer there. However I am getting a different error while preparing a file system partition with 52k alloted to it

Earlier I was able to create SPIFFS with 256k of allocated memory using the old method.
Can you tell me what is the maximum space available for creating a fstab file system?

All the files residing in the fs will go in the root filesystem. You don’t want to put your image in the that filesystem.

Your image file is intended to be mounted as a filesystem itself. The settings in mos.yml instructs mos to do that. Do what I told you in my previous post and it should work as expected.

Oh, right! My bad. I edited the path in my mos.yml as

APP_EXTRA_FW_PARTS : fs_data:type=fs,src=/mnt.img,ptn=fs_ext
and placed the image file in the E:/New/test as it is the root of the current app as can be seen in the pic.

Still getting the ‘No such file or directory : ./mnt.img’ error while doing ‘mos build’ command. I don’t get it I have placed the mnt.img file in the app directory and still it is not been detected in ‘./mnt.img’. I also tried making a new folder src and placed the image file inside the ‘./src/mnt.img’ with my previous attempt with mos.yml as seen in my older post. Was unsuccessful in making fstab image to get into the fw.zip :pensive:

src=/mnt.img -> src=mnt.img. The path is relative to the folder where mos.yml is.

@nliviu I changed the path to APP_EXTRA_FW_PARTS: fs_data:type=fs,src=mnt.img,ptn=fs_ext while keeping the file in the root directory relative to mos.yml file. Still getting No such file or directory: './mnt.img'. Is it because I am working in Windows Environment where the file directories are defined with different symbols?

The cloud build will not upload mnt.img, but src/mnt.img is uploaded and builds successfully.
So, move it in the src folder and modify

APP_EXTRA_FW_PARTS: fs_data:type=fs,src=src/mnt.img,ptn=fs_ext
1 Like

I tried but I just couldn’t get it to build successfully. I’m getting the same error.

I don’t know what are you doing, but it works for me.

1 Like

@Sumedh_Burbure Could you please share your most recent mos.yml file
I suppose you do not have the sources section there.
According to the guide mos.yml - to upload additional files to the cloud for build purpose and to make them available for mos build flow you should put them into folders listed by mos.yml sources section:

# List of files / directories with C sources. No slashes at the end of dir names.
  - src
  1. Add above code to your mos.yml file
  2. Create src folder at the same level where you do have mos.yml file
  3. Put your img file to the src folder

Should work