CN117453223A - Image file generation method and device of operating system, computer equipment and medium - Google Patents

Image file generation method and device of operating system, computer equipment and medium Download PDF

Info

Publication number
CN117453223A
CN117453223A CN202311349376.9A CN202311349376A CN117453223A CN 117453223 A CN117453223 A CN 117453223A CN 202311349376 A CN202311349376 A CN 202311349376A CN 117453223 A CN117453223 A CN 117453223A
Authority
CN
China
Prior art keywords
source code
code file
file
compiling
operating system
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
CN202311349376.9A
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.)
Beijing Hexin Digital Technology Co ltd
Hexin Technology Co ltd
Original Assignee
Beijing Hexin Digital Technology Co ltd
Hexin 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 Beijing Hexin Digital Technology Co ltd, Hexin Technology Co ltd filed Critical Beijing Hexin Digital Technology Co ltd
Priority to CN202311349376.9A priority Critical patent/CN117453223A/en
Publication of CN117453223A publication Critical patent/CN117453223A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • 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
    • 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

Abstract

The present application relates to a method, an apparatus, a computer device, a storage medium, and a computer program product for generating an image file of an operating system, which can be used in the field of computer technology. The method comprises the following steps: identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file; determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between source code files; according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file; and carrying out fusion processing on the compiled files to obtain mirror image files of the operating system to be compiled. By adopting the method, the generation efficiency of the mirror image file of the operating system can be improved.

Description

Image file generation method and device of operating system, computer equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for generating an image file of an operating system.
Background
With the development of computer technology, operating systems have important applications in a wide variety of fields. By analysis of the operating system, it can be appreciated that the operating system is the core of the computer. Therefore, how to efficiently generate an image file of an operating system has become an important research direction.
The traditional technology generally realizes the generation of the mirror image file of the operating system by manually writing codes; however, this method requires a lot of manual processing time to generate the image file of the operating system, resulting in low efficiency of generating the image file of the operating system.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an image file generation method, apparatus, computer device, computer-readable storage medium, and computer program product for an operating system that can improve the efficiency of generating an image file for the operating system.
In a first aspect, the present application provides a method for generating an image file of an operating system. The method comprises the following steps:
identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
According to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file;
and carrying out fusion processing on the compiling files to obtain the mirror image file of the operating system to be compiled.
In one embodiment, according to the dependency relationship information of the source code file, in a target compiling environment corresponding to the source code file, compiling the source code file to obtain a compiled file corresponding to the source code file, including:
determining the compiling sequence of the source code file according to the source code file dependency relationship information;
and according to the compiling sequence, compiling the source code files in a target compiling environment corresponding to each source code file to obtain compiling files corresponding to the source code files.
In one embodiment, before compiling the source code file in the target compiling environment corresponding to each source code file according to the compiling sequence to obtain the compiled file corresponding to the source code file, the method further includes:
constructing an isolated compiling environment corresponding to each source code file; the isolated compiling environment is used for isolating from the host system environment;
And taking the isolated compiling environment corresponding to each source code file as a target compiling environment corresponding to each source code file.
In one embodiment, the identifying the source code file of the operating system to be compiled to obtain the dependency information corresponding to the source code file includes:
identifying target field information from a source code file of an operating system to be compiled; the target field information is used for recording the dependency information corresponding to the source code file;
and extracting the dependency information corresponding to the source code file from the target field information.
In one embodiment, identifying the target field information from the source code file of the operating system to be compiled includes:
identifying a target subfile from a plurality of subfiles in a source code file of an operating system to be compiled; the target subfile is used for recording the description information of the source code file;
and identifying field information corresponding to the target field identification from the target subfile as the target field information.
In one embodiment, the determining, according to the dependency information, the dependency information of the source code file of the operating system to be compiled includes:
Identifying the dependency information to obtain a dependency relationship corresponding to each source code file;
carrying out fusion processing on the dependency relationship corresponding to each source code file to obtain a source code file dependency relationship tree;
and taking the source code file dependency relationship tree as source code file dependency relationship information of the operating system to be compiled.
In one embodiment, the fusing the compiled files to obtain the image file of the operating system to be compiled includes:
carrying out fusion processing on the compiling files to obtain fusion compiling files;
and carrying out mirror image processing on the fusion compiling file by utilizing a mirror image construction instruction to obtain a mirror image file of the operating system to be compiled.
In one embodiment, the method further comprises:
displaying image file generation process information of the operating system to be compiled through a display page associated with the operating system to be compiled; the image file generation process information at least comprises one or more of the source code file, dependency information corresponding to the source code file, a compiling file corresponding to the source code file, dependency relationship information of the source code file and an image file of the operating system to be compiled.
In a second aspect, the present application further provides an image file generating device of the operating system. The device comprises:
the file identification module is used for identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
the information determining module is used for determining the source code file dependency relationship information of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
the file compiling module is used for compiling the source code file in a target compiling environment corresponding to the source code file according to the source code file dependency relationship information to obtain a compiling file corresponding to the source code file;
and the file fusion module is used for carrying out fusion processing on the compiled files to obtain mirror image files of the operating system to be compiled.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
Determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file;
and carrying out fusion processing on the compiling files to obtain the mirror image file of the operating system to be compiled.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file;
And carrying out fusion processing on the compiling files to obtain the mirror image file of the operating system to be compiled.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file;
and carrying out fusion processing on the compiling files to obtain the mirror image file of the operating system to be compiled.
The image file generating method, the image file generating device, the computer equipment, the storage medium and the computer program product of the operating system identify the source code file of the operating system to be compiled, and obtain the dependency information corresponding to the source code file; determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files; according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file; and carrying out fusion processing on the compiling files to obtain the mirror image file of the operating system to be compiled. The scheme is characterized in that the dependency information of each source code file is obtained by identifying the source code file of an operating system to be compiled; according to the dependency information, determining dependency relationship information between source code files of an operating system to be compiled, wherein the dependency relationship information is used for describing the dependency relationship between the source code files; in a target compiling environment corresponding to the source code file, compiling the source code file according to the dependency relationship information to generate a corresponding compiling file; fusing the compiled files to generate mirror image files of the operating system to be compiled; through the steps, the identification, the dependency relationship determination, the compiling processing and the fusion processing of the source code file of the operating system to be compiled can be automatically realized, and finally the image file of the operating system is generated, so that the generating efficiency and the accuracy of the image file of the operating system are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for a person having ordinary skill in the art.
FIG. 1 is a flow diagram of a method for image file generation of an operating system in one embodiment;
FIG. 2 is a flow diagram that illustrates the steps of generating a compiled file in one embodiment;
FIG. 3 is a flowchart illustrating steps for building a target compilation environment in one embodiment;
FIG. 4 is a flowchart illustrating steps for extracting dependency information in one embodiment;
FIG. 5 is a schematic diagram illustrating an architecture of an image file generation method of an operating system in one embodiment;
FIG. 6 is a program directory diagram of a method for generating an image file of an operating system in one embodiment;
FIG. 7 is a block diagram of an image file generation device of an operating system in one embodiment;
fig. 8 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use, and processing of the related data are required to meet the related regulations.
In an exemplary embodiment, as shown in fig. 1, there is provided a method for generating an image file of an operating system, and the embodiment is applied to a terminal for illustration by the method; it will be appreciated that the method may also be applied to a server, and may also be applied to a system comprising a terminal and a server, and implemented by interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and the like; the server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers. In this embodiment, the method includes the steps of:
Step S101, identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file.
The source code file may be a source code file, for example, the source code file may be a source code package.
The dependency information corresponding to the source code file may be other source code files on which the source code file depends, for example, the dependency information corresponding to the source code file may include information such as other source code files, library files, tools, and the like on which the source code file depends.
Optionally, the terminal identifies the source code files of the operating system to be compiled, and identifies the dependency information corresponding to each source code file.
For example, the terminal scans a source code file of an operating system to be compiled to obtain a path, a name and other related information of the source code file; according to the type and format of the source code file, a corresponding analyzer is used for analyzing the source code file; in the process of analyzing the source code file, the dependency information in the source code file is identified.
Step S102, determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between source code files.
The source code file dependency relationship information may be used to represent the dependency relationship between the source code files.
Optionally, the terminal determines the dependency relationship between the source code files of the operating system to be compiled according to the dependency information of the source code files; and taking the dependency relationship between the source code files as the source code file dependency relationship information of the operating system to be compiled.
And step S103, according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file.
The target compiling environment may be a target environment for compiling an operating system, including a compiler, a library file, a tool chain, and the like, for example.
The compiled file may be a file generated by compiling a source code file, and may be a software package, for example, an rpm (Red Hat Package Manager, software package format under a software package management system) package.
Optionally, the terminal compiles the corresponding source code files in the target compiling environment corresponding to each source code file according to the source code file dependency relationship information, and generates compiling files corresponding to each source code file.
And step S104, fusing the compiled files to obtain mirror image files of the operating system to be compiled.
The fusion process may include operations such as file copying, file merging, file compression, and the like.
The image file may be a file containing a complete operating system, and may be used to install, deploy, and run the operating system.
Optionally, the terminal performs fusion processing on the compiled files, and integrates each compiled file into an image file of a complete operating system.
In the image file generation method of the operating system, the source code file of the operating system to be compiled is identified, and the dependency information corresponding to the source code file is obtained; determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between source code files; according to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file; and carrying out fusion processing on the compiled files to obtain mirror image files of the operating system to be compiled. The scheme is characterized in that the dependency information of each source code file is obtained by identifying the source code file of an operating system to be compiled; according to the dependency information, determining dependency relationship information between source code files of an operating system to be compiled, wherein the dependency relationship information is used for describing the dependency relationship between the source code files; in a target compiling environment corresponding to the source code file, compiling the source code file according to the dependency relationship information to generate a corresponding compiling file; fusing the compiled files to generate mirror image files of the operating system to be compiled; through the steps, the identification, the dependency relationship determination, the compiling processing and the fusion processing of the source code file of the operating system to be compiled can be automatically realized, and finally the image file of the operating system is generated, so that the generating efficiency and the accuracy of the image file of the operating system are improved.
In an exemplary embodiment, as shown in fig. 2, in step S103, according to the dependency information of the source code file, in a target compiling environment corresponding to the source code file, compiling the source code file to obtain a compiled file corresponding to the source code file, which specifically includes the following contents:
step S201, determining the compiling sequence of the source code file according to the dependency relationship information of the source code file;
step S202, compiling the source code files in a target compiling environment corresponding to each source code file according to the compiling sequence to obtain compiling files corresponding to the source code files.
Optionally, the terminal determines the compiling sequence of the source code files according to the dependency relationship information of the source code files, wherein the dependency relationship information can indicate which source code files need to be compiled first and which source code files depend on the compiling results of other source code files; and according to the determined compiling sequence, compiling the source code files in the target compiling environment corresponding to each source code file.
According to the technical scheme provided by the embodiment, the source code files are compiled according to the compiling sequence, so that the compiling files corresponding to the source code files can be obtained more efficiently and accurately, and the generation efficiency and the accuracy of the image files of the operating system can be improved.
In an exemplary embodiment, as shown in fig. 3, in the foregoing step, in the target compiling environment corresponding to each source code file according to the compiling sequence, the compiling process is performed on the source code file, and before the compiling file corresponding to the source code file is obtained, the method further includes a step of constructing the target compiling environment, specifically including the following contents:
step S301, constructing an isolated compiling environment corresponding to each source code file; the isolated compiling environment is used for isolating from the host system environment;
step S302, taking the isolated compiling environment corresponding to each source code file as the target compiling environment corresponding to each source code file.
The isolated compiling environment can be used for being isolated from the host system environment, so that the compiling process of the source code file is prevented from being influenced by the host system environment.
The host system environment may be a system environment of the terminal.
Optionally, before compiling the source code files according to the determined compiling sequence, the terminal constructs an isolated compiling environment for each source code file to obtain an isolated compiling environment corresponding to each source code file; and taking the isolated compiling environment corresponding to each source code file as a target compiling environment of the source code file.
According to the technical scheme provided by the embodiment, the target compiling environment isolated from the host system environment is constructed, so that the compiling process of the source code file is prevented from being influenced by the host system environment, and the generating accuracy of the compiling file corresponding to the source code file is improved.
In an exemplary embodiment, as shown in fig. 4, in step S101, a source code file of an operating system to be compiled is identified to obtain dependency information corresponding to the source code file, which specifically includes the following contents:
step S401, identifying target field information from a source code file of an operating system to be compiled; the target field information is used for recording the dependency information corresponding to the source code file;
step S402, extracting the dependency information corresponding to the source code file from the target field information.
The target field information may include dependency information corresponding to the source code file.
Optionally, the terminal identifies target field information from a source code file of the operating system to be compiled, wherein the target field information can be information of other files or libraries on which the source code file depends recorded in the source code file; and extracting the dependency information corresponding to the source code file from the target field information, wherein the dependency information can be used for a subsequent compiling process, and ensuring that the required dependency file can be correctly introduced and used.
According to the technical scheme provided by the embodiment, the dependency information corresponding to the source code file is extracted from the target field information, so that the dependency information corresponding to the source code file can be obtained more efficiently and accurately, and the generation efficiency and the accuracy of the mirror image file of the operating system can be improved.
In an exemplary embodiment, in the step, the identifying the target field information from the source code file of the operating system to be compiled specifically includes the following contents: identifying a target subfile from a plurality of subfiles in a source code file of an operating system to be compiled; the target sub-file is used for recording the description information of the source code file; and identifying field information corresponding to the target field identification from the target subfile as target field information.
The target subfile may be a subfile that includes description information or definition information of the source code file, for example, the target subfile may be a spec (Specification) file in the source code file.
The description information may be information for describing various metadata information (such as name, version, license, etc.) of the source code file and detailed process description from source code to compilation installation.
Wherein the target field identification may be BuildRequires.
The field information corresponding to the target field identifier may be information of a BuildRequires field.
Optionally, the terminal identifies and selects a target subfile from a plurality of subfiles contained in a source code file of the operating system to be compiled; and identifying and extracting field information corresponding to the target field identification from the target subfile.
For example, the terminal traverses a source code file of an operating system to be compiled, including a plurality of subfiles therein; identifying the target subfiles in a preset mode (such as according to file names, file paths or specific identifiers) in the process of traversing the source code files; and extracting field information corresponding to the target field identification from the target subfile by analyzing the content of the target subfile.
According to the technical scheme provided by the embodiment, the target field information corresponding to the target field identification is identified from the target subfiles, so that the target field information can be identified more efficiently and accurately, and the generation efficiency and the accuracy of the image file of the operating system can be improved.
In an exemplary embodiment, in step S102, the source code file dependency information of the operating system to be compiled is determined according to the dependency information, which specifically includes the following contents: identifying the dependency information to obtain a dependency relationship corresponding to each source code file; carrying out fusion processing on the dependency relationship corresponding to each source code file to obtain a source code file dependency relationship tree; and taking the source code file dependency relationship tree as source code file dependency relationship information of the operating system to be compiled.
Wherein, the dependency relationship may be a reference relationship or a dependency relationship between source code files.
The dependency relationship tree of the source code files can be a result of showing the dependency relationship among the source code files in a tree structure, and can help to understand and manage the dependency relationship among the source code files.
Optionally, the terminal identifies the dependency information contained in each source code file to obtain a dependency relationship corresponding to each source code file; the dependency relationship of each source code file is fused to obtain a source code file dependency relationship tree, wherein the source code file dependency relationship tree can clearly show the dependency relationship among the source code files, and is helpful for understanding and managing the construction process of the whole operation system; and taking the source code file dependency relationship tree as source code file dependency relationship information of the operating system to be compiled.
According to the technical scheme provided by the embodiment, the source code file dependency relationship tree is used as the source code file dependency relationship information of the operating system to be compiled, so that accurate and visual source code file dependency relationship information can be obtained, understanding and management of the dependency relationship between source code files can be facilitated, and the generation accuracy of the mirror image file of the operating system can be improved.
In an exemplary embodiment, in step S104, the fusing process is performed on the compiled file to obtain an image file of the operating system to be compiled, which specifically includes the following contents: carrying out fusion processing on the compiled files to obtain fusion compiled files; and carrying out mirror image processing on the fusion compiling file by utilizing the mirror image construction instruction to obtain a mirror image file of the operating system to be compiled.
The fused compiled file may be a total compiled file after the compiled files are fused or combined, and the fused compiled file may include all components and dependency items required by the operating system to be compiled.
The image construction instruction may be an instruction or tool for converting the compiled file into an executable image file format, for example, the image construction instruction may be an instruction corresponding to an image file construction program.
The image processing may be processing such as converting the fused compiled file to generate an image file of the final operating system to be compiled.
Optionally, the terminal performs fusion processing on the compiled files, and merges a plurality of compiled files into one fused compiled file; and carrying out mirror image processing on the fusion compiled file by using a mirror image construction instruction to generate a mirror image file of the operating system to be compiled, wherein the mirror image construction instruction can be a specific command or tool for converting the fusion compiled file into a file in an executable mirror image file format.
According to the technical scheme, the image processing is carried out on the fusion compiled file, so that the image file of the operating system to be compiled can be obtained more accurately, and the generation accuracy of the image file of the operating system can be improved.
In an exemplary embodiment, the method further includes the step of displaying information, and specifically includes the following: displaying the image file generation process information of the operating system to be compiled through a display page associated with the operating system to be compiled; the image file generating process information at least comprises one or more of a source code file, dependency information corresponding to the source code file, a compiling file corresponding to the source code file, source code file dependency relationship information and an image file of an operating system to be compiled.
The presentation page may be a user interface associated with the operating system to be compiled, for presenting information of the image file generating process, for example, the presentation page may be a web page or other form of user interface for presenting the image file generating process or the building process of the operating system to be compiled to a user.
The image file generating process information may be related information obtained in the construction process of the operating system to be compiled, and the related information includes one or more of a source code file, dependency information corresponding to the source code file, a compiled file corresponding to the source code file, dependency relationship information of the source code file, and an image file of the operating system to be compiled.
Optionally, the terminal creates a display page associated with the operating system to be compiled, for displaying information of the image file generating process; acquiring relevant information from the construction process of the operating system to be compiled, wherein the relevant information comprises one or more of a source code file, dependency information corresponding to the source code file, a compiling file corresponding to the source code file, dependency relationship information of the source code file and an image file of the operating system to be compiled; and displaying the acquired image file generation process information on a display page associated with the operating system to be compiled.
According to the technical scheme, the image file generation process information of the operating system to be compiled is displayed through the display page, so that a user can know the image file generation process or the construction process of the operating system to be compiled through the display page, and the image file generation process comprises compiling of a source code file, analysis of a dependency relationship, generation of a compiled file and generation of a final image file, and therefore visualization and manageability of image file generation of the operating system are improved, and the user can better know and control the image file generation process.
The following describes an image file generating method of an operating system provided by the present application in an embodiment, where the method is applied to a terminal to illustrate, and the main steps include:
The method comprises the steps that firstly, a terminal identifies a target subfile from a plurality of subfiles in a source code file of an operating system to be compiled; the target sub-file is used for recording the description information of the source code file; identifying field information corresponding to the target field identifier from the target subfile as target field information; the target field information is used for recording the dependency information corresponding to the source code file; and extracting the dependency information corresponding to the source code file from the target field information.
Secondly, the terminal identifies the dependency information to obtain the dependency relationship corresponding to each source code file; carrying out fusion processing on the dependency relationship corresponding to each source code file to obtain a source code file dependency relationship tree; and taking the source code file dependency relationship tree as source code file dependency relationship information of the operating system to be compiled.
And thirdly, determining the compiling sequence of the source code file by the terminal according to the dependency relationship information of the source code file.
Fourthly, the terminal constructs an isolated compiling environment corresponding to each source code file; the isolated compiling environment is used for isolating from the host system environment; and taking the isolated compiling environment corresponding to each source code file as a target compiling environment corresponding to each source code file.
And fifthly, compiling the source code files in a target compiling environment corresponding to each source code file according to the compiling sequence by the terminal to obtain compiling files corresponding to the source code files.
Sixthly, the terminal performs fusion processing on the compiled files to obtain fusion compiled files; and carrying out mirror image processing on the fusion compiling file by utilizing the mirror image construction instruction to obtain a mirror image file of the operating system to be compiled.
Seventh, the terminal displays the image file generation process information of the operating system to be compiled through a display page associated with the operating system to be compiled; the image file generating process information at least comprises one or more of a source code file, dependency information corresponding to the source code file, a compiling file corresponding to the source code file, source code file dependency relationship information and an image file of an operating system to be compiled.
According to the technical scheme provided by the embodiment, the source code files of the operating system to be compiled are identified, and the dependency information of each source code file is obtained; according to the dependency information, determining dependency relationship information between source code files of an operating system to be compiled, wherein the dependency relationship information is used for describing the dependency relationship between the source code files; in a target compiling environment corresponding to the source code file, compiling the source code file according to the dependency relationship information to generate a corresponding compiling file; fusing the compiled files to generate mirror image files of the operating system to be compiled; through the steps, the identification, the dependency relationship determination, the compiling processing and the fusion processing of the source code file of the operating system to be compiled can be automatically realized, and finally the image file of the operating system is generated, so that the generating efficiency and the accuracy of the image file of the operating system are improved.
The following describes an image file generating method of an operating system provided by the present application with an application example, and the application example is applied to a terminal by the method for illustration, where the software architecture can refer to fig. 5, and the main steps include:
the method comprises the steps that firstly, a build Requires field is used in a spec file of a source code package of a terminal to define a dependency program needed by compiling the source code package, the terminal uses a command through a system package dependency analysis program to analyze all the source code compiled dependency packages, records the dependency condition of each source code to be compiled through a key-value mode, and after the dependency is analyzed, regression call traversal is conducted on the dependency of each source code package until no dependency is found, a dependency relation tree is formed and then the dependency relation tree is stored in a mysql (relational database management system) database.
The second step, the terminal can display (browser displays) the information such as the dependence condition, compiling version and the like of each software package through the page; specific software packages can be selected for viewing and compiling, all software packages on a dependency link can be selected for compiling from scratch, all packages can be compiled by one key, and an iso (mirror file format) mirror image is finally generated; and checking log information of compiling failure, carrying out source code modification on the page, recording the modified version and then restarting compiling.
And thirdly, the execution script (callable execution script) of the terminal can be called by the page, and all execution operations of the page need to be called to the appointed script, so that the terminal completes the automatic management of the whole compiling flow, and can manage all compiled code versions and generated rpm package versions.
And fourthly, the terminal calls an rpm package construction program (software package construction program) through a script to construct a special cross-compiling environment for each piece of software to be compiled, isolates the special cross-compiling environment from the host system environment, avoids the pollution of the program, and compiles a corresponding rpm package.
And fifthly, after the software is completely finished and the rpm package is generated, the terminal invokes an iso construction program (an image file construction program) through a script to start to generate an iso image, so that the construction of the whole operating system is completed.
Referring to fig. 6, a root directory in a directory architecture of a program directory may include a bin (binary), an html (Hypertext Markup Language ), a lib (library file), a log (log file), a source (source), and a target (target file), where the bin is used to store an executable script, the html is used to store a visual html webpage, the lib is used to store a database driver, the log is used to store a log file during execution of software, the source is used to store a related software package of an operating system to be compiled, and the target is used to store an iso version file after compiling is completed.
Wherein, the script can be different forms of script; the software package dependency analysis algorithm can be implemented in different languages; the page display related program may be middleware such as ngix, which is a high performance http (Hypertext Transfer Protocol ) and reverse proxy web (network) server, or tomcat, which is a web application server.
The terminal generates executable scripts and webpages, links the rpm package construction program, the iso construction program, the system package dependency analysis program and other scattered programs, performs unified flow management from the rpm package construction to the iso image (image file) generation, and can use html pages to control the compiling process of each software and the compiling process of the whole operating system dependent package, including the construction of compiling environment, the compiling of opening software, the browsing of error logs, the source code page modification and version control, the final generation of the rpm package and the final construction of the iso image.
According to the technical scheme provided by the application example, the used compiling tool and the rpm package constructing tool are connected, batch compiling is carried out, and independent compiling of software is not needed; using a visual interface to carry out visual management on the whole compiling process of software, including source code management, compiling process management, error log checking management, rpm package management and target iso (mirror image file format) version file management; the individual software packages can be repeatedly compiled on the page for a plurality of times until the required version is successfully compiled; related packages on a certain dependency line can be compiled in batches on the page until a required version is successfully compiled; after compiling all the dependent software environments, all the software packages can be compiled by one key and an iso image (image file) can be generated; the dependency relationship of the software is arranged by using an algorithm to form a dependency relationship tree, and the compiling sequence of the software is clear at a glance; linking various software and steps required by the construction of the existing operating system by using scripts to form automatic operating system construction software; the browser page is used for carrying out visual operation on the whole construction flow, and the construction progress of an operating system and the problems are clear at a glance; integrating all key nodes for constructing an operating system to form an automatic construction mode; the software package dependency analysis algorithm can analyze the dependency of all packages and form a dependency tree on a page for display; the generation efficiency and the accuracy of the mirror image file of the operating system are improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides an image file generating device of the operating system for realizing the image file generating method of the operating system. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the image file generating device for one or more operating systems provided below may refer to the limitation of the image file generating method for an operating system hereinabove, and will not be repeated herein.
In an exemplary embodiment, as shown in fig. 7, there is provided an image file generating apparatus of an operating system, the apparatus 700 may include:
the file identification module 701 is configured to identify a source code file of an operating system to be compiled, so as to obtain dependency information corresponding to the source code file;
the information determining module 702 is configured to determine dependency information of a source code file of an operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between source code files;
the file compiling module 703 is configured to compile the source code file in a target compiling environment corresponding to the source code file according to the dependency relationship information of the source code file, to obtain a compiled file corresponding to the source code file;
and the file fusion module 704 is used for carrying out fusion processing on the compiled files to obtain mirror image files of the operating system to be compiled.
In an exemplary embodiment, the file compiling module 703 is further configured to determine a compiling order of the source code file according to the source code file dependency relationship information; and according to the compiling sequence, compiling the source code files in a target compiling environment corresponding to each source code file to obtain compiling files corresponding to the source code files.
In an exemplary embodiment, the apparatus 700 further comprises: the environment construction module is used for constructing isolation compiling environments corresponding to the source code files; the isolated compiling environment is used for isolating from the host system environment; and taking the isolated compiling environment corresponding to each source code file as a target compiling environment corresponding to each source code file.
In an exemplary embodiment, the file identifying module 701 is further configured to identify target field information from a source code file of an operating system to be compiled; the target field information is used for recording the dependency information corresponding to the source code file; and extracting the dependency information corresponding to the source code file from the target field information.
In an exemplary embodiment, the file identifying module 701 is further configured to identify a target subfile from a plurality of subfiles in a source code file of an operating system to be compiled; the target sub-file is used for recording the description information of the source code file; and identifying field information corresponding to the target field identification from the target subfile as target field information.
In an exemplary embodiment, the information determining module 702 is further configured to identify dependency information, so as to obtain a dependency relationship corresponding to each source code file; carrying out fusion processing on the dependency relationship corresponding to each source code file to obtain a source code file dependency relationship tree; and taking the source code file dependency relationship tree as source code file dependency relationship information of the operating system to be compiled.
In an exemplary embodiment, the file fusion module 704 is further configured to fuse the compiled files to obtain fused compiled files; and carrying out mirror image processing on the fusion compiling file by utilizing the mirror image construction instruction to obtain a mirror image file of the operating system to be compiled.
In an exemplary embodiment, the apparatus 700 further comprises: the information display module is used for displaying the image file generation process information of the operating system to be compiled through a display page associated with the operating system to be compiled; the image file generating process information at least comprises one or more of a source code file, dependency information corresponding to the source code file, a compiling file corresponding to the source code file, source code file dependency relationship information and an image file of an operating system to be compiled.
The modules in the image file generating device of the operating system may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In an exemplary embodiment, a computer device, which may be a terminal, is provided, and an internal structure thereof may be as shown in fig. 8. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method for generating an image file of an operating system. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, a computer device is also provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method embodiments described above.
In an exemplary embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (12)

1. A method for generating an image file of an operating system, the method comprising:
identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
determining the dependency relationship information of the source code file of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
According to the dependency relationship information of the source code file, compiling the source code file in a target compiling environment corresponding to the source code file to obtain a compiling file corresponding to the source code file;
and carrying out fusion processing on the compiling files to obtain the mirror image file of the operating system to be compiled.
2. The method according to claim 1, wherein the compiling the source code file in the target compiling environment corresponding to the source code file according to the source code file dependency relationship information to obtain the compiling file corresponding to the source code file includes:
determining the compiling sequence of the source code file according to the source code file dependency relationship information;
and according to the compiling sequence, compiling the source code files in a target compiling environment corresponding to each source code file to obtain compiling files corresponding to the source code files.
3. The method according to claim 2, wherein before performing compiling processing on the source code file in the target compiling environment corresponding to each source code file according to the compiling sequence to obtain the compiled file corresponding to the source code file, the method further comprises:
Constructing an isolated compiling environment corresponding to each source code file; the isolated compiling environment is used for isolating from the host system environment;
and taking the isolated compiling environment corresponding to each source code file as a target compiling environment corresponding to each source code file.
4. The method of claim 1, wherein identifying the source code file of the operating system to be compiled to obtain the dependency information corresponding to the source code file comprises:
identifying target field information from a source code file of an operating system to be compiled; the target field information is used for recording the dependency information corresponding to the source code file;
and extracting the dependency information corresponding to the source code file from the target field information.
5. The method of claim 4, wherein identifying the target field information from the source code file of the operating system to be compiled comprises:
identifying a target subfile from a plurality of subfiles in a source code file of an operating system to be compiled; the target subfile is used for recording the description information of the source code file;
and identifying field information corresponding to the target field identification from the target subfile as the target field information.
6. The method according to claim 1, wherein the determining the source code file dependency information of the operating system to be compiled according to the dependency information includes:
identifying the dependency information to obtain a dependency relationship corresponding to each source code file;
carrying out fusion processing on the dependency relationship corresponding to each source code file to obtain a source code file dependency relationship tree;
and taking the source code file dependency relationship tree as source code file dependency relationship information of the operating system to be compiled.
7. The method of claim 1, wherein the fusing the compiled files to obtain the image file of the operating system to be compiled comprises:
carrying out fusion processing on the compiling files to obtain fusion compiling files;
and carrying out mirror image processing on the fusion compiling file by utilizing a mirror image construction instruction to obtain a mirror image file of the operating system to be compiled.
8. The method according to any one of claims 1 to 7, further comprising:
displaying image file generation process information of the operating system to be compiled through a display page associated with the operating system to be compiled; the image file generation process information at least comprises one or more of the source code file, dependency information corresponding to the source code file, a compiling file corresponding to the source code file, dependency relationship information of the source code file and an image file of the operating system to be compiled.
9. An image file generation device of an operating system, the device comprising:
the file identification module is used for identifying a source code file of an operating system to be compiled to obtain dependency information corresponding to the source code file;
the information determining module is used for determining the source code file dependency relationship information of the operating system to be compiled according to the dependency information; the source code file dependency relationship information is used for describing the dependency relationship between the source code files;
the file compiling module is used for compiling the source code file in a target compiling environment corresponding to the source code file according to the source code file dependency relationship information to obtain a compiling file corresponding to the source code file;
and the file fusion module is used for carrying out fusion processing on the compiled files to obtain mirror image files of the operating system to be compiled.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 8 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 8.
CN202311349376.9A 2023-10-17 2023-10-17 Image file generation method and device of operating system, computer equipment and medium Pending CN117453223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311349376.9A CN117453223A (en) 2023-10-17 2023-10-17 Image file generation method and device of operating system, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311349376.9A CN117453223A (en) 2023-10-17 2023-10-17 Image file generation method and device of operating system, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN117453223A true CN117453223A (en) 2024-01-26

Family

ID=89592101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311349376.9A Pending CN117453223A (en) 2023-10-17 2023-10-17 Image file generation method and device of operating system, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN117453223A (en)

Similar Documents

Publication Publication Date Title
US10310701B2 (en) Software robots for programmatically controlling computer programs to perform tasks
WO2018228211A1 (en) Application conversion method, apparatus and device
JP2019516167A (en) Tools and methods for a real time data flow programming language
US11675575B2 (en) Checking source code validity at time of code update
Lampa et al. SciPipe: A workflow library for agile development of complex and dynamic bioinformatics pipelines
US9952835B2 (en) Generation of hybrid enterprise mobile applications in cloud environment
US9015608B2 (en) Regenerating a user interface area
US20170054790A1 (en) System and Method for Object Compression and State Synchronization
US20180136930A1 (en) Automated identification of code dependency
CN113868126A (en) Application debugging method, device and storage medium of equipment
CN113962597A (en) Data analysis method and device, electronic equipment and storage medium
CN113377342B (en) Project construction method and device, electronic equipment and storage medium
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
Oliveira pytest Quick Start Guide: Write better Python code with simple and maintainable tests
CN117453223A (en) Image file generation method and device of operating system, computer equipment and medium
CN114253537A (en) Form generation method and device, electronic equipment and storage medium
CN111221610B (en) Page element acquisition method and device
CN111694729A (en) Application testing method and device, electronic equipment and computer readable medium
CN114721932A (en) Data processing method, device, equipment and storage medium
CN111125565A (en) Method and equipment for inputting information in application
CN116028108B (en) Method, device, equipment and storage medium for analyzing dependent package installation time
Campesato Angular and Machine Learning Pocket Primer
CN115658023B (en) Building cockpit system generation method, device, equipment, medium and product
CN115904483A (en) Interface document generation method and device, medium and computer equipment
CN117950991A (en) Program testing method, device, electronic equipment and computer readable storage medium

Legal Events

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