Firmware updating method and device, equipment, storage medium and program product

By copying the read-only partition image and mounting the read-write partition to memory when BMC is started, ensuring that the BMC can still run normally during the firmware update process, solving the service reliability problems caused by traditional BMC firmware update methods and improving the service reliability of BMC.

CN120215970APending Publication Date: 2025-06-27DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311828424.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

Traditional BMC firmware update methods lead to poor reliability of BMC services, and the hardware monitoring service is stopped, so hardware problems cannot be discovered in time.

Method used

During the BMC startup process, copy the read-only partition image to memory, and mount the read-write partition to an independent configuration directory in memory. Set the firmware operation configuration to ensure that the BMC can still run normally during the firmware update process.

Benefits of technology

Continue running BMC through the in-memory firmware and running configuration, avoiding service interruption caused by inability to operate normally when updating the flash firmware, and improving the service reliability of BMC.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215970A_ABST
    Figure CN120215970A_ABST
Patent Text Reader

Abstract

The invention relates to a firmware updating method and device, equipment, a storage medium and a program product. The method comprises the steps that in the BMC starting process, a read-only partition mirror image of a preset read-only partition of BMC firmware in a flash memory of the BMC is copied into a memory of the BMC, the preset read-write partition of the BMC firmware in the flash memory is mounted to a mounting directory in the flash memory, and the preset read-write partition of the BMC firmware in the flash memory is loaded to the mounting directory according to the read-only partition mirror image stored in the memory and the mounting directory. And setting firmware running configuration in the memory to start the BMC, continuously running the BMC by using the BMC firmware in the memory and the firmware running configuration in the BMC firmware updating process, and performing firmware updating on the BMC firmware in the flash memory according to the new BMC firmware. By adopting the method, the service reliability of the BMC can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a firmware update method, apparatus, device, storage medium, and program product. Background Art

[0002] The BMC (Baseboard Management Controller) is used to manage the hardware on a server. The BMC can provide various services, such as hardware monitoring and fan speed regulation. With the rapid development of computer technology and electronic technology, the firmware of the BMC also needs to be updated.

[0003] During the update process of the BMC firmware, the related services provided by the BMC to the server will be affected. For example, the hardware monitoring service stops, making the hardware of the server in an unmonitored state. If some hardware problems occur during the update process of the BMC firmware, they cannot be detected in time.

[0004] Therefore, in the traditional BMC firmware update method, the service reliability of the BMC is poor. Summary of the Invention

[0005] Based on this, it is necessary to provide a firmware update method, apparatus, device, storage medium, and program product that can improve the service reliability of the BMC during the firmware update process of the BMC for the above technical problems.

[0006] In a first aspect, this application provides a firmware update method for the BMC. The method includes:

[0007] During the startup process of the BMC, copy the read-only partition image of the BMC firmware in the read-only partition of the flash memory of the BMC to the memory of the BMC;

[0008] Mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware operation configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC;

[0009] During the BMC firmware update process, continue to run the BMC using the BMC firmware and the firmware operation configuration in the memory, and update the BMC firmware in the flash memory according to the new BMC firmware.

[0010] In the above embodiments, while updating the old BMC firmware in the flash memory according to the new BMC firmware, the BMC sets the firmware running configuration in the memory based on the read-only partition image copied in advance to the memory and the read-write partition mounted under the mount directory, and runs the BMC using the firmware running configuration stored in the memory and the BMC firmware, avoiding the problem that the BMC cannot normally provide relevant services to the server due to the abnormal operation of the BMC firmware in the flash memory. The embodiments of the present application improve the service reliability of the BMC.

[0011] In one embodiment, setting the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory includes:

[0012] Mount the read-only partition image to the target directory in the memory. The read-only partition image includes executable programs, dependent libraries, and fixed configurations, and create an independent configuration directory;

[0013] Copy the modifiable configuration in the preset read-write partition corresponding to the mount directory to the independent configuration directory.

[0014] In the above embodiments, when copying the modifiable configuration in the preset read-write partition to the independent configuration directory in the memory, during the firmware upgrade of the BMC firmware in the flash memory, the BMC can access the modifiable configuration stored in the memory through the independent configuration directory, and set the firmware running configuration through the modifiable configuration stored in the memory and the data in the read-only partition image, avoiding the situation where the modifiable configuration stored in the flash memory is updated during the firmware update process, resulting in an incorrect setting of the firmware running configuration.

[0015] In one embodiment, the independent configuration directory is further used to store the variable configuration generated and modified during the operation of the BMC. The method further includes:

[0016] Enable the configuration real-time synchronization service, which is used to perform real-time synchronization of the configuration between the independent configuration directory and the mount directory.

[0017] In the above embodiments, enabling the configuration real-time synchronization service makes the data stored in the preset read-write partition of the BMC firmware in the flash memory consistent with the data stored in the independent configuration directory in the memory, so that after the BMC firmware is updated, the BMC can normally run the BMC firmware in the flash memory based on the variable configuration generated or modified during the update of the BMC firmware, ensuring the integrity of the data.

[0018] In one embodiment, before the BMC firmware update, the method further includes:

[0019] Disable the configuration real-time synchronization service and unmount the preset read-write partition in the mount directory;

[0020] After the BMC firmware is updated, the method further includes;

[0021] Mount the read / write partition of the new BMC firmware under the mount directory.

[0022] In the above embodiment, before the BMC firmware stored in the flash memory is updated according to the new BMC firmware, the configuration real-time synchronization service is turned off, and the read / write partition in the mount directory is unmounted, so that the BMC cannot incorrectly read the modifiable configuration in the preset read / write partition in the flash memory through the mount directory, ensuring the correctness of the modifiable configuration used by the BMC firmware in the running memory while the firmware is updated.

[0023] In one of the embodiments, the variable configuration includes user-modifiable configuration. Before continuing to run the BMC using the BMC firmware and the firmware running configuration in the memory, the method further includes:

[0024] Notify each service program to prohibit modifying the user-modifiable configuration;

[0025] After the BMC firmware in the flash memory is updated according to the new BMC firmware, the method further includes:

[0026] Send a recovery instruction to each service program to allow each service program to modify the modifiable configuration.

[0027] In the above embodiment, before the BMC continues to run the BMC using the BMC firmware and the firmware running configuration in the memory, each service program is prohibited from modifying the user-modifiable configuration, so that the firmware update process will not be affected by the user modifying the user-modifiable configuration, improving the security of the firmware update.

[0028] In one of the embodiments, the method further includes:

[0029] If a save configuration instruction is detected, restart the configuration synchronization service.

[0030] In the above embodiment, when the BMC receives the save configuration instruction, the data in the independent configuration directory is synchronized to the mount directory, so that the modifiable configuration generated during the continuous operation of the BMC during the BMC firmware update process is stored in the preset read / write partition of the new BMC firmware in the flash memory, so that the new BMC firmware in the flash memory can run using the modifiable configuration generated and modified during the BMC firmware update process.

[0031] In a second aspect, the present application further provides a firmware update device for the BMC. The device includes:

[0032] The first startup preparation module is used to copy the read-only partition image of the BMC firmware in the preset read-only partition of the BMC's flash memory to the memory of the BMC during the BMC startup process;

[0033] The second startup preparation module is used to mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC;

[0034] The update module is used to continue running the BMC using the BMC firmware and the firmware running configuration in the memory during the BMC firmware update process, and perform firmware update on the BMC firmware in the flash memory according to the new BMC firmware.

[0035] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method in the first aspect described above are implemented.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the first aspect described above are implemented.

[0037] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect described above are implemented.

[0038] In the above firmware update method, device, device, storage medium, and program product, during the BMC startup process, the read-only partition image of the BMC firmware in the preset read-only partition of the BMC's flash memory is copied to the memory of the BMC, and, the preset read-write partition of the BMC firmware in the flash memory is mounted to the mount directory in the flash memory, and the firmware running configuration is set in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC. During the BMC firmware update process, the BMC is continued to run using the BMC firmware and the firmware running configuration in the memory, and the BMC firmware in the flash memory is updated according to the new BMC firmware. In this way, while updating the old BMC firmware in the flash memory according to the new BMC firmware, the BMC sets the firmware running configuration in the memory based on the read-only partition image copied to the memory in advance and the read-write partition mounted under the mount directory, and runs the BMC using the firmware running configuration and the BMC firmware stored in the memory, avoiding the problem that the BMC cannot normally provide relevant services to the server due to the inability to normally run the BMC firmware in the flash memory when updating the BMC firmware in the flash memory. The embodiment of the present application improves the service reliability of the BMC. Description of the Drawings

[0039] To more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the related art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.

[0040] Figure 1 It is an application environment diagram of the firmware update method in an embodiment;

[0041] Figure 2 It is a schematic flowchart of the firmware update method in an embodiment;

[0042] Figure 3 It is a schematic structural diagram of the BMC firmware partition in another embodiment;

[0043] Figure 4 It is a schematic flowchart of step 202 in another embodiment;

[0044] Figure 5 It is a structural block diagram of the firmware update device in an embodiment;

[0045] Figure 6 It is a structural block diagram of the firmware update device in another embodiment;

[0046] Figure 7 It is a structural block diagram of the firmware update device in another embodiment;

[0047] Figure 8 It is a structural block diagram of the firmware update device in another embodiment;

[0048] Figure 9 It is a structural block diagram of the firmware update device in another embodiment;

[0049] Figure 10 It is a structural block diagram of the firmware update device in another embodiment;

[0050] Figure 11 It is an internal structural diagram of a computer device in an embodiment. Detailed implementation manners

[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the following further details the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] The BMC (Baseboard Management Controller) is used to manage the hardware on the server. The BMC can provide various services, such as hardware monitoring, fan speed regulation, etc. With the rapid development of computer technology and electronic technology, the firmware of the BMC also needs to be updated.

[0053] During the update process of the BMC firmware, the related services provided by the BMC to the server are affected. For example, the hardware monitoring service stops, making the hardware of the server in an unmonitored state. If some hardware problems occur during the upgrade process of the BMC firmware, they cannot be detected in time.

[0054] Therefore, with the traditional BMC firmware update method, the service reliability of the BMC is poor.

[0055] In view of this, the embodiments of the present application provide a firmware update method, device, equipment, storage medium, and program product. During the BMC startup process, the read-only partition image of the preset read-only partition of the BMC firmware in the flash memory of the BMC is copied to the memory of the BMC, and, the preset read-write partition of the BMC firmware in the flash memory is mounted under the mount directory in the flash memory, and a firmware operation configuration is set in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC. During the BMC firmware update process, the BMC in the memory is continued to run using the BMC firmware and the firmware operation configuration in the memory, and the BMC firmware in the flash memory is updated according to the new BMC firmware. In this way, while updating the old BMC firmware in the flash memory according to the new BMC firmware, the BMC sets the firmware operation configuration in the memory based on the read-only partition image copied to the memory in advance and the read-write partition mounted under the mount directory, and runs the BMC using the firmware operation configuration and the BMC firmware stored in the memory, avoiding the problem that the BMC cannot normally provide related services to the server due to the abnormal operation of the BMC firmware in the flash memory when updating the BMC firmware in the flash memory. The embodiments of the present application improve the service reliability of the BMC.

[0056] The firmware update method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the BMC 104 is connected to the server 102.

[0057] In an exemplary embodiment, as Figure 2 shown, a firmware update method is provided. Taking the method applied to the Figure 1 BMC 104 as an example for description, the method includes the following steps:

[0058] Step 201, during the BMC startup process, copy the read-only partition image of the preset read-only partition of the BMC firmware in the flash memory of the BMC to the memory of the BMC.

[0059] The BMC firmware is the firmware program to be updated installed on the BMC. The BMC firmware is stored in the flash memory (also known as flash memory, simply flash) of the BMC. When the BMC starts up, it will run the BMC based on the BMC firmware, thereby providing related services for the server, such as hardware monitoring, fan speed regulation, etc.

[0060] The preset read-only partition is one of the partitions of the storage space for storing files of the BMC firmware, and is used to store data that cannot be changed in the BMC firmware. For example, executable programs, dependent libraries, and fixed configurations, etc.

[0061] In the embodiment of the present application, the BMC directly copies the read-only partition image of the preset read-only partition to the memory of the BMC, avoiding the modification of the data that cannot be changed stored in the read-only partition, and ensuring the security of the data during the BMC firmware upgrade process.

[0062] Step 202: Mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC.

[0063] In order not to affect the BMC from providing related services to the server during the BMC firmware upgrade process, in the embodiment of the present application, when the BMC firmware is upgraded, the BMC is started through the firmware running configuration set in the memory, so that the BMC can run the BMC firmware based on the firmware running configuration stored in the memory, thereby avoiding the problem that the BMC cannot normally provide related services to the server due to the inability to run normally when the BMC firmware in the flash memory is upgraded.

[0064] Among them, the firmware running configuration is set according to the read-only partition image that has been copied to the memory of the BMC firmware and the data stored in the preset read-write partition.

[0065] The preset read-write partition is one of the partitions of the storage space for storing files of the BMC firmware, and is used to store data that can be changed, such as modifiable configurations of the BMC firmware.

[0066] In the embodiment of the present application, the data that can be changed and the data that cannot be changed in the BMC firmware are stored separately, reducing the risk of the data that cannot be changed being modified, and ensuring the security of the files during the BMC firmware upgrade process.

[0067] Regarding the partition structure of the BMC firmware, it can be as Figure 3As shown, the loader for booting the BMC firmware is stored in the u-boot partition; the environment variable system is stored in the u-boot-env partition; the kernel of the BMC firmware and the root file management system are stored in the kernel+initramfs partition; the rofs partition, i.e., the preset read-only partition, stores the executable programs, dependent libraries, and fixed configurations of the BMC firmware, etc., which are data that cannot be changed; the rwfs partition, i.e., the preset read-write partition, stores data that can be changed, such as modifiable configuration files.

[0068] The mount directory is a file directory created by the BMC in the flash through the file management system. Optionally, the BMC can create a mount directory in the flash according to the root file management system installed in the flash; optionally, the BMC can create a mount directory in the flash according to the file management system installed in the external device. The specific method for creating the preset directory is not specifically limited herein.

[0069] In the embodiment of the present application, the BMC mounts the preset read-write partition under the mount directory, so that the BMC can access the data that can be changed stored in the preset read-write partition through the mount directory. The BMC can perform corresponding settings on the firmware running configuration in the memory according to the read-only partition image stored in the memory and the data obtained by accessing through the mount directory, so that the BMC can run the BMC firmware based on the firmware running configuration set in the memory.

[0070] Step 203, during the BMC firmware update process, continue to run the BMC using the BMC firmware and the firmware running configuration in the memory, and update the BMC firmware in the flash according to the new BMC firmware.

[0071] When the BMC needs to perform a firmware update, the BMC will obtain the relevant files of the new version of the BMC firmware, that is, the new BMC firmware.

[0072] Regarding the method for obtaining the new BMC firmware, optionally, the BMC obtains the new BMC firmware sent by the remote server; optionally, the BMC obtains the new BMC firmware uploaded by the user from the external device. The method for the BMC to obtain the new BMC firmware is not specifically limited herein.

[0073] After the BMC obtains the new BMC firmware, it can use the new BMC firmware to perform a firmware update on the old version of the BMC firmware in the flash memory. The method for the BMC to perform a firmware update according to the new BMC firmware is as follows: The BMC can generate an erase instruction and erase the old BMC firmware stored in the flash memory according to the erase instruction; the BMC can generate a write instruction and write the new BMC firmware into the flash memory line by line according to the write instruction; the BMC can generate a verification instruction, and after the BMC writes the new BMC firmware into the flash memory line by line, verify the content stored in the flash memory to determine whether the new BMC firmware is correctly written into the flash memory.

[0074] The following describes the process of the BMC verifying the new BMC firmware in the flash memory.

[0075] Optionally, the BMC compares the new BMC firmware stored in the flash memory with the new BMC firmware line by line, and the comparison result can be used to indicate whether the BMC correctly writes the new BMC firmware into the flash memory; optionally, the BMC generates a first verification code corresponding to the new BMC firmware according to a preset verification condition, and then generates a second verification code corresponding to the content stored in the flash memory according to the same preset verification condition, and compares the first verification code with the second verification code, and the comparison result can be used to indicate whether the BMC correctly writes the updated BMC firmware into the flash memory.

[0076] While the BMC uses the new BMC firmware to perform a firmware update on the old BMC firmware in the flash memory, the BMC can continue to run the BMC based on the BMC firmware and firmware operation configuration in the memory, so as to avoid affecting the BMC from providing relevant services to the server during the process of updating the BMC firmware in the flash memory.

[0077] In a possible implementation manner, after the BMC firmware is updated, an appropriate time can be selected to restart the BMC to make the updated new BMC firmware take effect. For example, the BMC receives a firmware effect instruction uploaded by the user through other devices, and the firmware effect instruction is used to instruct the BMC to restart the BMC to make the new BMC firmware take effect. At this time, the BMC restarts the BMC according to the firmware effect instruction; or, the BMC restarts the BMC according to a preset effect time point to make the new BMC firmware take effect.

[0078] In the above firmware update method, during the BMC startup process, a read-only partition image of the BMC firmware in the read-only partition of the BMC's flash memory is copied to the memory of the BMC. Also, the preset read-write partition of the BMC firmware in the flash memory is mounted under the mount directory in the flash memory, and based on the read-only partition image stored in the memory and the mount directory, a firmware operation configuration is set in the memory to start the BMC. During the BMC firmware update process, the BMC firmware in the memory and the firmware operation configuration are used to continue running the BMC, and the BMC firmware in the flash memory is updated according to the new BMC firmware. In this way, while updating the old BMC firmware in the flash memory according to the new BMC firmware, the BMC sets the firmware operation configuration in the memory based on the read-only partition image copied to the memory in advance and the read-write partition mounted under the mount directory, and runs the BMC using the firmware operation configuration and the BMC firmware stored in the memory, avoiding the problem that the BMC cannot normally provide relevant services to the server due to the abnormal operation of the BMC firmware in the flash memory during the update of the BMC firmware in the flash memory. The embodiment of the present application improves the service reliability of the BMC.

[0079] In one embodiment, based on the above Figure 2 illustrated embodiment, refer to Figure 4 , this embodiment relates to the process of setting the firmware operation configuration in the memory according to the read-only partition image stored in the memory and the mount directory. As Figure 4 illustrated, step 202 includes step 401 and step 402:

[0080] Step 401, mount the read-only partition image under the target directory in the memory and create an independent configuration directory.

[0081] Step 402, copy the modifiable configuration in the preset read-write partition corresponding to the mount directory to the independent configuration directory.

[0082] The read-only partition image is an encapsulated file, including the executable program, dependent libraries, and fixed configuration of the old BMC firmware. The BMC cannot directly read the data included in the read-only partition image from the memory. In the embodiment of the present application, the BMC mounts the read-only partition image stored in the memory under the target directory created by the file management system in the memory, and the content in the read-only partition image stored in the memory can be accessed through the target directory.

[0083] When the BMC firmware is running, it needs to set the firmware operation configuration according to the fixed configuration included in the read-only partition image and the modifiable configuration stored in the preset read-write partition, and run the executable program in the read-only partition image stored in the memory according to the firmware operation configuration to complete the operation of the BMC firmware. Therefore, the BMC also needs to read the modifiable configuration stored in the preset read-write partition in the flash memory through the mount directory.

[0084] However, when performing a firmware update on the BMC firmware in the flash memory, all related files of the BMC firmware will be updated, including the modifiable configurations stored in the preset read-write partition. To avoid incorrect firmware operation configuration settings caused by the update of the modifiable configurations stored in the flash memory during the firmware update process, the BMC needs to copy the modifiable configurations to the memory in advance and read the correct modifiable configurations from the memory.

[0085] In the embodiment of the present application, the process by which the BMC copies the modifiable configurations to the memory may be as follows:

[0086] The BMC can create an independent configuration directory in the memory through the file management system and copy the modifiable configurations in the preset read-write partition to the independent configuration directory in the memory.

[0087] In this way, when the BMC performs a firmware upgrade on the BMC firmware in the flash memory, it can read the modifiable configurations stored in the memory through the independent configuration directory, and thus set the firmware operation configuration based on the modifiable configurations stored in the memory and the data in the read-only partition image.

[0088] Taking Figure 3 the partition result of the BMC firmware shown as an example, the process by which the BMC sets the firmware operation configuration in the memory according to the read-only partition image stored in the memory and the mount directory is introduced exemplarily:

[0089] The BMC copies the read-only partition image corresponding to the rofs partition to the memory, creates a target directory in the memory, such as / xyz, and mounts the read-only partition image to / xyz. At this time, the BMC can access the executable program, dependent libraries, and fixed configurations of the BMC firmware through / xyz; the BMC creates a mount directory / conf in the flash memory and mounts the modifiable configurations stored in the rwfs partition to the mount directory / conf. At this time, the BMC can read the modifiable configurations stored in the rwfs partition in the flash memory through / conf; the BMC creates an independent configuration directory / abc in the memory, reads the modifiable configurations stored in the rwfs partition in the flash memory through / conf, and copies the modifiable configurations to / abc.

[0090] In this way, during the subsequent BMC firmware upgrade process, the BMC can read the modifiable configurations of the BMC firmware through / abc, read the executable program, dependent libraries, and fixed configurations of the BMC firmware through / xyz, set the firmware operation configuration based on the fixed configuration and the modifiable configuration, and execute the executable program according to the firmware operation configuration to realize running the BMC firmware in the memory.

[0091] In the above embodiments, the modifiable configurations in the preset read-write partition are copied to an independent configuration directory in the memory. When performing a firmware upgrade on the BMC firmware in the flash memory, the BMC can access the modifiable configurations stored in the memory through the independent configuration directory, and set the firmware running configuration based on the modifiable configurations stored in the memory and the data in the read-only partition image, avoiding the situation where the modifiable configurations stored in the flash memory are updated during the firmware update process, resulting in incorrect settings of the firmware running configuration.

[0092] In a possible implementation manner, the independent configuration directory is also used to store the variable configurations generated and modified during the operation of the BMC. Therefore, based on the above Figure 4 shown embodiments, the process of setting the firmware running configuration in the memory according to the read-only partition image and the mount directory stored in the memory further includes: enabling the configuration real-time synchronization service.

[0093] In the embodiments of the present application, when the BMC is running, it will generate or modify variable configurations according to the specific running situation. For example, when it detects that the CPU temperature is too high during operation, it will modify the relevant limit parameters of the CPU to control the temperature of the CPU. When the BMC starts but the BMC firmware update has not been performed, the variable configurations generated and modified during the operation of the BMC will be stored in real time in the storage space corresponding to the independent configuration directory in the memory for the BMC to access and read the variable configurations through the independent configuration directory to update the firmware running configuration.

[0094] At this time, the data stored in the preset read-write partition of the BMC firmware in the flash memory has not been updated. To ensure that when the BMC firmware in the flash memory runs normally after the update, it can run based on the variable configurations generated or modified during the update of the BMC firmware, the BMC can enable the configuration real-time synchronization service. The configuration real-time synchronization service is used to perform real-time synchronization of the configurations between the independent configuration directory and the mount directory, so that the data stored in the preset read-write partition of the BMC firmware in the flash memory is consistent with the data stored in the independent configuration directory in the memory.

[0095] In the above embodiments, enabling the configuration real-time synchronization service makes the data stored in the preset read-write partition of the BMC firmware in the flash memory consistent with the data stored in the independent configuration directory in the memory, so that after the BMC firmware is updated, the BMC can run the BMC firmware in the flash memory normally based on the variable configurations generated or modified during the update of the BMC firmware, ensuring the integrity of the data.

[0096] In a possible implementation manner, based on the above embodiments, this embodiment relates to that before the BMC firmware is updated, the firmware update method further includes: disabling the configuration real-time synchronization service and unmounting the preset read-write partition in the mount directory.

[0097] In the embodiment of the present application, before the firmware update, the BMC closes the closed configuration real-time synchronization service, so that the data synchronization between the mounted directory and the independent configuration directory is no longer performed, so as to isolate the flash memory from the memory of the BMC, and avoid the error data generated in the independent configuration directory due to the data synchronization affecting the data in the independent configuration directory when updating the BMC firmware in the flash memory, ensuring the correctness of the firmware operation configuration used by the BMC firmware in the running memory while updating the BMC firmware in the flash memory.

[0098] At the same time, the BMC unmounts the preset read / write partition mounted in the mounted directory, so that the BMC cannot incorrectly read the modifiable configuration in the preset read / write partition in the flash memory through the mounted directory, ensuring the correctness of the firmware operation configuration used by the BMC firmware in the running memory.

[0099] After the BMC firmware update is completed, the firmware update method further includes: mounting the read / write partition of the new BMC firmware under the mounted directory.

[0100] After the BMC completes the update of the BMC firmware stored in the flash memory, the BMC mounts the read / write partition of the new BMC firmware stored in the flash memory under the mounted directory, so that the BMC can access the read / write partition of the new BMC firmware in the flash memory through the mounted directory.

[0101] In the above embodiment, before the firmware update of the BMC firmware stored in the flash memory according to the new BMC firmware, the configuration real-time synchronization service is closed, and the preset read / write partition in the mounted directory is unmounted, so that the BMC cannot incorrectly read the modifiable configuration in the preset read / write partition in the flash memory through the mounted directory, ensuring the correctness of the modifiable configuration used by the BMC firmware in the running memory while the firmware is updated.

[0102] In a possible implementation manner, based on the above embodiment, this embodiment relates to that before continuing to run the BMC using the BMC firmware and the firmware operation configuration in the memory, the firmware update method further includes: notifying each service program to prohibit modifying the user-modifiable configuration.

[0103] In a possible implementation manner, the variable configuration includes user-modifiable configuration and non-user-modifiable configuration. The user-modifiable configuration is the configuration data that the user can modify, such as the change of the IP address, and the non-user-modifiable configuration is the configuration data that the user cannot modify.

[0104] To prevent the user from modifying the user-modifiable configuration during the BMC's update of the BMC firmware stored in the flash memory, which may affect the firmware update process, the BMC needs to notify each service program it runs to prohibit modifying the user-modifiable configuration before continuing to run the BMC using the BMC firmware and firmware operation configuration in memory. In one possible implementation, the BMC generates a prohibition modification instruction and sends it to each service program to indicate that each service program cannot modify the user-modifiable configuration.

[0105] After the firmware update of the BMC firmware in the flash memory according to the new BMC firmware, the firmware update method further includes: sending a restoration instruction to each service program to allow each service program to modify the user-modifiable configuration.

[0106] After the firmware update, the BMC needs to restore the ability of each service program to modify the user-modifiable configuration. In one possible implementation, after the firmware update of the BMC firmware in the flash memory according to the new BMC firmware, the BMC generates a restoration instruction and sends it to each service program to indicate that each service program restores the function of modifying the user-modifiable configuration file according to this restoration instruction.

[0107] In the above embodiment, before the BMC continues to run the BMC using the BMC firmware and firmware operation configuration in memory, each service program is prohibited from modifying the user-modifiable configuration, so that the firmware update process will not be affected by the user's modification of the user-modifiable configuration, improving the security of the firmware update.

[0108] In one possible implementation, based on the above embodiment, this embodiment relates to the process of saving the configuration after the BMC firmware update. This process includes: if a configuration save instruction is detected, restart the configuration synchronization service.

[0109] In the embodiments of the present application, the configuration save instruction is used to indicate that when the BMC updates the BMC firmware stored in the flash memory according to the new BMC firmware and continues to run the BMC using the BMC firmware and firmware operation configuration in memory, the generated and modified modifiable configuration needs to be used when running the new BMC firmware in the flash memory.

[0110] In a possible implementation, the user can flexibly choose whether to retain the modifiable configurations generated or modified during the BMC firmware update according to requirements. Optionally, if the user chooses not to retain, the BMC will not detect the save configuration instruction. After the BMC firmware in the flash is updated according to the new BMC firmware, the BMC waits for the restart opportunity to restart the BMC, and the new BMC firmware running in the flash will not run using the modifiable configurations generated and modified during the BMC firmware update. Optionally, if the user chooses to retain, the BMC will detect the save configuration instruction and restart the configuration synchronization service according to the save configuration instruction to synchronize the independent configuration directory in the memory with the data in the mounted directory in the flash, so as to store the modifiable configurations generated during the continuous operation of the BMC during the BMC firmware update into the preset read-write partition of the new BMC firmware in the flash, so that the new BMC firmware in the flash can run using the modifiable configurations generated and modified during the BMC firmware update.

[0111] In the above embodiment, when the BMC receives the save configuration instruction, it synchronizes the data in the independent configuration directory to the mounted directory, so as to store the modifiable configurations generated during the continuous operation of the BMC during the BMC firmware update into the preset read-write partition of the new BMC firmware in the flash, so that the new BMC firmware in the flash can run using the modifiable configurations generated and modified during the BMC firmware update.

[0112] In one embodiment, an exemplary firmware update method is provided. This method is used for the BMC and includes:

[0113] Step a, during the BMC startup process, copy the read-only partition image of the BMC firmware in the read-only partition of the BMC's flash to the memory of the BMC;

[0114] Step b, mount the preset read-write partition of the BMC firmware in the flash under the mounted directory in the flash.

[0115] Step c, mount the read-only partition image under the target directory in the memory. The read-only partition image includes executable programs, dependent libraries, and fixed configurations, and create an independent configuration directory;

[0116] Step d, copy the modifiable configurations in the preset read-write partition corresponding to the mounted directory to the independent configuration directory.

[0117] Step e, start the configuration real-time synchronization service to start the BMC.

[0118] Among them, the configuration real-time synchronization service is used for real-time synchronization of configurations between the independent configuration directory and the mounted directory.

[0119] Among them, the independent configuration directory is also used to store the variable configurations generated and modified during the operation of the BMC.

[0120] Step f, turn off the configuration real-time synchronization service and unmount the mount directory in the flash memory.

[0121] Step g, notify each service program to prohibit modifying the user-modifiable configuration.

[0122] Step h, during the BMC firmware update process, continue to run the BMC using the BMC firmware in the memory and the firmware running configuration, and update the BMC firmware in the flash memory according to the new BMC firmware.

[0123] Step i, mount the read / write partition of the new BMC firmware under the mount directory.

[0124] Step j, send a recovery instruction to each service program to allow each service program to modify the modifiable configuration.

[0125] Step k, if a save configuration instruction is detected, restart the configuration synchronization service.

[0126] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0127] Based on the same inventive concept, the embodiments of the present application also provide a firmware update device for implementing the above-mentioned firmware update method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more of the following firmware update device embodiments can refer to the limitations on the firmware update method in the above text, and will not be repeated here.

[0128] In an exemplary embodiment, as Figure 5 shown, a firmware update device is provided. This device is used for the BMC and includes:

[0129] The first startup preparation module 501 is used to copy the read-only partition image of the BMC firmware in the preset read-only partition of the flash memory of the BMC to the memory of the BMC during the startup process of the BMC;

[0130] The second startup preparation module 502 is used to mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC;

[0131] The update module 503 is used to continue running the BMC using the BMC firmware and the firmware running configuration in the memory during the BMC firmware update process, and perform firmware update on the BMC firmware in the flash memory according to the new BMC firmware.

[0132] In one embodiment, refer to Figure 6 , the second startup preparation module 502 includes:

[0133] The mounting unit is used to mount the read-only partition image to the target directory in the memory. The read-only partition image includes executable programs, dependent libraries, and fixed configurations, and create an independent configuration directory;

[0134] The modifiable configuration copy unit is used to copy the modifiable configuration in the preset read-write partition corresponding to the mount directory to the independent configuration directory.

[0135] In one embodiment, refer to Figure 7 , the independent configuration directory is also used to store the variable configurations generated and modified during the operation of the BMC. The second startup preparation module 502 further includes:

[0136] The synchronization unit is used to enable the configuration real-time synchronization service, and the configuration real-time synchronization service is used to perform real-time synchronization of configurations between the independent configuration directory and the mount directory.

[0137] In one embodiment, refer to Figure 8 , the firmware update device further includes:

[0138] The synchronization shutdown module is used to shut down the configuration real-time synchronization service and unmount the preset read-write partition in the mount directory;

[0139] The firmware update device further includes:

[0140] The remounting module is used to mount the read-write partition of the new BMC firmware under the mount directory.

[0141] In one embodiment, refer to Figure 9 , the variable configuration includes user-modifiable configurations. The firmware update device further includes:

[0142] The modification prohibition module is used to notify each service program to prohibit modifying the user-modifiable configuration;

[0143] The firmware update device further includes:

[0144] The post-firmware-update restoration module is used to send a restoration instruction to each service program to allow each service program to modify the modifiable configuration.

[0145] In one embodiment, refer to Figure 10 , the firmware update device further includes:

[0146] The synchronization restart module is used to restart the configuration synchronization service if a save configuration instruction is detected.

[0147] Each module in the above firmware update device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form so that the processor can call and execute the operations corresponding to each of the above modules.

[0148] In an exemplary embodiment, a computer device is provided. The computer device can be a BMC, and its internal structure diagram can be as shown in Figure 11 . The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store firmware update data. The input / output interface of the computer device is used for the processor to exchange information with external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements a firmware update method.

[0149] Those skilled in the art can understand that Figure 11 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0150] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:

[0151] During the BMC startup process, copy the read-only partition image of the preset read-only partition of the BMC firmware in the flash memory of the BMC to the memory of the BMC;

[0152] Mount the preset read-write partition of the BMC firmware in the flash memory under the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC;

[0153] During the BMC firmware update process, continue to run the BMC using the BMC firmware in the memory and the firmware running configuration, and update the BMC firmware in the flash memory according to the new BMC firmware.

[0154] In one embodiment, when the processor executes the computer program, the following steps are further implemented:

[0155] Mount the read-only partition image under the target directory in the memory. The read-only partition image includes an executable program, a dependency library, and a fixed configuration, and create an independent configuration directory;

[0156] Copy the modifiable configuration in the preset read-write partition corresponding to the mount directory to the independent configuration directory.

[0157] In one embodiment, the independent configuration directory is further used to store the variable configuration generated and modified during the operation of the BMC. When the processor executes the computer program, the following steps are further implemented:

[0158] Enable the configuration real-time synchronization service, which is used for real-time synchronization of the configuration between the independent configuration directory and the mount directory.

[0159] In one embodiment, before the BMC firmware update, when the processor executes the computer program, the following steps are further implemented:

[0160] Disable the configuration real-time synchronization service and unmount the preset read-write partition in the mount directory;

[0161] After the BMC firmware update, when the processor executes the computer program, the following steps are further implemented:

[0162] Mount the read-write partition of the new BMC firmware under the mount directory.

[0163] In one embodiment, the variable configuration includes a user-modifiable configuration. Before using the BMC firmware in memory and continuing to run the BMC with the firmware running configuration, when the processor executes a computer program, the following steps are further implemented:

[0164] Notify each service program to prohibit modifying the user-modifiable configuration;

[0165] After performing a firmware update on the BMC firmware in the flash memory according to the new BMC firmware, when the processor executes a computer program, the following steps are further implemented:

[0166] Send a recovery instruction to each service program to allow each service program to modify the modifiable configuration.

[0167] In one embodiment, when the processor executes a computer program, the following steps are further implemented:

[0168] If a save configuration instruction is detected, restart the configuration synchronization service.

[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0170] During the BMC startup process, copy the read-only partition image of the preset read-only partition of the BMC firmware in the flash memory of the BMC to the memory of the BMC;

[0171] Mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC;

[0172] During the BMC firmware update process, continue to run the BMC using the BMC firmware in the memory and the firmware running configuration, and perform a firmware update on the BMC firmware in the flash memory according to the new BMC firmware.

[0173] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0174] Mount the read-only partition image to the target directory in the memory. The read-only partition image includes executable programs, dependent libraries, and fixed configurations, and create an independent configuration directory;

[0175] Copy the modifiable configuration in the preset read-write partition corresponding to the mount directory to the independent configuration directory.

[0176] In one embodiment, the independent configuration directory is further used to store the variable configurations generated and modified during the operation of the BMC. When the computer program is executed by the processor, the following steps are further implemented:

[0177] Enable the configuration real-time synchronization service, which is used for real-time synchronization of configurations between the independent configuration directory and the mounted directory.

[0178] In one embodiment, before the BMC firmware is updated, disable the configuration real-time synchronization service and unmount the preset read-write partition in the mounted directory;

[0179] After the BMC firmware is updated, when the computer program is executed by the processor, the following steps are further implemented:

[0180] Mount the read-write partition of the new BMC firmware under the mounted directory.

[0181] In one embodiment, the variable configuration includes user-modifiable configurations. Before continuing to run the BMC using the BMC firmware in memory and the firmware running configuration, when the computer program is executed by the processor, the following steps are further implemented:

[0182] Notify each service program to prohibit modifying the user-modifiable configurations;

[0183] After the firmware of the BMC in the flash memory is updated according to the new BMC firmware, when the computer program is executed by the processor, the following steps are further implemented:

[0184] Send a recovery instruction to each service program to allow each service program to modify the modifiable configurations.

[0185] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:

[0186] If a save configuration instruction is detected, restart the configuration synchronization service.

[0187] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the following steps are implemented:

[0188] During the BMC startup process, copy the read-only partition image of the preset read-only partition of the BMC firmware in the flash memory of the BMC to the memory of the BMC;

[0189] Mount the preset read-write partition of the BMC firmware in the flash memory under the mounted directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mounted directory to start the BMC;

[0190] During the BMC firmware update process, continue to run the BMC using the BMC firmware in memory and the firmware running configuration, and perform a firmware update on the BMC firmware in the flash memory according to the new BMC firmware.

[0191] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0192] Mount the read-only partition image to a target directory in memory. The read-only partition image includes executable programs, dependent libraries, and fixed configurations, and create an independent configuration directory;

[0193] Copy the modifiable configurations in the preset read-write partition corresponding to the mounted directory to the independent configuration directory.

[0194] In one embodiment, the independent configuration directory is also used to store variable configurations generated and modified during the operation of the BMC. When the computer program is executed by a processor, the following steps are further implemented:

[0195] Enable the configuration real-time synchronization service, which is used to perform real-time synchronization of configurations between the independent configuration directory and the mounted directory.

[0196] In one embodiment, before the BMC firmware update, disable the configuration real-time synchronization service and unmount the preset read-write partition in the mounted directory;

[0197] After the BMC firmware update, when the computer program is executed by a processor, the following steps are further implemented:

[0198] Mount the read-write partition of the new BMC firmware under the mounted directory.

[0199] In one embodiment, the variable configuration includes user-modifiable configurations. Before continuing to run the BMC using the BMC firmware in memory and the firmware running configuration, when the computer program is executed by a processor, the following steps are further implemented:

[0200] Notify each service program to prohibit modifying user-modifiable configurations;

[0201] After performing the firmware update on the BMC firmware in the flash memory according to the new BMC firmware, when the computer program is executed by a processor, the following steps are further implemented:

[0202] Send a recovery instruction to each service program to allow each service program to modify the modifiable configurations.

[0203] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0204] If a save configuration instruction is detected, restart the configuration synchronization service.

[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0206] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.

[0207] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0208] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A firmware update method, characterized in that, For a BMC, the method includes: During the BMC startup process, copy the read-only partition image of the BMC firmware in the preset read-only partition of the BMC's flash memory to the memory of the BMC; Mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC; During the BMC firmware update process, continue to run the BMC using the BMC firmware in the memory and the firmware running configuration, and update the BMC firmware in the flash memory according to the new BMC firmware.

2. The method according to claim 1, wherein The setting of the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory includes: Mount the read-only partition image to a target directory in memory and create an independent configuration directory , The read-only partition image includes an executable program, a dependency library, and a fixed configuration; Copy the modifiable configuration in the preset read-write partition corresponding to the mount directory to the independent configuration directory.

3. The method according to claim 2, characterized in that, The independent configuration directory is also used to store the variable configuration generated and modified during the operation of the BMC. The method further includes: Enable the configuration real-time synchronization service, which is used to perform real-time synchronization of the configuration between the independent configuration directory and the mount directory.

4. The method according to claim 3, wherein Before the BMC firmware update, the method further includes: Disable the configuration real-time synchronization service and unmount the preset read-write partition in the mount directory; After the BMC firmware update, the method further includes; Mount the read-write partition of the new BMC firmware to the mount directory.

5. The method according to claim 4, wherein The variable configuration includes user-modifiable configuration. Before continuing to run the BMC using the BMC firmware in the memory and the firmware running configuration, the method further includes: Notify each service program to prohibit modifying the user-modifiable configuration; After updating the BMC firmware in the flash memory according to the new BMC firmware, the method further includes: Send a recovery instruction to each service program to allow each service program to modify the user-modifiable configuration.

6. The method according to claim 5, characterized in that, The method further includes: If a save configuration instruction is detected, restart the configuration synchronization service.

7. A firmware update device, characterized in that, The device is for a BMC. The device includes: A first startup preparation module, which is used to copy the read-only partition image of the BMC firmware in the preset read-only partition of the BMC's flash memory to the memory of the BMC during the BMC startup process; A second startup preparation module, which is used to mount the preset read-write partition of the BMC firmware in the flash memory to the mount directory in the flash memory, and set the firmware running configuration in the memory according to the read-only partition image stored in the memory and the mount directory to start the BMC; An update module, which is used to continue to run the BMC using the BMC firmware in the memory and the firmware running configuration during the BMC firmware update process, and update the BMC firmware in the flash memory according to the new BMC firmware.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 6.