Operating system mirror image generation method and device and operating system mirror image installation method and device

By processing image creation instructions to generate customized software directories and index files, the problem of not being able to customize the installation of different versions of software images in traditional technologies is solved, and customized installation of multiple version images is realized.

CN121116331APending Publication Date: 2025-12-12ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511197969.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Traditional methods for generating custom operating system images cannot achieve customized installation of operating system images for different software versions.

Method used

By processing the image creation instructions sequentially, a custom software directory and image index file are created in the operating system image folder according to the software requirements. The custom software directory is then de-interferenced, boot entries and installation logic are written into it, and finally the image folder is packaged to generate multiple versions of the image.

Benefits of technology

It enables customized installation of operating system images for different software versions, ensuring that the image folder contains the index information of the target software package, and supports selecting different software versions of the image for installation by triggering different boot entries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121116331A_ABST
    Figure CN121116331A_ABST
Patent Text Reader

Abstract

The invention relates to an operating system mirror image generation method and device and an operating system mirror image installation method and device. The operating system mirror image generation method comprises the steps of processing received different mirror image creation instructions in sequence, and creating a customized software directory and a mirror image index file in a corresponding mirror image folder of an operating system according to software requirements corresponding to the mirror image creation instructions in the process of processing each mirror image creation instruction, performing interference removal processing on the customized software directory to remove interference on the processing process of the next mirror image creation instruction; writing a starting entry corresponding to each processed mirror image creation instruction in a basic mirror image of the operating system, and writing installation logic corresponding to each processed mirror image creation instruction in a mirror image folder; and packaging the mirror image folder to obtain a multi-version mirror image of the operating system. By adopting the method, operation system mirror image customized installation for different versions of software can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the software technical field, in particular to an operating system image generation method and device, and an operating system image installation method and device. BACKGROUND

[0002] An operating system image is a clone file of all data of an operating system installed in a storage device, including but not limited to a hard disk, a floppy disk, a magnetic tape, an optical disc, a flash disk, etc. With the development of software technology, the difference in the demand for operating system images by different users leads to the fact that the basic image of the operating system cannot meet the demand of all users, resulting in an increasing number of users using customized images of the operating system.

[0003] In the traditional technology, the generation method of the customized image of the operating system is to modify the basic image of the operating system locally, and specifically, an image file operation tool can be used to perform operations such as decompression, module cutting, kernel replacement, initialization setting, and adding or deleting installation packages on the basic image, and then compressing to form a customized image.

[0004] However, in the above traditional technology, when different users need to install different versions of software during the installation of the operating system image, the customized installation of the operating system image for different versions of software cannot be achieved. SUMMARY

[0005] Therefore, it is necessary to provide an operating system image generation method and device, and an operating system image installation method and device, to achieve the customized installation of the operating system image for different versions of software.

[0006] In a first aspect, the present application provides an operating system image generation method, comprising:

[0007] The received different image creation instructions are processed in sequence, and in the process of processing each image creation instruction, a customized software directory and an image index file are created in an operating system corresponding image folder according to the software demand corresponding to the image creation instruction, and the customized software directory is subjected to interference removal processing to remove the interference on the processing process of the next image creation instruction;

[0008] A start entry corresponding to each processed image creation instruction is written in the basic image of the operating system, and an installation logic corresponding to each processed image creation instruction is written in the image folder;

[0009] The image folder is packaged to obtain a multi-version image of the operating system;

[0010] The mirror folder includes a basic image of an operating system, the customized software directory includes a customized software package corresponding to the software requirement, the software corresponding to the customized software package belongs to software corresponding to a basic software package of the basic image, and versions of the customized software package and the basic software package are different, and the mirror index file records index information of a target software package, and the target software package is a software package in the customized software package and the basic software package.

[0011] In one of the embodiments, the customized software directory and the mirror index file are created in the mirror folder corresponding to the operating system according to the software requirement corresponding to the mirror creation instruction, and the creation includes:

[0012] An initial directory is created under an update directory of the mirror folder corresponding to the operating system.

[0013] Package information of a customized software package corresponding to the software requirement is determined according to the software requirement corresponding to the mirror creation instruction.

[0014] The customized software package corresponding to the software requirement is stored into the initial directory according to the package information of the customized software package, so as to obtain the customized software directory.

[0015] The mirror index file is created according to the package information of the customized software package and package information of a basic software package.

[0016] In one of the embodiments, the package information includes software identification and version information, and the mirror index file is created according to the package information of the customized software package and the package information of the basic software package, and the creation includes:

[0017] Each group of software packages with the same software identification in the customized software package and the basic software package and independent software packages with different software identification from other software packages are determined by scanning the mirror folder.

[0018] The target software package is determined according to the independent software package and a specified software package with version information meeting a version requirement in each group of software packages.

[0019] The mirror index file is created in the mirror folder according to the index information of the target software package.

[0020] In one of the embodiments, the version of the customized software package is higher than the version of the basic software package, and the target software package is determined according to the independent software package and the specified software package with the version information meeting the version requirement in each group of software packages, and the determination includes:

[0021] The software package with the highest version indicated by the version information in each group of software packages is selected to obtain the specified software package.

[0022] The target software package is determined according to the specified software package and the independent software package.

[0023] In one of the embodiments, the interference-removed processing is performed on the customized software catalog, including:

[0024] The customized software catalog is compressed, and the uncompressed customized software catalog is deleted.

[0025] In one of the embodiments, a start item corresponding to each processed image creation instruction is written in a base image of the operating system, including:

[0026] A plurality of initial items are added in a boot configuration file of the base image; wherein the number of the plurality of initial items is the same as the number of the processed image creation instructions;

[0027] A parameter value is configured for a label parameter of each initial item; wherein the parameter value is a file identification of an image index file corresponding to any image creation instruction, and the parameter values configured for different initial items are different.

[0028] In one of the embodiments, before sequentially processing the received different image creation instructions, the operating system image generation method further includes:

[0029] In response to a folder creation instruction, an image folder corresponding to the operating system is created;

[0030] A base image of the operating system is downloaded;

[0031] The base image is copied into the image folder.

[0032] In a second aspect, the application further provides an operating system image installation method, including:

[0033] In response to a triggering operation on any start item in the multi-version image, a temporary installation environment in the multi-version image is loaded, and installation logic corresponding to the start item in the multi-version image is queried; wherein the multi-version image is generated based on any method embodiment of the operating system image generation method provided in the first aspect; and the temporary installation environment includes a running directory.

[0034] According to the installation logic, a local software source directory is created in the running directory, a base image in the multi-version image is soft linked to the local software source directory, and an image index file corresponding to the start item is copied into the local software source directory.

[0035] According to the image index file, a target software package corresponding to the start item is obtained from the multi-version image, and the target software package is installed to complete the installation of the operating system image.

[0036] In a third aspect, the application further provides an operating system image generation device, including:

[0037] The instruction processing module is configured to sequentially process different image creation instructions received, and in the process of processing each image creation instruction, create a customized software directory and an image index file in an operating system corresponding image folder according to a software requirement corresponding to the image creation instruction, and perform interference removal processing on the customized software directory to remove interference on the processing process of the next image creation instruction.

[0038] The information writing module is configured to write a start item corresponding to each processed image creation instruction in a basic image of the operating system, and write installation logic corresponding to each processed image creation instruction in the image folder.

[0039] The image generation module is configured to package the image folder to obtain a multi-version image of the operating system.

[0040] The image folder includes a basic image of the operating system, the customized software directory includes a customized software package corresponding to the software requirement, the software corresponding to the customized software package belongs to the software corresponding to the basic software package of the basic image, and the versions of the customized software package and the basic software package are different, the image index file records index information of a target software package, and the target software package is a software package in the customized software package and the basic software package.

[0041] In a fourth aspect, the present application further provides an operating system image installation device, comprising:

[0042] The operation response module is configured to load a temporary installation environment in the multi-version image and query installation logic corresponding to the start item in the multi-version image in response to a trigger operation on any start item in the multi-version image, wherein the multi-version image is generated by any method embodiment of the operating system image generation method provided in the first aspect, and the temporary installation environment includes a running directory.

[0043] The information linking module is configured to create a local software source directory in the running directory according to the installation logic, and soft link the basic image in the multi-version image to the local software source directory, and copy the image index file corresponding to the start item into the local software source directory.

[0044] The image installation module is configured to obtain a target software package corresponding to the start item from the multi-version image according to the image index file, and install the target software package to complete the installation of the operating system image.

[0045] In a fifth aspect, the present application further provides a computer device comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of each method embodiment provided in the first aspect or the steps of each method embodiment provided in the second aspect when executing the computer program.

[0046] In a sixth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method embodiments of the first aspect or the steps of the method embodiments of the second aspect.

[0047] In a seventh aspect, the present application also provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the method embodiments of the first aspect or the steps of the method embodiments of the second aspect.

[0048] The operating system image generation method, the operating system image installation method and the device provided by the above embodiments can sequentially process different image creation instructions received, and in the process of processing each image creation instruction, create a customized software directory and an image index file in an operating system corresponding image folder according to the software requirement corresponding to the image creation instruction, and perform interference removal processing on the customized software directory to remove interference on the processing process of the next image creation instruction, so as to obtain the customized software directory and the image index file corresponding to each image creation instruction. Then, the starting entry corresponding to each processed image creation instruction is written in the basic image of the operating system in the image folder, and the installation logic corresponding to each processed image creation instruction is written in the image folder, so as to obtain the installation logic and the image index file corresponding to each starting entry. After that, the image folder is packaged to obtain multiple versions of the operating system. In this way, since the customized software directory includes a customized software package different from the basic software version of the basic image, and the image folder records the index information of the target software package, different image index files created for different versions of software collection can exist in the multiple version image, and the different image index files correspond to the operating system image of different versions of software, so that the operating system image of different versions of software can be installed by triggering different starting entries to select different software versions of the operating system image, thereby realizing customized installation of the operating system image for different versions of software. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.

[0050] Figure 1 The flowchart of the operating system image generation method provided by some embodiments of the present application is shown in the figure.

[0051] Figure 2A flowchart of creating a customized software directory and an image index file is provided for some embodiments of the present application.

[0052] Figure 3 A flowchart of creating an image index file is provided for some embodiments of the present application.

[0053] Figure 4 A flowchart of determining a target software package is provided for some embodiments of the present application.

[0054] Figure 5 A flowchart of creating a startup entry is provided for some embodiments of the present application.

[0055] Figure 6 A flowchart of an operating system image generation method is provided for some embodiments of the present application.

[0056] Figure 7 A flowchart of an operating system image generation method is provided for some embodiments of the present application.

[0057] Figure 8 A flowchart of an operating system image installation method is provided for some embodiments of the present application.

[0058] Figure 9 A structural block diagram of an operating system image generation apparatus is provided for some embodiments of the present application.

[0059] Figure 10 A structural block diagram of an operating system image installation apparatus is provided for some embodiments of the present application.

[0060] Figure 11 An internal structural diagram of a computer device is provided for some embodiments of the present application.

[0061] Figure 12 An internal structural diagram of a computer device is provided for some embodiments of the present application. DETAILED DESCRIPTION

[0062] In order to make the objects, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0063] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "a plurality of" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the options or any combination of the options.

[0064] In the conventional technology, the generation method of the customized image of the operating system is to modify the basic image of the operating system locally. Specifically, the basic image can be decompressed, module cropped, kernel replaced, initialized, installed package added or deleted, etc. by using an image file operation tool, and then compressed to form a customized image. However, in the above conventional technology, when different users need to install different versions of software during operating system image installation, the customized installation of the operating system image for different versions of software cannot be realized.

[0065] To solve the above technical problems, in one exemplary embodiment, an operating system image generation method is provided, which can be used for a server. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0066] Before describing the operating system image generation method, the basic image of the operating system is first described.

[0067] The so-called basic image of the operating system refers to an original image file published by an official or authoritative agency and containing operating system core components and a minimized running environment, which contains the core kernel, initialization program, basic command tool and file system structure required for the operating system to start and run. Generally, the basic image of the operating system can be ISO (International Organization for Standardization image), VMDK (Virtual Machine Disk image), etc.

[0068] The so-called basic software package of the basic image refers to a minimized software set necessary for maintaining the normal operation of the operating system core function, which is officially screened and pre-installed. Optionally, the basic software package of the basic image is the minimum version of the software package.

[0069] The base image of the operating system includes a base index file, which records the index information of the above-mentioned base software package, for installing the base image when the operating system image is installed. The index information of the base software package is structured data for managing, retrieving and locating the base software package, containing unique identification, version, dependency, storage location and other key information of the base software package.

[0070] For example, in the case of ISO format of the base image, the base index file is repodata (Repository Data), which can be identified in the operating system image installation process.

[0071] In an exemplary embodiment, as shown in Figure 1 The operating system image generation method is applied to a server as an example, which can include the following steps:

[0072] S101, sequentially process the received different image creation instructions, and in the process of processing each image creation instruction, create a customized software directory and an image index file in the operating system corresponding image folder according to the software requirement corresponding to the image creation instruction, and perform interference removal processing on the customized software directory to remove the interference on the processing process of the next image creation instruction.

[0073] The image folder includes the base image of the operating system, the customized software directory includes the customized software package corresponding to the software requirement, the software corresponding to the customized software package belongs to the software corresponding to the base software package of the base image, and the versions of the customized software package and the base software package are different. The image index file records the index information of the target software package, and the target software package is a software package in the customized software package and the base software package.

[0074] In the process of generating multiple version images, the image folder corresponding to the operating system can be constructed in advance, and the base image of the operating system is stored in the image folder, that is, the image folder includes all the contents in the base image of the operating system. For example, create an ISO folder as the image folder corresponding to the operating system, and copy the base image of the operating system into the ISO folder.

[0075] Further, sequentially process the received different image creation instructions. Optionally, different image creation instructions can be received at the same time, and each image creation instruction can be processed in sequence, that is, after one image creation instruction is processed, the processing of the next image creation instruction is started. Alternatively, only one image creation instruction can be received at a time, and the image creation instruction is immediately processed, and then the next image creation instruction is received after the image creation instruction is processed, and so on.

[0076] The software requirement corresponding to the mirror creation instruction can be understood as a set of key information of a software package to be contained in the operating system mirror specified by the mirror creation instruction, which is used to indicate the type, version, and other information of the software package, to ensure that the operating system mirror contains the expected software environment after being generated.

[0077] In the process of processing each mirror creation instruction, the customized software package corresponding to the software requirement of the mirror creation instruction can be determined first. The software corresponding to the customized software package belongs to the software corresponding to the basic software package of the basic mirror, and the versions of the customized software package and the basic software package are different. That is, each customized software package is a software package with the same software as a basic software package but different versions. For example, the basic mirror includes a tar (Tape Archive, document archiving tool) software package with a version of 1.0, and the customized software package can include a tar software package with a version of 2.0.

[0078] Further, a customized software directory containing the customized software package is created, and a target software package is determined from the customized software package and the basic software package, and a mirror index file recording index information of the target software package is created. Similar to the basic software package, the index information of the target software package is structured data used to manage, retrieve, and locate the target software package, including unique identification, version, dependency relationship, storage location, and other key information of the basic software package.

[0079] The target software package is a set of software necessary for maintaining the normal operation of the operating system core function and pre-installed after official screening. Optionally, since each customized software package is a software package with the same software as a basic software package but different versions, the customized software package and the basic software package of the basic software package that does not exist in the basic software package of the basic mirror are determined as the target software package. In this way, the software package indicated by the index information in the obtained mirror index file includes the customized software package with the same software as the basic software package but different versions, so that the target software package indicated by the index information in the obtained mirror index file can be installed according to the operating system mirror, and the customized installation of the operating system mirror with different versions of the software package of the basic mirror can be realized.

[0080] Considering that there may be customized software packages with the same software but different versions in the customized software packages corresponding to the software requirements of different mirror creation instructions, in order to avoid interference of the created customized software directory with the processing process of the next mirror creation instruction, after obtaining the customized software directory, the customized software directory is further subjected to interference removal processing to remove the interference of the customized software directory with the processing process of the next mirror creation instruction.

[0081] In the embodiment, the custom software directory can be understood as a folder storing the custom software package, and the interference-eliminating processing of the custom software directory means that the custom software package included in the custom software directory is not recognized in the processing of the next image creation instruction by technical means (such as permission isolation, metadata shielding, etc.), so as to realize the "logical isolation" of the custom software directory and the processing of the next image creation instruction, thereby excluding the interference of the custom software package included in the custom software directory on the processing of the next image creation instruction. For example, the permission of the custom software directory is set as "unreadable".

[0082] In an optional embodiment, the interference-eliminating processing of the custom software directory includes compressing the custom software directory and deleting the uncompressed custom software directory.

[0083] In the embodiment, the custom software package in the compressed custom software directory will not be scanned, so as not to interfere with the processing of the next image creation instruction.

[0084] As described above, after processing each image creation instruction, the corresponding image index file of the image creation instruction and the custom software directory after the interference-eliminating processing can be obtained.

[0085] S102, write the start item corresponding to each processed image creation instruction in the base image of the operating system, and write the installation logic corresponding to each processed image creation instruction in the image folder.

[0086] As described above, each image creation instruction corresponds to an image index file and a custom software directory, and each written start item corresponds to an image creation instruction, so each written start item corresponds to an image index file and a custom software directory. That is, the corresponding image creation instruction and the start item have a corresponding relationship, and correspond to the same image index file and custom software directory.

[0087] The start item refers to a specific installation option listed in the installation program or the boot menu and selected by the user in the operating system image installation process. After the user selects, the installation program will execute the corresponding operating system image installation process according to the image index file and the custom software directory included in the start item, and finally generate an operating system environment corresponding to the start item.

[0088] As described above, the base image of the operating system includes a base index file for installing the base image when the operating system image is installed, and the base image of the operating system also includes a start item corresponding to the base index file for installing the base image after the user selects.

[0089] Correspondingly, the so-called installation logic refers to a complete process design from loading an operating system image to deploying the operating system image in an operating system image installation process according to preset rules through a series of ordered instructions and operations. The execution path of installing the operating system image under different startup entries is determined.

[0090] Each image creation instruction corresponds to installation logic, which includes creating a local software source directory, reusing a base image through a soft link, and copying the image index file of the image creation instruction to achieve the acquisition and installation of the target software package corresponding to the image creation instruction. The installation logic corresponding to each image creation instruction can be referred to as the installation logic corresponding to the startup entry corresponding to each image creation instruction.

[0091] For example, the installation logic corresponding to each image creation instruction is written in the pre-installation script (starting with the %pre (Pre-installation Script) command) part of the ks.cfg (Kickstart Configuration File, installation configuration file) in the image folder. The ks.cfg is a simple text file that contains a series of command options for automatically installing an operating system image, such as installation method options, keyboard layout, system language settings, password settings, and repo (Repository, software repository) options, as well as pre-installation scripts, post-installation scripts (starting with the %post (Post-installation Script) command), and other scripts. The repo option is used to specify the source of the software package of the installed operating system image, i.e., the server or local path that stores the software package and its dependencies. By configuring the repo option, the required software package can be automatically retrieved and obtained from the specified repository during the installation of the operating system image, ensuring the reliability and consistency of the software source.

[0092] In this way, during the installation of the operating system image, any startup entry can be selected to install any image index file, and based on the installation logic corresponding to the startup entry, the target software package is obtained from the customized software directory and the base software package according to the index information in the selected image index file, to achieve customized installation of the operating system image for different versions of software.

[0093] Optionally, the starting entry corresponding to the processed image creation instruction can be written in the base image of the operating system and the installation logic corresponding to the processed image creation instruction can be written in the image folder immediately after the processing of each image creation instruction is completed; or, the starting entry corresponding to each processed image creation instruction can be written in the base image of the operating system and the installation logic corresponding to each processed image creation instruction can be written in the image folder after the processing of all image creation instructions is completed.

[0094] S103, packing the image folder to obtain a multi-version image of the operating system.

[0095] After the processing of the above different image creation instructions and the writing of the starting entry and the installation logic are completed, the entire content in the image folder is packed to obtain a new image file. The image file can be used as a multi-version image of the operating system because it can realize the customized installation of the operating system image for different versions of software. For each version of the operating system image, the corresponding customized software package and the image index file are saved in the multi-version image, which does not significantly increase the file size of the multi-version image.

[0096] In the above method for generating an operating system image, the received different image creation instructions are processed in sequence, and in the process of processing each image creation instruction, the customized software directory and the image index file are created in the corresponding image folder of the operating system according to the software requirements corresponding to the image creation instruction, and the customized software directory is deinterfered to remove the interference on the processing of the next image creation instruction, so as to obtain the customized software directory and the image index file corresponding to each image creation instruction. Then, the starting entry corresponding to each processed image creation instruction is written in the base image of the operating system in the above image folder, and the installation logic corresponding to each processed image creation instruction is written in the image folder, so as to obtain the installation logic and the image index file corresponding to each starting entry. After that, the above image folder is packed to obtain a multi-version of the operating system. In this way, because the customized software directory includes customized software packages different from the base software version of the base image, and the image folder records the index information of the target software package, different image index files created for different versions of software collection can exist in the multi-version image, and different image index files correspond to operating system images of different versions of software, so that different software version operating system images can be selected for installation by triggering different starting entries, and customized installation of the operating system image for different versions of software can be realized.

[0097] On the basis of the above embodiment, in an exemplary embodiment, the creation of the customized software directory and the image index file is further refined. Optionally, as Figure 2As shown, the method can include the following steps:

[0098] S201, creating an initial directory under an update directory of an operating system corresponding image folder.

[0099] After the operating system corresponding image folder is created, an update directory can be first created in the image folder, and then in the process of processing each image creation instruction, an initial directory is created under the update directory.

[0100] For example, an ISO folder is created as the operating system corresponding image folder, and the base image of the operating system is copied into the ISO folder. Then, an update directory is created in the ISO folder, with a path of ISO / update, to store the customized software directories of different image creation instructions. Then, in the process of processing the image creation instruction 1, a user1 folder with a path of ISO / update / user1 is created under the update directory as the initial directory.

[0101] S202, determining the package information of the customized software package corresponding to the software requirement according to the software requirement corresponding to the image creation instruction.

[0102] The package information of the software package is a collection of data describing the key contents of the software package core attributes, dependency relationships, version information, etc., such as software identification, version information, etc. The software requirement corresponding to the image creation instruction indicates the type, version, etc. of the customized software package, so the package information of the customized software package corresponding to the software requirement can be determined according to the software requirement corresponding to the image creation instruction.

[0103] S203, storing the customized software package corresponding to the software requirement into the initial directory according to the package information of the customized software package, to obtain the customized software directory.

[0104] As described above, the customized software package can be uniquely determined according to the package information of the customized software package, so the customized software package corresponding to the software requirement can be obtained according to the package information of the customized software package, and the obtained customized software package is stored into the initial directory to obtain the customized software directory.

[0105] For example, the customized software package is downloaded from a software library published by an official or authoritative organization according to the package information of the customized software package, and the customized software package is stored into the initial directory to obtain the customized software directory.

[0106] S204, creating an image index file according to the package information of the customized software package and the package information of the base software package.

[0107] The customized software package and the basic software package are stored in the above-mentioned mirror folder, so that the storage address of the customized software package and the basic software package can be determined, and according to the package information of the customized software package and the package information of the basic software package, the unique identification, version, dependency relationship and other key information of the customized software package and the basic software package can be determined, and then according to the above-mentioned key information and the storage address, the mirror index file can be created.

[0108] For example, in the processing process of the mirror creation instruction 1, first, the file name of the current basic index file is modified from repodata to repodata_0, and then the createrepo (Create Repository, create software warehouse) command is used to generate a new repodata file according to the above-mentioned key information and the storage address, and the file name of the new repodata file is modified to repodata_user1, so that the repodata_user1 file is the mirror index file corresponding to the mirror creation instruction 1, and user1 can be used as the file identification of the mirror index file corresponding to the mirror creation instruction 1. Then, after all the mirror creation instruction processing is completed, the file name of the current basic index file is restored from repodata_0 to repodata, so that the basic mirror can be normally installed.

[0109] In the embodiment, the initial directory and the package information of the customized software package can be created without changing the basic mirror of the operating system, so that the customized software directory and the mirror index file can be accurately and quickly created, the operating system mirror meeting the specific requirements corresponding to the mirror creation instruction can be quickly generated, and the stability and safety of the basic mirror of the operating system are maintained.

[0110] On the basis of the above-mentioned embodiments, in an exemplary embodiment, the creation of the mirror index file is further refined. Optionally, the package information includes software identification and version information, as shown in Figure 3 The method can include the following steps:

[0111] S301, scanning the mirror folder to determine each group of software packages with the same software identification in the customized software package and the basic software package, and the independent software package different from the software identification of other software packages.

[0112] As described above, each customized software package is the same software as a base software package but with different versions, and therefore, when scanning the image folder to check all the software packages in the image folder, each group of customized software packages and base software packages corresponding to the same software can be determined, and the software identification of each group of customized software packages and base software packages is the same, and meanwhile, the image folder also includes a base software package that does not have a customized software package corresponding to the same software, and the software identification of the base software package is different from the software identification of other software packages, so that the base software package can be used as an independent software package.

[0113] S302, determining a target software package according to the independent software package and the specified software package with version information meeting the version requirement in each group of software packages.

[0114] The specified software package with version information meeting the version requirement is selected from each group of software packages, for example, the software package with the lowest or highest version indicated by the version information in each group of software packages is selected as the specified software package, and then the selected specified software package and the independent software package can be determined as the target software package.

[0115] S303, creating an image index file in the image folder according to the index information of the target software package.

[0116] After the target software package is determined, the image index file can be created in the image folder according to the index information of the target software package.

[0117] In this embodiment, by scanning the image folder, the target software package meeting the software requirement corresponding to the image creation instruction can be quickly and accurately selected from the customized software packages in the customized software directory and the base software packages of the base image, so that the image index file can be accurately and quickly created, and further, the operating system image meeting the specific requirement corresponding to the image creation instruction can be quickly generated.

[0118] Based on the above embodiments, in an exemplary embodiment, the determination of the target software package is further refined. Optionally, the version of the customized software package is higher than the version of the base software package; as shown in the following table, the method can include the following steps: Figure 4

[0119] S401, selecting the software package with the highest version indicated by the version information in each group of software packages to obtain a specified software package.

[0120] ​As described above, the base package of the base image is usually a package of the lowest version, and in the customized installation of the operating system image for different versions of software, the user often wants to install a package of a version higher than the base package, therefore, the version of the customized package is higher than the version of the base package, and the package with the highest version indicated by the version information is selected from each group of packages to obtain the specified package. That is, the obtained specified package is the customized package.

[0121] S402, determining the target package according to the specified package and the independent package.

[0122] After obtaining the specified package, the specified package and the independent package can be determined as the target package.

[0123] In the embodiment, by selecting the package with the highest version indicated by the version information in each group of packages as the target package, the operating system image obtained by processing the image creation instruction can include the customized package with a version higher than the version of the base package, so as to meet the requirement of the user who wants to install a package with a version higher than the version of the base package in the operating system image installation process, and improve the user experience in the customized installation of the operating system image for different versions of software.

[0124] On the basis of the above embodiments, in an exemplary embodiment, the creation of the start entry is further refined.

[0125] Optionally, as shown in Figure 5 may include the following steps:

[0126] S501, adding a plurality of initial entries in the boot configuration file of the base image.

[0127] The number of the plurality of initial entries is the same as the number of the processed image creation instructions.

[0128] After the processing of all the image creation instructions is completed, the number of the processed image creation instructions can be determined, so that the number of the plurality of initial entries added in the boot configuration file of the base image is the same as the number of the processed image creation instructions.

[0129] S502, configuring a parameter value for the label parameter of each initial entry.

[0130] The parameter value is the file identifier of the image index file corresponding to any image creation instruction, and the parameter values configured by different initial entries are different.

[0131] For each initial entry, the parameter value of the label parameter of the initial entry can be configured as the file identifier of the image index file corresponding to any image creation instruction, to obtain a start entry corresponding to each image creation instruction. Different initial entries are configured with different parameter values, so that the initial entry corresponds to the image creation instruction one by one.

[0132] For example, different image creation instructions include image creation instruction 1 and image creation instruction 2, two menuentries are added in the base image grub.cfg (GRand Unified Bootloader configuration file, GRUB bootloader configuration file) as initial entries. Further, the image index file corresponding to the image creation instruction 1 is repodata_user1, and the file identifier of the image index file corresponding to the image creation instruction 1 is user1. Correspondingly, the image index file corresponding to the image creation instruction 2 is repodata_user2, and the file identifier of the image index file corresponding to the image creation instruction 2 is user2. In this way, the parameter value user1 can be configured for the label parameter user of one menuentry, that is, user=user1 is added in the menuentry. Correspondingly, the parameter value user2 is configured for the label parameter user of another menuentry, that is, user=user2 is added in the menuentry. In this way, the start entry corresponding to the image creation instruction 1 and the image creation instruction 2 can be obtained.

[0133] In the embodiment, by configuring the file identifier of the image index file corresponding to any image creation instruction for the label parameter of each initial entry, and configuring different parameter values for different initial entries, the start entry can be bound to the image index file, so that in the operating system image installation process, the required image index file can be selected by selecting the start entry, to select the software version in the operating system image according to the start entry, and to realize the customized installation of the operating system image for different versions of software.

[0134] On the basis of the above embodiments, in an exemplary embodiment, as shown in Figure 6 The operating system image generation method can include the following steps:

[0135] S601, in response to the folder creation instruction, create an image folder corresponding to the operating system.

[0136] In the process of generating multiple versions of images, the image folder corresponding to the operating system needs to be constructed in advance. Therefore, the folder creation instruction can be received, and the image folder corresponding to the operating system can be created in response to the folder creation instruction.

[0137] For example, in response to a folder creation instruction generated based on a user's folder creation operation, an ISO folder is created as a corresponding mirror folder of the operating system.

[0138] S602, downloading a basic mirror of the operating system.

[0139] The original mirror file containing the core components of the operating system, initial configuration and boot program can be downloaded from a designated distribution channel or an authorized resource site as the basic mirror file.

[0140] S603, copying the basic mirror into the mirror folder.

[0141] After obtaining the above-mentioned basic mirror file, all files in the basic mirror file can be copied to the mirror folder, so that the mirror folder includes a complete basic mirror file.

[0142] S604, sequentially processing different mirror creation instructions received, and in the process of processing each mirror creation instruction, creating a customized software directory and a mirror index file in the mirror folder corresponding to the operating system according to the software requirements corresponding to the mirror creation instruction, and performing interference removal processing on the customized software directory to remove interference on the processing process of the next mirror creation instruction.

[0143] S605, writing a start entry corresponding to each processed mirror creation instruction in the basic mirror of the operating system, and writing an installation logic corresponding to each processed mirror creation instruction in the mirror folder.

[0144] S606, packaging the mirror folder to obtain a multi-version mirror of the operating system.

[0145] The specific implementation of S604-605 is the same as that of S101-S103, which will not be repeated here.

[0146] In this embodiment, the complete basic mirror is copied in the mirror folder, which not only builds a unified and compliant initial environment for the multi-version mirror, but also does not affect the installation of the basic mirror when the operating system mirror is installed.

[0147] Based on the above-mentioned embodiments, an exemplary embodiment is taken as an example, in which the different mirror creation instructions include a first mirror creation instruction and a second mirror creation instruction, to illustrate the operating system mirror generation method, as shown in Figure 7 The operating system mirror generation method can include the following steps:

[0148] S701, after receiving the folder creation instruction, creating the mirror folder corresponding to the operating system in response to the folder creation instruction, and creating an update directory in the mirror folder.

[0149] S702, downloading the base image of the operating system and copying the base image into the mirror folder.

[0150] S703, after receiving the first image creation instruction, creating an initial directory corresponding to the first image creation instruction under the update directory.

[0151] S704, determining the package information of the customized software package corresponding to the software requirement according to the first image creation instruction, and storing the customized software package corresponding to the software requirement into the initial directory corresponding to the first image creation instruction according to the package information, to obtain the customized software directory corresponding to the first image creation instruction.

[0152] S705, scanning the mirror folder to determine each group of software packages with the same software identifier in the customized software package and the base software package, and the independent software package different from the software identifier of other software packages.

[0153] S706, selecting the software package with the highest version indicated by the version information in each group of software packages to obtain the specified software package, and determining the target software package according to the specified software package and the independent software package.

[0154] S707, creating the mirror index file corresponding to the first image creation instruction in the mirror folder according to the index information of the target software package.

[0155] S708, compressing the customized software directory corresponding to the first image creation instruction, and deleting the uncompressed customized software directory corresponding to the first image creation instruction.

[0156] S709, after receiving the second image creation instruction, creating an initial directory corresponding to the second image creation instruction under the update directory.

[0157] S710, determining the package information of the customized software package corresponding to the software requirement according to the second image creation instruction, and storing the customized software package corresponding to the software requirement into the initial directory corresponding to the second image creation instruction according to the package information, to obtain the customized software directory corresponding to the second image creation instruction.

[0158] S711, scanning the mirror folder to determine each group of software packages with the same software identifier in the customized software package and the base software package, and the independent software package different from the software identifier of other software packages.

[0159] S712, select the software package with the highest version indicated by the version information in each group of software packages to obtain a specified software package, and determine a target software package according to the specified software package and the independent software package.

[0160] S713, create a mirror index file corresponding to the second mirror creation instruction in the mirror folder according to the index information of the target software package.

[0161] S714, compress the customized software directory corresponding to the second mirror creation instruction, and delete the uncompressed customized software directory corresponding to the second mirror creation instruction.

[0162] S715, add the first initial entry and the second initial entry in the boot configuration file of the base image.

[0163] S716, configure the file identifier of the mirror index file corresponding to the first mirror creation instruction for the label parameter of the first initial entry, and configure the file identifier of the mirror index file corresponding to the second mirror creation instruction for the label parameter of the second initial entry.

[0164] S717, write the installation logic corresponding to the first mirror creation instruction and the installation logic corresponding to the second mirror creation instruction in the mirror folder.

[0165] S718, package the mirror folder to obtain a multi-version mirror image of the operating system.

[0166] The specific implementation of S701-S718 above is the same as that in the method embodiments above, and will not be repeated here.

[0167] Based on the same inventive concept, the embodiments of the present application also provide an operating system image installation method for implementing the operating system image generation method described above.

[0168] In an exemplary embodiment, the operating system image installation method can be used for servers and terminals. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0169] In an exemplary embodiment, as shown in Figure 8 An operating system image installation method is provided, which will be described by taking the case of applying the method to a server. The method can include the following steps:

[0170] S801, in response to a trigger operation for any startup entry in the multi-version mirror image, load a temporary installation environment in the multi-version mirror image, and query the installation logic corresponding to the startup entry in the multi-version mirror image.

[0171] The multi-version image is generated based on any of the above method embodiments of generating an operating system image; and the temporary installation environment includes a run directory.

[0172] The temporary installation environment (Temporary Installation Environment) refers to a temporary running environment created by an installation program during the installation of an operating system image before the operating system image to be installed is actually installed. This environment is used to perform installation operations, such as mounting a disk, copying system files, configuring partitions, etc. Optionally, the temporary installation environment in the multi-version image is loaded in the memory.

[0173] The run directory (run directory) refers to a temporary working directory created by an installation program in the temporary installation environment during the installation of an operating system image, used to store dynamic data generated during the installation, temporary configuration files, mount point information, program running logs, etc.

[0174] After the multi-version image is started, each startup entry in the multi-version image can be displayed, so that the user can trigger any startup entry through various ways such as touch screen and mouse operation, so that in response to the triggering operation of the startup entry, the temporary installation environment in the multi-version image can be loaded. Further, in the multi-version image, each startup entry corresponds to installation logic, an image index file, and a customized software directory, so that in response to the triggering operation of the startup entry, the installation logic corresponding to the startup entry can be queried.

[0175] Optionally, the generated multi-version image is written to a bootable medium such as an optical disc, and the bootable medium is installed in a server to be installed with an operating system image. After restarting the server, the server is initially started through a specific operation to enter a BIOS (Basic Input / Output System, Basic Input / Output System) / UEFI (Unified Extensible Firmware Interface, Unified Extensible Firmware Interface) setting interface, the bootable medium is set as the first startup item in the "startup order" column of the setting interface, and after saving, the setting interface is exited. Further, the server can automatically start from the bootable medium to load the boot configuration file in the multi-version image to enter an installation interface (such as graphical display, command line display, etc.), at which time each startup entry is presented in the installation interface.

[0176] S802, according to the installation logic, creating a local software source directory in the run directory, and soft-linking the base image in the multi-version image to the local software source directory, and copying the image index file corresponding to the startup entry to the local software source directory.

[0177] The so-called soft link (Symbolic Link), also known as symbolic link, is a special file which points to another file or directory through a path in text form.

[0178] As described above, the installation logic corresponding to each start entry includes: creating a local software source directory, reusing the base image through soft link, and creating the image index file of the image creation instruction through copying the image, to realize the acquisition and installation of the target software package corresponding to the image creation instruction. Therefore, after the installation logic corresponding to the start entry is queried, the local software source directory can be first created in the running directory, so that the base image in the multi-version image is soft linked to the local software source directory, and the image index file corresponding to the start entry is copied to the local software source directory.

[0179] For example, in the case where different image creation instructions include image creation instruction 1 and image creation instruction 2, there are image index file repodata_user1 corresponding to image creation instruction 1 and image index file repodata_user2 corresponding to image creation instruction 2, and start entries menuentry1 and menuentry2, wherein user=user1 is added in menuentry1, and user=user2 is added in menuentry2. Further, in response to menuentry1, the local software source directory repo_user1 can be created in the running directory of the temporary installation environment, and the base image in the multi-version image is soft linked to the local software source directory repo_user1, and the image index file repodata_user1 is copied to the local software source directory repo_user1.

[0180] S803, according to the image index file, the target software package corresponding to the start entry is acquired from the multi-version image, and the target software package is installed to complete the installation of the operating system image.

[0181] Since the image index file in the local software source directory is not identifiable, it is necessary to change the attribute of the image index file in the local software source directory to be identifiable, for example, the image index file repodata_user1 in the local software source directory repo_user1 is renamed to repodata, so that the renamed image index file repodata is identifiable. Further, according to the index information of each target software package recorded in the image index file, the target software package corresponding to the start entry is acquired from the multi-version image, and the target software package is installed to complete the installation of the operating system image.

[0182] In the above operating system image generation installation method, different image index files created for different versions of software sets can exist in the multi-version image, and the different image index files correspond to operating system images of different versions of software, so that operating system images of different versions of software can be customized and installed by triggering different startup entries to select operating system images of different versions of software for installation. Moreover, compared with the traditional technology of first installing a basic image and then updating the basic software package in the basic image to a new version of software package required by a user, the above operating system image generation installation method can directly implement customized installation of operating system images of different versions of software without installing a basic image, without increasing the installation time of the operating system image, and without affecting the installation of the basic image in the case of installing an operating system image of a new version of software.

[0183] It should be understood that, although each step in the flowchart involved in each of the above embodiments is shown in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.

[0184] Based on the same inventive concept, the embodiments of the present application also provide an operating system image generation device for implementing the above-mentioned operating system image generation method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more operating system image generation device embodiments provided below can refer to the limitations of the operating system image generation method in the above text, which will not be repeated here.

[0185] In one exemplary embodiment, as shown in Figure 9 An operating system image generation device is provided, including: an instruction processing module 910, an information writing module 920, and an image generation module 930, wherein:

[0186] The instruction processing module 910 is configured to sequentially process different received image creation instructions, and in the process of processing each image creation instruction, create a customized software directory and an image index file in an operating system corresponding image folder according to a software requirement corresponding to the image creation instruction, and perform interference removal processing on the customized software directory to remove interference on the processing process of the next image creation instruction.

[0187] The information writing module 920 is configured to write a start item corresponding to each processed image creation instruction in a basic image of the operating system, and write installation logic corresponding to each processed image creation instruction in the image folder.

[0188] The image generation module 930 is configured to package the image folder to obtain a multi-version image of the operating system.

[0189] The image folder includes a basic image of the operating system, the customized software directory includes a customized software package corresponding to the software requirement, the software corresponding to the customized software package belongs to the software corresponding to the basic software package of the basic image, and the versions of the customized software package and the basic software package are different, the image index file records index information of a target software package, and the target software package is a software package in the customized software package and the basic software package.

[0190] In an exemplary embodiment, the instruction processing module 910 includes:

[0191] The target creation unit is configured to create an initial directory under an update directory of the operating system corresponding image folder.

[0192] The information determination unit is configured to determine package information of a customized software package corresponding to the software requirement according to the software requirement corresponding to the image creation instruction.

[0193] The software storage unit is configured to store the customized software package corresponding to the software requirement into the initial directory according to the package information of the customized software package, to obtain the customized software directory.

[0194] The file creation unit is configured to create the image index file according to the package information of the customized software package and the package information of the basic software package.

[0195] In an exemplary embodiment, the package information includes software identification and version information, and the file creation unit includes:

[0196] The folder scanning subunit is configured to scan the image folder, determine each group of software packages with the same software identification and independent software packages different from the software identification of other software packages in the customized software package and the basic software package.

[0197] The software determining sub-unit is configured to determine the target software package according to the independent software package and the specified software package with the version information meeting the version requirement in each group of software packages.

[0198] The file creating sub-unit is configured to create a mirror index file in the mirror folder according to the index information of the target software package.

[0199] In an exemplary embodiment, the version of the customized software package is higher than the version of the basic software package; and the software determining sub-unit is specifically configured to:

[0200] select the software package with the highest version indicated by the version information in each group of software packages to obtain the specified software package;

[0201] determine the target software package according to the specified software package and the independent software package.

[0202] In an exemplary embodiment, the instruction processing module 910 is specifically configured to:

[0203] compress the customized software directory and delete the uncompressed customized software directory.

[0204] In an exemplary embodiment, the information writing module 920 is specifically configured to:

[0205] add a plurality of initial entries in the boot configuration file of the basic image; wherein the number of the plurality of initial entries is the same as the number of the processed mirror creation instructions;

[0206] configure a parameter value for the label parameter of each initial entry; wherein the parameter value is the file identifier of the mirror index file corresponding to any mirror creation instruction, and the parameter values configured for different initial entries are different.

[0207] In an exemplary embodiment, the operating system mirror generation apparatus further comprises:

[0208] a folder creating module configured to create a mirror folder corresponding to the operating system in response to a folder creation instruction;

[0209] a mirror downloading module configured to download a basic image of the operating system;

[0210] a mirror copying module configured to copy the basic image into the mirror folder.

[0211] Based on the same inventive concept, the embodiments of the present application further provide an operating system mirror generation apparatus for implementing the operating system mirror installation method described above. The solution provided by the apparatus is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more operating system mirror installation apparatus embodiments provided below can refer to the limitations of the operating system mirror generation installation described above, and will not be described here again.

[0212] In an example embodiment, as shown in Figure 10 An operating system image installation apparatus is provided, comprising: an operation response module 1010, an information linking module 1020, and an image installation module 1030, wherein:

[0213] The operation response module 1010 is configured to load a temporary installation environment in the multi-version image and query installation logic corresponding to the start item in the multi-version image in response to a trigger operation for any start item in the multi-version image; wherein the multi-version image is generated based on any of the above-mentioned operating system image generation methods; and the temporary installation environment comprises a running directory.

[0214] The information linking module 1020 is configured to create a local software source directory in the running directory according to the installation logic, and link the base image in the multi-version image to the local software source directory, and copy the image index file corresponding to the start item into the local software source directory.

[0215] The image installation module 1030 is configured to obtain the target software package corresponding to the start item from the multi-version image according to the image index file, and install the target software package to complete the installation of the operating system image.

[0216] The above-mentioned operating system image generation apparatus and operating system image installation apparatus can be implemented by software, hardware, and combinations thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above-mentioned modules.

[0217] In an example embodiment, a computer device is provided, which can be a server, and the internal structure diagram thereof can be as shown in Figure 11As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. 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, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is used to store data such as multi-version images. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement an operating system image generation method, or an operating system image installation method.

[0218] In an exemplary embodiment, a computer device, which can be a terminal, has an internal structure diagram as shown in the figure. Figure 12 As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. 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 operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be realized through WIFI, mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. The computer program is executed by the processor to implement an operating system image installation method. The display unit of the computer device is used to form a visually visible picture, which 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 device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0219] Those skilled in the art can understand that, Figure 11 and Figure 12The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0220] In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the method embodiments of the above-mentioned operating system image generation method, or the steps in the method embodiments of the above-mentioned operating system image installation method when executing the computer program.

[0221] In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the method embodiments of the above-mentioned operating system image generation method, or the steps in the method embodiments of the above-mentioned operating system image installation method when executing the computer program.

[0222] In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the method embodiments of the above-mentioned operating system image generation method, or the steps in the method embodiments of the above-mentioned operating system image installation method when executing the computer program.

[0223] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0224] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0225] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the patent of the present application. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for generating an operating system image, characterized in that, The method includes: The system processes different image creation instructions received sequentially. During the processing of each image creation instruction, a custom software directory and image index file are created in the corresponding image folder of the operating system according to the software requirements of the image creation instruction. The custom software directory is also subjected to de-interference processing to remove interference to the processing of the next image creation instruction. Write the boot entry corresponding to each processed image creation instruction into the base image of the operating system, and write the installation logic corresponding to each processed image creation instruction into the image folder; The image folder is packaged to obtain multiple versions of the operating system image; The image folder includes the base image of the operating system, the custom software directory includes custom software packages corresponding to the software requirements, the software corresponding to the custom software packages belongs to the software corresponding to the base software packages of the base image, and the versions of the custom software packages and the base software packages are different. The image index file records the index information of the target software packages, and the target software packages are the software packages in the custom software packages and the base software packages.

2. The method according to claim 1, characterized in that, The step of creating a custom software directory and image index file in the corresponding image folder of the operating system according to the software requirements corresponding to the image creation instruction includes: Create the initial directory in the update directory of the operating system's corresponding image folder; Based on the software requirements corresponding to the image creation instructions, determine the package information of the customized software package corresponding to the software requirements; Based on the package information of the customized software package, the customized software package corresponding to the software requirements is stored in the initial directory to obtain the customized software directory; Based on the package information of the customized software package and the package information of the base software package, an image index file is created.

3. The method according to claim 2, characterized in that, The package information includes software identifier and version information; the step of creating an image index file based on the package information of the customized software package and the package information of the base software package includes: Scan the image folder to identify groups of software packages with the same software identifier in the customized software package and the basic software package, as well as independent software packages with different software identifiers from other software packages; The target software package is determined based on the independent software package and the specified software package in each group of software packages whose version information meets the version requirements; Based on the index information of the target software package, create an image index file in the image folder.

4. The method according to claim 3, characterized in that, The version of the customized software package is higher than the version of the base software package; the step of determining the target software package based on the independent software package and the specified software packages in each group of software packages whose version information meets the version requirements includes: Select the package with the highest version indicated by the version information in each group of packages to obtain the specified package; The target software package is determined based on the specified software package and the independent software package.

5. The method according to claim 1, characterized in that, The process of removing interference from the customized software catalog includes: Compress the custom software directory and delete the uncompressed custom software directory.

6. The method according to claim 1, characterized in that, The step of writing the boot entry corresponding to each processed image creation instruction into the base image of the operating system includes: Add multiple initial entries to the boot configuration file of the base image; wherein the number of the multiple initial entries is the same as the number of image creation instructions processed; Configure parameter values ​​for the tag parameters of each initial entry; wherein, the parameter values ​​are file identifiers of the image index file corresponding to any image creation instruction, and the parameter values ​​configured for different initial entries are different.

7. The method according to any one of claims 1-6, characterized in that, Before processing the different image creation instructions received in sequence, the method further includes: In response to a folder creation command, create an image folder corresponding to the operating system; Download the base image of the operating system; Copy the base image to the image folder.

8. A method for installing an operating system image, characterized in that, The method includes: In response to a trigger operation for any boot entry in a multi-version image, a temporary installation environment in the multi-version image is loaded, and the installation logic corresponding to the boot entry in the multi-version image is queried; wherein, the multi-version image is generated based on the operating system image generation method according to any one of claims 1-7; the temporary installation environment includes a running directory; According to the installation logic, a local software source directory is created in the running directory, and a soft link is made to the base image in the multi-version image to the local software source directory, and the image index file corresponding to the startup entry is copied to the local software source directory; Based on the image index file, the target software package corresponding to the boot entry is obtained from the multi-version image, and the target software package is installed to complete the installation of the operating system image.

9. An operating system image generation device, characterized in that, The device includes: The instruction processing module is used to process different received image creation instructions sequentially. During the processing of each image creation instruction, a custom software directory and image index file are created in the corresponding image folder of the operating system according to the software requirements of the image creation instruction. The custom software directory is also subjected to de-interference processing to remove interference to the processing of the next image creation instruction. The information writing module is used to write the boot entry corresponding to each processed image creation instruction into the base image of the operating system, and to write the installation logic corresponding to each processed image creation instruction into the image folder. The image generation module is used to package the image folder to obtain multiple versions of the operating system image; The image folder includes the base image of the operating system, the custom software directory includes custom software packages corresponding to the software requirements, the software corresponding to the custom software packages belongs to the software corresponding to the base software packages of the base image, and the versions of the custom software packages and the base software packages are different. The image index file records the index information of the target software packages, and the target software packages are the software packages in the custom software packages and the base software packages.

10. An operating system image installation device, characterized in that, The device includes: An operation response module is configured to respond to a trigger operation for any boot entry in a multi-version image, load a temporary installation environment in the multi-version image, and query the installation logic corresponding to the boot entry in the multi-version image; wherein the multi-version image is generated based on the operating system image generation method according to any one of claims 1-7; the temporary installation environment includes a running directory; The information link module is used to create a local software source directory in the running directory according to the installation logic, and to create a soft link to the base image in the multi-version image to the local software source directory, and to copy the image index file corresponding to the startup entry to the local software source directory. The image installation module is used to obtain the target software package corresponding to the boot entry from the multi-version image according to the image index file, and install the target software package to complete the installation of the operating system image.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7, and the steps of the method according to claim 8.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7, and the steps of the method according to claim 8.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7, and the steps of the method according to claim 8.

Citation Information

Cited By

  • Mirror image file configuration method and device and electronic equipment

    CN121349480A