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-managerlaunched 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-managerstops it via the Start script app-managereither downloads the app tarball from DeviceHQ or if manually installing, checks it’s existence at the given path.app-managercreates a directory in/media/card/with the app name from manifest.json.app-managerextracts the contents of the app tarball into that directory- If a config file was selected when queuing the Install command from DeviceHQ,
app-managerdownloads the config file and places it in the config/ directory, overwriting any existing files. app-managerexecutes the Install script with the install argumentapp-managersaves the meta data for the newly installed appapp-managerexecutes the Install script with the postinstall argumentapp-managerstarts the app via the Start script.- The Conduit® checks into DeviceHQ to report new Installed Apps information
Uninstall Process
app-managerlaunched to uninstall a custom appapp-managerstops the app via the Start script.app-managerexecutes the Install script with the remove argumentapp-managerdeletes 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-managerto install dependenciesapp-managerexecutes the Install script with the install argumentapp-managerexecutes the Install script with the postinstall argument
- Launches
app-managerto start the appapp-managerstarts 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
