Skip navigation

OS

All information is taken from - Operator guide. IPTV MAG-200 High-resolution device.

Example: OS - Ubuntu 12.04 server, STB MAG-200.

Example of dhcp.conf

All examples are given for STB MAG-200.
STB MAG-200: Option space - TeleTec

STB software boot mode getting by DHCP protocol

When to STB is set Boot Mode as DHCP then after rebooting STB sends dhcp-request with next parameters:

  1. vendor_class_id - "TeleTecMAG200boot"

  2. dhcp_client_id - "TeleTecMAG200-XX:XX:XX:XX:XX:XX" , where XX:XX:XX:XX:XX:XX – MAC address of the device (STB)

Section vendor_spec contains the next options:
a. Version number of the Bootloader: Vernum – integer numeric value that has the format: XXX with leading zero
b. Date and time: datetime - __DATE__" - "__TIME__ After getting the dhcp-answer the bootloader analyses the presence of options TeleTec.mcip and TeleTec.mcport . If they are present the bootloader connects to the multicast group specified by these parameters and accepts the image from this group. If these options are not specified the image is loaded according to the protocol TFTP from the server address (for example - 192.168.1.1) specified in the string: next-server 192.168.1.1 by the path (for example - mag200/Bootstrap) specified in the string: filename ("mag200/Bootstrap") .

Thereafter the digital signature of the got image is checked using operator key (if it is set to STB) or standard manufacturer's key. After a successful signature checking the image is started. As the root file system is specified the NFS partition located by the address specified in the option root-path (at the beginning of this parameter the server IP-address should be specified followed by a colon and the location of the catalog to be mount as the root file system). The Boostrap ignores the option “rootp-path” .

The contents of the file dhcpd.conf:

  • To load Bootstrap from multicast group 224.10.0.50:9000:
class "MAG200_boot" {
  match if (( option vendor-class-identifier="TeleTecMAG200boot"));

  vendor-option-space TeleTec;
    option TeleTec.mcip    224.10.0.50;
    option TeleTec.mcport  9000;
}  
  • To load Bootstrap according to TFTP protocol:
class "MAG200_boot" {
match if (( option vendor-class-identifier="TeleTecMAG200boot"));
  filename "mag200/Bootstrap";
  next-server 192.168.1.2;
}
  • To load the kernel according to TFTP protocol with the root file system connected via NFS:
class "MAG200_boot" {
  match if (( option vendor-class-identifier="TeleTecMAG200boot"));
  filename "mag200/uImage";
  next-server 192.168.1.2;
  option root-path "192.168.1.2:/srv/mag200/rootfs";
}

The last variant is most often used by integrators for adjusting the program and by operators for checking the image before forming the image for flashing to the device.

File /etc/exports must contain the line: /srv/mag200 *(rw,no_root_squash,sync)

Indication of the basic program loading state STB MAG-200

After the switching on the device, the logo, if set, is displayed on the screen while the front panel indicator shows “200” . Then the bootloader displays information messages on the loading stages on the TV screen and on the front panel indicator.

Basic program loading stages Front panel Messages on the TV screen
Ethernet cable not connected Erln “No link detected!!!”
DHCP request sent dHCP “DHCP
Repeated DHCP request (together with the number of the attempt) dHCP “DHCP Retry#”
DHCP request failed Er10 “DHCP Error”
Loading the core from mtd4 nand “Load from nand”
Error when loading the core from mtd4 Er20 “Error loading image from nand”
mtd4 contents not correct Er20 “Active partition not valid”
Bootstrap from a multicast group load “Multicast load”
Bootstrap according to TFTP protocol tftp “Tftp load”
Digital signature check chec “Checking image”
Wrong image format Er30 “Wrong image”
Wrong digital signature Er30 “Wrong digital signature”
Core/Bootstrap launch GO__ “Loading …”

Bootstrap

Bootstrap allows the operator to upgrade the basic program stored in the device and perform the necessary settings. Bootstrap accepts, checks and launches the image. This image may be presented by the bootstrap signed with operator key installed in the device or by the generally accessible key - (stb_pubbin.key) . Standard bootstrap 1 consists of the Linux kernel and root file system RAM. DHCP-client is launched after the bootstrap. Dhcp-requests of client contain the option vendor-class-identifier set to the value “TeleTecMAG200boot” . If the dhcp-answer contains the parameter TeleTec.mcip_img and TeleTec.mcport_img , the attempts to load the image prepared by the client are performed from the multicast group TeleTec.mcip_img:TeleTec.mcport_img . The parameter TeleTec.ip_log:TeleTec.ip_port determine the addresses, to which bootstrap attempts to send the results of its work. This report can be obtained by issuing, for example, the command: nc –l ip_port from the server with с IP - TeleTec.ip_log . Bootstrap performs the check of the digital signature of an image received using the operator key, if set, otherwise the check is performed with the generally accessible key. Each image subject to upgrading is associated with the following parameters:

  • The date of creating the image by the operator. Bootstrap variable - “Image_Date” ;

  • The image version number. It is specified by the operator when creating the image. The bootstrap variable - “Image_Version” ;

  • Short description. The line is set by the operator. The bootstrap variable - “Image_Desc” .

Then the Version of the received image is compared with Version of the flashed image. If the Version of the received image is less then no upgrading takes place. If the Versions are equal then updating takes place only if the item Image Info Forced in the Bootloader menu has been preset to Yes . If the Version of the received image is greater, the image is upgraded. After the upgrade has succeeded the bootloader variables Image_Version , Image_Date and Image_Desc , as well as the NAND mode is set and the device is restarted. The bootloader variables Image_Version , Image_Date and Image_Desc can be viewed in the Bootloader menu command
Image Info or with the utility fw_printenv. The process of upgrade is accompanied by displaying corresponding messages on the TV screen.

The contents of the file dhcpd.conf:

 class "MAG200_upgrade" {
  match if (( option vendor-class-identifier="TeleTecMAG200upgrade"));
 
  vendor-option-space TeleTec;
    option TeleTec.mcip    224.10.0.50;
    option TeleTec.mcport  9000; 

    option TeleTec.mcip_img     224.10.0.51;
    option TeleTec.mcport_img   9001;

    option TeleTec.ip_log       192.168.1.2;
    option TeleTec.port_log     10000; 
} 

The stages of upgrading the basic program on the device

  • Starting the device in the “DHCP” mode;
  • Bootstrap loading from a multicast group or by TFTP;
  • Digital signature check;
  • Bootstrap start;
  • Receiving the image from a multicast group for refreshing;
  • Checking the digital signature of the image received;
  • Checking the image version number for upgrading;
  • Upgrading sections on the device;
  • Saving bootstrap variables;

Configuration and organization of the updating process using cyclic multicast group

To configure the system of upgrading images on the device using a cyclic multicast group perform the following steps:

  • Adjust DHCP-server;
  • Adjust the utility mcsend for cyclic broadcasting bootstrap and the image to upgrade to multicast group;

  • Prepare images for broadcasting;
  • Start the utility mcsend.

Preparation of images for broadcasting

STB software image making

DHCP server configuring

When the device operates by dhcp protocol, it fills the information element vendor-class-identifier . The analyses of the protocol allow determining some parameters and settings of the device, they are transferred in the answer of dhcp-server and affect the variants of loading and operation of the device.

The example of dhcpd-server configuration is shown in the dhcpd.conf file.

The options transferred by the information element vendor-specific are described in the section “Description of vendor specifics options”.

Configuration of cyclic multicast server

Cyclic multicast groups can be organized using utility mcsend. File mcast.conf contains an example of configuration in which two multicast groups are organized. The first group is 224.10.0.50: 9000 broadcasts boodstrap, the second group is 224.10.0.51: 9001 broadcasts imageupdate.

Utility mcsend is present in Operators utilities: Operator Utilities to make STB software image

The utility with prepared configuration file mcast.conf is started by the following command:

./mcsend -c ./mcast.conf

Desciption of update process using cyclic multicast groups

The process of updating the program in the device using cyclic multicast groups consists of the following stages:

  • Start of the device in the “DHCP” mode. In doing so the device sends a dhcp-request from vendor-class-identifier="TeleTecMAG200boot” and receives the answer from dhcp-server from TeleTec.mcip and TeleTec.mcport ;

  • The device receives the image from the multicast group TeleTec.mcip:TeleTec.mcport (in this example 224.10.0.50: 9000);

  • The correctness of the digital signature is checked using the operator key;
  • The image received is started. In this example it is a bootstrap;
  • Bootstrap is started and sends dhcp-request from vendor-class-identifier=“ TeleTecMAG200upgrade” and receives the answer from dhcp-server with TeleTec.mcip_img and TeleTec.mcport_img ;

  • Bootstrap receives the image from multicast group TeleTec.mcip_img:TeleTec.mcport_img (in this example 224.10.0.51: 9001) – this is imageupdate;

  • The correctness of the digital signature is checked using the operator key;
  • The imageupdate version number is checked;
  • Sections mtd4 and mtd5 are upgraded;
  • The device is restarted in the ”NAND” mode.

The description of the programm update process using fixed cyclic multicast groups

To upgrade the program using “fixed” cyclic multicast groups it is necessary to organize cyclic multicast groups with the utility mcsend (for example). In this situation, the device expects the group 224.50.0.50:9000 to broadcast Bootstrap, while the second group 224.50.0.51: 9001 to broadcast imageupdate. The addresses of the groups are fixed for this procedure. The file mcast_mcman.conf contains the example of a configuration which organizes these two multicast groups.

The process of upgrading the program in the device using “fixed” cyclic multicast groups consists of the following stages:

  • Organize Bootstrap broadcasting at the address 224.50.0.50: 9000 and imageupdate broadcasting - at the address 224.50.0.51: 9001;
  • Switch off the device;
  • Press the key “menu” on the remote control;
  • Switch on the device;
  • Select the menu item “Upgrade Image”/“MC Upgrade”;
  • The device receives the image from multicast group 224.50.0.50: 9000;
  • For checking the correctness of digital signature use operator key;
  • Start the image received. In this example this image is presented by Bootstrap;
  • Bootstrap starts and receives the image from multicast groups 224.50.0.51:9001 – this is the file imageupdate;
  • The correctness of the digital signature is checked using the operator key;
  • Imageupdate version number is checked;
  • Sections mtd4 and mtd5 are upgraded;
  • The device is restarted in the ”NAND” mode.

With this process the basic program on the device can be replaced without using the protocols dhcp and tftp, it will suffice to organize broadcasting the required files and initiate the replacement of the basic program.

Vendor-specific options description

Name Code Type Description Who uses
mcip 3 ip-address IP address of multicast group for kernel/Bootstrap receiving Bootloader
mcport 4 integer 16 Port of multicast group for kernel/Bootstrap receiving Bootloader
oppubfile 9 text Contains the file name, in which prepared operator's key for installation Bootstrap
mcip_img 10 ip-address IP address of multicast group for imageupdate receiving Bootstrap
mcport_img 11 integer 16 Port of multicast group for imageupdate receiving Bootstrap
mcip_mng 12 ip-address IP address of multicast group for commands receiving Firmware
mcport_mng 13 integer 16 Port of multicast group for commands receiving Firmware
ip_log 14 ip-address IP address of the server, on which Bootstrap can send reports Bootstrap
port_log 15 integer 16 Port of server, on which Bootstrap can send reports Bootstrap
logo_x 16 integer 16 Coordinates by x, left-top corner of the logo Bootloader
logo_y 17 integer 16 Coordinates by y, left-top corner of the logo Bootloader
bg_color 18 integer 32 Background color in “XRGB” format for messages while loading Bootloader
fg_color 19 integer 32 Fonts color “XRGB” format for messages while loading Bootloader
VerNumber 20 text Bootstrap version 3 digits with leading zero. Example: substring( option vendor-encapsulated-options,2,3)=“002” Dhcp-сервер
DateTime 21 text Date and time of Bootstrap creation Dhcp-сервер
portal_dhcp 22 text Starting portal, if there are no variables in “portal1” and “portal2” & variable ”use_portal_dhcp” doesn't set or has value “true”. If the variable “use_portal_dhcp” is set to ”false”, then it will not be used Dhcp-сервер

Example of dhcpd.conf file

  dhcpd.conf

option ntp-servers 10.1.1.1;

option domain-name-servers 10.1.1.1;
authoritative;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
allow bootp;


#############################################################
# Option for TeleTec
#############################################################

option space TeleTec;
option TeleTec.update_url code 24 = text;
option TeleTec.update_sboot code 25 = text;
option TeleTec.update_ver code 26 = text;
option TeleTec.update_mode code 27 = text;
option TeleTec.portal_dhcp code 22 = text;
option TeleTec.update_sboot_ver code 28 = text;
option TeleTec.logo_x code 16 = integer 16;
option TeleTec.logo_y code 17 = integer 16;
option TeleTec.bg_color code 18 = integer 32;
option TeleTec.fg_color code 19 = integer 32;
option TeleTec.mcip code 3 = ip-address;
option TeleTec.mcport code 4 = integer 16;
option TeleTec.oppubfile code 9 = text;
option TeleTec.mcip_img code 10 = ip-address;
option TeleTec.mcport_img code 11 = integer 16;
option TeleTec.mcip_mng code 12 = ip-address;
option TeleTec.mcport_mng code 13 = integer 16;
option TeleTec.ip_log code 14 = ip-address;
option TeleTec.port_log code 15 = integer 16;
option TeleTec.VerNumber code 20 = text;
option TeleTec.DateTime code 21 = text;

############################## BOOT MAG200 ###############################

class "MAG200_boot" {
match if (( option vendor-class-identifier="TeleTecMAG200boot"));
filename "mag200/uImage";
next-server 10.1.1.1;
option root-path "10.1.1.1:/srv/mag200";
option ntp-servers 10.1.1.1;
vendor-option-space TeleTec;
}

class "MAG200_vendor" {
match if (( option vendor-class-identifier="TeleTecMAG200"));
next-server 10.1.1.1;
option ntp-servers 10.1.1.1;
vendor-option-space TeleTec;
option TeleTec.portal_dhcp "http://10.1.1.1/stalker_portal/c/index.html";
option TeleTec.update_url "tftp://10.1.1.1/mag200/imageupdate_200_212r2";
option TeleTec.update_ver "212";
option TeleTec.update_sboot "http://10.1.1.1/mag200/SbootIm_038_200";
option TeleTec.update_sboot_ver "038";
option TeleTec.update_mode "tftp://10.1.1.1/mag200/Bootstrap_200_212r2";
}

############################## NETWORK ####################################

subnet 10.1.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
next-server 10.1.1.1;
pool {
range 10.1.1.10 10.1.1.254;
next-server 10.1.1.1;
option ntp-servers 10.1.1.1;
}
}

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.