The KerOS Distribution supports OPKG packages (embedded version compatible with dpkg packages).
OPKG packages are used to install customer applications and firmware upgrades (the firmware is installed with an OPKG package). OPKG packages use the .ipk
extension. It is strongly recommended to use OPKG packages to deploy binaries/applications since the backup mechanism relies on it.
A package can either be installed using the network or using a USB key.
After each update, the file /user/.update
is appended with the status of the update. Update status can be:
Error code can be the following:
Partial code corresponds to a successful installation that has conflict in configuration files.
This can cause a problem during an upgrade if the configuration files contain new field or value required by the updated software. The partial code warns the user that a manual modification of the configuration could be required, the list of the modified (and the location of the new ) configuration file being listed above the update status (shadow
and hostapd
in this example).
Example:
cat /user/.update 2017.12.01-14:55:18 -- Update from bscc_v1.13_klk_wifc.ipk: OK 2017.12.01-14:55:19 -- Update from lorasnmp_v1.13_klk_wifc.ipk: OK 2017.12.01-14:55:19 -- Update Status : updated 2, failed 0 , partial 0 result : OK 2017.12.01-15:00:44 -- Update from lorasnmp_v1.12_klk_wifc.ipk: ERROR (10) 2017.12.01-15:00:44 -- Update from toto_1.0.0_klk_lpbs.ipk: OK 2017.12.01-15:00:44 -- Update Status : updated 1, failed 1 , partial 0 result : FAILURE 2017.12.01-15:07:44 Existing conffile /user/rootfs_rw/etc/shadow is different from the conffile in the new package. The new conffile will be placed at /user/rootfs_rw/etc/shadow-opkg. Existing conffile /user/rootfs_rw/etc/hostapd.conf is different from the conffile in the new package. The new conffile will be placed at /user/rootfs_rw/etc/hostapd.conf-opkg. 2017.12.01-15:07:45 -- Update from keros_3.3-beta2-38-g12943bcb_klk-wifc.ipk: OK 2017.12.01-15:07:45 -- Update Status : updated 0, failed 0 , partial 1 result : PARTIAL 2017.12.01-15:12:18 -- Update from lorasnmp.ipk: OK 2017.12.01-15:12:28 -- Update from keros.ipk: OK 2017.12.01-15:12:28 -- Update from bscc.ipk: OK 2017.12.01-15:12:28 -- Update Status : updated 3, failed 0 , partial 0 result : OK 2017.12.01-15:12:28 -- Firmware restored from backup
The following example describes how to trigger an update over network. This example uses a package meant to upgrade the firmware, however, the steps are the same for any other package.
The following example describes how to trigger an update over network. This example uses a package meant to upgrade the firmware, however, the steps are the same for any other package.
# From a computer: scp keros_4.1.6_klkgw-signed.ipk root@<ip_address>:/user/.updates/
# On the gateway: sync
kerosd -u
reboot
/tmp/sys_startup_status.json
under the field sw_version
.The following example describes how to trigger an update over USB key. This example uses a package meant to upgrade the firmware, however, the steps are the same for any other package.
usb.autorun
: Auto executable scriptusbkey.txt
: USB password filekeros_x.y.z.ipk
: the update package/tmp/sys_startup_status.json
under the field sw_version
.
usbkey.txt
is a security file. It includes the password of “usbuser” user.
Find information about the usbuser password in the credential chapter.
In case of consecutive updates on few boards, usbkey.txt
can include multiple passwords (limited to 100). One password per line.
Here is an example of this file for 3 different boards:
usb.autorun
is a script automatically executed by the board if the usbkey.txt
file includes a correct password.
Anything can be done in this script but here is an example used to deploy a new firmware or/and new packages: