Install Script
Install Script Details
A template Install script is provided in the custom app template tarball. The Install script is responsible for installing any app dependencies.
- Required to exist at the top level of the application tarball
- It must accept the following command line arguments: install, postinstall, and remove.
- The provided template is configured to install IPK files listed in p_manifest.json, but this script can be fully customized to your needs including removing the IPK installing code.
- This script is the place to download files from the internet or perform actions like
npm install
- The install and postinstall functions must be written in such a way that they can be successfully executed multiple times
- This script is always run as root. Don’t forget to make the permissions on the Install script executable by the appropriate user.
The below process flows show exactly when and how the Install script is executed.
Install Process
app-manager
launched to install a custom app either from a DeviceHQ® command or manually from the command line- If a version of the app is already installed,
app-manager
stops it via the Start script app-manager
either downloads the app tarball from DeviceHQ or if manually installing, checks it’s existence at the given path.app-manager
creates a directory in/media/card/
with the app name from manifest.json.app-manager
extracts the contents of the app tarball into that directory- If a config file was selected when queuing the Install command from DeviceHQ,
app-manager
downloads the config file and places it in the config/ directory, overwriting any existing files. app-manager
executes the Install script with the install argumentapp-manager
saves the meta data for the newly installed appapp-manager
executes the Install script with the postinstall argumentapp-manager
starts the app via the Start script.- The Conduit® checks into DeviceHQ to report new Installed Apps information
Uninstall Process
app-manager
launched to uninstall a custom appapp-manager
stops the app via the Start script.app-manager
executes the Install script with the remove argumentapp-manager
deletes the entire app directory from/media/card/
The Conduit checks into DeviceHQ to report new Installed Apps information
Conduit Firmware Upgrade Process
- Conduit firmware upgrade initiated
- Conduit reboots and upgrades firmware
- On first boot after upgrade, the /etc/init.d/customapp script does the following for each installed app:
- Launches
app-manager
to install dependenciesapp-manager
executes the Install script with the install argumentapp-manager
executes the Install script with the postinstall argument
- Launches
app-manager
to start the appapp-manager
starts the app via the Start script.
- Launches
Warning for Updating Base Packages
The default Install script will both install and remove any opkg dependencies in p_manifest.json using opkg with the –force-depends argument. If you are updating a system library removing a package in this manner may have unintended consequences. If you are upgrading these packages, the opkg commands defined by OPKG_CMD_PREFIX and OPKG_CMD_PREFIX_R should be modified to remove –force-depends