• ...
  • Yocto
  • production
  • project creation
  • SDK extension
  • SimpleSwitch

Create your own SimpleSwitch™ package#

Now that we have a recipe (see Create a recipe), we can proceed to create the custom SimpleSwitch™ package.

For simplicity we assume the following

  • your application is called cmake-example

  • your project layer was named my-product

  • your application is started with cmake-example -c -p 1234

Add the recipe to your package
graphical application

add to dynamic-layers/meta-simpleswitch/recipes-core/images/simpleswitch-my-product-cmake-example.bb (in your project layer)

LICENSE = "CLOSED"

inherit simpleswitch-package

IMAGE_INSTALL += "cmake-example"
SIMPLESWITCH_STARTUP_COMMAND += "cmake-example -c -p 1234"
SIMPLESWITCH_INSTALL_DISPLAY_DRIVERS = "1"
SIMPLESWITCH_SYSTEM_REQUIREMENTS = "wayland"
non-graphical application

add to dynamic-layers/meta-simpleswitch/recipes-core/images/simpleswitch-my-product-cmake-example.bb (in your project layer)

LICENSE = "CLOSED"

inherit simpleswitch-package

IMAGE_INSTALL += "cmake-example"
SIMPLESWITCH_STARTUP_COMMAND += "cmake-example -c -p 1234"
Build the image

Now build the package with scotty

scotty build simpleswitch-my-product-cmake-example
Test on your device

From within a scotty shell run the following

devtool simpleswitch-install simpleswitch-my-product-cmake-example <ip of your device>

In case of problems you can check on the device

  • log output
  • status
simpleswitch-log simpleswitch-my-product-cmake-example
simpleswitch-status simpleswitch-my-product-cmake-example

to provide you more insights on what is failing

(optional) cleanup your device

From within a scotty shell run the following

devtool simpleswitch-uninstall simpleswitch-my-product-cmake-example <ip of your device>

to remove the previously installed SimpleSwitch™ package

(optional) integrate the new SimpleSwitch™ package into your image

Integrate your new SimpleSwitch™ package into a full base image, do

graphical application

add to dynamic-layers/meta-simpleswitch/recipes-core/images/simpleswitch-my-product-weston-image.bb (in your project layer)

SIMPLESWITCH_PACKAGES:append = " simpleswitch-my-product-cmake-example"
non-graphical application

add to dynamic-layers/meta-simpleswitch/recipes-core/images/simpleswitch-my-product-image.bb (in your project layer)

SIMPLESWITCH_PACKAGES:append = " simpleswitch-my-product-cmake-example"

Now you can build the respective image, flash it (see Flashing a base image) and have your custom application started automatically.