Skip navigation

Attention!!! Beginning from the 0.2.14-r8 version the changes in security were implemented. For image-making based on 0.2.14-r8 and further, it is necessary to use new operator utilities and manuals (INTERNAL LINK). It is recommended to remake your customized image version based on 0.2.14-r8 for improving the security level.

Documentation & Utilities

 Before you build the image, we recommend you to read the following documentation:

JavaScript API (pdf)
Operator's Guide (pdf)

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;
To decompress files, use the console program “tar” or “unzip”. 

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

For the default key using it is necessary 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 may differ 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 operator utilities 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 made as follows:

./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

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

Operators can initiate the addition of necessary sections in imageupdate setting with the following variables:

Name Description
KERNEL_PATH The location of the image file system that contains the core. If the variable is not assigned, 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 a number of the current image and the new one are the same, the 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 The number of an image version, which should be present in NAND partition named “Userfs”. If the number of the current image and the new one is the same, the 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


Need Help

Dave is an expert on the MAG STB and the author of this article.

Was this article helpful?

Yes No

Sorry to hear that.
How can we improve this article?

We use cookies in order to optimise our website, provide you with the best possible user experience and help us promote our products. Please read our Cookie Policy to find out how we use cookies and how you can control cookies.
By using this website or closing this message, you acknowledge our Privacy Policy and agree to our use of cookies as described in our Cookie Policy.