Create an update package

Android devices in the field can receive and install over-the-air (OTA) updates to the system and application software. Devices have a special recovery partition with the software needed to unpack a downloaded update package and apply it to the rest of the system.

To build an update package for your platform based on Digi's source code, follow these steps:

  1. Set up your environment and install the sources. If you have not already done so, see Set up your development computer.
  2. Change to the directory where the source code is installed.
$ cd dea-<version>
  1. Initialize the build environment:
$ source build/envsetup.sh
  1. Select a ConnectCore 6 target to build:
    1. imx6_ccimx6_sbc-eng creates development images with root access and additional debugging tools.
    2. imx6_ccimx6_sbc-user creates images with no root access, suited for production.

You will see information about the selected target:

$ lunch imx6_ccimx6_sbc-eng
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=imx6_ccimx6_sbc
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-55-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=DAK-5.1.1-r1
OUT_DIR=out
============================================
  
$
  1. When you develop locally, you would typically use plain make with no particular target to compile. When you prepare for release, however, you need to do this instead:
$ make -j<Number_Of_Jobs> dist

It compiles the whole source tree, as a plain make does. Then it generates several zip files inside the out/dist folder of dea-<version> directory:

  • imx6_ccimx6_sbc-ota-<build_id>.zip is the update package that can be installed through recovery. The package contains all the files needed by system, boot and recovery partition.
  • imx6_ccimx6_sbc-target_files-<build_id>.zip contains all the target files (apk, binaries, libraries, etc.) that will go into the final release package.
  • imx6_ccimx6_sbc-apps-<build_id>.zip contains all the apks.
  • imx6_ccimx6_sbc-img-<build_id>.zip contains image files for system, boot, and recovery.
  • imx6_ccimx6_sbc-symbols-<build_id>.zip contains all files in out/target/product/imx6_ccimx6_sbc/symbols.

The file imx6_ccimx6_sbc-ota-<build_id>.zip is the update package to be installed in your ConnectCore 6.

Note To install the update package imx6_ccimx6_sbc-ota-<build_id>.zip in your ConnectCore 6, follow the steps in Update the Android firmware.

Update package with wipe data support

The default imx6_ccimx6_sbc-ota-<build_id>.zip update package generated with make dist does not wipe the user data partition. To do so, you have to regenerate this file using the ota_from_target_files tool.

The ota_from_target_files tool generates an update package from the imx6_ccimx6_sbc-target_files-<build_id>.zip produced by the Android build system in Create an update package.

Use the --wipe_user_data option of this tool to generate an update package with wipe data partition support:

$ ./build/tools/releasetools/ota_from_target_files --wipe_user_data --no_signing --use_raw_images out/dist/imx6_ccimx6_sbc-target_files-<build_id>.zip out/dist/imx6_ccimx6_sbc-ota-wipe_data.zip

CAUTION! Block-based firmware updates are not supported.