fwflash - 固件查询与更新实用程序
/usr/sbin/fwflash [-l [-c device_class | ALL ]] | [-h]
fwflash [-f file1, file2,file3,... | -r file] [-y] [-d device_path]
fwflash 命令将二进制映像文件写入与 Solaris 主机连接的可执行 flash 操作的受支持设备。如果设备支持,此命令还能够将固件读取到文件中。由于更改设备的固件可能严重影响系统的稳定性,只有特权为 All 的用户才能执行此命令。可以向授权运行 fwflash 的用户授予 “Firmware Flash Update”(固件 Flash 更新)权限配置文件。
上述第一种形式的命令可提供设备的信息。它列出系统中 fwflash 支持进行固件升级的所有当前可用设备。您可以过滤列表操作,只显示指定类别的设备。第二种形式的命令可实现从指定设备读取固件映像或将固件映像写入到指定设备的操作。
支持以下选项:
可选参数,仅在与 –l 选项一起使用时有效。使用此选项时,此命令仅列出特定类别的设备。不会列举其他任何设备类别。Currently supported classes are IB, ETH, enclosure, disk, or ALL.如果没有为 –l 选项指定 –c,则类别缺省设置为 ALL。
此选项将搜索限制在指定类别内。Use IB for InfiniBand, ETH for Ethernet, enclosure for SCSI enclosures, and disk for SCSI/SATA/SAS/FC disks.
dev_path 为用户希望通过 –f 或 –r 操作修改的设备的绝对路径名称。如果找不到设备,此命令会失败。如果指定了 –d 选项,还必须指定 –f 或 –r。
指定要向设备写入的一个或多个二进制固件映像文件的路径。fwflash 将验证每个文件是否为指定设备的有效固件映像。如果不是,此命令将失败并生成一条相应的错误消息。Cards running secure firmware have additional restrictions (see NOTES section below).
如果指定了多个固件映像文件,则按照命令行中的顺序验证每个映像并将映像 flash 写入到设备中。如果有任一指定文件不能成功进行 flash 写入,将显示一条相应的消息。
将新固件映像 flash 写入到设备后,必须重新引导才能正确激活新固件。
显示 fwflash 的命令行用法消息。
列出系统中可以升级固件的设备并显示每个设备或设备类别的特定信息。
For InfiniBand (IB) and Ethernet (ETH) devices, the list operation displays the guids (Globally Unique Identifier) and MAC addresses currently set for the device, as well as the current firmware revision installed.There are four separate guids on the device; two of them can be set with the same value.Typically, there are two MAC addresses, one for each port on the device.Secure firmware cards will also show the firmware security attributes (see NOTES section below).
对于 SCSI 套件服务(ses 或 sgen)设备,则显示可识别的目标端口全球名称(如果存在)。
指定从设备中读取固件时创建的文件的路径。–f 和 –r 选项互斥。
并非所有可执行 flash 操作的设备都支持从设备中读回固件映像。At present, only InfiniBand (IB) and Ethernet (ETH) devices are supported for this operation.如果所选设备不支持此操作,将显示一条消息。Cards running secure firmware do not support this operation (see NOTES section below).
仅在指定 flash 读取 (–r) 或写入 (–f) 操作时有效。使用此选项时,fwflash 在运行时不会提示用户确认并且以非交互方式运行。请注意,所有选项都不允许向设备中强制 flash 写入不兼容的固件映像。
以下命令显示输入不带参数的命令时的 fwflash。
example# fwflash Usage: Usage: fwflash [-l [-c device_class | ALL]] | [-h] fwflash [-f file1,file2,file3,... | -r file] [-y] -d device_path -l list flashable devices in this system -c device_class limit search to a specific class eg IB for InfiniBand, ses for SCSI Enclosures -h print this usage message -f file1,file2,file3,... firmware image file list to flash -r file file to dump device firmware to -y answer Yes/Y/y to prompts -d device_path pathname of device to be flashed If -d device_path is specified, then one of -f <files> or -r <file> must also be specified If multiple firmware images are required to be flashed they must be listed together, separated by commas. The images will be flashed in the order specified.示例 2 列出可执行 flash 操作的设备
以下命令列出可执行 flash 操作的设备。
example# fwflash -l List of available devices: Device[0], /devices/pci@0,0/pci8086,3595@2/pci8086,32a@0,2/\ pci15b3,5a46@c/pci15b3,5a44@0:devctl Class [IB] GUID: System Image - 0002c901081e33b3 Node - 0000000000003446 Port 1 - 0002c901081e33b1 Port 2 - 0002c901081e33b2 Firmware revision: 2.7.8100 Product : 375-3606-03 PSID : SUN0150000009 Description : Sun Falcon QDR Device[1], /devices/pci@0,0/pci8086,3597@4/pci15b3,6278@0:devctl Class [IB] GUID: System Image - 0002c9010a99e3b3 Node - 0002c9010a99e3b0 Port 1 - 0002c9010a99e3b1 Port 2 - 0002c9010a99e3b2 Firmware revision: 2.7.8100 Product : 375-3606-03 PSID : SUN0150000009 Description : Sun Falcon QDR Device[2], /devices/pci@0,0/pci8086,2f04@2/pci15b3,16@0:devctl Class [ETH] GUID: System Image - ec0d9a0300d8f62a Node - ec0d9a0300d8f62a Port 1 - ec0d9a0300d8f62a Port 2 - ec0d9a0300d8f62b Mac 1 - 0000ec0d9ad8f62a Mac 2 - 0000ec0d9ad8f62b Firmware revision : 16.21.2024 Product : MCX556A-EDAS_C14 PSID : ORC0000000003 Description : CX556A - ConnectX-5 QSFP28 Security attributes: secure-fw signed
此外,对于显示为 SCSI 套件服务设备的 SAS 扩展器,输出可能如下所示:
example# fwflash -l List of available devices: Device[0] /devices/pci@0/pci@0/pci@2/scsi@0/ses@3,0:ses Class [sgen] Target port WWN : 500605b00002453d Vendor : SUN Product : 16Disk Backplane Firmware revision: 5021示例 3 Flash 升级 IB HCA 设备
以下命令 flash 升级 IB HCA 设备。
example# fwflash -f ./version.3.2.0000 \ -d /devices/pci@0,0/pci8086,3597@4/pci15b3,6278@0:devctl About to update firmware on: /devices/pci@0,0/pci8086,3597@4/pci15b3,6278@0:devctl Continue (Y/N): Y Updating . . . . . . . . . . . . Done. New image will be active after the system is rebooted.
请注意,系统会在升级前提示用户,而且用户必须重新引导主机才能激活新固件映像。
以下命令向命令中添加 –y 选项。
example# fwflash -y -f ./version.3.2.0000 \ -d /devices/pci@0,0/pci8086,3597@4/pci15b3,6278@0:devctl About to update firmware on: /devices/pci@0,0/pci8086,3597@4/pci15b3,6278@0:devctl Updating . . . . . . . . . . . . Done. New image will be active after the system is rebooted.示例 4 Flash Upgrading an ETH Device
The following command flash upgrades an ETH device.
example# fwflash -f \ fw-ConnectX5-rel-16_22_1002-MCX556A-EDAS_C14_Ax-FlexBoot-3.5.403.bin \ -d /devices/pci@0,0/pci8086,2f04@2/pci15b3,16@0:devctl Verify firmware image Current HCA firmware version: 16.21.2024 Security attributes: secure-fw signed Will be updated to firmware : 16.22.1002 Security attributes: secure-fw signed About to update firmware on /devices/pci@0,0/pci8086,2f04@2/pci15b3,16@0:devctl with file fw-ConnectX5-rel-16_22_1002-MCX556A-EDAS_C14_Ax-FlexBoot-3.5.403.bin. Do you want to continue (Y/N): Y Updating firmware: this takes about 40 seconds, so please be patient. Updating firmware: Success! fwflash: New firmware will be activated after you reboot示例 5 将设备固件读取到文件中
以下所示的命令将设备固件读取到文件中。此命令使用 –y 选项,读取时不提示用户。
example# fwflash -y -r /firmware.bin \ -d /devices/pci@1d,700000/pci@1/pci15b3,5a44@0:devctl About to read firmware on: /devices/pci@1d,700000/pci@1/pci15b3,5a44@0:devctl to filename: /firmware.bin Reading . . . Done.示例 6 找不到可执行 flash 操作的设备时
以下所示命令输出通知用户在系统中找不到可执行 flash 操作的受支持设备:
example# fwflash -l fwflash: No flashable devices attached with the ses driver in this system fwflash: No flashable devices attached with the sgen driver in this system fwflash: No flashable devices attached with the hermon driver in this system fwflash: No flashable devices in this system
/usr/lib/fwflash/identify 中的每个插件都会依次装入并遍历系统设备树,从而确定当前连接的设备中是否有可执行 flash 操作的设备。有关当前支持的设备类型和驱动程序的列表,请参见下文中的“附注”部分。
fwflash 命令返回以下值:
成功
失败
有关下列属性的说明,请参见 attributes(7):
|
hermon(4D), mlxne(4D), ses(4D), attributes(7)
The InfiniBand Trade Association website, https://www.infinibandta.org
The SCSI Storage Interfaces committee website, https://www.t10.org
《SCSI Primary Commands-4, SPC4》
《SCSI Enclosure Services-2, SES2》
《Serial Attached SCSI-2, SAS2》
fwflash 命令支持:
包含 AMD 或 Intel 并行 flash 部件的 InfiniBand 主机通道适配器 (InfiniBand Host Channel Adapter, IB HCA)。
附带 ses(4D) 驱动程序的 SCSI 附件服务设备,例如 SAS 扩展器。
Some Oracle OEM Mellanox adapters (e.g. ConnectX-5) use so-called "secure firmware" (SF).This feature is meant to restrict firmware usage to only officially approved versions.SF image files are digitally signed and verified when attempting to write the image to a card.
If the signature cannot be verified, the writing (-f) operation is blocked, and an error message will be printed.Once a card running SF is written with a new firmware image, the new image must be activated (via reboot), before the card can be written again with a new image.
Cards supporting SF will show "Security attributes" with the list (-l) option.Production SF will have the "secure-fw" and "signed" attributes.Development SF will also show the "dev" attribute.Debug SF will also have the "debug" attribute.Production and Development SF use different keys.A card running Production SF cannot be written with Development SF without using a special hardware procedure.
Cards running SF do not support the read (-r) option to read firmware from the card.