Building from legato source

may be a silly question, but I have been using the mksys command to build my system and not I have started building from legato source.
Is there any documentation about how to implement my custom app in the built system when building from legato source?

you can see here to modify the wifi.sdef to embed your app to legato.cwe.

how do you download the cwe file built to the target using the AirVantage FOTA platform?
Do you need to combine it in an app?

Here is an example to upgrade the legato cwe: ( you can extract it to see how the does)

is there a tool similar to the av-pack to generate this?
av-pack will not work as it can`t find the info file in the building directory

I don’t use any tool.
you can extract it with 7zip and modify it manually.

I believe there should be a command to make the app directly, so you can pass on parameters when making it.
This should be similar to the av-pack which is the proper process to make the app from the .update file.
Just to avoid manual errors when zipping it manually.

This is a good example of why to use a proper way to build the app:
The firmware has been updated but the return is failure state, where the final version should be bundled according to the system I have built form source:

[Router with ETH interface](javascript: void(0))
Initial firmware version: MDM=SWI9X06Y_02.36.06.00,LK=1.3.0_9c047c35f7,OS=3.18.140,RFS=SWI9X06Y_02.36.07.00,UFS=unknown,LE=19.11.5,LEO=19.11.5,CUPRI=9907957-001.000 ,CAPRI=SIERRA-001.043_001,MCU=002.015 - Installing full package
Package downloaded. Starting the upgrade process
Upgrade successful. Checking the final version
Unexpected final version [MCU=002.015]

It is because you did not state correctly the mcu version in the

I know, and I can get this with the cm info when logged into the target. this was just to say that the manual zipping sound a little messy solution for production systems.