• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

01-基础命令参考

07-软件升级命令

本章节下载 07-软件升级命令  (215.26 KB)

docurl=/cn/Service/Document_Software/Document_Center/Routers/Catalog/CR/CR16000-X/Command/Command_Manual/H3C_CR16000-X_CR-R2512-6W202/01/202009/1339723_30005_0.htm

07-软件升级命令


1 软件升级

如果将U盘内的软件包指定为设备下次启动时使用的软件包,重启设备时不要将U盘从设备上拔出,否则可能导致设备无法正常启动。建议将Flash中的软件包指定为设备下次启动时使用的软件包。

1.1  软件升级配置命令

1.1.1  boot-loader file

boot-loader file命令用来配置设备下次启动时使用的软件包。

【命令】

boot-loader file boot filename system filename [ feature filename&<1-30> ] [ patch filename&<1-16> ] { all | slot slot-number } { backup | main }

boot-loader file ipe-filename [ patch filename&<1-16> ] { all | slot slot-number } { backup | main }

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

boot:Boot包。

system:System包。

feature:Feature包。

patch:Patch包。

filename&<1-30>:软件包的名称,形如filesystemname/filename.bin。该文件必须保存在设备任一文件系统的根目录下,该参数中必须包含文件系统的名称,从存储介质名称开始最多可输入63个字符。&<1-30>表示前面的参数最多可以输入30次。有关指定文件夹和文件详细介绍请参见“基础配置指导”中的“文件系统管理”。

ipe-filename:IPE(Image Package Envelope,复合软件包套件)文件的名称,形如filesystemname/filename.ipe。该文件必须保存在设备任一文件系统的根目录下,该参数中必须包含文件系统的名称,从存储介质名称开始最多可输入63个字符。有关指定文件夹和文件详细介绍请参见“基础配置指导”中的“文件系统管理”。

all:指定系统中软件包适用的所有的硬件。

slot slot-number:表示待升级的主控板所在的槽位号。

backup:指定该软件包为备用启动软件包。备用启动软件包用于主用启动软件包不可用或异常情况时,引导设备启动。

main:指定该软件包为主用启动软件包。主用启动软件包用于引导设备启动。

【使用指导】

成功执行该命令后,系统会用命令中指定的软件包替换现有的软件包列表。如果命令行中没有指定Feature包,则更新后的软件包列表中不会有Feature包。

需要重启系统来完成指定下次启动软件包的加载。

系统会自动检查指定slot上对应路径下是否存在同名文件,如果不存在,则直接从指定路径拷贝一份并设置为下次启动软件包;如果存在,则提示用户是否从指定路径拷贝一份并设置为下次启动软件包。

本命令不支持安装叠加补丁。

【举例】

# 配置指定slot下次启动时所用的主用启动文件为flash:/all.ipe。

<Sysname> boot-loader file flash:/all.ipe slot 1 main

Verifying the IPE file and the images............Done.

CR16008-X images in IPE:

  boot.bin

  system.bin

This command will set the main startup software images. Continue? [Y/N]:Y

Add images to slot 1.

File flash:/boot.bin already exists on slot 1.

File flash:/system.bin already exists on slot 1.

Overwrite the existing files? [Y/N]:Y

Decompressing file boot.bin to flash:/boot.bin........................Done.

Decompressing file system.bin to flash:/system.bin...............................Done.

Verifying the file flash:/boot.bin on slot 1...Done.

Verifying the file flash:/system.bin on slot 1.............Done.

The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 1.

# 配置设备的主用下次启动软件为flash:/all.ipe。

<Sysname> boot-loader file flash:/all.ipe all main

Verifying the IPE file and the images.............Done.

CR16008-X images in IPE:

  Boot.bin

  System.bin

This command will set the main startup software images. Continue? [Y/N]:y

Add images to slot 1.

File flash:/Boot.bin already exists on slot 1.

File flash:/System.bin already exists on slot 1.

Overwrite the existing files? [Y/N]:y

Decompressing file Boot.bin to flash:/Boot.bin........................Done.

Decompressing file System.bin to flash:/System.bin...............................Done.

Verifying the file flash:/boot.bin on slot 1...Done.

Verifying the file flash:/system.bin on slot 1.............Done.

The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 1.

File flash:/boot.bin already exists on slot 0.

Do you want to overwrite the file?

 Y: Overwrite the file.

 N: Not overwrite the file.

 A: From now on, overwrite or not overwrite without prompt.

Please make a choice. [Y/N/A]:a

What type of overwrite operation do you want to perform?

  Y: Overwrite without prompt.

  N: Not overwrite or display prompt.

  Q: Return to the previous step.

Please make a choice. [Y/N/Q]:y

An existing file will be overwritten without prompt if it has the same name as any upgrade file.

Loading......................Done.

Loading......................Done.

The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 0.

Decompression completed.                                                        

Do you want to delete flash:/all.ipe now? [Y/N]:n

【相关命令】

·     display boot-loader

1.1.2  boot-loader update

boot-loader update命令用来实现当前软件版本的自动同步。

【命令】

boot-loader update { all | slot slot-number }

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

all:表示同步升级所有备用主控板。

slot slot-number:表示待升级的备用主控板所在的槽位号。

【使用指导】

本命令用于备用主控板和主用主控板/全局备用主控板和全局主用主控板软件版本不一致时,刷新备用主控板/全局备用主控板的软件版本,使其和主用主控板/全局主用主控板的软件版本相同。

通过该命令指定备用主控板/全局备用主控板的下次启动软件包时,系统会进行如下处理:

·     如果主用主控板/全局主用主控板当前是使用主用启动软件包列表启动的,则将其主用下次启动软件包列表中的软件包拷贝到备用主控板/全局备用主控板的对应目录下,并设置为备用主控板/全局备用主控板的主用下次启动软件包。如果这些软件包中有任一软件包不存在或者不可用,则命令执行失败。

·     如果主用主控板/全局主用主控板当前是使用备用启动软件包列表启动的,则将其备用下次启动软件包列表中的软件包拷贝到备用主控板/全局备用主控板的对应目录下,并设置为备用主控板/全局备用主控板的主用下次启动软件包。如果这些软件包中有任一软件包不存在或者不可用,则命令执行失败。

【举例】

# 同步指定slot的软件版本。

<Sysname> boot-loader update slot 2

This command will update the specified standby MPU. Continue? [Y/N]:y

Updating. Please wait...

Verifying the file flash:/boot.bin on slot 2.......Done.

Verifying the file flash:/system.bin on slot 2..................................Done.

Copying main startup software images to slot 2. Please wait.........Done.

Setting copied images as main startup software images for slot 2...

Done.

Successfully updated the startup software images of slot 2.

【相关命令】

·     display boot-loader

1.1.3  display boot-loader

display boot-loader命令用来显示本次启动和下次启动所采用的启动软件包的名称。

【命令】

display boot-loader [ slot slot-number ]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slot slot-number:表示主控板所在的槽位号。不指定该参数时,表示设备上的所有主控板。

【使用指导】

使用该命令可显示设备本次启动和下次启动所采用的启动软件包的名称。

【举例】

# 显示本次启动和下次启动所采用的启动软件包的名称。

<Sysname> display boot-loader

Software images on slot 1:

Current software images:

  flash:/boot.bin

  flash:/system.bin

Main startup software images:

  flash:/boot.bin

  flash:/system.bin

Backup startup software images:

  flash:/boot.bin

  flash:/system.bin

表1-1 display boot-loader命令显示信息描述表

字段

描述

Software images

启动软件包的相关信息

Current software images

最近一次启动使用的启动软件包列表

Main startup software images

主用下次启动软件包列表

Backup startup software images

备用下次启动软件包列表

 

【相关命令】

·     boot-loader file

1.1.4  display cpld version

display cpld version命令用来显示设备或单板系统中CPLD逻辑的版本信息。

【命令】

display cpld version [ slot slot-number ]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number:指定单板的CPLD逻辑版本信息。slot-number表示单板槽位号,未指定该参数时表示设备上的所有单板。

【使用指导】

使用此命令查看系统中正在运行的CPLD芯片的CPLD逻辑版本信息,并能确定相对于软件包中版本的新旧状态,以根据需要决定是否进行更新。

【举例】

# 显示所有CPLD逻辑版本信息。

<Sysname> display cpld version

Location     RunningVersion  FileVersion  VersionComparison  FileName

--------------------------------------------------------------------------------

0/0/1        3.0             3.0          Same               CRAMPU16E02003.vme

0/0/2        3.0             3.0          Same               CRAMPU16E03003.vme

0/0/3        3.0             3.0          Same               CRAMPU16E04003.vme

5/0/1        3.0             3.0          Same               CRACQ12HM01003.vme

5/0/2        2.0             2.0          Same               CRALPUSP01002.vme

5/0/3        129.0           1.0          Earlier            CRALPUSP02001.vme

5/0/4        255.0           1.0          Earlier            CRALPUSP03001.vme

6/0/1        4.0             3.0          Later              CRACQ12HM01003.vme

6/0/2        2.0             3.0          Earlier            CRAFP04HA02003.vme

6/0/3        2.0             4.0          Earlier            CRAFP04HA03004.vme

6/0/4        1.0             1.0          Same               CRAFP04HA04001.vme

6/2/1        3.0             3.0          Same               CRAXP12A01003.vme

10/0/1       3.0             3.0          Same               CRACQ12HM01003.vme

10/0/2       4.0             0.0          N/A                no file

表1-2 display cpld version命令显示信息描述表

字段

描述

Location

CPLD所在位置,格式为槽位号/子槽位号/CPLD编号

RunningVersion

当前正在运行的CPLD逻辑版本

FileVersion

软件包中的CPLD逻辑版本

VersionComparison

当前正在运行的CPLD逻辑版本相对于软件包中的CPLD逻辑版本新旧情况:

·     Earlier:运行的版本老

·     Later:运行的版本新

·     Same:版本一致

·     N/A:软件包中无对应的CPLD逻辑文件

FileName

软件包中的CPLD逻辑文件名

 

【相关命令】

·     update cpld

·     display update cpld status

1.1.5  display update cpld status

display update cpld status命令用来显示CPLD逻辑版本更新操作的进行状态。

【命令】

display update cpld status

【视图】

用户视图

【缺省用户角色】

network-admin

【使用指导】

使用此命令查看系统中CPLD逻辑版本更新操作的执行情况。在telnet断开并重新连接后,更新操作在后台继续执行,可以用此命令确认更新是否完成。

【举例】

# 未进行过更新时,查看状态。

<Sysname> display update cpld status

No CPLD update has been performed since the last system boot or switchover.

# 更新过程中,查看状态。

<Sysname> display update cpld status

CPLD update is in progress.

 

[2020-03-12 08:06:20] Started, 2 CPLDs total.

[2020-03-12 08:06:20] #1 CPLD 10/0/1: successful (2.0 to 3.0)

[2020-03-12 08:06:37] #2 CPLD 10/0/2: 86%...

# 更新完成,查看状态。

<Sysname> display update cpld status

No CPLD update is in progress. Last update status:

 

[2020-03-12 08:06:20] Started, 2 CPLDs total.

[2020-03-12 08:06:20] #1 CPLD 10/0/1: successful (2.0 to 3.0)

[2020-03-12 08:06:37] #2 CPLD 10/0/2: successful (2.0 to 4.0)

[2020-03-12 08:08:17] Finished, 2 success, 0 skipped, 0 failure, 0 error.

 

The update took 1 min 57 sec.

【相关命令】

·     display cpld version

·     update cpld

1.1.6  firmware update

firmware update命令用来升级CPLD等固件。

【命令】

firmware update slot slot-number [ subslot subslot-number ] { cpld cpld-number | module module-number } file filename

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number:指定设备上的单板,slot-number表示单板所在的槽位号。

subslot subslot-number:子卡所在的子槽位号。不指定该参数时,表示单板上的所有子卡。

cpld cpld-number:表示需要升级CPLD(Complex Programmable Logical Device 复杂可编程逻辑器件),cpld-number表示固件的编号。

module module-number:表示需要升级指定模块,module-number表示模块的编号。

file filename:升级文件的名称,形如filesystemname/filename.bin。不同固件升级文件的后缀可能不同,该文件必须保存在设备任一文件系统的根目录下,该参数中必须包含文件系统的名称,从存储介质名称开始最多可输入63个字符。有关指定文件夹和文件详细介绍请参见“基础配置指导”中的“文件系统管理”。

【使用指导】

固件升级后需要对其所在的板卡/设备进行下电后重新上电才能生效。请根据实际支持情况,选择下电方式:

·     切断外部电源

·     插拔板卡

【举例】

# 升级指定slot的1号CPLD。

<Sysname> firmware update slot 1 cpld 1 file package.bin

Updating firmware for CPLD on the specified card or subcard. Continue?[Y/N]:y

Updating the firmware…

Please power cycle the card or subcard to activate the firmware.

1.1.7  update cpld

update cpld命令用来更新设备或单板CPLD芯片的CPLD逻辑,可以一次批量更新多个CPLD芯片。

【命令】

update cpld [ [ slot slot-number [ cpu cpu-number | subslot subslot-number ] [ index cpld-index ] ] ] [ dry-run | allow-downgrade | ignore-version | ignore-status ] *

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number:更新指定单板CPLD芯片的CPLD逻辑。slot-number表示单板槽位号,未指定该参数时表示设备上的所有单板。

cpu cpu-number:通过指定CPU更新CPLD芯片的CPLD逻辑。对于存在多个CPU的单板,cpu-number表示单板上的CPU编号。对于只有一个CPU的单板,无需输入该参数,表示使用单板默认的CPU0进行CPLD逻辑更新。

subslot subslot-number:更新指定子卡CPLD芯片的CPLD逻辑。subslot-number表示子卡所在的子槽位号,未指定该参数时表示所有子卡。

index cpld-index:更新指定CPLD芯片的CPLD逻辑。cpld-number表示单板或子卡上的CPLD芯片编号,未指定该参数时表示所有CPLD芯片。

dry-run:预览更新。仅执行更新流程,但不实际更新。

allow-downgrade:允许降级。不指定此参数时,只会进行升级,指定此参数后,可以进行降级。

ignore-version:忽略版本检查。不指定此参数时,会进行的操作参见allow-downgrade参数的说明,指定此参数后,除了升级,还可以降级,且版本相同也会进行更新操作。

ignore-status:忽略子卡状态。不指定此参数时,要求子卡处于normal状态才可以更新,指定此参数后,子卡即使不处于normal状态也可以进行更新。

【使用指导】

使用此命令更新系统中CPLD芯片软件版本,更新时可以指定更新所有、单个框、单块单板、单块子卡、单个CPLD的逻辑。

更新前建议先用display cpld version命令查询CPLD版本信息,然后用带有dry-run参数的update cpld命令提前了解一下执行过程,再去掉dry-run参数进行正式更新。

更新CPLD逻辑需要较长时间,一旦开始执行不能中断,Ctrl+C或其它快捷键无效。更新过程中,需保证不掉电,单板不能重启和插拔,如果断电、重启或插拔可能导致单板或子卡损坏。更新过程中有详细的提示和进度显示。

更新过程中如果串口断开或telnet断开,更新操作将还在后台继续执行。串口重连后可以看到提示信息和进度显示。telnet重新连上后,使用display update cpld status命令确认更新是否完成。

CPLD逻辑更新后需要对其所在的板卡进行下电后重新上电才能生效。待单板、子卡处于normal状态后可以用display cpld version命令确认是否更新到软件包中的版本。

【举例】

# 更新指定单板上所有CPLD芯片软件版本。

<Sysname> update cpld slot 10

WARNING: The update will take a long time; please do NOT power down

or reset the device, card or subcard during the update.

Removing a card or subcard is also prohibited. Continue? [Y/N]:y

Please wait...

[2020-03-12 08:06:20] Started, 2 CPLDs total.

[2020-03-12 08:06:20] #1 CPLD 10/0/1: successful (2.0 to 3.0)

[2020-03-12 08:06:37] #2 CPLD 10/0/2: successful (2.0 to 4.0)

[2020-03-12 08:08:17] Finished, 2 success, 0 skipped, 0 failure, 0 error.

 

The update took 1 min 57 sec.

After the update, please reboot the device or remove and reinstall

the related card or subcard for the new version to take effect.

表1-3 update cpld命令显示信息描述表

字段

描述

WARNING

更新注意事项:更新CPLD逻辑需要较长时间,一旦开始执行不能中断,更新过程中,需保证不掉电,单板不能重启和插拔,如果掉电、重启或插拔可能导致单板或子卡损坏

#1 CPLD 10/0/1

正在更新此CPLD,#1表示更新到第几个,10/0/1格式为槽位号/子槽位号/CPLD编号

successful (2.0 to 3.0)

更新结果为成功,从2.0更新到3.0,其他可能结果包括:

failed (please try again):更新失败,请重试

skipped (subslot powered off):子卡未上电,无法更新,因此跳过

skipped (update file not found):软件包中无逻辑文件,无法更新,因此跳过

skipped (already version x.0):软件包中版本和运行版本相同,且未指定ignore-version参数,无需更新,因此跳过

skipped (version x.0 later than file y.0):运行版本比软件包中的版本高,且未指定ignore-version或allow-downgrade参数,无需更新,因此跳过

2 success, 0 skipped, 0 failure, 0 error

更新成功、跳过、失败、发生通信错误的计数

 

【相关命令】

·     display cpld version

·     display update cpld status

1.1.8  version auto-update enable

version auto-update enable命令用来开启备用主控板自动加载启动软件包的功能。

undo version auto-update enable命令用来关闭备用主控板自动加载启动软件包的功能。

【命令】

version auto-update enable

undo version auto-update enable

【缺省情况】

备用主控板自动加载启动软件包的功能处于开启状态。当启动过程中,当备用主控板发现自己版本和主用主控板版本不一致时,会自动加载主用主控板的当前启动软件包。

【视图】

系统视图

【缺省用户角色】

network-admin

【使用指导】

备用主控板自动加载的是主用主控板当前的启动软件包。

配置本命令及undo version check ignore命令后,在设备启动过程中,当备用主控板发现自己当前启动软件包版本和主用主控板的当前启动软件包版本不一致时,会自动拷贝主用主控板的当前启动软件包列表中的所有软件包,设置为自己的主用下次启动软件包,并自动重启。这样,能够使得备用主控板启动后,和主用主控板启动软件包的版本一致。

【举例】

# 开启备用主控板自动加载启动软件包的功能。

<Sysname> system-view

[Sysname] version auto-update enable

【相关命令】

·     version check ignore

1.1.9  version check ignore

version check ignore命令用来关闭对备用主控板进行启动软件包版本一致性检查功能。

undo version check ignore命令用来恢复缺省情况。

【命令】

version check ignore

undo version check ignore

【缺省情况】

对备用主控板启动软件包版本一致性检查功能处于开启状态。

【视图】

系统视图

【缺省用户角色】

network-admin

【使用指导】

如果关闭对备用主控板进行启动软件包版本一致性检查功能,当备用主控板和主用主控板启动软件包版本不一致时,备用主控板仍然使用不一致的版本启动,可能会造成设备功能问题。

如果开启对备用主控板进行启动软件包版本一致性检查功能,当备用主控板和主用主控板启动软件包版本不一致时,备用主控板会停留在启动阶段,不能正常启动。

建议用户不要关闭启动软件包版本一致性检查功能。

【举例】

# 开启对备用主控板进行版本一致性检查功能。

<Sysname> system-view

[Sysname] undo version check ignore

【相关命令】

·     version auto-update enable

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们