Legato-src build from vscode

Hi,

Installed the legato -source in vscode using leaf getsrc legato, as per the documentation Get Legato Source Code - Legato Docs do we need to build the legato source from command line going into the legato-src directory?

ctrl+Shift+B to build the SDK no longer works if the legato source is downloaded.

Executing task: mksys {LEGATO_DEF_FILE} -s components -t {LEGATO_TARGET} -w {LEGATO_OBJECT_DIR} -o {LEGATO_OUTPUT_DIR} <
/bin/bash: mksys: command not found
The terminal process “/bin/bash ‘-c’, ‘mksys {LEGATO_DEF_FILE} -s components -t {LEGATO_TARGET} -w {LEGATO_OBJECT_DIR} -o {LEGATO_OUTPUT_DIR}’” failed to launch (exit code: 127).

Terminal will be reused by tasks, press any key to close it.

from the legato.io it states " Once the source code for Linux is downloaded leaf removes the links to the pre-built toolchain and linux images. You must rebuild those from source code." where do we get the list of links to rebuild to be used by the VS Code?

Would’nt it be better if there is an option for leaf buildsrc which would build the source and rebuild the link automatically?

how about you create a new profile name and download the package in vscode?
In this case, I belive you don’t need to rebuild the legato source.

Requirement is to build the Legato source code and use it inside VS code? Skipping the legato source build is not what I am looking for.

Would like to know if it is possible to build the source inside VS Code? Recently all source distributions have been moved away from source.sierrawireless.com to git and can only be downloaded through leaf, hence would like to know if it is also possible to download and build the source or it is only to be used as a download tool?

i will open a new terminal to build the yocto source, not inside “leaf shell”.

Hi,

Opening a new terminal and building it from VS code default terminal is one and the same thing.

I am able to build the legato source inside VS code terminal and workspace through command line:
~/legatosamples$ ls -al legato-src/legato/build/wp76xx/
total 22060
drwxrwxr-x 12 pankaj pankaj 4096 Apr 20 13:27 .
drwxrwxr-x 7 pankaj pankaj 4096 Apr 20 13:26 …
drwxrwxr-x 5 pankaj pankaj 4096 Apr 20 13:26 3rdParty
drwxrwxr-x 3 pankaj pankaj 4096 Apr 20 13:26 apps
drwxrwxr-x 11 pankaj pankaj 4096 Apr 20 13:27 bundles
-rw-rw-r-- 1 pankaj pankaj 4049 Apr 20 13:26 .config.mk
-rw-rw-r-- 1 pankaj pankaj 3893 Apr 20 13:26 config.sh
drwxrwxr-x 3 pankaj pankaj 4096 Apr 20 13:26 debug
drwxrwxr-x 14 pankaj pankaj 4096 Apr 20 13:26 framework
lrwxrwxrwx 1 pankaj pankaj 23 Apr 20 13:27 legato.cwe → legato-squashfs.ubi.cwe
lrwxrwxrwx 1 pankaj pankaj 19 Apr 20 13:27 legato.default → legato.squashfs.ubi
drwxrwxr-x 5 pankaj pankaj 4096 Apr 20 13:27 legatoimg
lrwxrwxrwx 1 pankaj pankaj 10 Apr 20 13:27 legato_rw.cwe → legato.cwe
lrwxrwxrwx 1 pankaj pankaj 14 Apr 20 13:27 legato_rw.default → legato.default
lrwxrwxrwx 1 pankaj pankaj 15 Apr 20 13:27 legato_rw.squashfs → legato.squashfs
lrwxrwxrwx 1 pankaj pankaj 19 Apr 20 13:27 legato_rw.squashfs.ubi → legato.squashfs.ubi
-rw-r–r-- 1 pankaj pankaj 5160960 Apr 20 13:27 legato.squashfs
-rw-rw-r-- 1 pankaj pankaj 6029312 Apr 20 13:27 legato.squashfs.ubi
-rw-rw-r-- 1 pankaj pankaj 6030112 Apr 20 13:27 legato-squashfs.ubi.cwe
drwxrwxr-x 3 pankaj pankaj 4096 Apr 20 13:27 pa-check
drwxrwxr-x 4 pankaj pankaj 4096 Apr 20 13:27 _staging_system.wp76xx.update
drwxrwxr-x 8 pankaj pankaj 4096 Apr 20 13:27 system
-rw-rw-r-- 1 pankaj pankaj 5306314 Apr 20 13:27 system.wp76xx.update
drwxrwxr-x 2 pankaj pankaj 4096 Apr 20 13:26 tools

After Build legato from source is it possible to use the newly build SDK for application development or we have to use the prebuilt SDK from SWI?

Building the SDK or linux source from VS Code workspace and able to use it for building images would streamline the development workflow.

building it seperately in a different terminal is kind of moving back to older ways of doing things. If one is able to download the source code from leaf tool one should also be able to build it using leaf tool and able to use for existing workspace

For the build legato source how can we add it to the profile to be able to use it in the workspace? Is there a tool to package the built SDK into a leaf package?

Adding the location of he default.sdef from the legato src directory able to rebuild the project.
#include $CURDIR/legato-src/legato/default.sdef

Comment the line //#include $LEGATO_ROOT/default.sdef