Method for preventing online error update of openBMC firmware, storage medium, baseboard management controller and server
By embedding project keywords during the firmware compilation stage and comparing and verifying them during the update stage, the problem of incorrect firmware flashing in openBMC is solved, realizing automated and multi-layered protection against incorrect flashing, reducing maintenance costs and the risk of hardware damage.
Patent Information
- Application Number
- CN202611309929.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-27
AI Technical Summary
The existing openBMC firmware online update mechanism lacks project ownership verification, leading to frequent incorrect flashing, high repair costs, and significant risks.
During the firmware compilation phase, project keywords are embedded into the device tree of the bootloader, and during the update phase, the project affiliation is automatically compared using a verification function to ensure the accuracy of firmware updates.
It effectively eliminates the risk of incorrect flashing, reduces maintenance costs and the risk of hardware damage, and achieves multi-layered protection without increasing hardware costs.
Smart Images

Figure CN123178128A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server management firmware technology, and specifically to a method, storage medium, baseboard management controller, and server for preventing online error updates of openBMC firmware. Background Technology
[0002] OpenBMC is an open-source BMC (Baseboard Management Controller) firmware stack built on the Linux Yocto compilation system, widely used in out-of-band server management. OpenBMC firmware images typically include the U-Boot bootloader and its device tree, the Linux kernel, the root file system, and software services such as phosphor-software-manager.
[0003] During server maintenance, administrators often use web management interfaces (such as bmcweb) or Redfish interfaces to upload new BMC firmware for online upgrades. However, existing online update mechanisms have the following drawbacks: First, there is a lack of a mandatory verification mechanism for project ownership. The existing openBMC phosphor-software-manager service typically only verifies the version number, digital signature, or hash value in the MANIFEST file when verifying firmware to be updated. Its purpose is to verify the integrity and source credibility of the firmware, not to verify whether the firmware belongs to the current server project. Therefore, if an administrator mistakenly selects and uploads the openBMC firmware from project A to the server of project B due to operational error, the system cannot recognize and prevent this erroneous operation.
[0004] Secondly, incorrect firmware flashing has serious consequences and is costly to repair. Once an incorrect firmware flash occurs, the affected BMC chip will malfunction, preventing subsequent firmware updates via the network. In severe cases, it may be necessary to physically remove the BMC chip from the motherboard and perform offline flashing using a dedicated programmer, which is not only time-consuming and labor-intensive but also increases the risk of hardware damage and maintenance costs.
[0005] In the prior art, CN115390941A discloses a configuration method for YAML files, which selects the corresponding data structure variable value through the board ID to load the corresponding YAML file, enabling multiple server models to share a single image file. However, this solution addresses the runtime configuration loading problem; its identifier comes from the board ID read from an external GPIO or I2C bus, rather than being embedded within the firmware image, and it does not involve verification during the firmware update phase.
[0006] CN121635978A discloses a method for generating BMC firmware, which obtains the server's identifier and determines the corresponding configuration file using a mask matching method, thereby constructing BMC firmware suitable for the server. However, this solution only addresses the configuration assembly problem in the firmware generation stage, and its identifier comes from the motherboard DIP switch or CPLD register. It also does not involve reading and verifying the identifier from within the firmware to be updated during the firmware update stage.
[0007] Therefore, a technical solution is needed that can automatically verify the project ownership during the firmware online update phase and prevent incorrect flashing from the source.
[0008] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0009] This invention aims to solve the problems existing in the prior art and provides a method, storage medium, baseboard management controller and server for preventing online error updates of openBMC firmware. By embedding project keywords into the device tree of the bootloader during the firmware compilation stage and automatically reading the verification during the firmware update stage and comparing it with the preset project identifier of the local machine, a mandatory anti-error flashing verification is achieved at the software level.
[0010] This invention provides a method for preventing online error updates to openBMC firmware, comprising: During the firmware compilation stage: Write the project keyword that uniquely identifies the project's ownership into the device tree loaded by the firmware's bootloader; The bootloader containing the project keyword is compiled using a compilation system to generate a bootloader containing the project keyword. The storage location of the project keyword in the bootloader is located using a tool, and the address information corresponding to the storage location is recorded. Modify the verification function in the openBMC background service program so that the verification function can read the project keyword from the device tree of the firmware image to be updated based on the address information; Compile the modified bootloader and verification functions into a complete openBMC firmware image; During firmware online update: In response to the firmware to be updated uploaded by the user, the background service program calls the verification function, reads the project keyword in the firmware to be updated according to the address information corresponding to the storage location, and compares the read project keyword with the project identifier preset by the local machine; If the comparison matches, the firmware update continues; if the comparison does not match or the project keyword is not read, an error message indicating a project mismatch is generated and the update is terminated.
[0011] Preferably, writing the project keyword into the device tree loaded by the firmware's bootloader includes: Add a node to the device tree source file of the bootloader, and set the attribute value of the node to the project keyword.
[0012] Preferably, locating the storage location of the project keyword in the bootloader using a tool includes: The project keyword is retrieved from the compiled bootloader binary file using the hexdump and grep tools to obtain the byte offset of the project keyword in the bootloader, and the byte offset is used as the address information.
[0013] Preferably, the verification function is the checkImage function in the phosphor-software-manager service, and modifying the verification function in the openBMC background service program includes: Add code logic to the checkImage function, which is used to read a fixed length of bytes from the device tree of the firmware image to be updated based on the address information as the project keyword.
[0014] Preferably, the local preset project identifier is stored in the device tree loaded by the bootloader of the currently running openBMC firmware, and uses the same encoding format and length as the project keyword.
[0015] Preferably, the step of the background service program calling the verification function includes: After receiving the firmware to be updated, the phosphor-software-manager service creates a software version object and enters the verification state, calling the verification function to perform verification; if the verification fails, the software version object is marked as invalid and will not enter the activation process.
[0016] Preferably, generating an error message indicating a project mismatch and terminating the update includes: Return error codes and prompts to the user via the bmcweb or Redfish interface, and delete the firmware to be updated from the temporary buffer.
[0017] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the preceding claims.
[0018] The present invention also provides a baseboard management controller, including a memory and a processor, wherein the processor executes a computer program in the memory to implement the method described in any of the preceding claims.
[0019] The present invention also provides a server, including the aforementioned baseboard management controller, wherein the baseboard management controller is used to perform out-of-band management of the server motherboard and to perform anti-error flashing verification on the openBMC firmware to be updated based on the method described in any one of the above.
[0020] Compared with the prior art, the present invention has the following beneficial effects: First, it fundamentally eliminates the risk of incorrect firmware flashing. By embedding project keywords into the device tree of the bootloader during the firmware compilation stage, and having them automatically read and compared by a verification function during the firmware update stage, mandatory project ownership verification is implemented. Even if an administrator mistakenly selects a firmware file for a different project, the system will automatically identify and terminate the update, blocking the incorrect flashing path at its source.
[0021] Secondly, it reduces maintenance costs and the risk of hardware damage. It avoids expensive and complex hardware repair operations (such as disassembling the BMC chip and offline flashing) that must be performed due to incorrect firmware flashing, significantly reducing server maintenance costs and the risk of hardware damage.
[0022] Third, it does not increase hardware costs. Project keywords are directly written into the firmware image, requiring no additional hardware circuits or storage chips. The anti-flash function can be achieved solely through software modifications.
[0023] Fourth, it is compatible with existing verification mechanisms. The verification logic of this invention can coexist with existing signature verification, version number verification, and other mechanisms, complementing each other to form a multi-layered protection. Attached Figure Description
[0024] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart for generating new firmware schemes provided in an embodiment of the present invention.
[0025] Figure 2 A flowchart for updating the new scheme provided in an embodiment of the present invention.
[0026] Figure 3 This is a diagram illustrating code snippets for project keywords in the device tree source file. Detailed Implementation
[0027] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0028] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0029] An exemplary method is provided for preventing incorrect online updates of openBMC firmware. like Figure 1 As shown, during the firmware compilation stage: S101: Write the project keyword that uniquely identifies the project's ownership into the device tree loaded by the firmware's bootloader.
[0030] Furthermore, writing the project keywords into the device tree loaded by the firmware's bootloader includes: Add a node to the device tree source file of the bootloader, and set the attribute value of the node to the project keyword.
[0031] Specifically, a custom node is added to the U-Boot Device Tree Source File (DTS), and the attribute value of this node is set to the project keyword. For example, when compiling firmware for Project A server, the following is added to the DTS file: Figure 3 The content shown is as follows. Among them, "FW-00A" is the project keyword that uniquely identifies project A. This keyword uses ASCII plaintext format and is 8 bytes long (including the terminator).
[0032] S102: Compile the bootloader containing the project keyword using the compilation system to generate a bootloader containing the project keyword, locate the storage location of the project keyword in the bootloader using a tool, and record the address information corresponding to the storage location.
[0033] Furthermore, using tools to locate the storage location of the project keywords in the bootloader includes: The hexdump and grep tools are used to search for the project keyword in the compiled bootloader binary file to obtain the byte offset of the project keyword within the bootloader, and this byte offset is used as the address information. Specifically, the U-Boot containing the aforementioned project keyword is compiled using the Linux Yocto build system to generate a U-Boot binary file (u-boot.bin) containing the project keyword. The hexdump and grep tools are then used to search for the project keyword "FW-00A" in the compiled u-boot.bin to obtain the byte offset of this keyword in the binary file, which is used as the address information when the subsequent verification function reads the keyword.
[0034] S103: Modify the verification function in the openBMC background service program so that the verification function is configured to read the project keyword from the device tree of the firmware image to be updated based on the address information.
[0035] Furthermore, the verification function is the checkImage function in the phosphor-software-manager service, and modifying the verification function in the openBMC background service program includes: Add code logic (a means that can be implemented by those skilled in the art) to the checkImage function. The code logic is used to read a fixed length of bytes from the device tree of the firmware image to be updated as the project keyword based on the address information.
[0036] S104: Compile the modified bootloader and verification functions into a complete openBMC firmware image.
[0037] This generates an openBMC firmware image containing project keywords and verification functionality. This firmware image can then be distributed to the corresponding project's server for online updates.
[0038] During firmware online update: In response to the firmware to be updated uploaded by the user, the background service program calls the verification function to read the project keyword in the firmware to be updated according to the address information corresponding to the storage location, and compares the read project keyword with the project identifier preset by the local machine.
[0039] If the comparison matches, the firmware update continues; if the comparison does not match or the project keyword is not read, an error message indicating a project mismatch is generated and the update is terminated.
[0040] Furthermore, the step of the background service program calling the verification function includes: After receiving the firmware to be updated, the phosphor-software-manager service creates a software version object and enters the verification state, calling the verification function to perform verification; if the verification fails, the software version object is marked as invalid and will not enter the activation process.
[0041] Furthermore, the step of generating an error message indicating a project mismatch and terminating the update includes: Return error codes and prompts to the user via the bmcweb or Redfish interface, and delete the firmware to be updated from the temporary buffer.
[0042] Exemplary implementation: Step S201: The administrator selects and uploads the firmware to be updated through the openBMC web management interface (bmcweb). The system downloads the firmware file to the server's temporary buffer via the HTTP protocol.
[0043] Step S202: After receiving the firmware to be updated, the openBMC phosphor-software-manager service creates a software version object and enters the verification state. In the verification state, the service automatically calls the modified checkImage verification function.
[0044] Step S203: The checkImage verification function reads a fixed length of bytes from the U-Boot device tree region of the firmware image to be updated, based on the pre-recorded address information, and uses it as the project keyword.
[0045] Step S204: Compare the read project keyword with the local preset project identifier. The local preset project identifier is stored in the U-Boot device tree of the currently running openBMC firmware, and uses the same encoding format and length as the project keyword.
[0046] Step S205: Perform different operations based on the comparison results: If the comparison matches (e.g., the project keyword read is "FW-00A", and the local preset project identifier is also "FW-00A"), then it is determined that the firmware to be updated belongs to the local project, and the normal firmware update process continues; if the comparison does not match (e.g., the project keyword read is "FW-00B", and the local preset project identifier is "FW-00A"), then it is determined that the firmware to be updated does not belong to the local project, and an error code and prompt message are returned to the user through the bmcweb or Redfish interface, and the firmware to be updated in the temporary buffer is deleted, terminating the update process; if the project keyword is not read (e.g., the specified position is empty or reading fails), it is also determined to be a mismatch, an error message is generated, and the update is terminated.
[0047] Step S206: After the verification is successful, the system completes the firmware update and automatically clears the temporary buffer.
[0048] An exemplary computer-readable storage medium is provided. This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method steps for preventing online error updates to the openBMC firmware.
[0049] The computer-readable storage media include, but are not limited to, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0050] An example is provided for a baseboard management controller. The baseboard management controller in this embodiment includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the above-described method steps for preventing online error updates to the openBMC firmware.
[0051] The baseboard management controller is an independent microcontroller unit integrated on the server motherboard, used for out-of-band management of the server, including functions such as remote monitoring of hardware status, power on / off control, and firmware updates.
[0052] An example of providing a server The server in this embodiment includes a baseboard management controller, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the above-described method steps for preventing online error updates to the openBMC firmware.
[0053] The server is any one of a rack server, blade server, or tower server. The baseboard management controller is connected to the CPU chipset on the server motherboard via a PCIe or LPC bus to realize the out-of-band management function of the server.
[0054] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A method for preventing online error updates to openBMC firmware, characterized in that, include: During the firmware compilation phase: Write the project keyword that uniquely identifies the project's ownership into the device tree loaded by the firmware's bootloader; The bootloader containing the project keyword is compiled using a compilation system to generate a bootloader containing the project keyword. The storage location of the project keyword in the bootloader is located using a tool, and the address information corresponding to the storage location is recorded. Modify the verification function in the openBMC background service program so that the verification function can read the project keyword from the device tree of the firmware image to be updated based on the address information; Compile the modified bootloader and verification functions into a complete openBMC firmware image; During firmware online update: In response to the firmware to be updated uploaded by the user, the background service program calls the verification function, reads the project keyword in the firmware to be updated according to the address information corresponding to the storage location, and compares the read project keyword with the project identifier preset by the local machine; If the comparison matches, the firmware update continues; if the comparison does not match or the project keyword is not read, an error message indicating a project mismatch is generated and the update is terminated.
2. The method according to claim 1, characterized in that, The step of writing the project keyword into the device tree loaded by the firmware bootloader includes: Add a node to the device tree source file of the bootloader, and set the attribute value of the node to the project keyword.
3. The method according to claim 1, characterized in that, The method of locating the storage location of the project keywords in the bootloader using the tool includes: The project keyword is retrieved from the compiled bootloader binary file using the hexdump and grep tools to obtain the byte offset of the project keyword in the bootloader, and the byte offset is used as the address information.
4. The method according to claim 1, characterized in that, The verification function is the checkImage function in the phosphor-software-manager service. Modifying the verification function in the openBMC background service program includes: Add code logic to the checkImage function, which is used to read a fixed length of bytes from the device tree of the firmware image to be updated based on the address information as the project keyword.
5. The method according to claim 1, characterized in that, The project identifier preset by the local machine is stored in the device tree loaded by the bootloader of the currently running openBMC firmware, and uses the same encoding format and length as the project keyword.
6. The method according to claim 1, characterized in that, The process of calling the verification function by the background service program includes: After receiving the firmware to be updated, the phosphor-software-manager service creates a software version object and enters the verification state, calling the verification function to perform verification; if the verification fails, the software version object is marked as invalid and will not enter the activation process.
7. The method according to claim 1, characterized in that, The generation of project mismatch error messages and termination of updates includes: Return error codes and prompts to the user via the bmcweb or Redfish interface, and delete the firmware to be updated from the temporary buffer.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.
9. A baseboard management controller, comprising a memory and a processor, characterized in that, When the processor executes the computer program in the memory, it implements the method as described in any one of claims 1 to 7.
10. A server, characterized in that, Includes the baseboard management controller as described in claim 9, the baseboard management controller being used for out-of-band management of the server motherboard, and for performing anti-error flashing verification on the openBMC firmware to be updated based on the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
BMC firmware generation method and device, BMC and storage medium
CN121635978A
