User Tools

Site Tools


Sidebar

Kerlink Wiki Home Page

Home

Setups

General information

Wirnet™ iBTS information

Wirnet™ iFemtoCell information

Wirnet™ iFemtoCell-evolution information

Wirnet™ iStation information

System management

Network management

LoRa Features

KerOS customization

Support and resources



www.kerlink.com

wiki:upgrade_keros3_to_4

This is an old revision of the document!


Upgrade from KerOS version 3.x to 4.x with custom liveburner

KerOS v4.x introduces some important modifications (new Kernel, rootfsRW, hotfixing) requiring an upgrade with a liveburner. This page will provide a way to do this upgrade with conservation of some elements like the configuration and reinstall some additional packages.

Introduction

A liveburner package will by default flash the eMMC content and install only the KerOS package. So any package, data and configurations will be lost using such upgrade package.
This upgrade will be problematic for products already on the field that needs to keep a Device Management link UP and RUNNING before and after the upgrade.

To solve this, this procedure will provide:

  • A way to backup some files (i.e. configurations) before flashing the eMMC and restore them at the end of the upgrade.
  • A tool to customize a liveburner in order to add some additional packages during the upgrade.

Please note that an upgrade is always risky and must be tested and validated before deploying on the products on the field. We also recommend to upgrade products in small batches and not all the products in a row.

Upgrade procedure

When using this customized liveburner, the following steps are done to achieve the upgrade:

  1. Deploy and install the customized liveburner IPK on the product.
  2. Product will restart on the liveburner upgrade tool.
  3. Execution of the script preinst to mount a safezone and copy the files to backup on it.
  4. Upgrade of the KerOS system including the eMMC flash and installation of the KerOS package.
  5. Execution of the preapps and/or postapps scripts to access to the safezone and restore/merge saved files.
  6. Installation of the additional packages and save in backup.
  7. Restart on the new KerOS system.

Requirements

  • A desktop Linux machine (native or virtual).
  • An original KerOS liveburner 4.x package available in the resources page.
  • The update_liveburner_package-4.0-g8c53719.tar.gz tool available here.
  • The following packages:
    sudo apt-get install device-tree-compiler cpio binutils

Limits

Some limits are present in this upgrade mechanism:

  • Safezone space: 2MiB.
  • Additional packages max size cumulated: 20MiB.
  • Secure Storage is lost for products without Secure Boot activated.

Usage

Generate a custom liveburner (from a Linux machine)

Default process

First, uncompress the update_liveburner package:

#tar -xvzf update_liveburner_package-4.0-g8c53719.tar.gz
update_liveburner.sh
dumpimage
mkimage
fitimage.its
preinst
preapps

The package is ready to be used but will only backup/restore the network configuration files.

Then you can launch a generation of custom liveburner using the following command:

#./update_liveburner.sh liveburner_4.0.X_klk-lpbs-signed.ipk preinst preapps
Liveburner custom-liveburner_4.0.X_klk-lpbs-signed.ipk created

Additional packages can be installed simply by adding them as arguments.

./update_liveburner.sh liveburner_4.0.2_klk-lpbs-signed.ipk preinst preapps my_packet.ipk

Advanced process with customization (experienced user)

Default upgrade will only keep the network configuration but it is possible to customize it using the preinst and preapps scripts. Please note that some variables/mountpoints are provided:

Variable Role Example
ROOTFSRW_PATH Root path adapted to the firmware version. For KerOS < 4.0 it will be /user/rootfs_rw/ and for >= 4.0 version it will be / cp ${ROOTFSRW_PATH}/etc/hosts ${SAFEZONE_MOUNTPOINT}/
SAFEZONE_MOUNTPOINT The mountpoint to use to access the safezone cp ${ROOTFSRW_PATH}/etc/hosts ${SAFEZONE_MOUNTPOINT}/
/user The mountpoint to use to access the RW USER partiton cp /user/myfile.txt ${SAFEZONE_MOUNTPOINT}/

In case of custom upgrade, please note that the management of the content of the safezone needs to be done using the scripts preinst and preapps like detailed below.

The recommended way is at least to clean the safezone content before starting to backup your files. The only file that must be kept in the safezone is keros_config.tar.gz.

Save

Saving files must be done using the preinst script. It will be executed before installing the new firmware. As an example, the preinst script provided will backup the network configuration files in the safezone.
To add some files, append them at the end of the script like shown in the commented example line.

File to download - Preinst.sh

In case of customer blocking problem during the execution of this script, it is possible to interrupt the upgrade. To do so, it is possible to use the function fatal_error in the customer part of the script like this:

cp ${ROOTFSRW_PATH}/etc/non_existant_file ${SAFEZONE_MOUNTPOINT}/ || fatal_error "Error detected! stop the upgrade!!"

In addition, customers must take care about the last command launched by the script. If it returns an error, the upgrade will also be aborted.

This script is the last chance to stop an upgrade without consequences on the system. After this script, the upgrade is started and errors in other scripts will not stop the process.

Restore

To restore, 2 ways are possible:

  • Restore using the preapps/postapps scripts.
  • Use scripts in application packages.

The first way is the more simple way. It consist of adapting the preapps/postapps scripts (like for preinst). Kerlink recommends this method.

File to download - Preapps.sh

preapps script will be launched after the installation of the KerOS firmware but before installing any application package. postapps script will be launched after the installation of all the application packages.

The second way to restore files is to add pre/post scripts in the applications packages themselves, The drawback of this method is that application packages will be saved in backup. So the risk is to restore the files in safezone during a restoration of the product!

Install a custom liveburner

To upgrade your system, follow the software update process. Information here.

Expected traces of upgrade

Please find here the important part of a liveburner upgrade with save/restoration of network files:

traces.log

wiki/upgrade_keros3_to_4.1545919935.txt.gz · Last modified: 2019/01/17 10:01 (external edit)