====== 21 Updater ====== // see also [[http://dokuwiki.haprotec.de/products/haproplace/hud/spec/updater|HAPROplace Updater]] .// The updater consists of the following components: - ''updatePackage.tar.gpg'': Encrypted package containing the ''updatePackage.tar'' archive * Uploaded to the device via the web interface - ''updatePackage.tar'': archive containing the ''install'' script and the ''components'' directory * is included in the ''updatePackage.tar.gpg'' package - ''components'': directory containing the actual updates in the form of debian packages * is included in the ''updatePackage.tar'' archive - ''install'': script executed by ''setup'' * is included in the ''updatePackage.tar'' archive - ''setup'': script that runs at every boot and runs ''install'' (if present) ===== Update Package ===== * Update Package is a gpg encrypted tar archive * Uploaded to the device via the web interface * root-node decrypts the update package * decrypted file is the update archive (tar) and is called ''updatePackage.tar'' * if decryption succeeds: * root-node unpacks the update-archive ''updatePackage.tar'' to ''/var/local/setup/'' ===== Update archive ===== * ''updatePackage.tar'' contains the ''install'' script and the ''components'' directory * install-script ''/var/local/setup/install'' * Directory ''/var/local/setup/components/'' ==== Create ==== * [[https://gitlab.com/haprotec/deb-package-creator|update-package-creator]] ===== Components archive ===== * ''components'' directory, which contains the actual updates in the form of debian packages ==== Create ==== * [[https://gitlab.com/haprotec/deb-package-creator|deb-package-creator]] ===== Install script ===== * ''install'' is a Python script that performs the actual update * is located in ''/var/local/setup'' * standard operation: install the debian packages in ''components/'' (s.o.) (?) * additional actions optional (rights, other installs, etc. etc.) ===== Setup script ===== // 20160905: No longer own setup script, as the same script in [[https://gitlab.com/haprotec/raspi-sd-builder/tree/master/applications/hud/templates/usr/lib/haprotec/haprotec-setup|raspi-sd-builder -> haprotec-setup]] // * "webic-setup" is a Python script that executes the install script * Default operation: searches for a script ''/var/local/setup/install'' * if available: execute * automatically empties the folder ''/var/local/ setup'' after successful execution of the install script * If the install script ends with exit-code ''100'', the system restarts and the script is called again * installation * is in ''/usr/etc'' * must be executable (chmod +x) * template is in [[https://code.hampel-soft.com/haprotec-hud-webic/blob/master/_install/webic-setup|webic-setup]] (siehe auch [[https://gitlab.com/haprotec/raspi-sd-builder/tree/master/applications/hud/templates/usr/lib/haprotec/haprotec-setup|haprotec-setup]]) * is executed by ''systemd'' on every boot * service file is in ''/etc/systemd/system'' * template is in [[https://code.hampel-soft.com/haprotec-hud-webic/blob/master/_install/webic-setup.service|webic-setup.service]] (siehe auch [[https://gitlab.com/haprotec/raspi-sd-builder/blob/master/applications/hud/templates/etc/systemd/system/haprotec-setup.service|haprotec-setup.service]]) * activate with ''sudo systemctl enable webic-setup'' ---- **Python scripts** *shebang = ''#!/usr/bin/env python3'' *prerequisite: a symlink of python3->python3.4 *to be created with ''ln -s /usr/bin/python3.4 /usr/bin/python3''