CN114764335A - Method, device, terminal and storage medium for generating mirror image - Google Patents

Method, device, terminal and storage medium for generating mirror image Download PDF

Info

Publication number
CN114764335A
CN114764335A CN202111452534.4A CN202111452534A CN114764335A CN 114764335 A CN114764335 A CN 114764335A CN 202111452534 A CN202111452534 A CN 202111452534A CN 114764335 A CN114764335 A CN 114764335A
Authority
CN
China
Prior art keywords
configuration information
generating
rpm
mirror image
initial configuration
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
CN202111452534.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.)
Hunan Qilin Xin'an Technology Co ltd
Original Assignee
Hunan Qilin Xin'an 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 Hunan Qilin Xin'an Technology Co ltd filed Critical Hunan Qilin Xin'an Technology Co ltd
Priority to CN202111452534.4A priority Critical patent/CN114764335A/en
Publication of CN114764335A publication Critical patent/CN114764335A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a method, a device, a terminal and a storage medium for generating a mirror image, wherein the method comprises the following steps: if an instruction of creating a new mirror image is received, generating initial configuration information; modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information; downloading an rpm package based on the final configuration information; testing the rpm package; and if the test is successful, generating a mirror image based on the rpm packet. According to the scheme, when an instruction of a user for creating a new mirror image is received, initial configuration information can be generated, a subsequent user can modify the initial configuration information, and the modified configuration information is used for generating the mirror image.

Description

Method, device, terminal and storage medium for generating mirror image
Technical Field
The present invention relates to the field of mirror image generation technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for generating a mirror image.
Background
An image file of an Ostree (Chinese name: free tree) is applied to many aspects, such as installation backup of system software and the like, but the image file of the Ostree is generally generated by a mode of editing and packaging depending on manpower at present, and the mode causes low efficiency and wastes time and labor.
Thus, there is a need for a better solution to the problems of the prior art.
Disclosure of Invention
In view of this, the present disclosure provides a method, an apparatus, a terminal, and a storage medium for generating a mirror image, which are used to solve the problems in the prior art.
Specifically, the present invention proposes the following specific examples;
the embodiment of the invention provides a method for generating a mirror image, which comprises the following steps:
if an instruction of creating a new mirror image is received, generating initial configuration information;
modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information;
downloading an rpm package based on the final configuration information;
testing the rpm package;
and if the test is successful, generating a mirror image based on the rpm packet.
In a specific embodiment, the initial configuration information includes: the rpm software source address, the rpm software name, the rpm software version information and the candidate version information of the rpm software.
In a specific embodiment, the initial configuration information is displayed in a graphical manner.
In a specific embodiment, the method further comprises the following steps:
and associating the final configuration information, the mirror image and the user information and storing the information in a database.
In a specific embodiment, the method further comprises the following steps:
and if the test is unsuccessful, generating failure prompt information for displaying.
In a specific embodiment, the instruction for creating the new image is generated based on an operation of responding to a user to trigger a designated icon on the web-side display interface.
The embodiment of the present invention further provides a device for generating a mirror image, including:
the initial configuration module is used for generating initial configuration information if an instruction of creating a new mirror image is received;
the user-defined module is used for modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information;
a download module for downloading an rpm package based on the final configuration information;
the testing module is used for testing the rpm packet;
and the generating module is used for generating a mirror image based on the rpm packet if the test is successful.
In a specific embodiment, the initial configuration information includes: the rpm software source address, the rpm software name, the rpm software version information and the candidate version information of the rpm software.
The embodiment of the present invention further provides a terminal, which includes a processor and a memory, where the memory stores a computer program, and the processor implements the method for generating the mirror image when executing the computer program.
The embodiment of the present invention further provides a storage medium, in which a computer program is stored, and the computer program, when executed, implements the method for generating the mirror image.
Therefore, an embodiment of the present invention provides a method, an apparatus, a terminal, and a storage medium for generating a mirror image, where the method includes: if an instruction of creating a new mirror image is received, generating initial configuration information; modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information; downloading an rpm package based on the final configuration information; testing the rpm package; and if the test is successful, generating a mirror image based on the rpm packet. According to the scheme, when an instruction of a user for creating a new mirror image is received, initial configuration information can be generated, a subsequent user can modify the initial configuration information, and the modified configuration information is used for generating the mirror image.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention. Like components are numbered similarly in the various figures.
Fig. 1 is a schematic flow chart illustrating a method for generating a mirror image according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for generating a mirror image according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus for generating a mirror image according to an embodiment of the present invention;
fig. 4 is a schematic diagram of another structure of an apparatus for generating a mirror image according to an embodiment of the present invention.
Illustration of the drawings:
201-initial configuration module; 202-a custom module; 203-a download module;
204-a test module; 205-a generating module; 206-a storage module; 207-prompt module.
Detailed Description
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 of the embodiments.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are intended to indicate only specific features, numerals, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the presence of or adding to one or more other features, numerals, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
Example 1
Embodiment 1 of the present invention discloses a method for generating a mirror image, which includes the following steps, as shown in fig. 1:
step S101, if an instruction of creating a new mirror image is received, generating initial configuration information;
specifically, the initial configuration information corresponds to the Ostree image, the Ostree image may be generated based on the initial configuration information, and specifically, all configuration information related to the Ostree image may be stored in advance, so that when an instruction of creating a new image is received, the stored configuration information is called as the initial configuration information.
In addition, specifically, the instruction for creating the new image may further include some limiting conditions, specifically, for example, one or more of a version name, a version number, and a software source address may be included, and based on this, configuration information meeting the limiting conditions may be screened from all stored configuration information as initial configuration information.
The system comprises a client, a server and a server, wherein the server is used for storing system information; the ini file is mainly used for configuring ref (number/key) of the OStree version, and name (name) of the image, version9 (version), release (candidate version), which will be transmitted into lorax, and original source information; sh file, the script is configured in the file after the installation of the OStree mirror image;
specifically, the initial configuration information includes: the rpm software source address, the rpm software name, the rpm software version information and the candidate version information of the rpm software.
The initial configuration information is displayed in a graphical manner. Specifically, for example, the display may be performed in the form of an icon.
The instruction for creating the mirror image is generated based on the operation of responding to the user to trigger the appointed icon on the display interface of the web end.
Specifically, the user may click a designated icon to generate a new mirror image instruction. The operation of the user is simplified, and the processing efficiency is improved.
S102, modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information;
the specific modification may be, for example, that the user may add or delete a software package as needed, modify information such as refs (number/key) and release of the mirror image and the OSTree source, and add and delete the rpm software source).
Step S103, downloading an rpm package based on the final configuration information;
specifically, downloading is carried out based on the rpm software source address in the final configuration information to obtain an rpm package;
step S104, testing the rpm packet;
the specific test comprises the following steps: the integrity of the downloaded rpm package is tested, for example, the test of the MD5 value can be included, and the combined matching test of a plurality of downloaded rpm packages can be included.
Specifically, if the test is unsuccessful, failure prompt information is generated for display.
And S105, if the test is successful, generating a mirror image based on the rpm packet.
Further, in order to facilitate checking the modified final configuration information and the generated mirror image, the method further includes:
and associating the final configuration information, the mirror image and the information of the user and storing the information in a database.
Specifically, the process of generating the mirror image may be that the rpm packet is converted into an ostree source, and then the mirror image is generated by pulling the corresponding ref from the ostree source.
Example 2
Embodiment 2 of the present invention further discloses a device for generating a mirror image, as shown in fig. 2, including:
an initial configuration module 201, configured to generate initial configuration information if an instruction of creating a new mirror image is received;
the user-defined module 202 is configured to modify the initial configuration information based on a modification instruction of a user to obtain final configuration information;
a downloading module 203, configured to download an rpm package based on the final configuration information;
the test module 204 is used for testing the rpm package;
and the generating module 205 is configured to generate an image based on the rpm packet if the test is successful.
In a specific embodiment, the initial configuration information includes: the method comprises the steps of rpm software source address, rpm software name, rpm software version information and candidate version information of rpm software.
In a specific embodiment, the initial configuration information is displayed in a graphical manner.
In a specific embodiment, as shown in fig. 3, the method further includes:
a storage module 206, configured to store the final configuration information, the mirror image, and the user information in a database after associating the final configuration information, the mirror image, and the user information.
In a specific embodiment, as shown in fig. 4, the method further includes: and the prompt module 207 is used for generating failure prompt information for displaying if the test is unsuccessful.
In a specific embodiment, the instruction for creating the new image is generated based on an operation of triggering a designated icon on the web-side display interface by a user.
Example 3
The embodiment 3 of the present invention further discloses a terminal, which includes a processor and a memory, wherein the memory stores a computer program, and the processor implements the method for generating the mirror image in the embodiment 1 when executing the computer program.
Example 4
The embodiment 4 of the present invention further discloses a storage medium, in which a computer program is stored, and the computer program, when executed, implements the method for generating an image described in the embodiment 1.
Therefore, the embodiment of the invention provides a method, a device, a terminal and a storage medium for generating a mirror image, wherein the method comprises the following steps: if an instruction of creating a new mirror image is received, generating initial configuration information; modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information; downloading an rpm package based on the final configuration information; testing the rpm package; and if the test is successful, generating a mirror image based on the rpm packet. According to the scheme, when an instruction of a user for creating a new mirror image is received, initial configuration information can be generated, a subsequent user can modify the initial configuration information, and the modified configuration information is used for generating the mirror image.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present invention or a part of the technical solution that contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.

Claims (10)

1. A method of generating an image, comprising:
if an instruction of creating a new mirror image is received, generating initial configuration information;
modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information;
downloading an rpm package based on the final configuration information;
testing the rpm package;
and if the test is successful, generating a mirror image based on the rpm packet.
2. The method of claim 1, wherein the initial configuration information comprises: the rpm software source address, the rpm software name, the rpm software version information and the candidate version information of the rpm software.
3. The method of claim 1 or 2, wherein the initial configuration information is displayed graphically.
4. The method of claim 1, further comprising:
and associating the final configuration information, the mirror image and the user information and storing the information in a database.
5. The method of claim 1, further comprising:
and if the test is unsuccessful, generating failure prompt information for displaying.
6. The method of claim 1 wherein the instructions to create the new image are generated in response to a user triggering a designated icon on the web-side display interface.
7. An apparatus for generating a mirror image, comprising:
the initial configuration module is used for generating initial configuration information if an instruction of creating a new mirror image is received;
the user-defined module is used for modifying the initial configuration information based on a modification instruction of a user to obtain final configuration information;
a download module for downloading an rpm package based on the final configuration information;
the testing module is used for testing the rpm packet;
and the generating module is used for generating a mirror image based on the rpm packet if the test is successful.
8. The apparatus of claim 7, wherein the initial configuration information comprises: the rpm software source address, the rpm software name, the rpm software version information and the candidate version information of the rpm software.
9. A terminal, characterized in that it comprises a processor and a memory, in which a computer program is stored, which processor, when executing said computer program, implements the method of generating an image according to any one of claims 1 to 6.
10. A storage medium, characterized in that the storage medium has stored therein a computer program which, when executed, implements the method of generating an image according to any one of claims 1 to 6.
CN202111452534.4A 2021-12-01 2021-12-01 Method, device, terminal and storage medium for generating mirror image Pending CN114764335A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111452534.4A CN114764335A (en) 2021-12-01 2021-12-01 Method, device, terminal and storage medium for generating mirror image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111452534.4A CN114764335A (en) 2021-12-01 2021-12-01 Method, device, terminal and storage medium for generating mirror image

Publications (1)

Publication Number Publication Date
CN114764335A true CN114764335A (en) 2022-07-19

Family

ID=82364511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111452534.4A Pending CN114764335A (en) 2021-12-01 2021-12-01 Method, device, terminal and storage medium for generating mirror image

Country Status (1)

Country Link
CN (1) CN114764335A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908908A (en) * 2024-03-18 2024-04-19 麒麟软件有限公司 OSTree-based embedded system installation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908908A (en) * 2024-03-18 2024-04-19 麒麟软件有限公司 OSTree-based embedded system installation method
CN117908908B (en) * 2024-03-18 2024-05-24 麒麟软件有限公司 OSTree-based embedded system installation method

Similar Documents

Publication Publication Date Title
CN106339312B (en) API test method and system
CN107506221B (en) Application program upgrading method, device and equipment
CN105511911B (en) The generation method and device of system firmware upgrade package
US10698797B2 (en) Mobile application program testing method, server, terminal, and storage medium
CN111061643B (en) SDK cluster compatibility detection method and device, electronic equipment and storage medium
CN103177210A (en) Method of implanting dynamic stain analysis module in Android
CN110806868A (en) Single-page building and loading method
CN111694733A (en) API (application programming interface) testing method and device for software development kit SDK (software development kit)
CN111475161A (en) Method, device and equipment for accessing component
CN112860277A (en) Software deployment method, device and computer readable storage medium
CN108132832B (en) Application program starting method and device
CN114764335A (en) Method, device, terminal and storage medium for generating mirror image
US11909640B2 (en) Creating endpoints
CN110471828B (en) Operating system testing method, device and equipment thereof
CN111488731A (en) File generation method and device, computer equipment and storage medium
CN110795388B (en) Binary file processing method, system, equipment and readable storage medium
CN115168840A (en) Fault injection method and device and computer readable storage medium
CN110221952B (en) Service data processing method and device and service data processing system
CN111552510B (en) File construction method and device, electronic equipment and computer readable storage medium
CN114443065A (en) Platform deployment method, platform deployment device, electronic equipment and storage medium
CN108845953B (en) Interface testing method and device
CN109150951B (en) Method and device for starting Activity of Android system
CN112559293A (en) Application package monitoring method and device
CN110727416A (en) Development framework generation method and related device
CN111414190B (en) Request processing method and device

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