All information taken from - “Operator guide. IPTV MAG-200 High resolution device.”
Original documentation: Operator guide
Example: OS - Ubuntu 12.04 server, STB MAG-200.
STB MAG-200 - Option space - TeleTec
STB MAG-250 and subsequent models - Option space - Infomir
STB sends dhcp-request with next parameters:
vendor_class_id
- " TeleTecMAG200boot "
dhcp_client_id
- "TeleTecMAG200-XX:XX:XX:XX:XX:XX"
, где XX:XX:XX:XX:XX:XX
– MAC address of the devicevendor_spec
contains next optionsVernum
– format string "XXX"
with leading zero datetime
- __DATE__"
- "__TIME__
Having received the dhcp-answer the bootloader analyses the presence of options TeleTec.mcip
and TeleTec.mcport
. If they are present the bootloader connectsto 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 next-server located on the route filename("mag200/Bootstrap")
.
Thereafter the digital signature of the loaded image is checked using the installed operator key. After the check the image is started specifying the nfs section situated at the address specified in the option “root-path”
as the root file system (the IPof the server should be specified in the beginning of this parameter followed by a colon and the location of the catalogue to be assembled as the root of the file system). The Boostrap ignores the option “rootp-path”
.
The contents of the file dhcpd.conf:
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; }
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 protocol tftp 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)
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 lauch | GO__ | “Loading …” |
Bootstrap allows to the operator upgrading the basic program stored in the device and performing 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 the root file system RAM. DHCP-client is launched after the bootstrap. The dhcp-requests of the client contain the option vendor-class-identifier
set to the value “TeleTecMAG200boot”
. If the dhcp-answer contains 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 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:
“Image_Date”
;“Image_Version”
;“Image_Desc”
.
Then the version number of the image received is checked. If the image number is higher than the number of the image flashed, no upgrading takes place. If the numbers are equal, the refreshing takes place only provided the item “Image Info”/ “Forced”
in the bootstrap menu has been set to “Yes”
. If the image number is higher, the image is upgraded. After upgrade has succeeded the bootstrap variables “Image_Version”
, “Image_Date”
and “Image_Desc”
, as well as the “NAND”
mode are set and the device is re-started. The bootstrap variables “Image_Version”
, “Image_Date”
and “Image_Desc”
can be viewed in the bootstrap menu “Image Info”
or with the utility fw_printenv. The process of upgrade is accompanied with 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; }
To configure the system of upgrading images on the device using a cyclic multicast group perform the following steps:
bootstrap
and the image to upgrade to multicast group;
When the device is operation according to dhcp protocol, it fills the information element vendor-class-identifier
. The analyses of the protocol allows 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”.
Cicular multicast groups can be organized using the utility mcsend. The file mcast.conf contains the example of configuration, in which two multicast groups are organized. The first one 224.10.0.50: 9000 broadcasts boodstrap, the second one 224.10.0.51: 9001 broadcasts imageupdate.
mcsend is present in Operators utilities: Operator Utils MAG-200 Operator Utils MAG-250)
The utility with prepared configuration file mcast.conf is started by the following command:
./mcsend -c ./mcast.conf
The process of updating the program in the device using cyclic multicast groups consists of the following stages:
vendor-class-identifier="TeleTecMAG200boot”
and receives the answer from dhcp-server from TeleTec.mcip
and TeleTec.mcport
;TeleTec.mcip:TeleTec.mcport
(in this example 224.10.0.50: 9000);vendor-class-identifier=“ TeleTecMAG200upgrade”
and receives the answer from dhcp-server with TeleTec.mcip_img
and TeleTec.mcport_img
; TeleTec.mcip_img:TeleTec.mcport_img
(in this example 224.10.0.51: 9001) – this is imageupdate;
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 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:
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.
Name | Code | Type | Description | Who use |
---|---|---|---|---|
mcip | 3 | ip-address | IP address of multicast group for kernel/Bootstrap receiving | Boolloader |
mcport | 4 | integer 16 | Port of multicast group for kernel/Bootstrap receiving | Boolloader |
oppubfile | 9 | text | Contains the file name, in which prepeared 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 grop for commands receiving | Firmware |
ip_log | 14 | ip-address | IP address of 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 logo | Boolloader |
logo_y | 17 | integer 16 | Coordinates by y, left-top corner of logo | Boolloader |
bg_color | 18 | integer 32 | Background color in “XRGB” format for messages while loading | Boolloader |
fg_color | 19 | integer 32 | Fonts color “XRGB” format for messages while loading | Boolloader |
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 is 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 used | Dhcp-сервер |
<spoiler|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; ############################################################# # Option for Infomir ############################################################# option space Infomir; option Infomir.autostart code 1 = text; option Infomir.bootargs code 2 = text; option Infomir.mcip code 3 = ip-address; option Infomir.mcport code 4 = integer 16; option Infomir.oppubfile code 9 = text; option Infomir.mcip_img code 10 = ip-address; option Infomir.mcport_img code 11 = integer 16; option Infomir.mcip_mng code 12 = ip-address; option Infomir.mcport_mng code 13 = integer 16; option Infomir.ip_log code 14 = ip-address; option Infomir.port_log code 15 = integer 16; option Infomir.logo_x code 16 = integer 16; option Infomir.logo_y code 17 = integer 16; option Infomir.bg_color code 18 = integer 32; option Infomir.fg_color code 19 = integer 32; option Infomir.VerNumber code 20 = text; option Infomir.DateTime code 21 = text; option Infomir.portal_dhcp code 22 = text; option Infomir.timezone code 23 = text; option Infomir.update_url code 24 = text; option Infomir.update_sboot code 25 = text; option Infomir.update_ver code 26 = text; option Infomir.update_mode code 27 = text; option Infomir.update_sboot_ver code 28 = 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"; } ############################## BOOT MAG250 ################################ class "MAG250_boot" { match if (( option vendor-class-identifier="InfomirMAG250boot")); filename "mag250/uImage_mag250"; next-server 10.1.1.1; option root-path "10.1.1.1:/srv/mag250"; option ntp-servers 10.1.1.1; vendor-option-space Infomir; } class "MAG250_vendor" { match if (( option vendor-class-identifier="InfomirMAG250")); next-server 10.1.1.1; option ntp-servers 10.1.1.1; vendor-option-space Infomir; option Infomir.portal_dhcp "http://10.1.1.1/stalker_portal/c/index.html"; option Infomir.update_url "tftp://10.1.1.1/mag250/imageupdate_250_212r2"; option Infomir.update_ver "212"; option Infomir.update_sboot "http://10.1.1.1/mag250/SbootIm_mag250"; option Infomir.update_sboot_ver "007"; option Infomir.update_mode "tftp://10.1.1.1/mag250/Bootstrap_250_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; } }
</spoiler>