Pre-provision your SimpleSwitch™ images#
For all SimpleSwitch™ images you can provision files and folders in the /apps
partition directly from the build system,
so users can edit them in an installed image with the help of e.g. simpleswitch-filebrowser.
This supports also copying files and folders from all pre-installed SIMPLESWITCH_PACKAGES.
Provisioning support for recipes#
By adding
inherit simpleswitch-provision-recipe
to your recipe and then setting up
SIMPLESWITCH_PROVISION_FILES:append = " <source file or folder>:<destination file or folder>"
you can copy over files and folders if that recipe is part of a SimpleSwitch™ image.
For instance
SIMPLESWITCH_PROVISION_FILES:append = " ${datadir}/myapp/config:/myapp/config"
would copy the file /usr/share/myapp/config
to /apps/myapp/config
.
Note
if ${datadir}/myapp/config
is a folder it will copy the whole folder
Add dynamically provisioning#
If you want to create files dynamically for provisioning, you can use
pkg_postinst:${SIMPLESWITCH_PROVISION_PACKAGE}:append () {
if [ -n "$PROVISION_DIR" ]; then
# create files and folders
# please make sure that everything is installed into $PROVISION_DIR
# e.g. echo "SimpleSwitch is great" > $PROVISION_DIR/message-of-the-day.txt
fi
}
into your recipe that has inherit simpleswitch-provision-recipe
included.