Making an Index File
Before USB-based deployment, you must make an index file.
Procedure of Making an Index File
Two methods are available to make an index file of USB-based deployment: use a text file to edit the index file or use eDesk to make an index file.
- Method 1: Edit the index file on the PC:
- Create a text file.
- Edit the file based on the index file format.
- Rename the file as USB_AR.ini.
- Copy the USB_AR.ini file to the root directory of the USB flash drive.
- Method 2: Use eDesk to make an index file:
- Log in to eDesk.
- Choose Select Product, select the corresponding product to access the Config of Udisk Start page, as shown in Figure 4-3. . In
- On the Config of Udisk Start page, click Add to access the Add Device page, as shown in Figure 4-4. Set related parameters. For details, see Table 4-1.
- On the Add Device page, click Add Type. In the displayed dialog box Add Type, select the file type, as shown in Figure 4-5. In the dialog box Add Type, set parameters and click Confirm to save the file type. Return to the Add Device page, and click Confirm to save device information.
- On the Config of Udisk Start page, specify a directory for Index File Storage Directory, select the created index data, and click Create Index File, as shown in Figure 4-6.
- In the displayed dialog box, set the password used to generate an index file, as shown in Figure 4-7, and then click Confirm.
- You have created an index file successfully, as shown in Figure 4-8.
- In the displayed dialog box, click Open Folder to access the index file storage directory and obtain the corresponding index file, as shown in Figure 4-9. The USB_AR.ini in the USB_AR.ini_1506498352439.zip indicates the generated index file.
Index File Format
The index file format is as follows:
BEGIN AR [USB CONFIG] SN= EMS_ONLINE_STATE= [UPGRADE INFO] OPTION= DEVICENUM= [DEVICEn DESCRIPTION] OPTION= ESN= MAC= VERSION= DIRECTORY= FILENUM= TYPEn= FILENAMEn= FILE_HMACn= RESOURCE_NAMEn= RESOURCE_HMACn= EXECUTE_TIMEn= END AR
Field |
Description |
---|---|
BEGIN AR |
Start tag of the index file. This field cannot be modified. This field is mandatory. |
USB CONFIG |
USB flash drive configuration. This field cannot be modified. This field is mandatory. |
SN |
Data change time in the format YearMonthDay.HourMinuteSecond. For example, the value 20110628.080910 indicates 2011-06-28 08:09:10. This field is mandatory. NOTE:
The
SN field is a USB-based deployment flag. A device has a default USB-based
deployment flag. If the USB_AR.ini file exists
in the USB flash drive, the device checks whether the default USB-based
deployment flag and the SN value in the USB_AR.ini file are the same. If they are different, the USB-based deployment
process is triggered. If the deployment succeeds, the value of the
default USB-based deployment flag on the device is changed to the
SN value in the USB_AR.ini file. |
EMS_ONLINE_STATE |
Whether the NMS is online:
This field is mandatory. |
UPGRADE INFO |
Upgrade information header. This field cannot be modified. This field is mandatory. |
OPTION |
Upgrade mode flag. The field has a fixed value of AUTO. This field is mandatory. |
DEVICENUM |
Number of devices to be upgraded using this index file. The value is an integer that ranges from 1 to 100.
This field is mandatory. |
DEVICEn DESCRIPTION |
Description information header of device n. The value of n is an integer that ranges from 1 to 100. This field is mandatory. NOTE:
The value n must be set when you make the index file. |
OPTION |
Whether USB-based deployment is required for the device. The value OK indicates that USB-based deployment is required, and the value NOK indicates that USB-based deployment is not required. This field is mandatory. |
ESN |
Serial number of a device. If the value of this field is DEFAULT, the index file is applicable to all devices. Otherwise, the index file is applicable to a specific device. This field is mandatory. NOTE:
If this field is left empty, this field matches all devices. |
MAC |
MAC address of a device. If the value of this field is DEFAULT, the index file is applicable to all devices. Otherwise, the index file is applicable to a specific device. This field is mandatory. NOTE:
If this field is left empty, this field matches all devices. |
VERSION |
Version number after the upgrade. This field is mandatory. NOTE:
The version must be entered correctly. Otherwise, the device will fail to be upgraded. |
DIRECTORY |
Path for storing deployment files.
This field is mandatory. NOTE:
If this field is left empty, the deployment files are saved in the root directory of the USB flash drive. |
FILENUM |
Number of files to be loaded. If only the system software needs to be loaded, the value of this field is set to 1. If the system software and patch file need to be loaded, the value of this field is set to 2. This field is mandatory. |
TYPEn |
Upgrade file type:
NOTE:
The AR169-P-M9, AR169W-P-M9,
and AR169RW-P-M9 support USB-based VM creation. The requirements are
as follows:
The value of n is an integer that starts from 1. This field is mandatory. |
FILENAMEn |
Upgrade file name. For example, if the value of the TYPE1 field is SYSTEM-EXECUTE and the name of the executable file corresponding to the U disk is test_execute.sh, the value of the FILENAME1 field is test_execute.sh. The value of n is an integer that starts from 1. This field is mandatory. |
FILE_HMACn |
HMAC used to verify a file to be downloaded. The MAC address is a string of 64 characters that is calculated for a specific file using a file checker based on the HMAC-SHA256 algorithm. The key used to calculate the HMAC must be the same as the password configured by the set usb autoupdate password command. The value of n is an integer that starts from 1. NOTE:
This field is optional. This field is mandatory after the hmac enable command is executed to enable HMAC check for USB-based deployment. |
RESOURCE_NAMEn |
Name of the resource file to be upgraded. You can perform operations on the resource file through an executable file. For example, copy the resource file to the device. The resource file must be saved in the root directory of the USB flash drive. The value of n is an integer that starts from 1. This field is optional. |
RESOURCE_HMACn |
Information used to perform HMAC check on the loaded resource file. The MAC address is a string of 64 characters that is calculated for a specific file using a file checker based on the HMAC-SHA256 algorithm. The key used to calculate the HMAC must be the same as the password configured by the set usb autoupdate password command. The value of n is an integer that starts from 1. NOTE:
This field is optional. This field is mandatory after the hmac enable command is executed to enable HMAC check for USB-based deployment. |
EXECUTE_TIMEn |
Execution time of an executable file:
The value of n is an integer that starts from 1. This field is optional. This field is mandatory when upgrade files contain an executable file. |
END AR |
End tag of the index file. This field is mandatory. |
Examples
Example 1
- Data is changed at 08:09:10 on June 28, 2013.
- The NMS is offline.
- Upgrade is required.
- The device ESN is 00080123456789 and the MAC address is 0018-0303-1234.
- The system software system-software01.zip is stored in the root directory of the USB flash drive. The version number is V200R010. The HMAC string is c3caaee8f4f6bd1389f438801e40dad9af30f2fbbe7e8f55121b39c6c16ba488.
The index file that meets the preceding requirements is as follows:
BEGIN AR [USB CONFIG] SN=20130628.080910 EMS_ONLINE_STATE=NO [UPGRADE INFO] OPTION=AUTO DEVICENUM=1 [DEVICE1 DESCRIPTION] OPTION=OK ESN=00080123456789 MAC=0018-0303-1234 VERSION=V200R010 DIRECTORY=DEFAULT FILENUM=1 TYPE1=SYSTEM-SOFTWARE FILENAME1=system-software01.zip FILE_HMAC1=c3caaee8f4f6bd1389f438801e40dad9af30f2fbbe7e8f55121b39c6c16ba488 END AR
Example 2
- Data is changed at 08:09:10 on June 28, 2013.
- The NMS is offline.
- Upgrade is required.
- The system software system-software01.zip is stored in the root directory of the USB flash drive. The version number is V200R010. HMAC check is not required for any file.
The index file that meets the preceding requirements is as follows:
BEGIN AR [USB CONFIG] SN=20130628.080910 EMS_ONLINE_STATE=NO [UPGRADE INFO] OPTION=AUTO DEVICENUM=1 [DEVICE1 DESCRIPTION] OPTION=OK ESN=DEFAULT MAC=DEFAULT VERSION=V200R010 DIRECTORY=DEFAULT FILENUM=1 TYPE1=SYSTEM-SOFTWARE FILENAME1=system-software01.zip END AR
Example 3
- Data is changed at 08:09:10 on June 28, 2013.
- The NMS is offline.
- The ESN of the first device is 00080123456789. The MAC address is 0018-0303-1234. The name of the system software is V200R010.zip. The version number is V200R010. The configuration file system-config01.zip must be loaded. HMAC check is not required for any file.
- The ESN of the second device is 66680123456789. The MAC address is 0018-0303-5678. The name of the system software is V200R010.zip. The version number is V200R010. The configuration file system-config02.zip must be loaded. HMAC check is not required for any file.
The index file that meets the preceding requirements is as follows:
BEGIN AR [USB CONFIG] SN=20130628.080910 EMS_ONLINE_STATE=NO [UPGRADE INFO] OPTION=AUTO DEVICENUM=2 [DEVICE1 DESCRIPTION] OPTION=OK ESN=00080123456789 MAC=0018-0303-1234 VERSION=V200R010 DIRECTORY=DEFAULT FILENUM=2 TYPE1=SYSTEM-SOFTWARE FILENAME1=V200R010.zip TYPE2=SYSTEM-CONFIG FILENAME2=system-config01.zip [DEVICE2 DESCRIPTION] OPTION=OK ESN=66680123456789 MAC=0018-0303-5678 VERSION=V200R010 DIRECTORY=DEFAULT FILENUM=2 TYPE1=SYSTEM-SOFTWARE FILENAME1=V200R010.zip TYPE2=SYSTEM-CONFIG FILENAME2=system-config02.zip END AR
Example 4
- Data is changed at 08:09:10 on January 7, 2016.
- The NMS is offline.
- VM installation is required.
- The VM installation package (OVA file) usb.ova is stored in the root directory of the USB flash drive. The version number is V200R007C00. The HMAC string is 5c27a53005048beaa9f518da42912484edbf6bdd5a157ea777c8e80087a08b03.
- The VM configuration file osp_cfg.zip is stored in the root directory of the USB flash drive. The HMAC string is a1735904e3df0abf0bc2a3a7a32f33ecd641eaeb575ba4f5e88810df92c7fdce.
BEGIN AR [USB CONFIG] SN=20160107.080910 EMS_ONLINE_STATE=NO [UPGRADE INFO] OPTION=AUTO DEVICENUM=1 [DEVICE1 DESCRIPTION] OPTION=OK ESN=DEFAULT MAC=DEFAULT VERSION=V200R007C00 DIRECTORY=DEFAULT FILENUM=2 TYPE1=SYSTEM-OSP FILENAME1=usb.ova FILE_HMAC1=5c27a53005048beaa9f518da42912484edbf6bdd5a157ea777c8e80087a08b03 TYPE2=SYSTEM-CONFIG FILENAME2=osp_cfg.zip FILE_HMAC2=a1735904e3df0abf0bc2a3a7a32f33ecd641eaeb575ba4f5e88810df92c7fdce END AR
Example 5
- Data is changed at 08:09:10 on August 25, 2016.
- The NMS is offline.
- Upgrade is required.
- The configuration file is stored in the root directory of the USB flash drive and named vrpcfg.cfg.
- The master Android system database file is stored in the root directory of the USB flash drive and named settings.db.
- The slave Android system database file is stored in the root directory of the USB flash drive and named mos_settings.db.
- The APK file is stored in the root directory of the USB flash drive and named Player.apk.
- The Android boot logo file is stored in the root directory of the USB flash drive and named bootanimation_armaster.zip.
The index file that meets the preceding requirements is as follows:
BEGIN AR [USB CONFIG] SN=20160825.080910 //The SN needs to be changed during each device deployment. The current time is recommended as the SN. EMS_ONLINE_STATE=NO [UPGRADE INFO] OPTION=AUTO DEVICENUM=1 //Number of devices to be upgraded. [DEVICE1 DESCRIPTION] OPTION=OK ESN=DEFAULT MAC=DEFAULT VERSION=V200R006C12 //Upgrade version. It must be correct; otherwise, the deployment will fail. DIRECTORY=DEFAULT FILENUM=6 //Actual number of deployment files. TYPE1=SYSTEM-EXECUTE //The app-list.xml file is mandatory. FILENAME1=huawei_execute1.sh RESOURCE_NAME1=app-list.xml EXECUTE_TIME1=0 TYPE2=SYSTEM-EXECUTE //Executable files can be increased based on the number of deployment apps. FILENAME2=huawei_execute2.sh RESOURCE_NAME2=Player.apk EXECUTE_TIME2=0 TYPE3=SYSTEM-CONFIG //VRP configuration file. FILENAME3=vrpcfg.cfg TYPE4=SYSTEM-CONFIG //Master Android system database file. FILENAME4=settings.db TYPE5=SYSTEM-CONFIG //Slave Android system database file. FILENAME5=mos_settings.db TYPE6=SYSTEM-EXECUTE //Boot logo file. FILENAME6=huawei_execute3.sh RESOURCE_NAME6=bootanimation_armaster.zip EXECUTE_TIME6=0 END AR
Edit executable files.
New folders can be created and APK files can be copied on a device after the device reads the SYSTEM-EXECUTE field and executes the huawei_execute1.sh file. The huawei_execute1.sh file is as follows:
#!/bin/sh mkdir -p /mnt/rom/usbresource cp -r $1 /mnt/rom/usbresource chmod 777 -R /mnt/rom/usbresource
Subsequent executable files (huawei_execute2.sh and huawei_execute3.sh) have the same content and must be named differently depending on APK files so that APK files can be automatically copied from the USB flash drive to a device. The content is as follows:
#!/bin/sh cp -r $1 /mnt/rom/usbresource chmod 777 -R /mnt/rom/usbresourcee
Editing the app detection file app-list.xml.
The format of an app detection file is as follows:
<?xml version="1.0" encoding="utf-8"?> <list> <apk> <name>com.huawei.subpackagename</name> <version>20141024</version> <target>ARMaster</target> <status>install</status> <startinfo>com.huawei.subpackagename,com.huawei.subpackagename.MainActivity</startinfo> <url>/mnt/vrprootfs/mnt/rom/usbresource/player.apk</url> </apk> <apk> <name>com.huawei.subpackagename</name> <version>20141024</version> <target>ARSlave</target> <status>uninstall</status> <startinfo>com.huawei.subpackagename,com.huawei.subpackagename.MainActivity</startinfo> <url>/mnt/vrprootfs/mnt/rom/usbresource/player.apk</url> </apk> </list>
Field |
Description |
---|---|
<list></list> |
The app detection file is in list format. |
<apk></apk> |
APK information to be configured. NOTE:
If the device needs to operate multiple APK files, add multiple such fields to the app detection file. |
<name></name> |
Name of the APK software package. |
<version></version> |
APK version number. NOTE:
The value of this field must be the same as the version of the APK file to be installed, uninstalled, or updated; otherwise, the device repeatedly installs, uninstalls, or updates the APK file. |
<target></target> |
Android system type of the APK file:
|
<status></status> |
Operation type:
|
<startinfo></startinfo> |
Automatic APK startup information, in the format "<startinfo>package name, path and type of the main Activity to be started<startinfo>". If an APK file has the automatic startup attribute and is expected to start after the device starts, this field must be configured. |
<url></url> |
Storage path of an APK file on the device. |