• ...
  • SDK
  • Yocto
  • ...
  • ...
  • tools
  • debug
  • package
  • deploy
  • debug

Generate a SimpleSwitch™ package#

The simpleswitch-generate-package script helps to create SimpleSwitch™ packages from existing templates, without requiring to use Yocto. It will merge the template files and your own file to generate a SimpleSwitch™ package and its manifest fragment.

SimpleSwitch™ Package Creation Example#

Copying your own files over the SimpleSwitch™ template can be done using the following command

simpleswitch-generate-package --name simpleswitch-example --copy-dir deploy_dir \
     --template c --startup-command /usr/bin/c_test_prog
This will generate two files:
  • simpleswitch-example.ext4: A filesystem containing the merge of the template and your files. It needs to be deployed in the /apps folder of the target.

  • simpleswitch-example.simpleswitchpackage: A fragment of SimpleSwitch™ manifest. It needs to be concatenated to the /apps/simpleswitch-manifest.yaml file on the target.

Directory deploy_dir must contain all files to copy in the package, in a structure reflecting its hierarchy in the package

find deploy_dir -printf "%y %p\n"
d deploy_dir
d deploy_dir/usr
d deploy_dir/usr/bin
f deploy_dir/usr/bin/c_test_prog

template can be changed according to the desired template, run simpleswitch-generate-package --help to list all supported templates.

Finally, the startup command is specified using the --startup-command parameter.

Advanced usage#

Detailed usage of simpleswitch-generate-package#

usage: simpleswitch-generate-package [-h] [--description DESCRIPTION] [--license LICENSE] [--reboot-required {0,1}] [--size-factor SIZE_FACTOR]
                                 [--system-requirements [SYSTEM_REQ ...]] [-a [BIND_PATH ...]] [-C [COPY_DIRS ...]] [-d]
                                 [-D [DEPENDS_ON ...]] [-I INSTALL_COMMAND] [-m [MAKEFILE_DIRS ...]] -n NAME [-N] [-p STORAGE_SIZE]
                                 [-r SYSROOT_DIR] [-S SIZE] -s STARTUP_COMMAND -t TEMPLATE [-u] [-U UNINSTALL_COMMAND] [-w WORK_DIR]

options:
  -h, --help            show this help message and exit
  --description DESCRIPTION
                        Description of the package (default: )
  --license LICENSE     License of the package in SPDX notation (default: Avnet-OSS-1.0)
  --reboot-required {0,1}
                        Package requires a reboot on install/uninstall (default: 0)
  --size-factor SIZE_FACTOR
                        Overhead factor of filesystem (default: 1.2)
  --system-requirements [SYSTEM_REQ ...]
                        Base image features required (default: [])
  -a [BIND_PATH ...], --bind-path [BIND_PATH ...]
                        Bind mount (default: [])
  -C [COPY_DIRS ...], --copy-dir [COPY_DIRS ...]
                        Directories to copy into the roots (default: [])
  -d, --debug           Enable debugging (default: False)
  -D [DEPENDS_ON ...], --depends-on [DEPENDS_ON ...]
                        Packages required (default: [])
  -I INSTALL_COMMAND, --install-command INSTALL_COMMAND
                        Command on installation (default: )
  -m [MAKEFILE_DIRS ...], --makefile-dir [MAKEFILE_DIRS ...]
                        Directories with makefiles (default: [])
  -n NAME, --name NAME  Name of the package (default: None)
  -N, --no-autostart    Disable autostart (default: False)
  -p STORAGE_SIZE, --storage-size STORAGE_SIZE
                        Size of persistent storage (default: -1)
  -r SYSROOT_DIR, --sysroot SYSROOT_DIR
                        Sysroot (default: )
  -S SIZE, --size SIZE  Filesystem size (default: None)
  -s STARTUP_COMMAND, --startup-command STARTUP_COMMAND
                        Startup command (default: )
  -t TEMPLATE, --template TEMPLATE
                        Template to use (default: None)
  -u, --allow-update    Enable updating (default: False)
  -U UNINSTALL_COMMAND, --uninstall-command UNINSTALL_COMMAND
                        Command on uninstallation (default: )
  -w WORK_DIR, --work-dir WORK_DIR
                        Working directory (default: current working directory)

Tip

Tips for package generation

description can be a string or a file. If it’s a file, the content will be used

All settings of bind-path, depends-on and system-requirements will be merged with the settings provided by the SDK template for the chosen template style.

reboot-required setting passed, only become effective if the the setting provided by the SDK template for the chosen template style, do not enforce that already.