How to run shell script after boot

Customer and I do not know how to make kConfig file. I checked kconfig options (Legato KConfig Options - Legato Docs) but I cannot explain it to customer because I am not the expert for Linux.

You don’t need to make kconfig file

What timing and how should customer add their application to cwe file?

Customer is using leaf tool and build their application by .adef file.
To create their application as default application, customer need to create sdef or other to kernel. I need to explain these procedure to customer but I am not the expert for Linux. Could you please prepare sample procedure for Hello world or anything?

What do you mean by timing

This is how you make legato.cwe

Leaf shell
Go to the corresponding legato framweork folder
make clean
make wp76xx

Customer cannot succeed to create any file with their application as default application.

Maybe, I think that we cannot work it because we did not understand final goal.

Please advise the following question.

Q1. WP76xx module is configured as follows. Is my understand correct?

Modem Firmware: modemFW.spk

Linux Distribution: boot-yocto.cwe

Base Legato System: legatoz.cwe

Customer application: custom-firmware.spk

Q2. To add custom application as default application, should customer create .spk file. Is my understanding correct?

If not, please let us know which file should customer add their application.

Q3. Customer sent “make wp76xx”. But there is not selection menu for their application and created spk file. How do customer add their application in this process?

First of all, can they build the legato.cwe ?

Q1:
There is no such thing:
Customer application: custom-firmware.spk

If you want to build your application as default application, you need to build to legato.cwe

Q2: No, there is no such thing called “custom-firmware.spk”
As said before, you need to first successfully build the legato.cwe, and then add your application to wifi.sdef as default application.

Q3: “make wp76xx” is to build the legato.cwe in “build” folder, not generating the spk file.

Thanks. I can image final goal to build legato.cwe.
Please advise the following.

Q4. Customer said that there is 2 wifi.sdef. Which is better to use it.
-/home/root/workspace/legatoAF/legato/modules/WiFi/wifi.sdef
-/home/root/.leaf/wp76-legato_19.02.0-201903211732/modules/WiFi/wifi.sdef

Q5. To add their application, should customer add their application to wifi.sdef as below.
Apps:
{
//WiFi services
$LEGATO_WIFI_ROOT/service/wifiService.adef
$LEGATO_WIFI_ROOT/apps/sample/wifiClientTest/wifiClientTest.adef
$LEGATO_WIFI_ROOT/apps/sample/wifiApTest/wifiApTest.adef
$LEGATO_WIFI_ROOT/apps/sample/wifiWebAp/wifiWebAp.adef
$LEGATO_WIFI_ROOT/apps/too;s/wifi.adef

$LEGATO_WIFI_ROOT/customer/HelloWord.adef
}

Q6. Which folder should customer set Path and send “make wp76xx” command.

Q4. it depends where you build the legato image.

If you are building the legato (make wp76xx) in
/home/root/.leaf/wp76-legato_19.02.0-201903211732/.
Then you should modify
home/root/.leaf/wp76-legato_19.02.0-201903211732/modules/WiFi/wifi.sdef

Q5: correct

Q6: you do “leaf shell” first, and then it will set the path for you.

Thanks. To explain it to my customer, I sent “make wp76xx”. But I saw the following error.
c1: all warnings being treated as errors
make[2]: *** [Makefile:14: /home/nexty/.leaf/wp76-legato_19.02.0-201903211732/bin/mkPatch] Error 1
make[2]: Leaving directory ‘/home/nexty/.leaf/wp76-legato_19.02.0-201903211732/framework/tools/mkPatch’
make[1]: *** [Makefile.hostTools:89: mkPatch] Error 2
make[1]: Leaving directry ‘/home/nexty/.leaf/wp76-legato_19.02.0-201903211732’
make: *** [Makefile:506: tools] Error 2

I sent the following and try it. But the result is same.

(lsh) root:~/.leaf/wp76-legato_19.02.0-201903211732$ . bin/configlegatoenv
[wp76xx] Toolchain dir = /opt/swi/SWI9X07Y_02.28.03.05/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
prefix = arm-poky-linux-gnueabi-
sysroot = /opt/swi/SWI9X07Y_02.28.03.05/sysroots/armv7a-neon-poky-linux-gnueabi
kernelroot = /opt/swi/SWI9X07Y_02.28.03.05/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel
[wp77xx] Toolchain dir = /opt/swi/SWI9X07Y_02.28.03.05/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
prefix = arm-poky-linux-gnueabi-
sysroot = /opt/swi/SWI9X07Y_02.28.03.05/sysroots/armv7a-neon-poky-linux-gnueabi
kernelroot = /opt/swi/SWI9X07Y_02.28.03.05/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel

I am using Ubuntu 20.04 now, is it working?

Have you entered “make clean” before “make wp76xx”?

Yes, I sent the following step

  1. leaf shell
  2. Go to working folder
  3. . bin/configlegatoenv
  4. make clean
  5. make wp76xx

if you use “leaf shell” , there is no need to " . bin/configlegatoenv"

I see.
But the original step was below. But I saw the “c1: all warnings being treated as errors” and stop it.
Note: I did not add any adef file to wifi.sdef yet. Should I add it?

  1. leaf shell
  2. Go to working folder
  3. make clean
  4. make wp76xx

for the default package, it should be OK to make legato.cwe without any modification.

I put the all log for make wp76xx. Can you find root cause?
log_make.txt (13.7 KB)

I don’t see such problem in ubuntu 14,16 or 18.
Here is my compilation log for swi_wp76_4.0.3 (legato 19.2.0) in Ubuntu 14:
log.txt (185.9 KB)

Maybe you can give a try on those Ubuntu version.

I tried ubuntu 14 and 16. But I cannot install leaf correctly.
I install ubuntu 18 and can install leaf correctly. But my environment returned “mkapp: command not found”. My procedure is below, please advise it. ubuntu 20 is no issue at this stage.

  1. Install ubuntu 18
  2. apt-get update
  3. apt-get upgrade
  4. wget https://downloads.sierrawireless.com/tools/leaf/leaf_latest.deb -O /tmp/leaf_latest.deb && sudo apt install /tmp/leaf_latest.deb
  5. mkdir ~/myWorkspace; cd ~/myWorkspace
  6. leaf search -t wp76xx
  7. leaf setup wp76stable -p swi-wp76_4.0.3
  8. leaf status
  9. leaf shell
  10. mkapp -t wp76xx helloword.adef
    mkapp: command not found

I don’t see problem on Ubuntu 18:

Leaf Shell /bin/bash started in Leaf environment.

(lsh:swi-wp76_4.7.0) owner@ubuntu:~/leaf$ mkapp
** ERROR:
Bad configuration environment file path '/home/owner/leaf/leaf-data/swi-wp76_4.7.0/wp76-legato/build/localhost/config.sh'.
(lsh:swi-wp76_4.7.0) owner@ubuntu:~/leaf$ mkapp -h

Command line parameters
  -C, --cflags, <string>
        (Multiple, optional) Specify extra flags to be passed to the C compiler.

  -K, --key, <string>
        (Optional) Specify the private key path which should be used to sign update package. Once specified, corresponding public certificate path must be specified to verify update package on target.

  -L, --ldflags, <string>
        (Multiple, optional) Specify extra flags to be passed to the linker when linking executables.

  -P, --pub-cert, <string>
        (Optional) Specify the public certificate path which should be used to verify update package on target. Once specified, corresponding private key path must be specified to sign update package on host.

  -S, --ima-sign
        (Optional) Sign the package with IMA key. If this option specified, it will first look for IMA private key and public certificatein command line parameter. If nothing specified in command line it will look for environment variable LE_CONFIG_IMA_PRIVATE_KEY (private key path) and LE_CONFIG_IMA_PUBLIC_CERT (public certificate signed by system private key).

  -X, --cxxflags, <string>
        (Multiple, optional) Specify extra flags to be passed to the C++ compiler.

  -a, --append-to-version, <string>
        (Multiple, optional) Specify a suffix to append to the application version specified in the .adef file.  Will automatically insert a '.' between the .adef's version string and any version strings specified on the command-line.  Multiple occurences of this argument will be combined into a single string.

  -b, --bin-pack
        (Optional) Generate a binary-app package instead of a .update file. Binary-app packages can be used to distribute an application without its original source code.  This binary app package file is intended to be included in a system definition (.sdef)  file's 'apps:' section in place of a .adef file.

  -c, --component-search, <string>
        (Multiple, optional) (DEPRECATED) Add a directory to the source search path (same as -s).

  -d, --debug-dir, <string>
        (Optional) Generate debug symbols and place them in the specified directory.  Debug symbol files will be named with build-id

  -g, --generate-code
        (Optional) Only generate code, but don't compile, link, or bundle anything. The interface definition (include) files will be generated, along with component and executable main files and configuration files. This is useful for supporting context-sensitive auto-complete and related features in source code editors, for example.

  -i, --interface-search, <string>
        (Multiple, optional) Add a directory to the interface search path.

  -j, --jobs, <integer>
        (Optional) Run N jobs in parallel (default derived from CPUs available)

  -n, --dont-run-ninja
        (Optional) Even if a build.ninja file exists, ignore it, delete the staging area, parse all inputs, and generate all output files, including a new copy of the build.ninja, then exit without running ninja.  This is used by the build.ninja to to regenerate itself and any other files that need to be regenerated when the build.ninja finds itself out of date.

  -o, --output-dir, <string>
        (Optional) Specify the directory into which the final, built application file (ready to be installed on the target) should be put.

  -p, --no-pie
        (Optional) Do not build application executable as a position independent executable.

  -s, --source-search, <string>
        (Multiple, optional) Add a directory to the source search path.

  -t, --target, <string>
        (Optional) Set the compile target (localhost|ar7).

  -v, --verbose
        (Optional) Set into verbose mode for extra diagnostic information.

  -w, --object-dir, <string>
        (Optional) Specify the directory into which any intermediate build artifacts (such as .o files and generated source code files) should be put.

(lsh:swi-wp76_4.7.0) owner@ubuntu:~/leaf$