Method for updating firmware by using BMC
Technical Field
The invention relates to the technical field of server management, in particular to a method for updating firmware by using BMC.
Background
The BMC executes a server remote management controller, which is called Basebard management controller in English. The method can perform operations such as firmware upgrading, machine equipment checking and the like on the machine in a state that the machine is not started.
There are various ways for the BMC to update the firmware, such as updating via a network, updating via a programmer, etc. Under certain conditions (for example, when Flash is erased in the network updating process, the updating is interrupted due to careless power failure, and the original system cannot be restarted), the burner is required to update the firmware, and if the burner or the burner seat is not available at the moment, the updating work is inconvenient.
Based on this, the invention provides a method for updating firmware by using BMC.
Disclosure of Invention
The technical task of the invention is to provide a method for updating firmware by using BMC aiming at the defects.
A method for updating firmware by using BMC is implemented by the following steps: in the server, updating through a network to enable the BMC to be a burner, updating firmware of Flash with the same model as the BMC, starting the BMC in an SPI Flash mode, and fixing the SPIFlash on the PCB board by using a chip holder.
The detailed process comprises the following steps:
firstly, installing a Flash A on a chip holder, and configuring a BMC into a burner mode after a server system is started based on the Flash A;
taking out the Flash A chip and replacing the Flash A chip with a Flash B chip of firmware of the same model to be programmed;
the BMC starts to update the firmware and starts to write the Flash B chip;
and after the updating is finished, the Flash A chip is replaced, and the uploaded firmware is burnt into the Flash B chip.
The process of configuring the BMC into the burner mode is as follows:
firstly, burning BMC firmware into Flash A, and entering a Web management page after a system is started;
selecting a burner mode in a Web management page, and entering a firmware updating stage;
the Web page sends a command for updating to the BMC, the BMC executes the command after receiving the command, and returns an execution state to the Web page after the execution is finished;
after the Web page acquires the state, if the execution is successful, popping up an uploading firmware dialog box, and at the moment, successfully configuring the BMC into a burner mode; and if the execution fails, restarting the system.
The server is provided with a Linux system, and correspondingly, when the Web page sends a preparation updating command to the BMC, the preparation updating command comprises the following steps: all client requests, kill firmware update independent processes, rmmod all modules, unmount firmware update independent file systems, mount/dev/shm devices to/mnt directories and format as tmpfs file systems are closed.
The process of programming the firmware with the same model number written by the BMC to the Flash B chip is as follows:
firstly, selecting firmware to be programmed, uploading selected information to a Web page, and sending a firmware verification command to a BMC by the Web page;
the BMC receives the verification command, reads the size of the uploaded firmware and starts to update the firmware;
the Web page reads the update progress of the BMC at regular time and displays the update progress on the Web;
and after the updating is finished, taking out the Flash B chip in the BMC chip holder, replacing the Flash B chip with the Flash A chip, burning the uploaded firmware into the Flash B chip, and restarting the BMC to finish the updating work.
When the BMC updates the firmware, the Flash size is erased according to the size of the uploaded firmware.
The Web page and the BMC updating process adopt an HTTP/HTTPs protocol, and information interaction is carried out through inter-process communication.
Compared with the prior art, the method for updating the firmware by using the BMC has the following beneficial effects:
according to the method for updating the firmware by using the BMC, disclosed by the invention, the BMC can be a burner (only Flash of the same type is burnt) without a third-party tool, so that the firmware is updated, the practicability is high, the firmware updating cost is lower, the implementation is easy, the application range is wide, and the method has good popularization and application values.
Drawings
FIG. 1 is a flow chart of the implementation of the method of the present invention.
Detailed Description
The invention is further described with reference to the following figures and specific embodiments.
As shown in fig. 1, a method for updating firmware using BMC adopts HTTP/HTTPs protocol to update through a network, so that BMC becomes a burner and can update firmware of BMC Flash.
The realization process is as follows: in the server, updating through a network to enable the BMC to be a burner, updating firmware of Flash with the same type as the BMC, starting the BMC in an SPI Flash mode, and fixing the SPI Flash on the PCB by using a chip holder.
The scheme is characterized in that the BMC is started in an SPI Flash mode, and the SPI Flash uses a chip holder instead of being directly welded on a PCB. The Flash updating steps are as follows:
burning the BMC firmware with the function into Flash A, and entering a Web to enter a management page after a system is started;
selecting a burner mode in a firmware updating page, and entering a firmware updating stage;
the Web page sends a command for updating to the BMC, the BMC executes the command after receiving the command, and returns an execution state to the Web after the execution is finished;
the server is provided with a Linux system, and correspondingly, the Web page sends a command for preparing update to the BMC. The BMC executes the prepare update command. The main operations include: closing all client requests, processes irrelevant to kill firmware update, all rmmod modules, file systems irrelevant to unmount firmware update, mounting/dev/shm equipment to/mnt directories, formatting the devices into tmpfs file systems and the like;
after the Web acquires the state, if the execution is successful, popping up an uploading firmware dialog box; if the execution fails, the system is restarted;
taking out the Flash A chip in the BMC chip holder, and replacing the Flash A chip with the same model to be programmed with the Flash B chip;
selecting firmware to be programmed in the firmware uploading dialog box, and after uploading is finished, sending a firmware verification command to the BMC by the Web;
the BMC receives the verification command, reads the size of the uploaded firmware and starts to update the firmware;
the Web reads the update progress of the BMC at regular time and displays the update progress on the Web;
after the updating is finished, taking out the Flash B chip in the BMC chip holder, then replacing the Flash B chip with the Flash A chip, burning the uploaded firmware into the Flash B, restarting the BMC to finish the updating operation, and burning the uploaded firmware into the Flash B to finish the updating work;
when the BMC updates the firmware, the Flash size is erased according to the size of the uploaded firmware, so that the time is saved.
And the Web and the BMC updating process carry out information interaction through interprocess communication.
The present invention can be easily implemented by those skilled in the art from the above detailed description. It should be understood, however, that the intention is not to limit the invention to the particular embodiments described. On the basis of the disclosed embodiments, a person skilled in the art can combine different technical features at will, thereby implementing different technical solutions.
In addition to the technical features described in the specification, the technology is known to those skilled in the art.