Image building for the internal STB software MAG-200/250

Beginning from 0.2.14-r8 version the changes in security were implemented. For image making based on 0.2.14-r8 and further it is necessaru to use new operators utilities and manuals. It is recommended to remake your customized image version based on 0.2.14-r8 for improving security level.

Documentation & Utilities

Before you build the image, we recommend you to read the following documentation: JavaScript API Operator's Guide
Required Utilities: Operator Utils MAG-200 Operator Utils MAG-250

Requirements of OS

*nix OS i386

Recommended OS: Linux Ubuntu i386

Required packets

For example: For Ubuntu 11.04 i386 it is enough to install:

mtd-utils

Image preparing

Recommendation: You need to run all commands with “root” permission; For unpack files use console program “tar” or “unzip”.

It is neccessary to set the operator key by default before image using.

For the default key using it is neccessary to run the following commands:

gpg --import stb_secbin.key
export MAG200_OP_KEY=STB_PUBLIC

Preparing of uImage, uImzlib_null.img, uImzlib.img

For preparing the uImage, uImzlib_null.img, uImzlib.img to use the file ./images/vmlinux.bin (For MAG-200) or ./images/vmlinux.bin.mag250 (For MAG-250).

vmlinux.bin or vmlinux.bin.mag250 which is taken from the release (MAG-200, MAG-250) and place it to the directory ./images

The Command Shell which is in the scripts and system shell can be different from each other!

Run the command:

./kernel_sign.sh

Imageupdate preparing

The operator can make changes based on your needs. For example, a set of utilities to expand or add commands, and implement new algorithms for the interaction with the STB.

In the utilities operator from January 28, 2011 it became possible to imageupdate additionally add the following section is not required:

second image of the bootloader;

logo;

section to set the variables of bootloader;

image of the local bootstrap;

image of a userfs.

The image with additional sections can be make such as:

./img_make.sh 212 "Test_test" ../rootfs MAG200 ./img_make.profile.mag200

where:

212	version of the image, must be a number. After successfully upgrading the standard Bootstrap variable of bootloader “Image_Version” takes this value. Strongly recommended: use number of “image version” the same as it is number in release
“Test_test”	brief description (!Attention! Spaces are not allowed!). After successfully upgrading the standard Bootstrap variable of bootloader “Image_Desc” takes this value
../rootfs	the location of the root file system STB. An example of the root file system rootfs-….tar.gz you can get from release (MAG-200, MAG-250)
MAG200	Model STB for which the assembled image. For STB MAG250 must be MAG250
./img_make.profile.mag200	file in which you can configure additional sections

A sample configuration file img_make.profile.mag200

# Profile for imageupdate
# Kernel's file system
export KERNEL_PATH=./uImzlib.img
# Image Version (digit)
#export IMAGE_VERSION=66
# Image Description
#export IMAGE_DESCRIPTION="Test create New Imageupdate"
# Directory where locate rootfs
#export ROOTFS_PATH=/srv/stb/sg/stm/0.1.60
# File name for enviroment variable
export ENV_VARIABLE_PATH=./images/env.txt
# Bootstrap
#export BOOTSTRAP_VERSION=1
#export BOOTSTRAP_PATH=./images/Bootstrap.img
# Userfs
export USERFS_VERSION=1
export USERFS_PATH=./images/userfs.img
# File name for SecondBoot
export SECONDBOOT_PATH=./images/SbootIm
# File name for Logotype
export LOGOTYPE_PATH=./images/logo.bmp.gz
export MAG200_OP_KEY=STB_PUBLIC

The operator can initiate the addition of the necessary sections in imageupdate setting the following variables:

Name	Description
KERNEL_PATH	The location of the image file system that contains the core. If the variable is not assignment, then use the ./UImzlib.img.
IMAGE_VERSION	The version number of the image must be a number. Similarly, the first parameter when calling ./img_make.sh
IMAGE_DESCRIPTION	brief description. Similarly, the first parameter when calling ./img_make.sh
ROOTFS_PATH	the location of the root file system STB. Similarly, the third parameter when calling ./img_make.sh
ENV_VARIABLE_PATH	This variable should contain the path to the file, which contains the bootloader variables and their meaning. An example of such a file, see env.txt, He shows how to set variables of bootloader, in particular, font color and background color. “$” Symbol should be screened.
BOOTSTRAP_VERSION	The version number of the image, which must be located in the NAND section titled “Bootstrap”. If number of current image and new one are the same, update will not work.
BOOTSTRAP_PATH	The location of the image file system containing Bootstrap . The image is prepared using the bootstrap_img.sh.
USERFS_VERSION	Number of image version,which should be present in NAND partition named “Userfs”. If number of current image and new one are the same, update will not work.
USERFS_PATH	The location of the image user file system (image to be recorded in the section “NAND” with the title “Userfs”). The image is prepared using the userfs_img.sh. Previously the operator must put the necessary files to it in a subdirectory named /userfs.
SECONDBOOT_PATH	The path to the second image bootloader.
LOGOTYPE_PATH	The path to the file logo, prepared by the operator.

Example file env.txt

bg_color=0x00006498
fg_color=0x00FFFFFF
portal1=http://10.1.0.1/stalker_portal/c/index.html
language=ru
update_url=http://10.1.0.1/imageupdate
ntpurl=10.1.0.1
timezone_conf=Europe/Kiev

Most used variables