-
Notifications
You must be signed in to change notification settings - Fork 0
Scripts
Every leaf package has the possibility to bring some scripts to run during the installation process:
-
preinstall.sh
-
postinstall.sh
They get run if they exist, leaf will ignore them, if they do not exist. The scripts HAVE to return 0, everything else tells leaf that there was an error and stops the installation process.
leaf needs these scripts to be made executable by using the command chmod +x <myscript> on them using root priveleges. If these scripts are not made executable leaf will fail the execution step and stop the installation process.
This script gets run once the package is extracted but not deployed to the system, you can adjust your installation files
This script gets run once the files of the package have been copied to the root
There are some environment variables to use:
- ROOTDIR
- PKGROOT
This variable is where leaf deploys the package to, please use this as a prefix to root file operations, instead of referring /etc/myconfig use $ROOTDIR/etc/myconfig so that a installation to other directories is possible.
This variable is the path the extracted package lies in before being deployed to the system, normally this directory is /var/cache/leaf/packages/<package>-<version>, this can help the package do some work or bring additional scripts with it that are not in the data/ directory so they do not get deployed to the root.