DHCP server configuration. Loading and updating STB software MAG200
OS
All information is taken from - Operator guide. IPTV MAG-200 High-resolution device.
Example: OS - Ubuntu 12.04 server, STB MAG-200.
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:
vendor_class_id -"TeleTecMAG200boot" dhcp_client_id -"TeleTecMAG200-XX:XX:XX:XX:XX:XX" , whereXX:XX:XX:XX:XX:XX – MAC address of the device (STB)
Section
a. Version number of the Bootloader:
b. Date and time:
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
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
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
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 -
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
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
DHCP server configuring
When the device operates by dhcp protocol, it fills the information element
The example of dhcpd-server configuration is shown in the
The options transferred by the information element
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 fromTeleTec.mcip andTeleTec.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 withTeleTec.mcip_img andTeleTec.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
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-сервер |