The subject matter herein generally relates to firmware update.
A firmware is a software embedded in a hardware device, usually located in a special application integrated circuit (ASIC), a flash memory of programmable logic device (PLD), an electrically erasable programmable read-only memory (EERPOM) or a programmable read-only memory (PROM), and the firmware can usually be updated by users.
With a rapid development of technology and user needs related fields, manufactures may improve the performance and reliability of equipment, repair existing program problems or add new functions to the equipment through regular firmware upgrades, so that the equipment can be kept in the best working condition. In the current firmware burning technology, the related files of the firmware are usually stored in a folder to a fixed position, failure of firmware burning may be happen caused by unintentionally changing the location or wrong name of the firmware burning file.
Implementations of the present disclosure will now be described, by way of embodiments, with reference to the attached figures.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features of the present disclosure. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one”.
Several definitions that apply throughout this disclosure will now be presented.
The connection can be such that the objects are permanently connected or releasably connected. The term “comprising,” when utilized, means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in the so-described combination, group, series, and the like.
A firmware burning method is applied in one or more electronic devices which can compute. The hardware may be but is not limited to Microprogrammed Control Units, Application Specific Integrated Circuits, Field-Programmable Gate Arrays, Digital Signal Processors, and embedded devices, etc.
In block S100, a redhat package manager specification (RPM SPEC) file is configured based on attribute information of a firmware.
In one embodiment, the redhat package manager (RPM) is a common software package manager based on Redhat, Centos, Fedora and other Linux systems. Users can install a RPM software with only one command, and execute their own scripts in the installation and uninstall stages. The SPEC files are configuration specification files, which is the core of the RPM package compilation process. The SPEC file may record how the package is configured, what patches are made, what files are installed, where to install, and what levels of activities are required during the installation process.
In one embodiment, a header keyword part of the RPM SPEC file, a first execution part association of an installation process of the RPM SPEC file, and a second execution part association of an unloading process of the RPM SPEC file are configured based on the attribute information of the firmware. For example, the RPM SPEC file can include two parts: the header keyword and the execution part of each stage before and after of installation and unloading. Specifically, configuring the header keyword part of the RPM SPEC file based on the attribute information of the firmware comprises following steps: a package name of the firmware installation package is defined through a module field and a version field; a name of the burning tool is defined through a flash tool field; a file name of the firmware image file by a fw_image field, a uefi_bios_image field, and a legacy_bios_image field are defied and a detailed description of the firmware installation package is defined through a description field.
In one embodiment, taking the RPM creation of Host Bus Adapter(HBA) card burning as an example, the configuration of RPM SPEC file is as follows:
In one embodiment, the first execution part association of the installation process of the RPM SPEC file and the second execution part association of the unloading process of the RPM SPEC file are configured based on the attribute information of the firmware that can comprise following steps: an image file to be burned is defined through an install field, and a first script to be executed is defined after the firmware installation package is installed through a post field; a second script to be executed is defined before the firmware installation package is unloaded through a postun field and files comprised in the firmware installation package are defined through a files script. In this embodiment, the contents of the RPM SPEC file are as follows:
In block S200, the RPM SPEC file is copied to a first directory of a RPM software directory, and a burning tool and a firmware image file are copied to a second directory of the RPM software directory.
In one embodiment, taking the RPM software directory of “/root/rpmbuild” as an example, the RPM SPEC file can be copied to a “/root/rpmbuild/SPECS” directory, the “/root/rpmbuild/SPECS” directory is defined as the first directory, a burning tool and a firmware image file are copied to a “/root/rpmbuild/SOURCE” directory, and the “/root/rpmbuild/SOURCE” directory is defined as the second directory. In the subsequent installation and burning process of the firmware installation package, the RPM SPEC files can be read from the first directory, and the burning tool and the firmware image file can be read from the second directory. In other embodies, RPM SPEC files, burning tool and firmware image files can be copied to different directories.
In block S300, a firmware installation package is generated based on the first directory, the second directory, and a preset RPM product command.
In one embodiment, when the preset RPM product command is receiving, the preset RPM product command can be executed to generate the firmware installation package based on the first directory and the second directory. For example, when the firmware burning system received the preset RPM product command, the firmware system can generate a binary firmware upgrade package based on the RPM SPEC files of the first directory, and the burning tool and the firmware image file of the second directory, and the firmware upgrade package is stored in a third directory. In this embodiment, the third directory can be a “/root/rpmbuild/RPMS” directory, this application does not restrict the third directory. The firmware upgrade package can comprise a RPM SPEC file, a burning tool and a firmware image file.
In block S400, the firmware installation package is installed based on a preset RPM installation command to burn the firmware.
In one embodiment, when the firmware burning system receives the preset RPM installation command, the firmware burning system can install the firmware installation package, the burning tool and the firmware image file are decompressed to the specified position(the specified position can be the position that the user sets), the burning tool can execute all the instructions of firmware burning in turn to achieve the effect of firmware burning. In this embodiment, the firmware burning system can read RPM SPEC filed from the first directory, read burning tools and firmware image files from the second directory. It also avoids some problems of the wrong address of RPM SPEC files, the burning tools and the firmware image files and improves the efficiency of burning.
In one embodiment, in the process of firmware burning, the firmware burning system can generate the check code of the firmware installation package based on a cyclic redundancy check (CRC) algorithm, a MD5 Message-Digest (MD5) algorithm or a Secure Hash (SHA1) algorithm. The firmware installation package is checked based on the check code of the firmware installation package to obtain a checking result of a checking process.
In one embodiment, the method can customize the SPEC file according to the actual firmware burning requirements, and package the firmware image file, the burin tool and the SPEC file into the RPM firmware installation package. It can realize the effect of installation and burning, and avoid the problem of wrong operation of related burning files. At the same time, the method verifies the consistency of the firmware installation package before completing the final burning work, which further improves the efficiency of burning and avoids the burning failure caused by version number inconsistency or device mismatch between the firmware and the firmware installation package.
Referring to
In one embodiment, as shown in
In one embodiment, a non-transitory storage medium recording instructions is disclosed. When the recorded computer instructions are executed by a processor of an electronic device 20, the electronic device 20 can perform the method.
The embodiments shown and described above are only examples. Many details known in the field are neither shown nor described. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in matters of shape, size, and arrangement of the parts within the principles of the present disclosure, up to and including the full extent established by the broad general meaning of the terms used in the claims. It will therefore be appreciated that the embodiments described above may be modified within the scope of the claims.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202211603093.8 | Dec 2022 | CN | national |