A BMC startup method and related components
By using a counter during BMC startup to determine the availability of storage media and firmware image files, and switching to backup storage media under abnormal conditions, the problem of BMC startup exception is solved and the server is ensured to run normally.
Patent Information
- Application Number
- CN202210751050.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-06-29
AI Technical Summary
During the BMC startup process, the firmware mirror file or storage media itself that was written to the storage medium in advance may have an abnormality, causing the BMC to fail to start normally, which will affect the normal operation of the server.
By controlling the output value of the counter to be increased by one when the boot loader is started, and determining whether the counter output value exceeds the preset threshold during the kernel loading process. If it exceeds, restart the boot loader and switch to the firmware image file in the backup storage medium.
Ensure that the BMC can automatically switch to the backup storage medium when encountering an abnormality in the primary storage medium or firmware image file, avoiding the BMC from being stuck or starting cyclically, and ensuring the normal startup and operation of the server.
Smart Images

Figure CN114995840B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of servers, and particularly to a BMC startup method and related components. Background Art
[0002] With the continuous development of information technology, the demand for servers in various industries has surged, and the BMC (Baseboard Management Controller), which monitors the operating status of servers, has also been greatly developed. The startup process of the BMC can generally be divided into: the boot loader calls the firmware image file from the storage medium to load data into the specified memory, loads the kernel into the specified memory, loads the file system into the specified memory, and starts the application program. However, the firmware image file pre-burned into the storage medium may be abnormal, or the storage medium itself may be abnormal, and these situations will cause the BMC to fail to start normally, thereby affecting the server. Summary of the Invention
[0003] The purpose of the present invention is to provide a BMC startup method and related components, which can ensure the normal startup of the BMC, and thus ensure the normal operation of the server.
[0004] To solve the above technical problems, the present invention provides a BMC startup method, which is characterized by including:
[0005] When the boot loader starts, control the output value of the counter to increment by one;
[0006] Control the boot loader to call the firmware image file in the primary storage medium, so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC;
[0007] After the kernel is normally loaded into the memory, clear the output value of the counter;
[0008] When the kernel is not normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call the firmware image file in the backup storage medium.
[0009] Preferably, after controlling the boot loader to call the firmware image file in the primary storage medium, it further includes:
[0010] Judge whether the file system can be normally loaded into the memory;
[0011] When the file system can be successfully loaded into the memory, proceed to the step of clearing the output value of the counter;
[0012] When the file system cannot be successfully loaded into the memory, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call the firmware image file in the backup storage medium.
[0013] Preferably, after controlling the boot loader to call the firmware image file in the primary storage medium, the following steps are further included:
[0014] Determine whether the application can be started normally;
[0015] When the application can be started normally, proceed to the step of clearing the output value of the counter;
[0016] When the application cannot be started normally, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call the firmware image file in the backup storage medium.
[0017] Preferably, after the kernel is not successfully loaded into the memory and the current output value of the counter is greater than a preset threshold, the following steps are further included:
[0018] Mark the hardware upgrade flag of the primary storage medium as an unavailable flag, where the hardware upgrade flag includes an available flag and the unavailable flag.
[0019] Preferably, after the kernel is not successfully loaded into the memory and the current output value of the counter is greater than a preset threshold, the following steps are further included:
[0020] Generate an alarm message for prompting an exception in the primary storage medium and send the alarm message to the client.
[0021] Preferably, after the kernel is not successfully loaded into the memory and the current output value of the counter is greater than a preset threshold, the following steps are further included:
[0022] Burn the firmware image file in the backup storage medium into the primary storage medium.
[0023] To solve the above technical problems, the present invention further provides a BMC startup system, including:
[0024] A counter increment unit, configured to control the output value of the counter to increment by one when the boot loader starts;
[0025] A mirror file calling unit, configured to control the boot loader to call the firmware mirror file in the primary storage medium, so that the boot loader loads data from the firmware mirror file into the memory corresponding to the BMC;
[0026] A counter clearing unit, configured to clear the output value of the counter after the kernel is successfully loaded into the memory;
[0027] A storage medium switching unit, configured to, when the kernel is not successfully loaded into the memory, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call the firmware mirror file in the backup storage medium.
[0028] Preferably, it further includes:
[0029] A file system loading judgment unit, configured to, after controlling the boot loader to call the firmware mirror file in the primary storage medium, judge whether the file system can be successfully loaded into the memory; when the file system can be successfully loaded into the memory, trigger the counter clearing unit; when the file system cannot be successfully loaded into the memory, trigger the storage medium switching unit.
[0030] Preferably, it further includes:
[0031] An application startup judgment unit, configured to, after controlling the boot loader to call the firmware mirror file in the primary storage medium, judge whether the application can be successfully started; when the application can be successfully started, trigger the counter clearing unit; when the application cannot be successfully started, trigger the storage medium switching unit.
[0032] Preferably, it further includes:
[0033] A marking unit, configured to, after the kernel is not successfully loaded into the memory and the current output value of the counter is greater than a preset threshold, mark the hardware upgrade identifier of the primary storage medium as an unavailable identifier, where the hardware upgrade identifier includes an available identifier and the unavailable identifier.
[0034] Preferably, it further includes:
[0035] An alarm prompting unit, configured to, after the kernel is not successfully loaded into the memory and the current output value of the counter is greater than a preset threshold, generate an alarm message for prompting that an exception occurs in the primary storage medium and send the alarm message to the client.
[0036] Preferably, it further includes:
[0037] A mirror image file burning unit, configured to burn a firmware mirror image file in the backup storage medium to the primary storage medium after the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than a preset threshold.
[0038] To solve the above technical problems, the present invention further provides a BMC startup device, including:
[0039] A memory, configured to store a computer program;
[0040] A processor, configured to implement the steps of the above BMC startup method when executing the computer program.
[0041] To solve the above technical problems, the present invention further provides a server, including the above BMC startup device.
[0042] To solve the above technical problems, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above BMC startup method are implemented.
[0043] In summary, the present invention discloses a BMC startup method and related components. First, when the boot loader starts, the output value of the counter is incremented by one for subsequent determination of whether the primary storage medium is abnormal based on the output value of the counter; the boot loader is controlled to call the firmware mirror image file in the primary storage medium so that the boot loader loads data from the firmware mirror image file into the memory corresponding to the BMC; when the kernel is normally loaded into the memory, it proves that the primary storage medium can be used normally, so the output value of the counter is cleared; when the kernel fails to be normally loaded into the memory, if the current output value of the counter is greater than the preset threshold, it proves that the primary storage medium has appeared abnormal multiple times, and it is determined that the primary storage medium cannot be used normally. At this time, the bootloader is controlled to restart and the boot loader is controlled to call the firmware mirror image file in the backup storage medium, ensuring the normal startup of the BMC. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required in the prior art and the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0045] Figure 1 It is a flowchart of a BMC startup method provided by the present invention;
[0046] Figure 2Schematic diagram of a BMC startup system provided by the present invention;
[0047] Figure 3 Schematic diagram of a BMC startup device provided by the present invention. Specific implementation manner
[0048] The core of the present invention is to provide a BMC startup method and related components, which can ensure the normal startup of the BMC, and further ensure the normal operation of the server.
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0050] Please refer to Figure 1 , Figure 1 Flowchart of a BMC startup method provided by the present invention. The BMC startup method includes:
[0051] S11: When the boot loader starts, control the output value of the counter to increment by one;
[0052] In the prior art, the storage medium involved in the startup process of the BMC and the firmware image file burned in the storage medium may both have abnormalities, which may cause the BMC to fail to start normally, and further affect the server.
[0053] In this application, considering that the startup process of the BMC can be roughly divided into the boot loader calling the firmware image file from the storage medium to load data into the specified memory, loading the kernel into the specified memory, loading the file system into the specified memory, and starting the application program. Among them, the process of calling the firmware image file from the storage medium occurs after the boot loader starts. Therefore, before involving the storage medium and the firmware image file, that is, when the boot loader starts, first control the output value of the counter to increment by one, and after involving the storage medium and the firmware image file, modify the output value of the counter based on whether the storage medium and the firmware image file can work normally, so as to judge whether the storage medium and the firmware image file can work normally based on the output value of the counter.
[0054] S12: Control the boot loader to call the firmware image file in the primary storage medium, so that the boot loader loads data in the firmware image file into the memory corresponding to the BMC;
[0055] In this application, in addition to the primary storage medium, a backup storage medium is also provided in the server. When the primary storage medium or the firmware image file in the primary storage medium has an abnormality, the firmware image file in the backup storage medium can be called, which improves the stability of BMC operation.
[0056] In this application, considering that a primary storage medium and a backup storage medium are provided in the server, it is necessary to specify that BMC calls the firmware image file from the primary storage medium first each time it starts, and then starts the backup storage medium when the primary storage medium has an abnormality. After the boot loader is controlled to call the firmware image file in the primary storage medium, the bootloader can automatically load relevant information from the firmware image file into the corresponding memory of the BMC.
[0057] It should be noted that the types and storage capacities of the primary storage medium and the backup storage medium can be set according to actual situations, and this application does not make special limitations on this.
[0058] S13: After the kernel is normally loaded into the memory, clear the output value of the counter;
[0059] Considering that the startup process of BMC is that the boot loader calls the firmware image file from the storage medium to load data into the specified memory, loads the kernel into the specified memory, loads the file system into the specified memory, and starts the application program. Therefore, in this application, if the kernel is normally loaded into the memory, it can be proved that the process of the boot loader calling the firmware image file from the primary storage medium to load data into the specified memory is proceeding normally, which proves that there is no abnormality in the primary storage medium in the server, and there is no abnormality in the firmware image file in the primary storage medium. Therefore, after the kernel is normally loaded into the memory, that is, after it is determined that there is no abnormality in the primary storage medium and its firmware image file, the output value of the counter is cleared to prepare for the next startup of BMC.
[0060] S14: When the kernel is not normally loaded into the memory, if the current output value of the counter is greater than the preset threshold, control the boot loader to restart and control the boot loader to call the firmware image file in the backup storage medium.
[0061] Similarly, considering that the BMC startup process is in sequence that the boot loader calls the firmware image file from the storage medium to load data into the specified memory, loads the kernel into the specified memory, loads the file system into the specified memory, and starts the application program. Therefore, in this application, if the kernel is not normally loaded into the memory, it indicates that there is an abnormality in the previous step of the BMC startup process when the kernel is loaded into the memory, that is, the process that the boot loader calls the firmware image file from the primary storage medium to load data into the specified memory. Therefore, the output value of the counter will not be cleared.
[0062] At the same time, in order to exclude the influence on the BMC startup caused by other factors except for the abnormality of the primary storage medium and the firmware image file in the primary storage medium, in this application, when the output value of the counter is greater than the preset threshold, it is determined that the primary storage medium and the firmware image file in the primary storage medium are abnormal. That is, when the boot loader fails to call the firmware image file in the primary storage medium multiple times, it will be determined that the primary storage medium and the firmware image file in the primary storage medium are abnormal, making the judgment on whether the primary storage medium and the firmware image file in the primary storage medium are abnormal more accurate and reliable.
[0063] In summary, in this application, by making cumulative retry judgments in the startup boot phase, that is, the boot loader startup phase, and making cumulative clearings in the kernel running phase, that is, the process of loading the kernel into the memory, the availability of the primary storage medium of the BMC and the firmware image file in the primary storage medium is judged. In addition, this application can also control whether the boot loader enables the primary storage medium or the backup storage medium by operating the hardware upgrade flag of the storage medium, thereby avoiding the BMC from being in a stuck or loop startup state all the time and ensuring the normal startup of the BMC.
[0064] In summary, the present invention discloses a BMC startup method. First, when the boot loader starts, control the output value of the counter to increment by one for subsequent judgment of whether the primary storage medium is abnormal based on the output value of the counter; control the bootloader to call the firmware image file in the primary storage medium so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC; the normal loading of the kernel into the memory proves that the primary storage medium can be used normally, so the output value of the counter is cleared; when the kernel is not normally loaded into the memory, if the current output value of the counter is greater than the preset threshold, it proves that the primary storage medium has appeared abnormal multiple times, and it is determined that the primary storage medium cannot be used normally. At this time, control the boot loader to restart and control the boot loader to call the firmware image file in the backup storage medium, thereby avoiding the BMC from being in a stuck or loop startup state all the time and ensuring the normal startup of the BMC.
[0065] Based on the above embodiments:
[0066] As a preferred embodiment, after controlling the boot loader to call the firmware image file in the primary storage medium, the following steps are further included:
[0067] Determine whether the file system can be normally loaded into the memory;
[0068] When the file system can be normally loaded into the memory, enter the step of clearing the output value of the counter;
[0069] When the file system cannot be normally loaded into the memory, enter the step of controlling the boot loader to restart and controlling the boot loader to call the firmware image file in the backup storage medium if the current output value of the counter is greater than the preset threshold.
[0070] Considering that the BMC startup process is successively that the boot loader calls the firmware image file from the storage medium to load data into the specified memory, loads the kernel into the specified memory, loads the file system into the specified memory, and starts the application program. Therefore, in order to further determine whether the primary storage medium, the firmware image file in the primary storage medium, and the kernel are all normally loaded into the memory, in this embodiment, it is also determined whether the file system can be normally loaded into the memory. If the file system can be normally loaded into the memory, it proves that in the BMC startup process, the boot loader calls the primary storage medium, the boot loader calls the firmware image file from the primary storage medium to load data into the memory corresponding to the BMC, the kernel is loaded into the memory, and the file system is loaded into the memory are all normally completed. At this time, it can be determined that neither the primary storage medium nor the firmware image file in the primary storage medium has an abnormality, and at this time, the output value of the counter is cleared.
[0071] Similarly, considering that the BMC startup process is successively that the boot loader calls the firmware image file from the storage medium to load data into the specified memory, loads the kernel into the specified memory, loads the file system into the specified memory, and starts the application program. Therefore, in this application, if the file system is not normally loaded into the memory, it indicates that the steps before the file system is loaded into the memory in the BMC startup process, that is, the boot loader calls the firmware image file in the primary storage medium and the kernel is loaded into the memory, may all have abnormalities. Therefore, the output value of the counter will not be cleared.
[0072] Meanwhile, in order to exclude the influence of other factors on the BMC startup, in this application, when the file system cannot be normally loaded into the memory, it is also necessary to determine that the primary storage medium and the firmware image file in the primary storage medium are abnormal only when the current output value of the determination counter is greater than the preset threshold. That is, only when the boot loader fails to call the firmware image file in the primary storage medium multiple times or the file system cannot be normally loaded into the memory multiple times, it will be determined that the primary storage medium and the firmware image file in the primary storage medium are abnormal, making the judgment on whether the primary storage medium and the firmware image file in the primary storage medium are abnormal more accurate and reliable, and thus avoiding the BMC from being in a stuck or loop startup state all the time.
[0073] As a preferred embodiment, after controlling the boot loader to call the firmware image file in the primary storage medium, it further includes:
[0074] Determine whether the application can be started normally;
[0075] When the application can be started normally, enter the step of clearing the output value of the counter;
[0076] When the application cannot be started normally, enter the step of controlling the boot loader to restart and controlling the boot loader to call the firmware image file in the secondary storage medium if the current output value of the counter is greater than the preset threshold.
[0077] Considering that the startup process of the BMC is successively that the boot loader calls the firmware image file from the storage medium to load data into the specified memory, loads the kernel into the specified memory, loads the file system into the specified memory, and starts the application. Therefore, in order to further ensure that the primary storage medium, the firmware image file in the primary storage medium, the file system loaded into the memory, and the startup of the application can all be completed normally, in this embodiment, it is further determined whether the application can be started normally. If the application can be started normally, it proves that the processes of the boot loader calling the primary storage medium, the boot loader loading the firmware image file from the primary storage medium into the memory corresponding to the BMC, loading the kernel into the memory, loading the file system into the memory, and starting the application during the BMC startup process are all completed normally. At this time, it can be determined that neither the primary storage medium nor the firmware image file in the primary storage medium is abnormal, and at this time, the output value of the counter is cleared.
[0078] Similarly, considering that the BMC startup process sequentially involves the boot loader calling the firmware image file from the storage medium to load data into the specified memory, loading the kernel into the specified memory, loading the file system into the specified memory, and starting the application, if the application fails to start properly, it indicates that there may be an abnormality in the steps before the application startup during the BMC startup process, including the boot loader calling the firmware image file in the primary storage medium. Therefore, the output value of the counter will not be cleared.
[0079] Meanwhile, to exclude the influence of other factors on the BMC startup, in this application, when the application fails to start properly, it is also necessary to determine that the primary storage medium and the firmware image file in the primary storage medium are abnormal only when the current output value of the counter is greater than the preset threshold. That is, it is only when the boot loader fails to call the firmware image file in the primary storage medium multiple times, or the file system fails to be loaded into the memory normally multiple times, or the application fails to start that it will be determined that the primary storage medium and the firmware image file in the primary storage medium are abnormal, making the judgment of whether the primary storage medium and the firmware image file in the primary storage medium are abnormal more accurate and reliable, and thus avoiding the BMC from being stuck or in a loop startup state.
[0080] As a preferred embodiment, after the kernel fails to be loaded into the memory normally and the current output value of the counter is greater than the preset threshold, it further includes:
[0081] Marking the hardware upgrade flag of the primary storage medium as an unavailable flag, where the hardware upgrade flag includes an available flag and an unavailable flag.
[0082] In this embodiment, considering that each storage medium in the server has a corresponding hardware upgrade flag, and the hardware upgrade flag generally includes an available flag and an unavailable flag, the BMC can control the boot loader to call the storage medium with the hardware upgrade flag being the available flag during startup, thereby ensuring that the boot loader can normally call the firmware image file from the primary storage medium during the BMC startup process.
[0083] Therefore, in this embodiment, when the kernel fails to be loaded into the memory normally and the current output value of the counter is greater than the preset threshold, that is, when excluding the abnormal BMC startup caused by other factors, the hardware upgrade flag of the primary storage medium is marked as an unavailable flag, so that the operation and maintenance personnel can timely understand the situation of the primary storage medium and the backup storage medium in the server, and the next time the BMC is started, the firmware image file can be called from the backup storage medium.
[0084] In summary, after determining that the primary storage medium has an abnormality, that is, the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than the preset threshold, marking the hardware upgrade identifier of the primary storage medium as an unavailable identifier can ensure the normal startup of the BMC and also provide information for the operation and maintenance personnel to understand the status of the storage medium in the server.
[0085] As a preferred embodiment, after the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than the preset threshold, it further includes:
[0086] Generating an alarm message for prompting an abnormality of the primary storage medium and sending the alarm message to the client.
[0087] In this embodiment, after determining that the primary storage medium has an abnormality, that is, the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than the preset threshold, an alarm message for prompting an abnormality of the primary storage medium can also be generated. The specific form of the alarm message is not particularly limited in this application, as long as it can prompt the operation and maintenance personnel that an abnormality has occurred in the primary storage medium in the server. After generating the alarm message, the alarm message also needs to be sent to the client so that the user using the client can timely understand the status of the primary storage medium.
[0088] As a preferred embodiment, after the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than the preset threshold, it further includes:
[0089] Burning the firmware image file in the backup storage medium to the primary storage medium.
[0090] In this embodiment, after determining that the primary storage medium has an abnormality, that is, the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than the preset threshold, in order to restore the primary storage medium to an available state, in this application, the firmware image file in the backup storage medium is also burned to the primary storage medium. In this way, when the BMC starts up next time, when the bootloader calls the firmware image file in the primary storage medium, it can normally call the firmware image file in the primary storage medium, instead of starting the backup storage medium after determining that the primary storage medium has an abnormality.
[0091] In addition, the firmware image file stored in the external storage medium or the backup of the pre-stored firmware image file can also be burned to the primary storage medium, as long as the firmware image file in the primary storage medium can be restored to normal. This application does not make a special limitation on this.
[0092] It should also be noted that after the firmware image file in the spare storage medium is burned to the primary storage medium, if the boot loader still cannot normally call the firmware image file in the primary storage medium, the operation and maintenance personnel can be prompted that the primary storage medium may be abnormal, and the primary storage medium can be repaired or replaced.
[0093] In summary, in this embodiment, by burning the firmware image file in the spare storage medium to the primary storage medium after determining that the primary storage medium is abnormal, the primary storage medium can be repaired, which provides a guarantee for the normal startup of the BMC, and further ensures the normal operation of the server.
[0094] Please refer to Figure 2 , Figure 2 , which is a schematic structural diagram of a BMC startup system provided by the present invention. The BMC startup system includes:
[0095] A counter accumulation unit 11, configured to control the output value of the counter to increment by one when the boot loader starts;
[0096] An image file calling unit 12, configured to control the boot loader to call the firmware image file in the primary storage medium, so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC;
[0097] A counter clearing unit 13, configured to clear the output value of the counter after the kernel is normally loaded into the memory;
[0098] A storage medium switching unit 14, configured to, when the kernel is not normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call the firmware image file in the spare storage medium.
[0099] In summary, the present invention discloses a BMC startup system. First, a counter accumulation unit 11 is used to increment the output value of a counter by one when the bootloader starts, so as to subsequently determine whether the primary storage medium is abnormal based on the output value of the counter; an image file calling unit 12 is used to control the boot loader to call the firmware image file in the primary storage medium, so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC; a counter clearing unit 13 is used to clear the output value of the counter when the kernel is normally loaded into the memory, proving that the primary storage medium can be used normally; a storage medium switching unit 14 is used to, when the kernel is not normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, proving that the primary storage medium has appeared abnormal multiple times and determining that the primary storage medium cannot be used normally, at this time controlling the boot loader to restart and controlling the boot loader to call the firmware image file in the secondary storage medium, thereby avoiding the BMC from being stuck or in a loop startup state all the time and ensuring the normal startup of the BMC.
[0100] By judging whether the image in the storage medium runs reliably through the entire startup process from the BMC startup to the normal operation of the kernel, and switching the primary and secondary images, it can effectively avoid the problem that the BMC system cannot start, and improve the reliability of product maintenance and use.
[0101] Based on the above embodiments:
[0102] As a preferred embodiment, it further includes:
[0103] A file system loading judgment unit is used to judge whether the file system can be normally loaded into the memory after controlling the boot loader to call the firmware image file in the primary storage medium; if the file system can be normally loaded into the memory, it triggers the counter clearing unit 13; if the file system cannot be normally loaded into the memory, it triggers the storage medium switching unit 14.
[0104] As a preferred embodiment, it further includes:
[0105] An application startup judgment unit is used to judge whether the application can be normally started after controlling the boot loader to call the firmware image file in the primary storage medium; when the application can be normally started, it triggers the counter clearing unit 13; when the application cannot be normally started, it triggers the storage medium switching unit 14.
[0106] As a preferred embodiment, it further includes:
[0107] A marking unit, configured to mark the hardware upgrade identifier of the primary storage medium as an unavailable identifier after the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than a preset threshold, where the hardware upgrade identifier includes an available identifier and an unavailable identifier.
[0108] As a preferred embodiment, it further includes:
[0109] An alarm prompt unit, configured to generate an alarm message for prompting an abnormality of the primary storage medium and send the alarm message to the client after the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than a preset threshold.
[0110] As a preferred embodiment, it further includes:
[0111] A mirror file burning unit, configured to burn the firmware mirror file in the secondary storage medium into the primary storage medium after the kernel fails to be normally loaded into the memory and the current output value of the counter is greater than a preset threshold.
[0112] Please refer to Figure 3 , Figure 3 , which is a schematic structural diagram of a BMC startup device provided by the present invention. The BMC startup device includes:
[0113] A memory 21, configured to store a computer program;
[0114] A processor 22, configured to implement the steps of the above BMC startup method when executing the computer program.
[0115] In summary, the present invention discloses a BMC startup device, including a memory 21 and a processor 22. The processor 22 is configured to first, when the boot loader starts, control the output value of the counter to increment by one for subsequent determination of whether the primary storage medium has an abnormality based on the output value of the counter; control the boot loader to call the firmware mirror file in the primary storage medium so that the boot loader loads data from the firmware mirror file into the memory corresponding to the BMC; the normal loading of the kernel into the memory proves that the primary storage medium can be used normally, so the output value of the counter is cleared; when the kernel fails to be normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, it proves that the primary storage medium has had an abnormality multiple times, and it is determined that the primary storage medium cannot be used normally. At this time, control the boot loader to restart and control the boot loader to call the firmware mirror file in the secondary storage medium, thereby avoiding the BMC from being stuck or in a loop startup state all the time, and ensuring the normal startup of the BMC.
[0116] The present invention further provides a server, including the above BMC startup device.
[0117] For the relevant introduction of a server provided by the present invention, please refer to the embodiments of the above BMC startup method, which will not be elaborated herein again.
[0118] The present invention also 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 above BMC startup method are implemented.
[0119] In summary, the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it first controls the output value of a counter to increment by one when the boot loader starts, so as to subsequently determine whether the primary storage medium is abnormal based on the output value of the counter; controls the boot loader to call the firmware image file in the primary storage medium, so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC; when the kernel is normally loaded into the memory, it proves that the primary storage medium can be used normally, so the output value of the counter is cleared; when the kernel is not normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, it proves that the primary storage medium has appeared abnormal multiple times, and it is determined that the primary storage medium cannot be used normally. At this time, the boot loader is controlled to restart and the boot loader is controlled to call the firmware image file in the backup storage medium, ensuring the normal startup of the BMC.
[0120] In this specification, the embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0121] It should also be noted that the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
[0122] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A BMC startup method, characterized in that, including: When the boot loader starts, control the output value of the counter to increment by one; Control the boot loader to call the firmware image file in the primary storage medium so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC; After the kernel is normally loaded into the memory, clear the output value of the counter; When the kernel is not normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call the firmware image file in the backup storage medium.
2. The BMC startup method according to claim 1, characterized in that, After controlling the boot loader to call the firmware image file in the primary storage medium, it further includes: Determine whether the file system can be normally loaded into the memory; When the file system can be normally loaded into the memory, enter the step of clearing the output value of the counter; When the file system cannot be normally loaded into the memory, enter the step of, if the current output value of the counter is greater than a preset threshold, controlling the boot loader to restart and controlling the boot loader to call the firmware image file in the backup storage medium.
3. The BMC startup method according to claim 1, characterized in that, After controlling the boot loader to call the firmware image file in the primary storage medium, it further includes: Determine whether the application can be normally started; When the application can be normally started, enter the step of clearing the output value of the counter; When the application cannot be normally started, enter the step of, if the current output value of the counter is greater than a preset threshold, controlling the boot loader to restart and controlling the boot loader to call the firmware image file in the backup storage medium.
4. The BMC startup method according to claim 1, characterized in that, After the kernel is not normally loaded into the memory and the current output value of the counter is greater than a preset threshold, it further includes: Mark the hardware upgrade flag of the primary storage medium as an unavailable flag, where the hardware upgrade flag includes an available flag and the unavailable flag.
5. The BMC startup method according to claim 1, characterized in that, After the kernel is not normally loaded into the memory and the current output value of the counter is greater than a preset threshold, it further includes: Generate an alarm message for prompting an exception in the primary storage medium and send the alarm message to the client.
6. The BMC startup method according to any one of claims 1 to 5, characterized in that, After the kernel is not normally loaded into the memory and the current output value of the counter is greater than a preset threshold, it further includes: Burn the firmware image file in the backup storage medium into the primary storage medium.
7. A BMC startup system, characterized in that, including: A counter incrementing unit for controlling the output value of the counter to increment by one when the boot loader starts; An image file calling unit for controlling the boot loader to call the firmware image file in the primary storage medium so that the boot loader loads data from the firmware image file into the memory corresponding to the BMC; A counter clearing unit for clearing the output value of the counter after the kernel is normally loaded into the memory; A storage medium switching unit, configured to, when the kernel fails to be normally loaded into the memory, if the current output value of the counter is greater than a preset threshold, control the boot loader to restart and control the boot loader to call a firmware image file in a backup storage medium.
8. A BMC startup device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the BMC startup method according to any one of claims 1 to 6 when executing the computer program.
9. A server, characterized in that, Comprising the BMC startup device according to claim 8.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the BMC startup method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for securely storing and loading firmware and electronic device
CN113656086A
Device programming with system generation
US20180034682A1