< Home

Making an Index File

Procedure

To edit an index file on a PC, perform the following operations:
  1. Create a text file.
  2. Edit the file in a specific format.
  3. Save the file as smart_config.ini.
  4. Copy the smart_config.ini file to the root directory of the USB flash drive.

Index File Formats

  • In a smart_config.ini index file, each line can contain no more than 512 characters. Otherwise, the index file is invalid.

  • The field names in the smart_config.ini index file are case insensitive. All field values except passwords are case insensitive.

  • In the index file, fields related to file loading are all optional, but you must specify at least one file type field. The system software name, configuration file name, and path file name are at most 48 bytes long, and names of other files are at most 64 bytes long.

BEGIN LSW
[GLOBAL CONFIG]
TIMESN=
AUTODELFILE=
ACTIVEMODE=
USB-DEPLOYMENT PASSWORD=
[DEVICEn DESCRIPTION]
OPTION=
ESN=
MAC=
AUTODELFILE=
ACTIVEMODE=
DEVICETYPE=
HMAC=
DIRECTORY=
SYSTEM-SOFTWARE=
SYSTEM-CONFIG=
SYSTEM-PAT=
SYSTEM-WEB=
SYSTEM-SCRIPT=
SYSTEM-USERDEF1=
SYSTEM-USERDEF2=
SYSTEM-USERDEF3=
END LSW

The smart_config.ini index file can contain comments. A comment starts with a semicolon (;). You can add a comment after a field in the same line (separate the field and comment with a space) or the next line.

Table 1 Fields in the smart_config.ini index file

Field

Description

BEGIN LSW

Mandatory. It is the start flag of the index file and cannot be modified.

GLOBAL CONFIG

Mandatory. It is the start flag of the global configuration and cannot be modified.

TIMESN

Mandatory. It indicates when the data was changed. The value is a string of 1 to 16 characters without spaces. The recommended format is yyyymmdd.hhmmss.

For example, if the index file was edited at 08:09:10 on June 28, 2011, you can set this field to TIMESN=20110628.080910.

Each device to be upgraded has a TIMESN field. In a USB-based upgrade, a device sets the TIMESN field before it restarts (or after the upgrade is complete if the device does not need to restart). This TIMESN field cannot be used in the next upgrade. If the upgrade fails after the device restarts, you must change the TIMESN value before starting a USB-based upgrade again.

AUTODELFILE

Optional. It specifies whether to delete the old system software after a successful upgrade.

  • AUTODELFILE=YES: The original system software will be deleted after a successful upgrade.
  • AUTODELFILE=NO: The original system software will not be deleted after a successful upgrade.

The default value of the AUTODELFILE field is NO. If this field does not exist, is empty, or has an invalid value, the default value is used.

The AUTODELFILE field can be used in the global configuration or the configuration for a single device.

  • The AUTODELFILE field in the [GLOBAL CONFIG] section applies globally, and the AUTODELFILE field in the [DEVICEn DESCRIPTION] section applies only to the specific device.

  • If the AUTODELFILE field is set to YES or NO for a device, the configuration takes effect for this device. If the AUTODELFILE field is not set or kept empty for a device, the global configuration takes effect for the device.

ACTIVEMODE

Optional. It specifies the mode in which the downloaded files are activated.

  • DEFAULT: uses the respective default activation modes of the downloaded files.

    The system software and configuration file are activated after the device restarts; the patch file is activated without a need to restart the device; the web page file, and user-defined file do not need to be activated, and the USB-based deployment ends when these files are downloaded.

  • RELOAD: activates the downloaded files by restarting the device.

The default value of the ACTIVEMODE field is DEFAULT. If this field does not exist, is empty, or has an invalid value, the default value is used.

The ACTIVEMODE field can be used in the global configuration or the configuration for a single device.

  • The ACTIVEMODE field in the [GLOBAL CONFIG] section applies globally, and the ACTIVEMODE field in the [DEVICEn DESCRIPTION] section applies only to the specific device.

  • If the ACTIVEMODE field is set to DEFAULT or RELOAD for a device, the configuration takes effect for this device. If the ACTIVEMODE field is not set or kept empty for a device, the global configuration takes effect for the device.

USB-DEPLOYMENT PASSWORD

Optional. It specifies the authentication password for USB-based deployment. If an authentication password has been configured on the device to be upgraded, fill this field with the configured password. If no password is configured on the device, keep this field blank or delete it. Only one authentication password can be specified in an index file. If an index file is used to upgrade multiple devices, configure the same authentication password on these devices.
NOTE:

From V200R007, the authentication password for USB-based deployment cannot be manually configured. If an authentication password has been configured before the upgrade, the password is saved as pre-upgrade configuration after the software version is upgraded to V200R007 or later. It is recommended that you run the undo set device usb-deployment password command to delete the configured password after the upgrade is complete.

DEVICEn DESCRIPTION

Mandatory. It is the start flag of the file description, where n is a device number. The device number starts at 0 and ends at 65535.

NOTE:
  • Each field in the DEVICEn DESCRIPTION section can be used only once. If a field is used repeatedly, no device will match DEVICEn.

  • The system matches the DEVICE fields from top to bottom in the file and stops the matching when it finds a matching device description.

OPTION

Optional. It specifies whether the file information for a device is valid.
  • OPTION=OK: The file information is valid.

  • OPTION=NOK: The file information is invalid and the system does not check the file information for this device.

The default value of this field is OK. If this field does not exist, is empty, or has an invalid value, the default value is used.

ESN

Optional. It specifies the equipment serial number of a device. If this field is set to DEFAULT, the ESN of the device is not checked. If this field is set to another value, the ESN of the device must be the same as the configured value.

The default value of this field is DEFAULT. If this field does not exist or is empty, the default value is used.

The system matches the devices to be upgraded with device description from top to bottom in the index file. The matching priority of the fields is MAC > ESN > DEVICETYPE > DEFAULT (descending order). Once a device matches DEVICEn, files specified in DEVICEn are loaded to the device. When an error occurs during file loading, the system does not match this device with other device description and only generates an error report.

MAC

Optional. It specifies the MAC address of a device, in the XXXX-XXXX-XXXX format. X is a hexadecimal number. If this field is set to DEFAULT, the device MAC address is not checked. If this field is set to another value, the device MAC address must be the same as the configured value.

The default value of this field is DEFAULT. If this field does not exist or is empty, the default value is used.

DEVICETYPE

Optional. It specifies a device type, for example, S5720-HI. If this field is set to DEFAULT, the device type is not checked. If this field is set to another value, the device type must be the same as the configured value.

The default value of this field is DEFAULT. If this field does not exist or is empty, the default value is used.

HMAC

Optional. It specifies the hashed message authentication code (HMAC) used to verify the configuration file to be loaded. The HMAC is a string of 64 characters, which is calculated for the configuration file saved in the USB flash drive by an HMAC-SHA256 calculation tool. The key used to calculate the HMAC must be the same as the HMAC key configured by the set device usb-deployment hmac-key command.

By default, the configuration file to be loaded is not verified.

NOTE:

The HMAC can be generated for a configuration file using an HMAC-SHA256 calculation tool (such as OpenSSL or HashCalc).

If upgrade files include a configuration file, for security purposes, it is recommended that you run the set device usb-deployment config-file password command to configure an encryption password for the configuration file, compress the configuration file using the configured password before saving it in the USB flash drive, and run the set device usb-deployment hmac command to enable HMAC verification on the device to be upgraded and run the set device usb-deployment hmac-key command to configure the HMAC key for HMAC vertification.

DIRECTORY

Optional. It specifies the directory where files are saved in the USB flash drive.
  • If this field is empty or does not exist, files are saved in the root directory of the USB flash drive.
  • DIRECTORY=/abc: Files are saved in the abc directory.

By default, this field is empty.

The directory name specified in the index file must be in the same format as required by the file system.
  • The directory depth must be less than or equal to 4 levels. The full path must start with a slash (/), and subdirectories are separated by a slash. The directory cannot end with a slash. For example, abc/test is a valid directory, whereas /abc/test/ is an invalid directory.
  • Each subdirectory can contain 1 to 15 characters.
  • The directory name is case insensitive and cannot contain spaces and the following special characters: ~ * / \ : ' " < > | ? [ ] %.

SYSTEM-SOFTWARE

Optional. It specifies a system software name, with an extension .cc.

If this field is set, the device compares the specified system software version with the running system software version. If they are the same, the device does not copy the system software from the USB flash drive and stops the upgrade.

SYSTEM-CONFIG

Optional. It specifies a configuration file name, with an extension .cfg or .zip.

SYSTEM-PAT

Optional. It specifies a patch file name, with an extension .pat.

SYSTEM-WEB

Optional. It specifies a web page file name, with an extension .web.7z.

SYSTEM-SCRIPT

Optional. It specifies a script file name.

When this field is specified, the stack configuration will be imported to the device during USB-based deployment. After the device restarts, the stack configuration takes effective.

A script file uses .bat as the file name extension. The file name consists of 5-64 characters. The file content format is the same as the format of a configuration file. The exclamation mark (!) indicates a comment. An example of a script file is as follows:

#
stack slot 0 renumber 2
! Modify the stack ID
#
interface stack-port 0/1
port interface xgigabitethernet 0/0/27 enable
#
interface stack-port 0/2
port interface xgigabitethernet 0/0/28 enable
NOTE:
  • The script file edited in the UNIX or Linux system is not supported because the device cannot identify the content of such a file.
  • Rollback cannot be performed when the script file delivery configuration is incorrect during USB-based deployment. You can modify the script file, modify the incorrect configuration, delete the delivered configuration, and run the script file again to implement USB-based deployment.
  • If a script file contains a command that is not supported by stack and that will be saved to the configuration file, the command will be lost after the device restarts.
  • If the slot ID in the stack commands in the script file is different from the slot ID of the device, the script file cannot be executed. If the stack slot slot-id renumber new-slot-id command is included in the script file, the slot ID in other stack commands must be the same as slot-id in this command. The following is an example of an incorrect script file. The current slot ID of the device is 0, and 2 is the new slot ID used after a restart. Other stack commands should use the current slot ID 0, but not 2.
    #
    stack slot 0 renumber 2 
    #
    interface stack-port 2/1 
    port interface XGigabitEthernet 2/0/1 enable
    
  • The stack cables can be connected before or after the USB-based deployment is complete. If a switch connected by a stack cable becomes a non-master switch after the script file is imported, the switch does not generate a USB-based deployment success report.

SYSTEM-USERDEF1

SYSTEM-USERDEF2

SYSTEM-USERDEF3

Optional. It specifies a user-defined file name.

END LSW

Mandatory. It is the end flag of the index file.

  • When editing an index file, press Enter when a line is finished. After editing the file, save it.
  • If a field is not found, the system considers that the field is left blank.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >