FSTAB image file not getting into the fw.zip build

#1

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
handlersargs.cmd
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/build_local.go:679:
/go/src/github.com/mongoose-os/mos/mos/build_local.go:666:
/go/src/github.com/mongoose-os/mos/mos/build_local.go:431:
/go/src/github.com/mongoose-os/mos/mos/build.go:223:
/go/src/github.com/mongoose-os/mos/mos/build.go:166:
/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.
    mos.yml:

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

arch: PLATFORM

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

config_schema:

  • [“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”]

tags:

  • js

filesystem:

  • fs

libs:

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.

#2

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

#3

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?

#4

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.

#5

@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?

#6

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.

#7

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:

#8

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

#9

@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?

#10

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
#11

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

#12

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

1 Like