State scripts


Including state scripts in Artifacts and disk images

To include state scripts in Artifacts and images, create a new Yocto recipe that inherits mender-state-scripts and copies them into place in do_compile, using the ${MENDER_STATE_SCRIPTS_DIR} variable. This works for both root file system and Artifact scripts.

Take a look at the example-state-scripts recipe to get started.

If you add or remove a recipe containing state scripts to a build, you need to clear the tmp directory of the Yocto build before building a new image. An alternative is to call bitbake -c clean <recipe> with the affected recipe, but the first method is recommended since it will cover all cases, regardless of recipe name. Merely changing a recipe does not require this step.

Found errors? Think you can improve this documentation? Simply click the Edit link at the top of the page, and then the icon on Github to submit changes.