[go: up one dir, main page]

CN117591136A - Storage image generation method, device, computer equipment and storage medium - Google Patents

Storage image generation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117591136A
CN117591136A CN202311549175.3A CN202311549175A CN117591136A CN 117591136 A CN117591136 A CN 117591136A CN 202311549175 A CN202311549175 A CN 202311549175A CN 117591136 A CN117591136 A CN 117591136A
Authority
CN
China
Prior art keywords
file
target
software package
configuration file
red hat
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
CN202311549175.3A
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.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data 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 Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202311549175.3A priority Critical patent/CN117591136A/en
Publication of CN117591136A publication Critical patent/CN117591136A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of computers, and discloses a storage mirror image generation method, a storage mirror image generation device, computer equipment and a storage medium. The memory image generation method comprises the following steps: acquiring the system type of a target operating system, target version information of a red cap software package manager file, a compiling configuration file and a software package configuration file; analyzing the compiling configuration file to obtain all component codes; based on the system type and the component code, an executable binary program is obtained; generating a red cap software package manager file based on the target version information, the executable binary program, and the software package configuration file; based on the red cap software package manager file, a target IOS image is generated. According to the scheme provided by the embodiment of the invention, the manufacturing efficiency of the IOS mirror image can be improved, and meanwhile, the manual workload can be reduced.

Description

存储镜像生成方法、装置、计算机设备及存储介质Storage image generation method, device, computer equipment and storage medium

技术领域Technical field

本发明涉及计算机技术领域,具体涉及存储镜像生成方法、装置、计算机设备及存储介质。The present invention relates to the field of computer technology, and specifically to storage image generation methods, devices, computer equipment and storage media.

背景技术Background technique

相关技术中,Ceph作为主流的开源存储系统和OpenStack的重要组件,被广泛用于各大企业的云计算业务中,其中,ceph是一种开源存储软件,OpenStack是一个开源的云计算管理平台项目。近几年随着国产化的全面兴起,除了原来的英特尔X86架构,ceph也不断适配支持各种国产操作系统和国产处理器。存储厂商以IOS(International Organizationfor Standardization,IOS镜像)镜像的方式定期对外提供存储系统,但是由于不同硬件架构和操作系统的差异,研发人员往往需要针对不同操作系统人工制作ISO,从而导致IOS镜像的制作效率较低且人工工作量较大。Among related technologies, Ceph, as a mainstream open source storage system and an important component of OpenStack, is widely used in the cloud computing business of major enterprises. Among them, ceph is an open source storage software, and OpenStack is an open source cloud computing management platform project. . In recent years, with the overall rise of localization, in addition to the original Intel X86 architecture, ceph has also continued to adapt and support various domestic operating systems and domestic processors. Storage manufacturers regularly provide storage systems in the form of IOS (International Organization for Standardization, IOS image) images. However, due to differences in different hardware architectures and operating systems, R&D personnel often need to manually produce ISOs for different operating systems, resulting in the production of IOS images. The efficiency is lower and the manual workload is larger.

发明内容Contents of the invention

有鉴于此,本发明提供了一种存储镜像生成方法、装置、计算机设备及存储介质,能够提高IOS镜像的制作效率,同时能够减少人工工作量。In view of this, the present invention provides a storage image generation method, device, computer equipment and storage medium, which can improve the production efficiency of IOS images and reduce manual workload.

第一方面,本发明提供了一种存储镜像生成方法,所述方法包括:In a first aspect, the present invention provides a storage image generation method, which method includes:

获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,其中,所述编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,所述软件包配置文件用于制作所述红帽软件包管理器文件;Obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, where the compilation configuration file includes the component code of each component corresponding to the distributed file storage system, The software package configuration file is used to make the Red Hat software package manager file;

对所述编译配置文件进行解析,得到所有的组件代码;Parse the compiled configuration file to obtain all component codes;

基于所述系统类型和所述组件代码,得到可执行二进制程序;Based on the system type and the component code, obtain an executable binary program;

基于所述目标版本信息、所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件;Generate the Red Hat software package manager file based on the target version information, the executable binary program and the software package configuration file;

基于所述红帽软件包管理器文件,生成目标IOS镜像。Based on the Red Hat package manager file, the target IOS image is generated.

本发明实施例提供的存储镜像生成方法,通过获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,以及对所述编译配置文件进行解析,得到所有的组件代码,能够基于所述系统类型和所述组件代码,得到可执行二进制程序,再基于所述目标版本信息、所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件,以及基于所述红帽软件包管理器文件,能够自动生成所述目标IOS镜像,因此,能够提高IOS镜像的制作效率,同时能够减少人工工作量。The storage image generation method provided by the embodiment of the present invention obtains the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, and analyzes the compilation configuration file. , obtain all component codes, obtain an executable binary program based on the system type and the component code, and then generate the The Red Hat software package manager file can automatically generate the target IOS image based on the Red Hat package manager file. Therefore, the production efficiency of the IOS image can be improved and the manual workload can be reduced at the same time.

在一些可选的实施方式中,所述基于所述目标版本信息、所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件,包括:In some optional implementations, generating the Red Hat software package manager file based on the target version information, the executable binary program and the software package configuration file includes:

获取所述红帽软件包管理器文件的初始版本信息,所述初始版本信息是基于所述软件包配置文件的操作指示文件确定的;Obtain initial version information of the Red Hat software package manager file, where the initial version information is determined based on the operation instruction file of the software package configuration file;

将所述初始版本信息替换成所述目标版本信息,得到替换后的软件包配置文件;Replace the initial version information with the target version information to obtain a replaced software package configuration file;

基于所述可执行二进制程序和所述替换后的软件包配置文件,生成所述红帽软件包管理器文件。The Red Hat software package manager file is generated based on the executable binary program and the replaced software package configuration file.

本发明实施例提供的存储镜像生成方法,通过获取红帽软件包管理器文件的初始版本信息,以及将初始版本信息替换成目标版本信息,得到替换后的软件包配置文件,能够基于可执行二进制程序和替换后的软件包配置文件,生成实际要构建的红帽软件包管理器文件。The storage image generation method provided by the embodiment of the present invention obtains the initial version information of the Red Hat software package manager file and replaces the initial version information with the target version information to obtain the replaced software package configuration file, which can be based on the executable binary program and replaced package configuration files to generate the actual Red Hat Package Manager files to be built.

在一些可选的实施方式中,所述基于所述红帽软件包管理器文件,生成目标IOS镜像,包括:In some optional implementations, generating a target IOS image based on the Red Hat package manager file includes:

获取所述目标操作系统对应的基础目录,所述基础目录为生成所述目标IOS镜像的输入目录;Obtain the base directory corresponding to the target operating system, where the base directory is the input directory for generating the target IOS image;

将所述红帽软件包管理器文件拷贝至所述基础目录中;Copy the Red Hat package manager file to the base directory;

在所述基础目录下生成所述目标IOS镜像。The target IOS image is generated in the base directory.

本发明实施例提供的存储镜像生成方法,通过获取目标操作系统对应的基础目录,将红帽软件包管理器文件拷贝至基础目录中,以及在基础目录下生成目标IOS镜像,能够保证生成的目标IOS镜像的准确性。The storage image generation method provided by the embodiment of the present invention can ensure that the generated target is obtained by obtaining the base directory corresponding to the target operating system, copying the Red Hat software package manager file to the base directory, and generating the target IOS image under the base directory. Accuracy of iOS images.

在一些可选的实施方式中,所述在所述基础目录下生成所述目标IOS镜像,包括:In some optional implementations, generating the target IOS image under the base directory includes:

在所述基础目录下创建以平台或者日期为标识的子目录;Create a subdirectory identified by platform or date under the basic directory;

在所述子目录下生成所述目标IOS镜像。Generate the target IOS image in the subdirectory.

本发明实施例提供的存储镜像生成方法,通过在基础目录下创建以平台或者日期为标识的子目录,能够在子目录下生成目标IOS镜像。The storage image generation method provided by the embodiment of the present invention can generate a target IOS image in the subdirectory by creating a subdirectory identified by platform or date in the basic directory.

在一些可选的实施方式中,所述获取所述目标操作系统对应的基础目录,包括:In some optional implementations, obtaining the basic directory corresponding to the target operating system includes:

获取所述目标操作系统的初始国际标准化组织文件,所述初始国际标准化组织文件包括安装文件、系统启动引导文件和基础管理文件包;Obtain the initial International Organization for Standardization files of the target operating system, where the initial International Organization for Standardization files include installation files, system startup boot files and basic management file packages;

基于所述初始国际标准化组织文件生成所述基础目录。The base directory is generated based on the initial International Organization for Standardization file.

本发明实施例提供的存储镜像生成方法,通过获取目标操作系统的初始国际标准化组织文件,基于初始国际标准化组织文件生成基础目录,能够基于该基础目录生成对应的目标操作系统的目标IOS镜像。The storage image generation method provided by the embodiment of the present invention can generate the target IOS image of the corresponding target operating system based on the basic directory by obtaining the initial ISO file of the target operating system and generating a basic directory based on the initial ISO file.

在一些可选的实施方式中,所述基于所述系统类型和所述组件代码,得到可执行二进制程序,包括:In some optional implementations, the executable binary program is obtained based on the system type and the component code, including:

根据所述系统类型和所述组件代码确定目标编译指令;Determine target compilation instructions based on the system type and the component code;

基于所述目标编译指令对所述组件代码进行编译,得到可执行二进制程序。The component code is compiled based on the target compilation instruction to obtain an executable binary program.

本发明实施例提供的存储镜像生成方法,通过系统类型和组件代码确定目标编译指令,能够基于目标编译指令对组件代码进行编译,得到可执行二进制程序,以便于后续基于该可执行二进制程序能够生成准确的红帽软件包管理器文件。The storage image generation method provided by the embodiment of the present invention determines the target compilation instruction through the system type and component code, and can compile the component code based on the target compilation instruction to obtain an executable binary program, so that it can be subsequently generated based on the executable binary program. Accurate Red Hat Package Manager documentation.

在一些可选的实施方式中,所述获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件之前,包括:In some optional implementations, before obtaining the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, the process includes:

提取所述目标操作系统的初始IOS镜像;Extract the initial IOS image of the target operating system;

生成所述初始IOS镜像的第一校验文件;Generate the first verification file of the initial IOS image;

对所述第一校验文件进行存储;Store the first verification file;

所述获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,包括:The method of obtaining the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file includes:

生成所述目标IOS镜像的第二校验文件;Generate a second verification file of the target IOS image;

对所述第一校验文件和所述第二校验文件进行比对,得到比对结果;Compare the first verification file and the second verification file to obtain a comparison result;

若所述比对结果表征所述第一校验文件和所述第二校验文件不一致,重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件。If the comparison result indicates that the first verification file and the second verification file are inconsistent, re-obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software Package configuration file.

本发明实施例提供的存储镜像生成方法,通过生成初始IOS镜像的第一校验文件以及生成目标IOS镜像的第二校验文件,对第一校验文件和第二校验文件进行比对,能够对目标IOS镜像进行一致性核对,若比对结果表征第一校验文件和第二校验文件不一致,重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,以此提升生成的目标IOS镜像的准确性。The storage image generation method provided by the embodiment of the present invention generates a first verification file for the initial IOS image and a second verification file for the target IOS image, and compares the first verification file and the second verification file. Able to check the consistency of the target IOS image. If the comparison result indicates that the first verification file and the second verification file are inconsistent, the system type of the target operating system, the target version information of the Red Hat package manager file, and the compilation are re-obtained. Configuration files and software package configuration files to improve the accuracy of the generated target IOS image.

第二方面,本发明提供了一种存储镜像生成装置,包括:In a second aspect, the present invention provides a storage image generation device, including:

获取模块,用于获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,其中,所述编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,所述软件包配置文件用于制作所述红帽软件包管理器文件;The acquisition module is used to obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, wherein the compilation configuration file includes each corresponding file of the distributed file storage system. The component code of the component, the software package configuration file is used to make the Red Hat software package manager file;

解析模块,用于对所述编译配置文件进行解析,得到所有的组件代码;The parsing module is used to parse the compilation configuration file and obtain all component codes;

程序生成模块,用于基于所述系统类型和所述组件代码,得到可执行二进制程序;A program generation module, used to obtain an executable binary program based on the system type and the component code;

第一文件生成模块,用于基于所述目标版本信息、所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件;A first file generation module, configured to generate the Red Hat software package manager file based on the target version information, the executable binary program and the software package configuration file;

存储镜像生成模块,用于基于所述红帽软件包管理器文件,生成目标IOS镜像。The storage image generation module is used to generate the target IOS image based on the Red Hat package manager file.

在一些可选的实施方式中,第一文件生成模块具体包括:In some optional implementations, the first file generation module specifically includes:

第一获取子模块,用于获取所述红帽软件包管理器文件的初始版本信息,所述初始版本信息是基于所述软件包配置文件的操作指示文件确定的;The first acquisition sub-module is used to acquire the initial version information of the Red Hat software package manager file, where the initial version information is determined based on the operation instruction file of the software package configuration file;

替换子模块,用于将所述初始版本信息替换成所述目标版本信息,得到替换后的软件包配置文件;Replacement submodule, used to replace the initial version information with the target version information to obtain the replaced software package configuration file;

第一文件生成子模块,用于基于所述可执行二进制程序和所述替换后的软件包配置文件,生成所述红帽软件包管理器文件。The first file generation submodule is used to generate the Red Hat software package manager file based on the executable binary program and the replaced software package configuration file.

在一些可选的实施方式中,存储镜像生成模块具体包括:In some optional implementations, the storage image generation module specifically includes:

第二获取子模块,用于获取所述目标操作系统对应的基础目录,所述基础目录为生成所述目标IOS镜像的输入目录;The second acquisition sub-module is used to acquire the basic directory corresponding to the target operating system, where the basic directory is the input directory for generating the target IOS image;

拷贝子模块,用于将所述红帽软件包管理器文件拷贝至所述基础目录中;The copy submodule is used to copy the Red Hat software package manager file to the base directory;

存储镜像生成子模块,用于在所述基础目录下生成所述目标IOS镜像。The storage image generation submodule is used to generate the target IOS image in the base directory.

在一些可选的实施方式中,存储镜像生成子模块具体包括:In some optional implementations, the storage image generation submodule specifically includes:

子目录生成单元,用于在所述基础目录下创建以平台或者日期为标识的子目录;A subdirectory generation unit, used to create a subdirectory identified by platform or date under the basic directory;

存储镜像生成单元,用于在所述子目录下生成所述目标IOS镜像。A storage image generation unit is configured to generate the target IOS image in the subdirectory.

在一些可选的实施方式中,第二获取子模块具体包括:In some optional implementations, the second acquisition sub-module specifically includes:

获取单元,用于获取所述目标操作系统的初始国际标准化组织文件,所述初始国际标准化组织文件包括安装文件、系统启动引导文件和基础管理文件包;An acquisition unit, configured to acquire the initial ISO files of the target operating system, where the initial ISO files include installation files, system startup boot files and basic management file packages;

基础目录生成单元,用于基于所述初始国际标准化组织文件生成所述基础目录。A basic directory generating unit, configured to generate the basic directory based on the initial International Organization for Standardization file.

在一些可选的实施方式中,程序生成模块具体包括:In some optional implementations, the program generation module specifically includes:

指令确定子模块,用于根据所述系统类型和所述组件代码确定目标编译指令;Instruction determination submodule, used to determine target compilation instructions according to the system type and the component code;

程序生成子模块,用于基于所述目标编译指令对所述组件代码进行编译,得到可执行二进制程序。A program generation submodule is used to compile the component code based on the target compilation instruction to obtain an executable binary program.

在一些可选的实施方式中,存储镜像生成装置还包括:In some optional implementations, the storage image generation device further includes:

提取模块,用于提取所述目标操作系统的初始IOS镜像;An extraction module, used to extract the initial IOS image of the target operating system;

第二文件生成模块,用于生成所述初始IOS镜像的第一校验文件;The second file generation module is used to generate the first verification file of the initial IOS image;

存储模块,用于对所述第一校验文件进行存储;A storage module used to store the first verification file;

获取模块具体包括:The acquisition modules specifically include:

第二文件生成子模块,用于生成所述目标IOS镜像的第二校验文件;The second file generation submodule is used to generate the second verification file of the target IOS image;

比对子模块,用于对所述第一校验文件和所述第二校验文件进行比对,得到比对结果;A comparison submodule, used to compare the first verification file and the second verification file to obtain a comparison result;

第三获取子模块,用于若所述比对结果表征所述第一校验文件和所述第二校验文件不一致,重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件。The third acquisition sub-module is used to re-acquire the system type of the target operating system and the target of the Red Hat software package manager file if the comparison result indicates that the first verification file and the second verification file are inconsistent. Version information, compilation configuration files and package configuration files.

第三方面,本发明提供了一种计算机设备,包括:存储器和处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机指令,处理器通过执行计算机指令,从而执行上述第一方面或其对应的任一实施方式的存储镜像生成方法。In a third aspect, the present invention provides a computer device, including: a memory and a processor. The memory and the processor are communicatively connected to each other. Computer instructions are stored in the memory, and the processor executes the computer instructions to execute the first aspect. Or the storage image generation method of any corresponding embodiment.

第四方面,本发明提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机指令,计算机指令用于使计算机执行上述第一方面或其对应的任一实施方式的存储镜像生成方法。In a fourth aspect, the present invention provides a computer-readable storage medium. Computer instructions are stored on the computer-readable storage medium. The computer instructions are used to cause the computer to execute the storage image of the above-mentioned first aspect or any of its corresponding embodiments. Generate method.

附图说明Description of drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description The drawings illustrate some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting any creative effort.

图1为本申请实施例提供的一种可选的实施环境的示意图;Figure 1 is a schematic diagram of an optional implementation environment provided by the embodiment of the present application;

图2是根据本发明实施例的一种存储镜像生成方法的流程图;Figure 2 is a flow chart of a storage image generation method according to an embodiment of the present invention;

图3是根据本发明实施例的另一种存储镜像生成方法的流程图;Figure 3 is a flow chart of another storage image generation method according to an embodiment of the present invention;

图4是根据本发明实施例的又一种存储镜像生成方法的流程图;Figure 4 is a flow chart of yet another storage image generation method according to an embodiment of the present invention;

图5是本申请实施例提供的一种存储镜像生成装置的示意图;Figure 5 is a schematic diagram of a storage image generation device provided by an embodiment of the present application;

图6是本发明实施例提供的一种可选的计算机设备的结构示意图。Figure 6 is a schematic structural diagram of an optional computer device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, 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 in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present invention.

参照图1,图1为本申请实施例提供的一种可选的实施环境的示意图,该实施环境包括服务器101。Referring to Figure 1, Figure 1 is a schematic diagram of an optional implementation environment provided by an embodiment of the present application. The implementation environment includes a server 101.

示例性地,服务器101可以获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,其中,编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,软件包配置文件用于制作红帽软件包管理器文件,接着对编译配置文件进行解析,得到所有的组件代码,并基于系统类型和组件代码,得到可执行二进制程序,然后基于目标版本信息、可执行二进制程序和软件包配置文件,生成红帽软件包管理器文件,最后基于红帽软件包管理器文件,生成目标IOS镜像。For example, the server 101 can obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file, and the software package configuration file, where the compilation configuration file includes various configuration files corresponding to the distributed file storage system. The component code and package configuration file of the component are used to make the Red Hat package manager file. Then the compiled configuration file is parsed to obtain all component codes. Based on the system type and component code, an executable binary program is obtained, and then based on The target version information, executable binary program and software package configuration file are used to generate the Red Hat package manager file. Finally, the target IOS image is generated based on the Red Hat package manager file.

服务器101可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。另外,服务器101还可以是区块链网络中的一个节点服务器。The server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and basic cloud computing services such as big data and artificial intelligence platforms. In addition, the server 101 can also be a node server in the blockchain network.

值得注意的是,随着信息技术的高速发展,各行各业的数据都出现了“井喷式”的爆发增长,Ceph作为主流的开源存储系统和OpenStack的重要组件,被广泛用于各大企业的云计算业务中,其中,ceph是一种开源存储软件,OpenStack是一个开源的云计算管理平台项目。近几年随着国产化的全面兴起,除了原来的英特尔X86架构,ceph也不断适配支持各种国产操作系统和国产处理器。存储厂商以ISO的方式定期对外提供存储系统,但是由于不同硬件架构和操作系统的差异,研发人员往往需要针对不同操作系统手动编译对应ceph相关代码和软件包并制作ISO,从而导致IOS镜像的制作效率较低且人工工作量较大。It is worth noting that with the rapid development of information technology, data in all walks of life have experienced explosive growth. As a mainstream open source storage system and an important component of OpenStack, Ceph is widely used in major enterprises. In the cloud computing business, ceph is an open source storage software, and OpenStack is an open source cloud computing management platform project. In recent years, with the overall rise of localization, in addition to the original Intel X86 architecture, ceph has also continued to adapt and support various domestic operating systems and domestic processors. Storage manufacturers regularly provide storage systems in the form of ISOs. However, due to differences in different hardware architectures and operating systems, developers often need to manually compile the corresponding ceph-related codes and software packages for different operating systems and produce ISOs, which leads to the production of IOS images. The efficiency is lower and the manual workload is larger.

基于此,本发明实施例提供了一种存储镜像生成方法、装置、计算机设备及存储介质,能够提高IOS镜像的制作效率,同时能够减少人工工作量。Based on this, embodiments of the present invention provide a storage image generation method, device, computer equipment and storage medium, which can improve the production efficiency of IOS images and reduce manual workload.

根据本发明实施例,提供了一种存储镜像生成方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, an embodiment of a storage image generation method is provided. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although A logical order is shown in the flowcharts, but in some cases, the steps shown or described may be performed in a different order than herein.

在本实施例中提供了一种存储镜像生成方法,可用于上述的服务器。图2是根据本发明实施例的存储镜像生成方法的流程图,如图2所示,该流程包括如下步骤:This embodiment provides a storage image generation method, which can be used in the above-mentioned server. Figure 2 is a flow chart of a storage image generation method according to an embodiment of the present invention. As shown in Figure 2, the process includes the following steps:

步骤S201,获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件。Step S201: Obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file, and the software package configuration file.

目标版本信息是指生成的目标IOS镜像所包含的存储相关的红帽软件包管理器文件的版本号,如V2.2.1,其中,目标IOS镜像的版本号与其所包含的存储相关的红帽软件包管理器文件的版本号相同,因此,只获取红帽软件包管理器文件的目标版本信息,或者还可以获取生成的目标IOS镜像的版本号,在此不作具体限制。The target version information refers to the version number of the storage-related Red Hat package manager file contained in the generated target IOS image, such as V2.2.1, where the version number of the target IOS image is related to the storage-related Red Hat software it contains. The version numbers of the package manager files are the same. Therefore, only the target version information of the Red Hat package manager file can be obtained, or the version number of the generated target IOS image can also be obtained. There are no specific restrictions here.

系统类型是指生成目标IOS镜像的目标操作系统的类型,如ARM、X86或者Kylin等。The system type refers to the type of the target operating system used to generate the target IOS image, such as ARM, X86, or Kylin.

示例性地,目标操作系统的系统类型和红帽软件包管理器文件的目标版本信息可以通过命令行传参的方式传递给存储镜像创建程序,即是说,存储镜像创建程序以命令行程序的形式呈现,需要制作对应操作系统的存储镜像时,通过命令行程序运行,并通过命令行传参的方式将系统类型和目标版本信息传递给程序,比如,假设命令行传递的参数是create_iso 2.2.6X86,则表明要创建一个X86操作系统下的存储镜像,其版本号为2.2.6。For example, the system type of the target operating system and the target version information of the Red Hat package manager file can be passed to the storage image creation program through command line parameters. That is to say, the storage image creation program uses the command line program's In the form of presentation, when you need to create a storage image corresponding to the operating system, run it through the command line program, and pass the system type and target version information to the program through command line parameters. For example, assume that the parameters passed on the command line are create_iso 2.2. 6X86, indicating that you want to create a storage image under the X86 operating system, and its version number is 2.2.6.

编译配置文件包括分布式文件存储系统(即ceph)对应的各个组件的组件代码,该组件代码可以作为后续编译代码输入。比如,以行为单位,每一行指定一个配置一个组件服务,那么编译配置文件可以包括组件名、每个组件的代码仓库地址(比如git代码仓库地址)和代码分支名,各字段值之间以“=”分隔,如下所示:The compilation configuration file includes the component code of each component corresponding to the distributed file storage system (ceph), which can be input as subsequent compilation code. For example, if each line specifies a component service in line units, then the compiled configuration file can include the component name, the code warehouse address of each component (such as the git code warehouse address) and the code branch name, with " ="separated as follows:

git@192.168.167.103:project/server1.git=mastergit@192.168.167.103:project/server1.git=master

git@192.168.167.103:project/server2.git=developgit@192.168.167.103:project/server2.git=develop

git@192.168.167.103:project/server3.git=develop server3git@192.168.167.103:project/server3.git=develop server3

其中,“=”之前的信息为组件的代码仓库地址,“=”后的信息为代码分支名。Among them, the information before "=" is the code warehouse address of the component, and the information after "=" is the code branch name.

软件包配置文件用于制作红帽软件包管理器(RedHat Package Manager,RPM)文件,该软件包配置文件可以包括SPEC文件、对应组件的配置文件和系统服务配置文件。其中,SPEC文件包括建立一个RPM包必需的信息,其包括属于RPM包的文件以及RPM包的文件在操作系统下所安装的文件夹,安装及卸载该RPM包时会执行的操作等。另外,制作RPM包时会根据SPEC文件中的定义,将可执行二进制程序、对应组件的配置文件、系统服务配置文件等组织成对应的结构打包成一个RPM文件。对应组件的配置文件则是对应组件的相关配置参数,运行时需要进行加载。系统服务配置文件通常指systemd(系统守护进程)服务的配置文件,如果该存储组件需要以systemd服务的形式进行管理,则需要提供对应的systemd服务配置文件。The software package configuration file is used to make the Red Hat Package Manager (RPM) file. The software package configuration file can include SPEC files, corresponding component configuration files, and system service configuration files. Among them, the SPEC file includes the information necessary to create an RPM package, including the files belonging to the RPM package and the folder where the RPM package files are installed under the operating system, the operations that will be performed when installing and uninstalling the RPM package, etc. In addition, when making an RPM package, the executable binary program, corresponding component configuration files, system service configuration files, etc. are organized into corresponding structures and packaged into an RPM file based on the definitions in the SPEC file. The configuration file of the corresponding component is the relevant configuration parameters of the corresponding component, which needs to be loaded at runtime. The system service configuration file usually refers to the configuration file of the systemd (system daemon) service. If the storage component needs to be managed in the form of a systemd service, the corresponding systemd service configuration file needs to be provided.

需要说明的是,存储相关的各个组件及服务一般是以RPM包的形式包含在存储系统ISO镜像中,因此需要将存储相关各个组件制作成RPM的形式。基于此,需要将制作存储各个组件RPM包的相关配置文件集中放置起来,便于后续处理。It should be noted that storage-related components and services are generally included in the storage system ISO image in the form of RPM packages, so each storage-related component needs to be made into RPM form. Based on this, the relevant configuration files for making and storing the RPM packages of each component need to be centrally placed to facilitate subsequent processing.

步骤S202,对编译配置文件进行解析,得到所有的组件代码。Step S202: parse the compilation configuration file to obtain all component codes.

存储镜像创建程序对编译配置文件进行解析,以拉取所有的组件代码,该组件包括ceph相关组件、管理软件或其他组件,在此不再一一列举。The storage image creation program parses the compiled configuration file to pull all component codes. This component includes ceph-related components, management software or other components, which are not listed here.

步骤S203,基于系统类型和组件代码,得到可执行二进制程序。Step S203: Obtain an executable binary program based on the system type and component code.

具体地,存储镜像创建程序根据传递进来的系统类型,使用对应的目标操作系统的编译工具和编译指令编译组件代码,生成可执行二进制程序。Specifically, the storage image creation program uses the compilation tools and compilation instructions of the corresponding target operating system to compile the component code according to the passed system type, and generates an executable binary program.

步骤S204,基于目标版本信息、可执行二进制程序和软件包配置文件,生成红帽软件包管理器文件。Step S204: Generate a Red Hat software package manager file based on the target version information, executable binary program and software package configuration file.

存储镜像创建程序利用目标版本信息更新生成目标IOS镜像的目录,在该目录下根据可执行二进制程序和软件包配置文件生成红帽软件包管理器文件。The storage image creation program uses the target version information to update the directory where the target IOS image is generated, and generates the Red Hat package manager file in this directory based on the executable binary program and the software package configuration file.

步骤S205,基于红帽软件包管理器文件,生成目标IOS镜像。Step S205: Generate the target IOS image based on the Red Hat software package manager file.

存储镜像创建程序基于红帽软件包管理器文件,可以通过调用mkisofs命令生成目标IOS镜像。The storage image creation program is based on the Red Hat package manager file and can generate the target IOS image by calling the mkisofs command.

本发明实施例提供的存储镜像生成方法,通过获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,以及对编译配置文件进行解析,得到所有的组件代码,能够基于系统类型和组件代码,得到可执行二进制程序,再基于目标版本信息、可执行二进制程序和软件包配置文件,生成红帽软件包管理器文件,以及基于红帽软件包管理器文件,能够自动生成目标操作系统对应的目标IOS镜像,因此,能够提高IOS镜像的制作效率,同时能够减少人工工作量。The storage image generation method provided by the embodiment of the present invention obtains the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, and analyzes the compilation configuration file to obtain All component codes can obtain executable binary programs based on system type and component code, and then generate Red Hat package manager files based on target version information, executable binary programs and software package configuration files, and based on Red Hat software packages The manager file can automatically generate the target IOS image corresponding to the target operating system. Therefore, it can improve the efficiency of IOS image production and reduce manual workload.

在本实施例中提供了一种存储镜像生成方法,可用于上述的服务器。图3是根据本发明实施例的存储镜像生成方法的流程图,如图3所示,该流程包括如下步骤:This embodiment provides a storage image generation method, which can be used in the above-mentioned server. Figure 3 is a flow chart of a storage image generation method according to an embodiment of the present invention. As shown in Figure 3, the process includes the following steps:

步骤S301,获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件。Step S301: Obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file, and the software package configuration file.

其中,编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,软件包配置文件用于制作红帽软件包管理器文件。Among them, the compiled configuration file includes the component code of each component corresponding to the distributed file storage system, and the software package configuration file is used to make the Red Hat software package manager file.

详细请参见图2所示实施例的步骤S201,在此不再赘述。For details, please refer to step S201 in the embodiment shown in Figure 2, which will not be described again here.

步骤S302,对编译配置文件进行解析,得到所有的组件代码。Step S302: parse the compilation configuration file to obtain all component codes.

详细请参见图2所示实施例的步骤S202,在此不再赘述。Please refer to step S202 in the embodiment shown in Figure 2 for details, which will not be described again here.

步骤S303,基于系统类型和组件代码,得到可执行二进制程序。Step S303: Obtain an executable binary program based on the system type and component code.

具体地,上述步骤S303具体包括:Specifically, the above step S303 specifically includes:

步骤S3031,根据系统类型和组件代码确定目标编译指令。Step S3031: Determine the target compilation instruction according to the system type and component code.

比如,假设系统类型为X86且组件代码为C语言,则使用的目标编译指令为gcc;又如,假设系统类型为ARM且组件代码为C语言,则使用的目标编译指令为arm-linux-gcc交叉编译指令。For example, assuming the system type is Cross-compilation instructions.

步骤S3032,基于目标编译指令对组件代码进行编译,得到可执行二进制程序。Step S3032: Compile the component code based on the target compilation instructions to obtain an executable binary program.

在本申请实施例中,通过系统类型和组件代码确定目标编译指令,能够基于目标编译指令对组件代码进行编译,得到可执行二进制程序,以便于后续基于该可执行二进制程序能够生成准确的红帽软件包管理器文件。In the embodiment of this application, the target compilation instructions are determined through the system type and component code, and the component code can be compiled based on the target compilation instructions to obtain an executable binary program, so that accurate Red Hat can be subsequently generated based on the executable binary program. Package manager files.

步骤S304,基于目标版本信息、可执行二进制程序和软件包配置文件,生成红帽软件包管理器文件。Step S304: Generate a Red Hat software package manager file based on the target version information, executable binary program and software package configuration file.

具体地,上述步骤S304具体包括:Specifically, the above step S304 specifically includes:

步骤S3041,获取红帽软件包管理器文件的初始版本信息。Step S3041: Obtain the initial version information of the Red Hat software package manager file.

其中,初始版本信息是基于软件包配置文件的操作指示文件确定的,该操作指示文件即SPEC文件。The initial version information is determined based on the operation instruction file of the software package configuration file, which is the SPEC file.

步骤S3042,将初始版本信息替换成目标版本信息,得到替换后的软件包配置文件。Step S3042: Replace the initial version information with the target version information to obtain the replaced software package configuration file.

具体地,存储镜像创建程序将目标版本信息,替换软件包配置文件的操作指示文件中的红帽软件包管理器文件的初始版本信息。其中,初始版本信息是默认的版本信息,与实际要构建红帽软件包管理器文件的版本信息不一致,因此,需要SPEC文件中的初始版本信息替换为目标版本信息。Specifically, the storage image creation program replaces the target version information with the initial version information of the Red Hat package manager file in the operation instruction file of the software package configuration file. Among them, the initial version information is the default version information, which is inconsistent with the version information actually used to build the Red Hat package manager file. Therefore, the initial version information in the SPEC file needs to be replaced with the target version information.

步骤S3043,基于可执行二进制程序和替换后的软件包配置文件,生成红帽软件包管理器文件。Step S3043: Generate a Red Hat software package manager file based on the executable binary program and the replaced software package configuration file.

具体地,在所有组件编译完毕后,存储镜像创建程序会将该组件对应的可执行二进制程序和替换后的软件包配置文件,以目录的形式组织,其目录名以组件名+目标版本信息进行标识,最后将该目录打包成同名的tar.gz格式文件,调用rpmbuild指令生成对应组件的红帽软件包管理器文件。Specifically, after all components are compiled, the storage image creation program will organize the executable binary program corresponding to the component and the replaced software package configuration file in the form of a directory, and the directory name will be the component name + target version information. logo, and finally package the directory into a tar.gz format file with the same name, and call the rpmbuild command to generate the Red Hat package manager file for the corresponding component.

在本申请实施例中,通过获取红帽软件包管理器文件的初始版本信息,以及将初始版本信息替换成目标版本信息,得到替换后的软件包配置文件,能够基于可执行二进制程序和替换后的软件包配置文件,生成实际要构建的红帽软件包管理器文件。In the embodiment of this application, by obtaining the initial version information of the Red Hat software package manager file and replacing the initial version information with the target version information, the replaced software package configuration file is obtained, which can be based on the executable binary program and the replaced package configuration file to generate the actual Red Hat Package Manager files to be built.

步骤S305,基于红帽软件包管理器文件,生成目标IOS镜像。Step S305: Generate the target IOS image based on the Red Hat software package manager file.

具体地,上述步骤S305具体包括:Specifically, the above step S305 specifically includes:

步骤S3051,获取目标操作系统对应的基础目录。Step S3051: Obtain the basic directory corresponding to the target operating system.

其中,基础目录为生成目标IOS镜像的输入目录。Among them, the base directory is the input directory for generating the target IOS image.

步骤S3052,将红帽软件包管理器文件拷贝至基础目录中。Step S3052: Copy the Red Hat software package manager file to the base directory.

在一些可选的实施方式中,在将红帽软件包管理器文件拷贝至基础目录中后,可以更新基础目录的repodata。In some optional implementations, after copying the Red Hat package manager files to the base directory, the repodata of the base directory can be updated.

具体地,待所有组件的红帽软件包管理器文件包生成后,存储镜像创建程序会将生成的红帽软件包管理器文件自动拷贝到基础目录的指定路径下。Specifically, after the Red Hat Package Manager file packages for all components are generated, the storage image creation program will automatically copy the generated Red Hat Package Manager files to the specified path of the base directory.

进一步地,还会调用createrepo和repo2module创建repodata和modularmetadata。其中,repodata是后续使用构建好的ISO安装部署系统时所需要的,安装时会自动安装相关软件包,createrepo是一个对红帽软件包管理器文件进行索引建立的工具,比如,对指定路径下的红帽软件包管理器文件进行检索,把每个红帽软件包管理器文件的信息存储到指定的索引文件,在此不作具体限制。Further, createrepo and repo2module will also be called to create repodata and modularmetadata. Among them, repodata is required for subsequent installation and deployment of the system using the built ISO. Related software packages will be automatically installed during installation. Createrepo is a tool for indexing Red Hat package manager files, for example, under the specified path Red Hat package manager files are retrieved, and the information of each Red Hat package manager file is stored in the specified index file. There are no specific restrictions here.

步骤S3053,在基础目录下生成目标IOS镜像。Step S3053: Generate the target IOS image in the base directory.

由于红帽软件包管理器文件是目标IOS镜像中软件包的一部分,因此,需要在包含有红帽软件包管理器文件的基础目录下生成目标IOS镜像。Since the Red Hat Package Manager file is part of the software package in the target IOS image, the target IOS image needs to be generated in the base directory containing the Red Hat Package Manager file.

在本申请实施例中,通过获取目标操作系统对应的基础目录,将红帽软件包管理器文件拷贝至基础目录中,以及在基础目录下生成目标IOS镜像,能够保证生成的目标IOS镜像的准确性。In the embodiment of this application, by obtaining the base directory corresponding to the target operating system, copying the Red Hat package manager file to the base directory, and generating the target IOS image under the base directory, the accuracy of the generated target IOS image can be ensured. sex.

在一些可选的实施方式中,步骤S3051具体包括:In some optional implementations, step S3051 specifically includes:

步骤a1,获取目标操作系统的初始国际标准化组织文件。Step a1: Obtain the initial ISO file of the target operating system.

初始国际标准化组织文件包括安装文件、系统启动引导文件和基础管理文件包等等。其中,安装文件即ks文件,安装文件包含一些或所有操作系统的安装选项,如设置时区、对驱动器进行分区的方式或者应该安装的软件包。定制好的安装文件可以方便用户进行安装而无需用户干预,对于同时大量部署操作系统的应用场景尤为便利。系统启动引导文件即grub文件,grub文件包含了系统引导菜单的相关配置,比如,可以定制与操作系统厂商的相关信息,在引导系统安装时进行展示。基础管理文件包即基础红帽软件包管理器文件。The initial ISO files include installation files, system startup boot files, basic management file packages, etc. Among them, the installation file is the ks file. The installation file contains some or all installation options for the operating system, such as setting the time zone, how to partition the drive, or the software packages that should be installed. Customized installation files can facilitate users to install without user intervention, which is especially convenient for application scenarios where a large number of operating systems are deployed at the same time. The system startup boot file is the grub file. The grub file contains the relevant configuration of the system boot menu. For example, information related to the operating system manufacturer can be customized and displayed when booting the system installation. The basic management file package is the basic Red Hat Package Manager file.

步骤a2,基于初始国际标准化组织文件生成基础目录。Step a2: Generate a basic directory based on the initial ISO file.

其中,基础目录包含安装对应平台最小环境操作系统的各个软件包及相关文件。Among them, the base directory contains various software packages and related files for installing the minimum environment operating system of the corresponding platform.

需要说明的是,目标操作系统一般以ISO格式对外提供,比如,目标操作系统为存储系统,其本质是一个包含了存储相关软件的定制化操作系统。首先需要从目标操作系统对应的初始国际标准化组织文件中提取相应内容,作为后续生成对应的目标操作系统的目标IOS镜像的基础目录。It should be noted that the target operating system is generally provided externally in ISO format. For example, the target operating system is a storage system, which is essentially a customized operating system that includes storage-related software. First, the corresponding content needs to be extracted from the initial International Organization for Standardization file corresponding to the target operating system, as the base directory for subsequent generation of the target IOS image of the corresponding target operating system.

以X86的目标操作系统为例,基于初始国际标准化组织文件生成基础目录,具体可以是挂载目标操作系统的CentOS(Community Enterprise Operating System,社区企业操作系统)对应的初始国际标准化组织文件,从初始国际标准化组织文件中拷贝其内容到基础目录。Taking the target operating system of Copies the contents of the ISO file to the base directory.

进一步地,可以使用createrepo命令为生成目标IOS镜像创建更新repodata,并定制安装文件、系统启动引导文件。Furthermore, you can use the createrepo command to create updated repodata for generating the target IOS image, and customize the installation file and system startup boot file.

在本申请实施例中,通过获取目标操作系统的初始国际标准化组织文件,基于初始国际标准化组织文件生成基础目录,能够基于该基础目录生成对应的目标操作系统的目标IOS镜像。In the embodiment of the present application, by obtaining the initial ISO file of the target operating system and generating a basic directory based on the initial ISO file, the target IOS image of the corresponding target operating system can be generated based on the basic directory.

在一些可选的实施方式中,步骤S3053具体包括:In some optional implementations, step S3053 specifically includes:

步骤b1,在基础目录下创建以平台或者日期为标识的子目录。Step b1: Create a subdirectory identified by platform or date in the basic directory.

具体地,存储镜像创建程序在该基础目录的指定路径下创建以平台/日期为标识的子目录。该子目录即预设的存储路径,用来存放生成的目标IOS镜像,此路径可以在程序中自定义。Specifically, the storage image creation program creates a subdirectory identified by platform/date under the specified path of the base directory. This subdirectory is the default storage path used to store the generated target IOS image. This path can be customized in the program.

步骤b2,在子目录下生成目标IOS镜像。Step b2, generate the target IOS image in the subdirectory.

具体地,存储镜像创建程序切换至子目录,在子目录下,调用mkisofs指令生成对应该目标操作系统的目标IOS镜像。Specifically, the storage image creation program switches to a subdirectory, and in the subdirectory, calls the mkisofs instruction to generate a target IOS image corresponding to the target operating system.

在本申请实施例中,通过在基础目录下创建以平台或者日期为标识的子目录,能够在子目录下生成目标IOS镜像。In this embodiment of the present application, by creating a subdirectory identified by platform or date under the base directory, the target IOS image can be generated under the subdirectory.

在一些可选的实施方式中,获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件之前,可以提取目标操作系统的初始IOS镜像,生成初始IOS镜像的第一校验文件,对第一校验文件进行存储。In some optional implementations, before obtaining the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, the initial IOS image of the target operating system can be extracted and generated. The first verification file of the initial IOS image stores the first verification file.

然后在生成目标IOS镜像之后,生成目标IOS镜像的第二校验文件,对第一校验文件和第二校验文件进行比对,得到比对结果,若比对结果表征第一校验文件和第二校验文件不一致,说明生成目标IOS镜像的过程中可能出现错误,因此,可以重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,以重新生成新的目标IOS镜像。Then after generating the target IOS image, generate a second verification file of the target IOS image, compare the first verification file and the second verification file, and obtain the comparison result. If the comparison result represents the first verification file It is inconsistent with the second verification file, indicating that an error may have occurred during the process of generating the target IOS image. Therefore, you can re-obtain the system type of the target operating system, the target version information of the Red Hat package manager file, the compilation configuration file and the software package. Configuration file to regenerate a new target IOS image.

其中,调用md5sum命令生成目标IOS镜像的第二校验文件。同样地,也可以调用md5sum命令生成初始IOS镜像的第一校验文件。其中,第一校验文件和第二校验文件均为MD5校验文件。Among them, the md5sum command is called to generate the second verification file of the target IOS image. Similarly, you can also call the md5sum command to generate the first verification file of the initial IOS image. Among them, the first verification file and the second verification file are both MD5 verification files.

在本申请实施例中,通过生成初始IOS镜像的第一校验文件以及生成目标IOS镜像的第二校验文件,对第一校验文件和第二校验文件进行比对,能够对目标IOS镜像进行一致性核对,若比对结果表征第一校验文件和第二校验文件不一致,重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,以此提升生成的目标IOS镜像的准确性。In this embodiment of the present application, by generating a first verification file for the initial IOS image and a second verification file for the target IOS image, and comparing the first verification file and the second verification file, the target IOS can be verified. The image is checked for consistency. If the comparison result indicates that the first verification file and the second verification file are inconsistent, the system type of the target operating system, the target version information of the Red Hat package manager file, the compilation configuration file and the software are re-obtained. Package configuration file to improve the accuracy of the generated target IOS image.

需要说明的是,在上述各个实施例中,基础目录、编译配置文件和软件包配置文件在初次配置完毕后,若后续无变动则无需再次配置。It should be noted that in each of the above embodiments, after the initial configuration of the basic directory, compilation configuration file and software package configuration file is completed, if there are no subsequent changes, there is no need to configure them again.

在一些可选的实施方式中,在目标IOS镜像生成后,可以在执行本申请实施例方法的服务器和安装测试服务器上挂载网络文件系统(比如nfs共享文件系统),执行本申请实施例方法的服务器将目标IOS镜像存于共享文件系统中,然后通过脚本跳转到安装测试服务器上,直接使用共享文件系统中的目标IOS镜像在虚拟机上进行安装测试,工作人员可以通过对应的管理平台查看测试结果,而无需等待目标IOS镜像生成后手动测试,以此完成一次性目标IOS镜像的生成和测试,同时提高了测试时间。In some optional implementations, after the target IOS image is generated, a network file system (such as an nfs shared file system) can be mounted on the server that executes the method of the embodiment of this application and the installation test server, and the method of the embodiment of this application is executed. The server stores the target IOS image in the shared file system, then jumps to the installation test server through a script, and directly uses the target IOS image in the shared file system to perform installation testing on the virtual machine. Staff can use the corresponding management platform Check the test results without waiting for the target IOS image to be generated and test manually, thereby completing the generation and testing of the one-time target IOS image and improving the test time.

为了更加清楚的说明存储镜像生成的过程,下面以具体的示例进行说明。In order to explain the storage image generation process more clearly, a specific example is used to illustrate below.

参照图4,开始时,可以获取各个平台架构对应的目标操作系统对应的基础目录,然后设置编译配置文件,该编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,该组件代码可以作为后续编译代码输入。接着,可以创建红帽软件包管理器文件制作目录,将该红帽软件包管理器文件存放至该目录下,再通过命令行传参的方式将目标操作系统的系统类型和红帽软件包管理器文件的目标版本信息传递给存储镜像创建程序。紧接着,自动从编译配置文件中拉取对应的组件代码,基于系统类型和组件代码,得到可执行二进制程序。然后,获取红帽软件包管理器文件的初始版本信息,初始版本信息是基于软件包配置文件的操作指示文件确定的,将初始版本信息替换成目标版本信息,得到替换后的软件包配置文件,基于可执行二进制程序和替换后的软件包配置文件,生成红帽软件包管理器文件,并将生成的红帽软件包管理器文件拷贝至基础目录中,并更新基础目录中的repodata。最后,调用mkisofs命令生成目标IOS镜像,对目标IOS镜像进行一致性校验,即提取目标操作系统的初始IOS镜像,生成初始IOS镜像的第一校验文件和目标IOS镜像的第二校验文件,对第一校验文件和第二校验文件进行比对,得到比对结果,若比对结果表征第一校验文件和第二校验文件不一致,重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,如此,本申请实施例能够自动生成多个平台架构的存储镜像,极大地提升了制作存储镜像的效率和准确性。Referring to Figure 4, at the beginning, you can obtain the basic directory corresponding to the target operating system corresponding to each platform architecture, and then set the compilation configuration file. The compilation configuration file includes the component code of each component corresponding to the distributed file storage system. The component code can As input for subsequent compiled code. Then, you can create a Red Hat package manager file production directory, store the Red Hat package manager file in this directory, and then pass the command line parameters to set the system type of the target operating system and the Red Hat package manager The target version information of the server file is passed to the storage image creation program. Then, the corresponding component code is automatically pulled from the compiled configuration file, and an executable binary program is obtained based on the system type and component code. Then, obtain the initial version information of the Red Hat package manager file. The initial version information is determined based on the operation instruction file of the software package configuration file. Replace the initial version information with the target version information to obtain the replaced software package configuration file. Based on the executable binary program and the replaced software package configuration file, generate the Red Hat package manager file, copy the generated Red Hat package manager file to the base directory, and update the repodata in the base directory. Finally, call the mkisofs command to generate the target IOS image, and perform consistency verification on the target IOS image, that is, extract the initial IOS image of the target operating system, and generate the first verification file of the initial IOS image and the second verification file of the target IOS image. , compare the first verification file and the second verification file to obtain the comparison result. If the comparison result indicates that the first verification file and the second verification file are inconsistent, re-obtain the system type and red color of the target operating system. Cap the target version information, compilation configuration file and software package configuration file of the software package manager file. In this way, the embodiment of the present application can automatically generate storage images for multiple platform architectures, greatly improving the efficiency and accuracy of making storage images.

参照图5,本申请的一个实施例还提供了一种存储镜像生成装置,包括:Referring to Figure 5, one embodiment of the present application also provides a storage image generation device, including:

获取模块501,用于获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件,其中,编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,软件包配置文件用于制作红帽软件包管理器文件;The acquisition module 501 is used to obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, where the compilation configuration file includes various components corresponding to the distributed file storage system The component code and package configuration file are used to make the Red Hat package manager file;

解析模块502,用于对编译配置文件进行解析,得到所有的组件代码;The parsing module 502 is used to parse the compilation configuration file and obtain all component codes;

程序生成模块503,用于基于系统类型和组件代码,得到可执行二进制程序;The program generation module 503 is used to obtain an executable binary program based on the system type and component code;

第一文件生成模块504,用于基于目标版本信息、可执行二进制程序和软件包配置文件,生成红帽软件包管理器文件;The first file generation module 504 is used to generate the Red Hat software package manager file based on the target version information, executable binary program and software package configuration file;

存储镜像生成模块505,用于基于红帽软件包管理器文件,生成目标IOS镜像。The storage image generation module 505 is used to generate a target IOS image based on the Red Hat software package manager file.

在一些可选的实施方式中,第一文件生成模块504具体包括:In some optional implementations, the first file generation module 504 specifically includes:

第一获取子模块,用于获取红帽软件包管理器文件的初始版本信息,初始版本信息是基于软件包配置文件的操作指示文件确定的;The first acquisition submodule is used to obtain the initial version information of the Red Hat software package manager file. The initial version information is determined based on the operation instruction file of the software package configuration file;

替换子模块,用于将初始版本信息替换成目标版本信息,得到替换后的软件包配置文件;The replacement submodule is used to replace the initial version information with the target version information and obtain the replaced software package configuration file;

第一文件生成子模块,用于基于可执行二进制程序和替换后的软件包配置文件,生成红帽软件包管理器文件。The first file generation submodule is used to generate Red Hat package manager files based on the executable binary program and the replaced software package configuration file.

在一些可选的实施方式中,存储镜像生成模块505具体包括:In some optional implementations, the storage image generation module 505 specifically includes:

第二获取子模块,用于获取目标操作系统对应的基础目录,基础目录为生成目标IOS镜像的输入目录;The second acquisition sub-module is used to obtain the basic directory corresponding to the target operating system. The basic directory is the input directory for generating the target IOS image;

拷贝子模块,用于将红帽软件包管理器文件拷贝至基础目录中;Copy submodule, used to copy Red Hat package manager files to the base directory;

存储镜像生成子模块,用于在基础目录下生成目标IOS镜像。The storage image generation submodule is used to generate the target IOS image in the base directory.

在一些可选的实施方式中,存储镜像生成子模块具体包括:In some optional implementations, the storage image generation submodule specifically includes:

子目录生成单元,用于在基础目录下创建以平台或者日期为标识的子目录;The subdirectory generation unit is used to create subdirectories identified by platform or date under the basic directory;

存储镜像生成单元,用于在子目录下生成目标IOS镜像。The storage image generation unit is used to generate target IOS images in subdirectories.

在一些可选的实施方式中,第二获取子模块具体包括:In some optional implementations, the second acquisition sub-module specifically includes:

获取单元,用于获取目标操作系统的初始国际标准化组织文件,初始国际标准化组织文件包括安装文件、系统启动引导文件和基础管理文件包;The acquisition unit is used to obtain the initial ISO files of the target operating system. The initial ISO files include installation files, system startup boot files and basic management file packages;

基础目录生成单元,用于基于初始国际标准化组织文件生成基础目录。The basic directory generation unit is used to generate the basic directory based on the initial ISO file.

在一些可选的实施方式中,程序生成模块503具体包括:In some optional implementations, the program generation module 503 specifically includes:

指令确定子模块,用于根据系统类型和组件代码确定目标编译指令;Instruction determination submodule, used to determine target compilation instructions based on system type and component code;

程序生成子模块,用于基于目标编译指令对组件代码进行编译,得到可执行二进制程序。The program generation submodule is used to compile the component code based on the target compilation instructions to obtain an executable binary program.

在一些可选的实施方式中,存储镜像生成装置还包括:In some optional implementations, the storage image generation device further includes:

提取模块,用于提取目标操作系统的初始IOS镜像;Extraction module, used to extract the initial IOS image of the target operating system;

第二文件生成模块,用于生成初始IOS镜像的第一校验文件;The second file generation module is used to generate the first verification file of the initial IOS image;

存储模块,用于对第一校验文件进行存储;A storage module used to store the first verification file;

获取模块501具体包括:The acquisition module 501 specifically includes:

第二文件生成子模块,用于生成目标IOS镜像的第二校验文件;The second file generation submodule is used to generate the second verification file of the target IOS image;

比对子模块,用于对第一校验文件和第二校验文件进行比对,得到比对结果;The comparison submodule is used to compare the first verification file and the second verification file to obtain the comparison result;

第三获取子模块,用于若比对结果表征第一校验文件和第二校验文件不一致,重新获取目标操作系统的系统类型、红帽软件包管理器文件的目标版本信息、编译配置文件和软件包配置文件。The third acquisition sub-module is used to re-obtain the system type of the target operating system, the target version information of the Red Hat package manager file, and the compilation configuration file if the comparison result indicates that the first verification file and the second verification file are inconsistent. and package configuration files.

本实施例中的存储镜像生成装置是以功能模块的形式来呈现,这里的模块是指专用集成电路(Application Specific Integrated Circuit,简称ASIC),执行一个或多个软件或固定程序的处理器和存储器,和/或其他可以提供上述功能的器件。The storage image generation device in this embodiment is presented in the form of a functional module. The module here refers to an Application Specific Integrated Circuit (ASIC for short), a processor and a memory that executes one or more software or fixed programs. , and/or other devices that can provide the above functions.

上述各个模块和单元的更进一步的功能描述与上述对应实施例相同,在此不再赘述。Further functional descriptions of the above-mentioned modules and units are the same as those in the above-mentioned corresponding embodiments, and will not be described again here.

本发明实施例还提供一种计算机设备,具有上述图5所示的存储镜像生成装置。An embodiment of the present invention also provides a computer device having the storage image generating device shown in Figure 5 above.

请参阅图6,图6是本发明可选实施例提供的一种计算机设备的结构示意图,如图6所示,该计算机设备包括:一个或多个处理器10、存储器20,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相通信连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在计算机设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在一些可选的实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个计算机设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图6中以一个处理器10为例。Please refer to Figure 6. Figure 6 is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention. As shown in Figure 6, the computer device includes: one or more processors 10, a memory 20, and a device for connecting The interfaces of each component include high-speed interfaces and low-speed interfaces. Various components communicate with each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor may process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative implementations, multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired. Likewise, multiple computer devices may be connected, each device providing part of the necessary operation (eg, as a server array, a set of blade servers, or a multi-processor system). Figure 6 takes a processor 10 as an example.

处理器10可以是中央处理器,网络处理器或其组合。其中,处理器10还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路,可编程逻辑器件或其组合。上述可编程逻辑器件可以是复杂可编程逻辑器件,现场可编程逻辑门阵列,通用阵列逻辑或其任意组合。The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit, a programmable logic device or a combination thereof. The above-mentioned programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general array logic or any combination thereof.

其中,存储器20存储有可由至少一个处理器10执行的指令,以使至少一个处理器10执行实现上述实施例示出的方法。The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

存储器20可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据一种小程序落地页的展现的计算机设备的使用所创建的数据等。此外,存储器20可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些可选的实施方式中,存储器20可选包括相对于处理器10远程设置的存储器,这些远程存储器可以通过网络连接至该计算机设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 20 may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store the use of the computer device according to the presentation of a small program landing page. The data created etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some optional implementations, the memory 20 may optionally include memories remotely located relative to the processor 10 , and these remote memories may be connected to the computer device through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.

存储器20可以包括易失性存储器,例如,随机存取存储器;存储器也可以包括非易失性存储器,例如,快闪存储器,硬盘或固态硬盘;存储器20还可以包括上述种类的存储器的组合。The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memories.

该计算机设备还包括通信接口30,用于该计算机设备与其他设备或通信网络通信。The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.

本发明实施例还提供了一种计算机可读存储介质,上述根据本发明实施例的方法可在硬件、固件中实现,或者被实现为可记录在存储介质,或者被实现通过网络下载的原始存储在远程存储介质或非暂时机器可读存储介质中并将被存储在本地存储介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件的存储介质上的这样的软件处理。其中,存储介质可为磁碟、光盘、只读存储记忆体、随机存储记忆体、快闪存储器、硬盘或固态硬盘等;进一步地,存储介质还可以包括上述种类的存储器的组合。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件,当软件或计算机代码被计算机、处理器或硬件访问且执行时,实现上述实施例示出的方法。Embodiments of the present invention also provide a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware or firmware, or can be recorded in a storage medium, or can be implemented as original storage downloaded through the network. Computer code in a remote storage medium or a non-transitory machine-readable storage medium and to be stored in a local storage medium such that the methods described herein may be stored on a computer using a general purpose computer, a special purpose processor, or programmable or special purpose hardware Such software processing on storage media. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above types of memories. It can be understood that a computer, processor, microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor or hardware, the above implementations are implemented. The method illustrated.

虽然结合附图描述了本发明的实施例,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the appended rights. within the scope of the requirements.

Claims (10)

1.一种存储镜像生成方法,其特征在于,所述方法包括:1. A storage image generation method, characterized in that the method includes: 获取目标操作系统的系统类型.红帽软件包管理器文件的目标版本信息.编译配置文件和软件包配置文件,其中,所述编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,所述软件包配置文件用于制作所述红帽软件包管理器文件;Obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, where the compilation configuration file includes the component code of each component corresponding to the distributed file storage system, The software package configuration file is used to make the Red Hat software package manager file; 对所述编译配置文件进行解析,得到所有的组件代码;Parse the compiled configuration file to obtain all component codes; 基于所述系统类型和所述组件代码,得到可执行二进制程序;Based on the system type and the component code, obtain an executable binary program; 基于所述目标版本信息.所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件;Generate the Red Hat software package manager file based on the target version information, the executable binary program and the software package configuration file; 基于所述红帽软件包管理器文件,生成目标IOS镜像。Based on the Red Hat package manager file, the target IOS image is generated. 2.根据权利要求1所述的方法,其特征在于,所述基于所述目标版本信息.所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件,包括:2. The method of claim 1, wherein generating the Red Hat software package manager file based on the target version information, the executable binary program and the software package configuration file includes: : 获取所述红帽软件包管理器文件的初始版本信息,所述初始版本信息是基于所述软件包配置文件的操作指示文件确定的;Obtain initial version information of the Red Hat software package manager file, where the initial version information is determined based on the operation instruction file of the software package configuration file; 将所述初始版本信息替换成所述目标版本信息,得到替换后的软件包配置文件;Replace the initial version information with the target version information to obtain a replaced software package configuration file; 基于所述可执行二进制程序和所述替换后的软件包配置文件,生成所述红帽软件包管理器文件。The Red Hat software package manager file is generated based on the executable binary program and the replaced software package configuration file. 3.根据权利要求1所述的方法,其特征在于,所述基于所述红帽软件包管理器文件,生成目标IOS镜像,包括:3. The method according to claim 1, characterized in that generating a target IOS image based on the Red Hat software package manager file includes: 获取所述目标操作系统对应的基础目录,所述基础目录为生成所述目标IOS镜像的输入目录;Obtain the base directory corresponding to the target operating system, where the base directory is the input directory for generating the target IOS image; 将所述红帽软件包管理器文件拷贝至所述基础目录中;Copy the Red Hat package manager file to the base directory; 在所述基础目录下生成所述目标IOS镜像。The target IOS image is generated in the base directory. 4.根据权利要求3所述的方法,其特征在于,所述在所述基础目录下生成所述目标IOS镜像,包括:4. The method according to claim 3, characterized in that generating the target IOS image under the base directory includes: 在所述基础目录下创建以平台或者日期为标识的子目录;Create a subdirectory identified by platform or date under the basic directory; 在所述子目录下生成所述目标IOS镜像。Generate the target IOS image in the subdirectory. 5.根据权利要求3所述的方法,其特征在于,所述获取所述目标操作系统对应的基础目录,包括:5. The method according to claim 3, characterized in that said obtaining the basic directory corresponding to the target operating system includes: 获取所述目标操作系统的初始国际标准化组织文件,所述初始国际标准化组织文件包括安装文件.系统启动引导文件和基础管理文件包;Obtain the initial International Organization for Standardization files of the target operating system, where the initial International Organization for Standardization files include installation files, system startup boot files and basic management file packages; 基于所述初始国际标准化组织文件生成所述基础目录。The base directory is generated based on the initial International Organization for Standardization file. 6.根据权利要求1所述的方法,其特征在于,所述基于所述系统类型和所述组件代码,得到可执行二进制程序,包括:6. The method of claim 1, wherein obtaining an executable binary program based on the system type and the component code includes: 根据所述系统类型和所述组件代码确定目标编译指令;Determine target compilation instructions based on the system type and the component code; 基于所述目标编译指令对所述组件代码进行编译,得到可执行二进制程序。The component code is compiled based on the target compilation instruction to obtain an executable binary program. 7.根据权利要求1所述的方法,其特征在于,所述获取目标操作系统的系统类型.红帽软件包管理器文件的目标版本信息.编译配置文件和软件包配置文件之前,包括:7. The method according to claim 1, characterized in that, before obtaining the system type of the target operating system, the target version information of the Red Hat software package manager file, and compiling the configuration file and the software package configuration file, the method includes: 提取所述目标操作系统的初始IOS镜像;Extract the initial IOS image of the target operating system; 生成所述初始IOS镜像的第一校验文件;Generate the first verification file of the initial IOS image; 对所述第一校验文件进行存储;Store the first verification file; 所述获取目标操作系统的系统类型.红帽软件包管理器文件的目标版本信息.编译配置文件和软件包配置文件,包括:The method of obtaining the system type of the target operating system, the target version information of the Red Hat package manager file, the compilation configuration file and the software package configuration file include: 生成所述目标IOS镜像的第二校验文件;Generate a second verification file of the target IOS image; 对所述第一校验文件和所述第二校验文件进行比对,得到比对结果;Compare the first verification file and the second verification file to obtain a comparison result; 若所述比对结果表征所述第一校验文件和所述第二校验文件不一致,重新获取目标操作系统的系统类型.红帽软件包管理器文件的目标版本信息.编译配置文件和软件包配置文件。If the comparison result indicates that the first verification file and the second verification file are inconsistent, re-obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, compile the configuration file and software Package configuration file. 8.一种存储镜像生成装置,其特征在于,包括:8. A storage image generation device, characterized in that it includes: 获取模块,用于获取目标操作系统的系统类型.红帽软件包管理器文件的目标版本信息.编译配置文件和软件包配置文件,其中,所述编译配置文件包括分布式文件存储系统对应的各个组件的组件代码,所述软件包配置文件用于制作所述红帽软件包管理器文件;The acquisition module is used to obtain the system type of the target operating system, the target version information of the Red Hat software package manager file, the compilation configuration file and the software package configuration file, wherein the compilation configuration file includes each corresponding file of the distributed file storage system. The component code of the component, the software package configuration file is used to make the Red Hat software package manager file; 解析模块,用于对所述编译配置文件进行解析,得到所有的组件代码;The parsing module is used to parse the compilation configuration file and obtain all component codes; 程序生成模块,用于基于所述系统类型和所述组件代码,得到可执行二进制程序;A program generation module, used to obtain an executable binary program based on the system type and the component code; 第一文件生成模块,用于基于所述目标版本信息.所述可执行二进制程序和所述软件包配置文件,生成所述红帽软件包管理器文件;A first file generation module, configured to generate the Red Hat software package manager file based on the target version information, the executable binary program and the software package configuration file; 存储镜像生成模块,用于基于所述红帽软件包管理器文件,生成目标IOS镜像。A storage image generation module is used to generate a target IOS image based on the Red Hat package manager file. 9.一种计算机设备,其特征在于,包括:9. A computer device, characterized in that it includes: 存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行权利要求1至7中任一项所述的存储镜像生成方法。A memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes any one of claims 1 to 7 by executing the computer instructions. The storage image generation method described. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机指令,所述计算机指令用于使计算机执行权利要求1至7中任一项所述的存储镜像生成方法。10. A computer-readable storage medium, characterized in that computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause the computer to execute the storage image according to any one of claims 1 to 7 Generate method.
CN202311549175.3A 2023-11-17 2023-11-17 Storage image generation method, device, computer equipment and storage medium Pending CN117591136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311549175.3A CN117591136A (en) 2023-11-17 2023-11-17 Storage image generation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311549175.3A CN117591136A (en) 2023-11-17 2023-11-17 Storage image generation method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117591136A true CN117591136A (en) 2024-02-23

Family

ID=89917502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311549175.3A Pending CN117591136A (en) 2023-11-17 2023-11-17 Storage image generation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117591136A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118133282A (en) * 2024-03-13 2024-06-04 北京江民新科技术有限公司 Cross-platform antivirus method and system based on mobile equipment
CN119025157A (en) * 2024-10-28 2024-11-26 西安星源博锐新能源技术有限公司 Online compilation and packaging method based on Buildroot
CN119494299A (en) * 2025-01-17 2025-02-21 北京开源芯片研究院 A verification method, device, electronic device and readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118133282A (en) * 2024-03-13 2024-06-04 北京江民新科技术有限公司 Cross-platform antivirus method and system based on mobile equipment
CN119025157A (en) * 2024-10-28 2024-11-26 西安星源博锐新能源技术有限公司 Online compilation and packaging method based on Buildroot
CN119494299A (en) * 2025-01-17 2025-02-21 北京开源芯片研究院 A verification method, device, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
US9996374B2 (en) Deployment and installation of updates in a virtual environment
US9779111B2 (en) Method and system for configuration of virtualized software applications
US9207934B2 (en) Method and system for virtualization of software applications
CN117591136A (en) Storage image generation method, device, computer equipment and storage medium
US10684846B2 (en) Using semantic annotations to control compatibility behaviors
CN109491695A (en) A kind of increment updating method of integrated Android application
US20190377662A1 (en) Identifying a source file for use in debugging compiled code
US10338910B2 (en) Multi-tenant upgrading
US10228993B2 (en) Data dump for a memory in a data processing system
US11113186B1 (en) Testing and publishing of resource handlers in a cloud environment
US12182602B2 (en) Provisioning DPU management operating systems using firmware capsules
CN114756290B (en) Operating system installation method, device and readable storage medium
CN115291946A (en) Hongmong system transplanting method, device, electronic equipment and readable medium
CN115129348A (en) Resource updating method, device and equipment of application program and readable storage medium
US10540151B1 (en) Graphical customization of a firmware-provided user interface (UI)
CN116225617A (en) Management migration method and device for container instance, electronic equipment and storage medium
CN102216901B (en) Component extension method and device
CN115113972A (en) Application transformation method, system, cluster, medium and program product
CN114880073B (en) A cloud application engine deployment method, device, equipment and storage medium for shielding web framework from users
CN117170640A (en) A component management method, device and readable storage medium for a low-code platform
CN113918244B (en) Thermal patch processing method and device
CN115145604A (en) Containerized electric power marketing system deployment method
CN119377015B (en) Method, device, equipment and storage medium for configuring mirror image memory
US12307278B1 (en) Infrastructure creation based on application code
CN118708189A (en) Code compilation method, device, computer equipment, storage medium and program product

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