Building Mongoose OS from source

#1

Hi,

I’m evaluating Mongoose OS for use in our project. We have two main requirements:

  • possibility of building from source code (hotfixing, improvements, contributions)
  • running on Linux x86 (ideally posix platform build, but emulation also would be ok)
  1. My goal is: Building from source for ESP32 and Linux x86 platforms
  2. My actions are:
    docker run -v pwd:/mongoose-os -it mgos/esp32-build:3.2-r7 bash
    cd /mongoose-os/platforms/esp32
    make -f Makefile.build
  3. The result I see is:
    /opt/Espressif/esp-idf/components/bootloader_support/src/secure_boot_signatures.c:28:28: fatal error: mbedtls/sha256.h: No such file or directory
  4. My expectation & question is:
    Is there any instruction how to build mongoose os and libs from source? (at least what are ESP-IDF and other deps versions know to build with Mongoose OS)
    Is it possible to build regular x86 Linux binary to improve testing and development times? Something like native_posix board in Zephyr OS (I found there is posix/ubuntu platforms code but for now it doesn’t look useful)
    Is possible to receive for restricted libraries if we decide to use enterprise license?

pawell

#2

mos build --local will pull all the available source files in the deps directory. If you modify a source file, it will be used as such.

I export DEPS_DIR (dependencies) and LIBS_DIR (binary libs) on a debian 9 system and build with e.g.

mos build --local --deps-dir $DEPS_DIR --binary-libs-dir $LIBS_DIR --platform esp8266

Run mos help --full to see all the options.

AFAIK, if you have a commercial license you’ll have acces to the source files of the close source libraries.

#3

Thanks @nliviu!

Few points to add - some parts of Mongoose OS are closed-source, specifically, all OTA-related functionality and a private fork of mbedTLS.
Thus, if 100% source build is a hard requirement, look elsewhere.

#4

@nliviu @cpq thank you both for answers!

I still have a question about posix/ubuntu platforms. Are they usable? If so how to use them?

1 Like
#5

Build firmware with --platform ubuntu

#6

@cpq Thanks for your suggestion - I have tried to build for ubuntu platform
I cloned the demo-c project & build it with --platform ubuntu
What I see is below:

$ ./bin/app1 
main                 PIDs: parent=16352 child=16353 uid=1000 gid=1000 euid=1000 egid=1000
ubuntu_cap_init      Lacking capability to bind ports <1024, continuing anyway
ubuntu_cap_init      Cannot change to directory (null)
main                 Exiting. Have a great day!

should I run it from the docker image?
what have I missed?
Thanks

#7

Run it like this

./build/bin/* --insecure
1 Like