Sometimes it is necessary to prepare the system for package installation or perform some cleaning action once the update finishes. SWU provides the ability to execute custom shell code at some points during the package installation process. Digi Embedded Yocto already implements this functionality through the update scripts included in the swu-images recipe. Depending on the SWU package to build, the process includes one of the following scripts:
-
update_images.sh
Update script included for SWU packages based on images. -
update_files.sh
: Update script included for SWU packages based on files. -
update_rdiff.sh
: Update script included for SWU packages based on differences.
Digi Embedded Yocto adds code to these scripts to accommodate the system for the install process; however, you can customize them in two ways:
-
Directly modify the desired script in the swu-images recipe to add your custom code. The scripts are located in
<dey_sources_folder>/meta-digi/meta-digi-dey/recipes-digi/swu-images/files/
. -
Replace the script included in the update package with your own by setting the variable
SWUPDATE_SCRIPT
with the full path of the script in your system.
The update script is executed twice during the installation process:
-
Before the installation process starts. At this point, the script is executed with the argument
preinst
. -
After the installation process finishes. At this point, the script is executed with the argument
postinst
.
Using an update script is not mandatory for the SWU package installation process to work properly, but it does provide customization and flexibility. |