How do you determine which `sdef` file to use?

I have to create a customer kernel module for a wp7702 target running the 15.1 Firmware. I am trying to do this the legato way, knowing i can always fall back on Yocto/Bitbake recipes. I am following the Legato Custom Kernel Module Guide and created the mdef file, but i am stuck at the Building your System step.

This step gives the following example:

mksys -t wp85 mySystem.sdef

While I can replace wp85 with wp77, I do not know what needs to be in the sdef file. Should it be the sdef file used to create the FW 15.1 Legato layer? Can it be a mostly empty sdef file that just references the mdef file?

here is an example for mangoh red board:

@jyijyi I need the following clarrified:

  • Is the Legato CWE in the Firmware 15.1 Component page generate by that sdef? If yes then I need either git tags/commits or repo manifests that correspond with the 15.1 release.

  • Is there one ‘sdef’ file per target or can they be layered? Meaning if i need to add a custom kernel module, do i need to modify the one sdef file and rebuilt or can i create an ‘sdef’ file that just tracks the single module?

normally i just download the legato source by VSCode +Leaf
and then compile in the “leaf shell” by “make wp77xx”.

To add additional application, you can see here to modify wifi.sdef

@jyijyi correct me if I am wrong, but what you just suggested does not allow for the adding of a custom kernel module.

I am just trying to follow the documentation. Legato builds and I run ‘make wp77xx’ without issue. Starting from there, please tell me how to add a custom kernel module.

Have you modified wifi.sdef to add a simple hello world application?

To add kernel module, you need to add something like this

kernelModules:
{
$CURDIR/linux_kernel_modules/mangoh/mangoh_red
$CURDIR/linux_kernel_modules/mt7697wifi/mt7697wifi_core
}

@jyijyi ok I see that wifi.sdef is what the .config' files are pointing to after they are generated by make wp77xx`. Please update the Custom Kernel Module Guide, with this information and I also recommend elaborating more.