CN115617386A - Method, device, equipment and storage medium for constructing firmware in storage equipment - Google Patents

Method, device, equipment and storage medium for constructing firmware in storage equipment Download PDF

Info

Publication number
CN115617386A
CN115617386A CN202211102471.4A CN202211102471A CN115617386A CN 115617386 A CN115617386 A CN 115617386A CN 202211102471 A CN202211102471 A CN 202211102471A CN 115617386 A CN115617386 A CN 115617386A
Authority
CN
China
Prior art keywords
firmware
target
file
management system
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211102471.4A
Other languages
Chinese (zh)
Inventor
董强强
陈阳
黄玉龙
刘清林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211102471.4A priority Critical patent/CN115617386A/en
Publication of CN115617386A publication Critical patent/CN115617386A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The application discloses a method, a device, equipment and a storage medium for constructing firmware in storage equipment, and relates to the technical field of storage. The method comprises the following steps: generating corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as the file head and takes the firmware entity as the file content; acquiring a system compression package which is constructed and generated based on a source code of a storage management system; decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package. The method separates the construction of the firmware from the construction of the source code of the storage management system, does not need to reconstruct the whole storage management system when the firmware is updated and the version of the storage management system needs to be released again, and only needs to construct the firmware of the acquired system compression packet, thereby improving the efficiency of the firmware construction.

Description

Method, device, equipment and storage medium for constructing firmware in storage equipment
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a storage medium for constructing firmware in a storage device.
Background
Because of the characteristics of high reliability and high stability of a storage system, a storage device is required to have a redundancy characteristic on hardware, generally, one storage device has 2/4/8 controllers, and a storage management system is IO (Input/Output) management software running on a controller and is generally installed and upgraded by a system installation package. The controllers in the storage device are mirror images of each other. Each Controller at least includes firmware (firmware) such as a BIOS (Basic Input Output System), a CPLD (Complex programmable logic device), a BMC (Baseboard Management Controller), a PSU power supply, an OSES operating System, and a custom-made card. Thus, the entire storage system manages a significant amount of firmware.
In the prior art, firmware construction refers to writing the version number of the expected firmware into a system code source file, the firmware is placed into a specified directory, and the construction refers to a process of generating a source code into an executable application program, and comprises compiling, linking and packaging other tool components into a usable or executable form. When the storage management system installation package is constructed, a source file and firmware containing version numbers are constructed at the same time, and are packaged into an iso package uniformly so as to generate the system installation package. After the whole installation package is filled or upgraded, whether the current firmware version and the expected version in the equipment are consistent or not can be detected, if the current firmware version and the expected version are inconsistent, the current firmware version and the expected version can be upgraded into the expected firmware in the package, and the purpose of centralized management of the firmware is achieved. However, in this construction method, when any firmware that the storage management system depends on is released, the corresponding expected version number in the source code needs to be modified, and the entire storage management system needs to be reconstructed, and then the entire storage management system installation package needs to be fully verified, which is time-consuming, labor-consuming, and very inconvenient.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a device and a medium for constructing firmware in a storage device, which can improve the efficiency of firmware construction. The specific scheme is as follows:
in a first aspect, the present application discloses a method for constructing firmware in a storage device, including:
generating corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content;
acquiring a system compression package which is constructed and generated based on a source code of a storage management system;
decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package.
Optionally, the generating the corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity includes:
taking the firmware version number and a sum check code corresponding to the firmware entity as a file header and taking the firmware entity as file content; the checksum is used to verify the firmware entity;
and obtaining target format firmware conforming to the target file format based on the file header and the file content.
Optionally, after repackaging the copied decompressed file to obtain a final storage management system installation package, the method further includes:
when the storage management system runs, acquiring the firmware version number stored in the target format firmware, and judging whether the firmware version number is consistent with the actual firmware version number;
if not, acquiring the sum check code from the head of the target format firmware, and generating an actual sum check code corresponding to a firmware entity in the target format firmware;
and if the sum check code is consistent with the actual sum check code, executing firmware upgrading.
Optionally, after generating the corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity, the method further includes:
uploading the target format firmware to a target path;
correspondingly, before copying the target format firmware to the target directory, the method further includes:
and acquiring the target format firmware from the target path.
Optionally, the obtaining of the system compression package constructed and generated based on the storage management system source code includes:
acquiring a historical release packet of a storage management system as the system compression packet;
or, based on the source code of the storage management system, the system compression package is obtained through compiling, linking and initially constructing.
Optionally, the constructing the generated system compression package based on the storage management system source code includes:
compiling and linking source codes of the storage management system, and generating components of each function of the storage management system;
and storing the component to a target directory, encrypting the directory tree where the target directory is located to obtain an encrypted file, and packaging the encrypted file to obtain the system compression packet.
Optionally, the decompressing the target directory in the compressed packet includes:
decompressing the system compression packet and decrypting the encrypted file in the decompressed file;
and determining the target directory from the directory tree obtained after decryption.
In a second aspect, the present application discloses an apparatus for constructing firmware in a storage device, including:
the target format firmware generation module is used for generating corresponding target format firmware according to a target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content;
the compressed packet acquisition module is used for acquiring a system compressed packet constructed and generated based on the source code of the storage management system;
and the installation package generation module is used for decompressing the target directory in the compressed package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the firmware construction method in the storage device.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by the processor implements the method of firmware construction in a storage device as previously described.
In the application, a corresponding target format firmware is generated according to a target file format based on a firmware version number and a firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content; acquiring a system compression package which is constructed and generated based on a source code of a storage management system; decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed files to obtain a final storage management system installation package. Therefore, the construction of the firmware is separated from the construction of the source code of the storage management system, namely the firmware construction function is decoupled from the original process, the firmware version number and the firmware entity are synthesized into the target format firmware in the new format, the firmware updating only needs to maintain the target format firmware, engineering management is convenient, if the storage management system needs to be released, the firmware version number in the source code does not need to be concerned and modified, particularly, when only the firmware updating needs to be released again to the version of the storage management system, the whole storage management system does not need to be reconstructed, only the original release package is constructed with the firmware, the construction function of the firmware is clear, time and labor are saved, simplicity and reliability are realized, and the firmware construction efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for constructing firmware in a storage device according to the present application;
FIG. 2 is a diagram illustrating a data format of a specific target format firmware provided herein;
FIG. 3 is a flowchart of a specific method for constructing firmware in a storage device according to the present disclosure;
fig. 4 is a flowchart of a specific method for constructing firmware in a storage device according to the present application;
fig. 5 is a schematic diagram of a file content of a storage management system constructed based on system source code after temporary package decompression according to an embodiment of the present disclosure;
FIG. 6 is a diagram illustrating a result of constructing a specific storage management system installation package according to the present application;
FIG. 7 is a schematic structural diagram of a firmware building apparatus in a storage device according to the present application;
fig. 8 is a block diagram of an electronic device provided in the present application.
Detailed Description
In order to make the objects, 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 drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, the firmware construction is to write the version number of the expected firmware into a system code source file, put the firmware into a specified directory, construct a source file and firmware containing the version number simultaneously when constructing the storage management system installation package, and uniformly package them into an iso package to generate the system installation package. After the whole installation package is filled or upgraded, whether the current firmware version in the equipment is consistent with the expected version or not can be detected, if the current firmware version is inconsistent with the expected version, the current firmware version can be upgraded into the expected firmware in the package, and the purpose of centralized management of the firmware is achieved. However, in this construction method, when any firmware that the storage management system depends on is released, the corresponding expected version number in the source code needs to be modified, and the entire storage management system needs to be reconstructed, and then the entire storage management system installation package needs to be fully verified, which is time-consuming, labor-consuming, and very inconvenient. In order to overcome the technical problem, the application provides a method for constructing firmware in a storage device, which can improve the efficiency of firmware construction.
The embodiment of the application discloses a method for constructing firmware in a storage device, and referring to fig. 1, the method may include the following steps:
step S11: generating corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content.
In this embodiment, the corresponding target format firmware is generated based on the firmware version number and the target file format generated by the firmware entity, that is, compared with the prior art, the firmware version number is decoupled from the system source code, the firmware version number and the firmware entity are synthesized into the target format firmware in a new format, the original firmware data storage structure is changed, and the related information of the firmware and the system source code are separately stored. The target file format is a format in which the firmware version number is a file header and the firmware entity is file content.
In this embodiment, the generating the corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity may include: taking the firmware version number and a sum check code corresponding to the firmware entity as a file header and taking the firmware entity as file content; the checksum is used for verifying the firmware entity; and obtaining target format firmware conforming to the target file format based on the file header and the file content. The data format of the new format target format firmware formed in this embodiment is as shown in fig. 2, that is, specifically, the header of the target format firmware includes a version number, a checksum (checksum), and other information related to the firmware, and the content of the target format firmware includes a firmware entity.
In this embodiment, after repackaging the copied decompressed file to obtain the final storage management system installation package, the method may further include: when the storage management system runs, acquiring the firmware version number stored in the target format firmware, and judging whether the firmware version number is consistent with the actual firmware version number; if not, acquiring the sum check code from the head of the target format firmware, and generating an actual sum check code corresponding to a firmware entity in the target format firmware; and if the sum check code is consistent with the actual sum check code, executing firmware upgrading. It can be understood that the version number stored in the target format firmware is an expected version number, the version number stored in the target format firmware is compared with the actual firmware version number used by the system, if the version number stored in the target format firmware is not consistent with the actual firmware version number, it is indicated that the firmware used by the system is not the expected firmware, and therefore firmware upgrade is required, at this time, the checksum stored in the target format firmware is obtained, and the actual checksum corresponding to the firmware entity is calculated based on the firmware entity stored in the target format firmware, if the checksum is consistent with the actual checksum, it is indicated that the firmware is correct and upgrade can be performed, and then the storage management system performs firmware upgrade according to the firmware entity in the target format firmware.
That is, in the present embodiment, the firmware and the corresponding version number are combined to output the new format file. The new file consists of a header and a firmware entity. The header may specifically occupy 64 bytes, holding the desired version number, the checksum value of the firmware entity, and other information describing the firmware. When the storage management system runs, an expected version number is obtained from a file, the actual version number of the firmware is detected to be inconsistent with the expectation, a checksum value is further obtained, the checksum is generated by checking the firmware entity of the file, and when the checksum is consistent, the firmware is upgraded from the head offset. Therefore, the expected construction version number is decoupled from the source code, the version number is placed at the head of the target format firmware, when the storage management system runs, the expected version number is obtained from the head of the specific target format firmware, and the checksum is newly added at the head of the file, so that the reliability of the firmware is improved. And during upgrading, skipping the head part of the target format firmware and starting upgrading from the effective position.
Step S12: and acquiring a system compression package which is constructed and generated based on the source code of the storage management system.
In this embodiment, the obtaining of the system compression package generated based on the storage management system source code construction may include: acquiring a historical release packet of a storage management system as the system compression packet; or, based on the source code of the storage management system, the system compression package is preliminarily constructed through compiling and linking. That is, the system compression package acquired at this time may be an installation package issued in history, or may be a temporary package obtained through preliminary construction based on the source code of the storage management system. It can be understood that the system compression package obtained at this time may be a compression package that does not include various types of firmware, the firmware is added separately at a later time, or may be a historical release package that is historically released and includes firmware and is constructed according to a firmware construction scheme in the prior art, and the subsequent addition of the firmware is directly covered.
Step S13: decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package.
In this embodiment, after the system compression package is obtained, the target directory in the system compression package is decompressed, then the target format firmware is copied to the target directory, and the copied decompressed file is repackaged to obtain the final storage management system installation package. The temporary package established for the first time based on the source code of the storage management system or the previous storage management system release package is used as input, after reverse operation, the target format firmware with the firmware version is placed into a firmware directory for secondary establishment, and the final storage management system installation package is obtained.
In this embodiment, after generating the corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity, the method may further include: uploading the target format firmware to a target path; correspondingly, before the copying the target format firmware to the target directory, the method may further include: and acquiring the target format firmware from the target path. Specifically, the target format firmware is uploaded to the version sending path, and when the automatic construction platform is deployed in the later stage and the storage management system carries out the second stage of firmware construction, the storage management system only needs to copy the target format firmware from the version sending path to the target directory.
As can be seen from the above, in this embodiment, the corresponding target format firmware is generated according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as the file head and takes the firmware entity as the file content; acquiring a system compression package which is constructed and generated based on a source code of a storage management system; decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package. Therefore, in the embodiment, the construction of the firmware is separated from the construction of the source code of the storage management system, that is, the firmware construction function is decoupled from the original flow, the firmware version number and the firmware entity are synthesized into the target format firmware in the new format, the firmware update only needs to maintain the target format firmware, engineering management is convenient, for example, when the storage management system needs to be released, the firmware version number in the source code does not need to be concerned and modified, particularly when only the firmware update needs to be released again to the version of the storage management system, the whole storage management system does not need to be reconstructed, only the original release package is constructed with the firmware, so that the construction function of the firmware is clear, and for a firmware update scene, the method is time-saving, labor-saving, simple and reliable, and improves the efficiency of firmware construction.
The embodiment of the present application discloses a specific method for constructing firmware in a storage device, and as shown in fig. 3, the method may include the following steps:
step S21: generating corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content.
Step S22: and compiling and linking the source code of the storage management system, and generating components of each function of the storage management system.
Step S23: and storing the component to a target directory, encrypting the directory tree where the target directory is located to obtain an encrypted file, and packaging the encrypted file to obtain a system compression package.
In this embodiment, for example, as shown in fig. 4, the construction process is divided into two stages, where the first stage constructs a temporary storage management system package based on a system source code, and the second stage adds firmware to construct a final storage management system installation package. When the temporary package is constructed, the source codes are compiled and linked in sequence, and each service component of the storage management system, namely the executable program is generated. The storage management system installation package comprises an EFI boot file, an isolinux boot file and a gpg, wherein EFI and isolinux are necessary boot files in the boot phase, and the gpg package mainly comprises directories from 00000000 to 00000009 which classify various components required by the operation of the storage management system according to categories. Then, the above service components may be placed under 00000005 directories, and the various components on which the storage management system depends may be placed under other directories from 00000000 to 00000009 according to categories, where it is noted that the various firmware is not placed in the target directory. And finally, packaging the whole directory tree, gpg encryption and iso packaging to obtain a system compression package through preliminary construction.
Step S24: decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed files to obtain a final storage management system installation package.
In this embodiment, the decompressing the target directory in the compressed packet may include: decompressing the system compression packet and decrypting the encrypted file in the decompressed file; and determining the target directory from the directory tree obtained after decryption. The content contained after decompression is shown in fig. 5. That is, according to the reverse operation constructed by the system compression package, the operation is decompressed to the directory 00000000 to 000000009, in this embodiment, the directory 00000006 is added to store various managed firmware, so that the target format firmware is copied from the source path to the directory 00000006, and then each component directory is packaged to generate the final storage management system installation package, for example, fig. 6 shows a specific storage management system iso installation package construction result diagram.
And when the storage management system runs the firmware upgrading function module, inquiring the corresponding target format firmware under the 00000006 directory. When the storage management system needs to release, the firmware version number in the source code does not need to be modified, when the second stage is constructed, the new format file only needs to be copied to the 00000006 function directory from the source path, and the operation is simple. In addition, when the firmware is released and the old version of the storage management system has the requirement of updating the firmware version, the new version of the firmware can be packaged on the basis of the original version of the storage management system only by constructing the second stage to generate a new installation package of the storage management system without reconstructing the whole project, the function change point of the new package compared with the old package is controllable, and the specific verification point is clear.
Therefore, in the embodiment, a firmware construction method is designed, which is to decouple the firmware version number originally in the source code into the firmware, add the version number and the checksum to the head of the original firmware, and generate the target format firmware conforming to the target file format. During actual construction, the storage management system does not pay attention to the specifically dependent firmware version number any more, and can be directly constructed. And during specific construction, a firmware construction link of a second stage is added, the temporary package constructed in the first stage or the final package of the original storage management system is used as input, after reverse operation, the file in the new firmware format is copied to a target directory and packaged into a storage management system package, and the new package has the function of the latest firmware. When the automatic construction platform is deployed at the later stage, the second stage construction only needs to take the firmware publishing path as a source path and take the target directory as a destination path to copy.
In addition, according to the scheme in the embodiment, the components which do not need to be recompiled and linked are stripped from the system source code in a secondary packaging mode, so that for the rest functional components in the system installation package, the components which do not need to be recompiled and linked can be secondarily packaged in the mode, the expandability is high, and the construction and updating efficiency of various types of components is improved.
For the specific process of the step S21, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
As can be seen from the above, in this embodiment, a corresponding target format firmware is generated according to a target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content; compiling and linking source codes of the storage management system, and generating components of each function of the storage management system; storing the component to a target directory, encrypting a directory tree where the target directory is located to obtain an encrypted file, and packaging the encrypted file to obtain the system compression packet; decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed files to obtain a final storage management system installation package. Therefore, the construction stage is divided into two steps, firstly, an installation temporary package is constructed based on the source code of the storage management system, then, the target format firmware with the version number is driven into the installation temporary package through reverse operation of the first step, a final storage management system installation package is generated, the firmware construction function is decoupled from the original flow, the second step is executed again aiming at firmware updating, the system source code does not need to be reconstructed, the problem of reconstructing the whole storage management system is solved, further, full-function verification of the whole storage management system installation package is not needed, only the firmware updating function is verified, and the firmware construction efficiency is improved.
Correspondingly, an embodiment of the present application further discloses an apparatus for constructing firmware in a storage device, as shown in fig. 7, the apparatus includes:
a target format firmware generating module 11, configured to generate corresponding target format firmware according to a target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as the file head and takes the firmware entity as the file content;
a compressed packet obtaining module 12, configured to obtain a system compressed packet that is constructed and generated based on a storage management system source code;
and the installation package generation module 13 is configured to decompress the target directory in the compressed package, copy the target format firmware to the target directory, and repackage the copied decompressed file to obtain a final storage management system installation package.
Therefore, in the embodiment, the corresponding target format firmware is generated according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content; acquiring a system compression package which is constructed and generated based on a source code of a storage management system; decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed files to obtain a final storage management system installation package. Therefore, in the embodiment, the construction of the firmware is separated from the construction of the source code of the storage management system, namely the firmware construction function is decoupled from the original flow, the firmware version number and the firmware entity are synthesized into the target format firmware in a new format, the firmware update only needs to maintain the target format firmware, the engineering management is convenient, if the storage management system needs to be released, the attention is not needed and the firmware version number in the source code is not needed to be modified, particularly, when only the firmware update needs to be released again to the version of the storage management system, the whole storage management system does not need to be reconstructed, only the original release package is subjected to the construction of the firmware, the construction function of the firmware is clear, the time and labor are saved, the operation is simple and reliable, and the efficiency of the firmware construction is improved.
In some specific embodiments, the target format firmware generating module 11 may be specifically configured to use the firmware version number and the checksum corresponding to the firmware entity as a file header, and use the firmware entity as a file content; the checksum is used for verifying the firmware entity; and obtaining target format firmware conforming to the target file format based on the file header and the file content.
In some embodiments, the firmware constructing apparatus in the storage device may specifically include:
a version number obtaining unit, configured to obtain the firmware version number stored in the target format firmware when the storage management system runs, and determine whether the firmware version number is consistent with an actual firmware version number;
a check code obtaining unit, configured to obtain the checksum from the header of the target format firmware if the actual checksum is inconsistent with the actual checksum, and generate an actual checksum corresponding to a firmware entity in the target format firmware;
and the firmware upgrading unit is used for executing firmware upgrading if the sum check code is consistent with the actual sum check code.
In some specific embodiments, the firmware constructing apparatus in the storage device may specifically include:
the firmware storage unit is used for uploading the target format firmware to a target path after generating corresponding target format firmware according to a target file format based on the firmware version number and the firmware entity;
correspondingly, the firmware constructing apparatus in the storage device may specifically include:
and the firmware acquisition unit is used for acquiring the target format firmware from the target path before copying the target format firmware to the target directory.
In some specific embodiments, the compressed packet obtaining module 12 may specifically include:
a historical release packet acquisition unit, configured to acquire a historical release packet of a storage management system as the system compression packet;
and the construction unit is used for primarily constructing and obtaining the system compression package through compiling and linking based on the source code of the storage management system.
In some specific embodiments, the compressed packet obtaining module 12 may specifically include:
the compiling and linking unit is used for compiling and linking the source code of the storage management system and generating components of each function of the storage management system;
and the packaging unit is used for storing the component to a target directory, encrypting the directory tree where the target directory is located to obtain an encrypted file, and packaging the encrypted file to obtain the system compression package.
In some specific embodiments, the installation package generating module 13 may specifically include:
the decompression unit is used for decompressing the system compression packet and decrypting the encrypted file in the decompressed file;
and the directory determining unit is used for determining the target directory from the directory tree obtained after decryption.
Further, the embodiment of the present application also discloses an electronic device, which is shown in fig. 8, and the content in the drawing cannot be considered as any limitation to the application scope.
Fig. 8 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the firmware construction method in the storage device disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., the resources stored thereon include an operating system 221, a computer program 222, data 223 including object format firmware, etc., and the storage may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device and the computer program 222 on the electronic device 20, so as to realize the operation and processing of the mass data 223 in the memory 22 by the processor 21, and may be Windows Server, netware, unix, linux, and the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the firmware construction method in the storage device executed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, an embodiment of the present application further discloses a computer storage medium, where computer-executable instructions are stored in the computer storage medium, and when the computer-executable instructions are loaded and executed by a processor, the steps of the method for constructing firmware in a storage device disclosed in any of the foregoing embodiments are implemented.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts between the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The method, the apparatus, the device and the medium for constructing firmware in a storage device provided by the present invention are described in detail above, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for constructing firmware in a storage device is characterized by comprising the following steps:
generating corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content;
acquiring a system compression packet constructed and generated based on a source code of a storage management system;
decompressing a target directory in the system compression package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package.
2. The method of claim 1, wherein generating corresponding target format firmware according to a target file format based on the firmware version number and the firmware entity comprises:
taking the firmware version number and a sum check code corresponding to the firmware entity as a file header, and taking the firmware entity as file content; the checksum is used to verify the firmware entity;
and obtaining target format firmware conforming to the target file format based on the file header and the file content.
3. The method for building firmware in a storage device according to claim 2, wherein after repackaging the copied decompressed files to obtain a final storage management system installation package, the method further comprises:
when the storage management system runs, acquiring the firmware version number stored in the target format firmware, and judging whether the firmware version number is consistent with the actual firmware version number;
if not, acquiring the checksum from the head of the target format firmware, and generating an actual checksum corresponding to a firmware entity in the target format firmware;
and if the sum check code is consistent with the actual sum check code, executing firmware upgrading.
4. The method of claim 1, wherein after generating the corresponding target format firmware according to the target file format based on the firmware version number and the firmware entity, further comprising:
uploading the target format firmware to a target path;
correspondingly, before copying the target format firmware to the target directory, the method further includes:
and acquiring the target format firmware from the target path.
5. The method for building firmware in storage device according to claim 1, wherein the obtaining of the system compression package generated based on the storage management system source code building comprises:
acquiring a historical release packet of a storage management system as the system compression packet;
or, based on the source code of the storage management system, the system compression package is obtained through compiling, linking and initially constructing.
6. The method for building firmware in a storage device according to any one of claims 1 to 5, wherein building the generated system compression package based on the storage management system source code comprises:
compiling and linking source codes of the storage management system, and generating components of each function of the storage management system;
and storing the component to a target directory, encrypting the directory tree where the target directory is located to obtain an encrypted file, and packaging the encrypted file to obtain the system compression packet.
7. The method of claim 6, wherein the decompressing the target directory in the compressed packet comprises:
decompressing the system compression packet and decrypting the encrypted file in the decompressed file;
and determining the target directory from the directory tree obtained after decryption.
8. An apparatus for constructing firmware in a storage device, comprising:
the target format firmware generation module is used for generating corresponding target format firmware according to a target file format based on the firmware version number and the firmware entity; the target file format takes the firmware version number as a file head and takes the firmware entity as file content;
the compressed packet acquisition module is used for acquiring a system compressed packet constructed and generated based on the source code of the storage management system;
and the installation package generation module is used for decompressing the target directory in the compressed package, copying the target format firmware to the target directory, and repackaging the copied decompressed file to obtain a final storage management system installation package.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the firmware construction method in the storage device according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by the processor implements the firmware construction method in the storage device according to any one of claims 1 to 7.
CN202211102471.4A 2022-09-09 2022-09-09 Method, device, equipment and storage medium for constructing firmware in storage equipment Pending CN115617386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211102471.4A CN115617386A (en) 2022-09-09 2022-09-09 Method, device, equipment and storage medium for constructing firmware in storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211102471.4A CN115617386A (en) 2022-09-09 2022-09-09 Method, device, equipment and storage medium for constructing firmware in storage equipment

Publications (1)

Publication Number Publication Date
CN115617386A true CN115617386A (en) 2023-01-17

Family

ID=84859013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211102471.4A Pending CN115617386A (en) 2022-09-09 2022-09-09 Method, device, equipment and storage medium for constructing firmware in storage equipment

Country Status (1)

Country Link
CN (1) CN115617386A (en)

Similar Documents

Publication Publication Date Title
US6493871B1 (en) Method and system for downloading updates for software installation
US20070294685A1 (en) Program upgrade system and method for ota-capable portable device
CN104346167A (en) Method and device for generating application channel package
CN103645910A (en) Methods for updating applications
GB2413653A (en) Software installation comprising a decision phase and installation phase
CN106648724B (en) Application program hot repair method and terminal
CN111008034B (en) Patch generation method and device
CN107239299B (en) Plug-in upgrading method and device
CN104052818A (en) Version upgrade method and device for mobile terminal
CN109857423B (en) Program version updating method and device, server and readable storage medium
CN111258587A (en) Method, device, equipment and storage medium for realizing android application plug-in
CN113326058A (en) Method, device, equipment and medium for updating version of application
CN114756264A (en) Cloud manufacturing method and upgrading method for USB (universal serial bus) flash disk upgrading package of vehicle-mounted software
CN113961226B (en) Software development kit repairing method, terminal, server and equipment
CN115617386A (en) Method, device, equipment and storage medium for constructing firmware in storage equipment
CN111046389A (en) Method for securely updating firmware components and portable computer station for implementation
CN116243950A (en) Vehicle software upgrading method, server, vehicle, storage medium and system
CN115794118A (en) Kernel code processing method and electronic equipment
CN115543429A (en) Project environment building method, electronic equipment and computer readable storage medium
CN110795113B (en) Redis cluster service installation method, server and medium
CN111221556B (en) Remote upgrade RSU mirror image method and system
CN114143197A (en) OTA (over the air) upgrading method, device and equipment of Internet of things equipment and readable storage medium
CN112558994A (en) Application software upgrading method, device, equipment and storage medium
CN110825406A (en) Software upgrading method and related equipment
CN113553071B (en) Software installation method, computer device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination