CN115344275A - Method and device for generating image file of operating system and computer equipment - Google Patents

Method and device for generating image file of operating system and computer equipment Download PDF

Info

Publication number
CN115344275A
CN115344275A CN202210977143.2A CN202210977143A CN115344275A CN 115344275 A CN115344275 A CN 115344275A CN 202210977143 A CN202210977143 A CN 202210977143A CN 115344275 A CN115344275 A CN 115344275A
Authority
CN
China
Prior art keywords
operating system
script
virtual machine
customized
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210977143.2A
Other languages
Chinese (zh)
Inventor
吴少斌
范佳
王子骏
马立珂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Dingjia Computer Technology Co ltd
Original Assignee
Guangzhou Dingjia Computer Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Dingjia Computer Technology Co ltd filed Critical Guangzhou Dingjia Computer Technology Co ltd
Priority to CN202210977143.2A priority Critical patent/CN115344275A/en
Publication of CN115344275A publication Critical patent/CN115344275A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

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

Abstract

The application relates to a method, a device, a storage medium and a computer program product for generating an image file of an operating system. The method comprises the following steps: responding to an operating system customization request, and acquiring a customization code; downloading an operating system manufacturing environment mirror image of a specified version through a mirror image downloading script in the customized code; starting a virtual machine in a system manufacturing container operated by computer equipment according to an operating system manufacturing environment mirror image; the virtual machine is used for constructing an operating system manufacturing environment; calling a virtual machine to run a preset operating system configuration script through a system manufacturing container; the operating system configuration script is used for carrying out configuration operation on the initial operating system in an operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system; and encapsulating the target operating system and generating an image file of the target operating system. By adopting the method, the generation efficiency of the mirror image file of the customized operating system can be improved.

Description

Method and device for generating image file of operating system and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating an image file of an operating system, and a computer device.
With the development of computer technology, windows systems are more and more common, computer hardware is more diverse, and preinstalled systems (such as WinPE systems) used for installing, deploying and repairing Windows operating systems are more important.
At present, when a traditional pre-installation operating system is manufactured, technicians often need to configure the image files of the operating system in a complex manner to obtain the pre-installation operating system meeting requirements, and a large amount of time and manpower are often consumed during manufacturing, so that the efficiency of generating the image files of the operating system is not high.
Therefore, the traditional technology has the problem of low generation efficiency of the image file of the customized operating system.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an image file generating method and apparatus for an operating system, and a computer device, which can improve the image file generating efficiency of a customized operating system.
A method for generating an image file of an operating system is applied to a server and comprises the following steps:
responding to an operating system customization request, and acquiring a customization code;
downloading an operating system manufacturing environment mirror image of a specified version through a mirror image downloading script in the customized code;
starting a virtual machine in a system manufacturing container operated by a server according to an operating system manufacturing environment mirror image; the virtual machine is used for constructing an operating system manufacturing environment;
calling a virtual machine to run a preset operating system configuration script through a system manufacturing container; the operating system configuration script is used for carrying out configuration operation on the initial operating system in the operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system;
and encapsulating the target operating system and generating an image file of the target operating system.
In one embodiment, the operating system configuration script includes an operating system creation script and a configuration file import script, and the system production container is used to call the virtual machine to run the preset operating system configuration script, including:
calling a virtual machine to run an operating system to create a script through a system manufacturing container; the operating system creating script is used for creating an initial operating system;
acquiring a customized configuration file, and calling a virtual machine to run the configuration file import script through a system manufacturing container; the configuration file import script is used for importing a customized configuration file into the initial operating system so as to perform configuration operation on the initial operating system to obtain a target operating system.
In one embodiment, the customized configuration file includes a customized application program, a hardware driver and a language package, the configuration file import script includes an application program import script, a hardware driver installation script and a language package installation script, and the system manufacturing container calls the virtual machine to run the configuration file import script, including:
calling a virtual machine to run an application program import script through a system manufacturing container; the application program import script is used for importing the customized application program to an initial operating system;
calling a virtual machine to run a hardware driver installation script through a system manufacturing container; the hardware driver installation script is used for installing a hardware driver to an initial operating system;
calling a virtual machine running language package installation script through a system manufacturing container; the language package installation script is used for installing a language package to an initial operating system; and obtaining the target operating system.
In one embodiment, obtaining a customized configuration file comprises:
acquiring a customized application program code in a customized code;
compiling the customized application program codes through pre-installed compiling software to obtain a customized application program;
and taking the customized application program as a customized configuration file.
In one embodiment, starting a virtual machine in a system production container run by a server according to an operating system production environment image comprises:
installing virtual machine manufacturing software in a system manufacturing container;
creating a virtual machine in a system creation container according to an operating system creation environment mirror image by using the installed virtual machine creation software;
starting the virtual machine in the system production container.
In one embodiment, the method further comprises:
responding to the operating system customization request, and starting to run at least one container corresponding to the operating system customization request in the server;
and taking at least one container corresponding to the operating system customization request as a system manufacturing container.
An image file generating apparatus of an operating system, the apparatus comprising:
the acquisition module is used for responding to the operating system customization request and acquiring the customization code;
the downloading module is used for downloading the operating system manufacturing environment mirror image of the specified version through the mirror image downloading script in the customized code;
the execution module is used for starting the virtual machine in a system manufacturing container operated by the server according to the operating system manufacturing environment mirror image; the virtual machine is used for constructing an operating system manufacturing environment;
the calling module is used for calling the virtual machine to run a preset operating system configuration script through the system manufacturing container; the operating system configuration script is used for carrying out configuration operation on the initial operating system in the operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system;
and the packaging module is used for packaging the target operating system and generating the mirror image file of the target operating system.
A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the above-mentioned method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program realizes the steps of the above-mentioned method when being executed by a processor.
A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the above-mentioned method when executed by a processor.
According to the method and the device for generating the image file of the operating system and the computer equipment, the customized code is obtained through the customized request, and the operating system manufacturing environment image of the specified version is downloaded through the image downloading script in the customized code; then, according to the operating system manufacturing environment mirror image, starting a virtual machine in a system manufacturing container operated by the server, wherein the virtual machine can be used for constructing an operating system manufacturing environment; calling a virtual machine to run a preset operating system configuration script through the system manufacturing container, and performing configuration operation on the initial operating system in the operating system manufacturing environment to obtain a target operating system; therefore, the customized codes of all versions can be pulled, the operating system manufacturing environment is virtualized by using a virtualization technology, the operating system manufacturing environment of each version is managed by using the image files, the initial operating system is configured and operated in the operating system manufacturing environment to obtain the target operating system meeting the user customized requirements, developers do not need to configure the image files of the operating system in a complicated manner, the phenomenon that a large amount of time and manpower are consumed in the process of manufacturing the image files is avoided, and the generation efficiency of generating the image files of the operating system is effectively improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for generating an image file of an operating system in one embodiment;
FIG. 2 is a flowchart illustrating a method for generating an image file of an operating system according to an embodiment;
FIG. 3 is a functional flow diagram of a method for generating an image file for an operating system, according to one embodiment;
FIG. 4 is a diagram illustrating the operating system's build environment architecture, in one embodiment;
FIG. 5 is a flowchart illustrating an alternative method for generating an image file for an operating system according to an embodiment;
FIG. 6 is a block diagram of an apparatus for generating an image file of an operating system according to an embodiment;
FIG. 7 is a diagram of the internal structure of a computer device, in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
The method for generating the image file of the operating system can be applied to the application environment shown in fig. 1. Wherein the terminal 102 may communicate with the server 104 over a network. The server 104 responds to an operating system customization request initiated by the terminal 102 to acquire a customization code; the server 104 downloads the operating system production environment image of the specified version through the image download script in the customized code; the server 104 starts a virtual machine in a system manufacturing container operated by the server according to the operating system manufacturing environment mirror image; the virtual machine is used for constructing an operating system manufacturing environment; the server 104 calls a virtual machine to run a preset operating system configuration script through the system manufacturing container; the operating system configuration script is used for carrying out configuration operation on the initial operating system in the operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system; server 104 encapsulates the target operating system and generates an image file of the target operating system. In practical applications, the terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
In one embodiment, as shown in fig. 2, a method for generating an image file of an operating system is provided, which is described by taking the method as an example applied to the server 104 in fig. 1, and includes the following steps:
step S202, responding to the operating system customizing request, and acquiring a customizing code.
The operating system customization request may be a request for the terminal to trigger the server to generate an operating system meeting the user customization requirement.
The operating system may refer to a preinstalled system for installing, deploying and repairing the Windows operating system. For example, the operating system may refer to a WinPE (Windows Preinstallation Environment) system.
The customized code may be code that a user inputs to customize an operating system having a specific function.
In practical applications, the customized code may include a production environment image download script code, an operating system creation script code, and a configuration file import script code.
In specific implementation, a user can select an operating system version needing to be customized through a terminal, so that the terminal sends an operating system customization request corresponding to the operating system version to a server, and the server receives and responds to the operating system customization request and downloads the customization code from a code warehouse. The code warehouse is pre-stored with customized codes pushed aiming at the version of the operating system.
For example, when a user uses an online code repository software GitLab (an open source project for a repository management system) to make a specific version of WinPE, after selecting the version of WinPE to be customized, the customized code corresponding to the version of WinPE is pushed to the GitLab code repository, so that the server can download the customized code from the GitLab code repository. Code branch management in the GitLab can manage customized WinPE codes of various versions, and the automatic and customized production control of WinPE is realized through the GitLab CI (continuous integration function provided by the GitLab).
And step S204, downloading the operating system manufacturing environment mirror image of the specified version through the mirror image downloading script in the customized code.
The image downloading script may refer to a script for downloading an operating system production environment image.
The operating system production environment image may refer to an environment image required when producing an operating system of a specified version.
In a specific implementation, after the server obtains the customized code from the code repository, the server may run the image download script in the customized code, so as to download the environment image file required for making the operating system of the specified version.
Step S206, according to the operating system manufacturing environment mirror image, starting a virtual machine in a system manufacturing container operated by a server; the virtual machine is used to build an operating system production environment.
Wherein the system authoring container may be a relatively independent runtime environment that provides the build application services.
The virtual machine may be a complete computer system which has a complete hardware system function and runs in a completely isolated environment through software simulation, and the work which can be completed in the physical computer can be realized in the virtual machine.
Wherein the operating system production environment may be a development environment required for producing a specified version of the operating system.
In the concrete implementation, after the server responds to the operating system customization request, the system manufacturing container is started, and the virtual machine is created and started in the system manufacturing container according to the operating system manufacturing environment mirror image.
For example, when the customized operation of the WinPE system is implemented in the open source project, gitLab, automatically starts pipeline (a functional component of GitLab cic, which is a construction task executed in stages), calls a Docker server (an open source application container engine) through GitLab Runner (open source project for running jobs and sending results back to GitLab) to start a CentOS container (a relatively independent running environment providing a service for constructing an application), and automatically downloads the customized code of a GitLab code repository. The operating system production environment image is downloaded by running a script in the customized code in the CentOS container to install a KVM virtualization software (an open source system virtualization module), and the operating system production environment image is created with the KVM virtualization software to create a Virtual Machine and start the Virtual Machine.
Step S208, calling a virtual machine to run a preset operating system configuration script through the system manufacturing container; the operating system configuration script is used for carrying out configuration operation on the initial operating system in an operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirements corresponding to the customization requests of the operating system.
The operating system configuration script may be a script used to create an initial operating system, import applications, install hardware drivers, and install language packages when configuring a target operating system.
The initial operating system may be a system having functions that the basic operating system should have when the target operating system is configured.
Wherein, the target operating system can be the target operating system which needs to be customized by the user.
In a specific implementation, the server may call the virtual machine in the system manufacturing container, run the operating system configuration script, and import the customized application program, the hardware driver program, and the language package required for configuring the target operating system into the initial operating system created in the virtual machine, so as to obtain the target operating system.
For example, when a WinPE having a specific function is created in a GitLab, after acquiring a customized code of a WinPE operating system, the GitLab automatically starts a pipeline, calls a Docker server through the GitLab Runner and starts a CentOS container therein, the CentOS container remotely calls a virtual machine through OpenSSH (implementation of encrypted communication through a computer network using SSH), runs a preset cmd script (command line interpreter application available in most Windows operating systems for executing an input command) in the virtual machine to obtain a pure WinPE, runs a preset cmd configuration script, imports a customized exe program (executable, a binary executable program that can be positioned in a storage space of the operating system in a floating manner) required for generating a target WinPE system in the pure WinPE, and installs required hardware drivers and language packages to generate the target WinPE system.
Step S210, packaging the target operating system and generating a mirror image file of the target operating system.
The image file may be an image file corresponding to an operating system with a specific function required by a user.
In a specific implementation, after configuring an operating system with a specific function in a pure operating system, the server may encapsulate the configured operating system with the specific function to generate an operating system image file with the specific function.
For example, after a target WinPE is generated, the WinPE is encapsulated to generate an ISO image, and the ISO image (an optical disc image that is an image File obtained by copying all information on an optical disc) is uploaded to a version directory corresponding to an FTP Server (File Transfer Protocol Server, a computer providing File storage and access services on the internet, and a computer providing services according to the FTP Protocol).
To facilitate understanding of those skilled in the art, fig. 3 provides a functional flowchart of a method for generating an image file of an operating system, taking customized WinPE as an example; after the customized code is obtained in the GitLab code warehouse, a Docker server is called through a GitLab Runner, a CentOS container is created in the Docker server, a customized code script is operated, KVM virtualization software is installed in the CentOS container, simultaneously an image file required by the customized WinPE is downloaded, a virtual machine is started, the image file of the customized WinPE is manufactured in the virtual machine, and the customized WinPE image file is packaged into an ISO image file and uploaded to a corresponding version directory of the FTP server.
In the method for generating the image file of the operating system, the customized code is obtained through the customized request, and the operating system manufacturing environment image of the specified version is downloaded through the image downloading script in the customized code; then according to the operating system manufacturing environment mirror image, starting a virtual machine in a system manufacturing container operated by the server, wherein the virtual machine can be used for constructing an operating system manufacturing environment; calling a virtual machine to run a preset operating system configuration script through the system manufacturing container, and performing configuration operation on the initial operating system in the operating system manufacturing environment to obtain a target operating system; therefore, customized codes of various versions can be pulled, an operating system manufacturing environment is virtualized by using a virtualization technology, image files are used for managing the operating system manufacturing environment of each version, a target operating system meeting the customization requirements of a user is obtained by configuring and operating an initial operating system in the operating system manufacturing environment, custom software, hardware drivers and language packages are led into the initial operating system, the customizing process of the operating system is managed in a coding and programming mode, the generation of the customized operating system is controlled, developers do not need to configure the image files of the operating system in a complicated mode, the operation is easier to operate when the operating system is manufactured, only the customized content of the WinPE system needs to be concerned, the customizing process of the WinPE system does not need to be concerned, the problem that a large amount of time and manpower are consumed in the process of manufacturing the image files is avoided, and the generation efficiency of the image files of the operating system is effectively improved.
In another embodiment, the operating system configuration script includes an operating system creation script and a configuration file import script, and the system production container calls the virtual machine to run a preset operating system configuration script, including: calling a virtual machine to run an operating system to create a script through a system manufacturing container; the operating system creating script is used for creating an initial operating system; acquiring a customized configuration file, and calling a virtual machine to run the configuration file import script through a system manufacturing container; the configuration file import script is used for importing a customized configuration file to the initial operating system so as to perform configuration operation on the initial operating system to obtain a target operating system.
Wherein the operating system creation script may be a script for creating an initial operating system in the started virtual machine.
The configuration file import script may be a script for importing a configuration file required by the target operating system to the initial operating system.
Wherein, the customized configuration file can be a configuration file required for manufacturing the target operating system.
The configuration file import script may be a script for importing a configuration file required for generating a customized operating system into an initial operating system.
In the specific implementation, after the server starts the virtual machine in the system manufacturing container, a preset operating system configuration script is run in the virtual machine, an operating system creation script in the operating system configuration script is run to create an initial operating system, a configuration file import script in the operating system configuration script is run to import an application program, a hardware driver and a language package required by manufacturing a target operating system into the initial operating system, and the target operating system is obtained.
For example, when the WinPE production environment virtual machine is remotely called in the CentOS container through OpenSSH, the server may run a preset cmd script for creating a pure WinPE to create a pure WinPE system in the WinPE production environment virtual machine, then run a preset cmd script which is a target WinPE configuration file to configure the file for the pure WinPE system, and generate a target WinPE.
According to the technical scheme, the system manufacturing container calls the virtual machine to run the operating system to create the script to create the initial operating system, the customized configuration file is obtained, the configuration file importing script is run in the initial operating system to configure the initial operating system, and the target operating system is obtained. Meanwhile, the virtual machine is used for manufacturing the operating system, so that the problems that the environment of the physical machine is damaged and not easy to recover due to errors in the manufacturing process when the physical machine is used for manufacturing can be effectively solved.
In another embodiment, the customized configuration file comprises a customized application program, a hardware driver and a language package, the configuration file import script comprises an application program import script, a hardware driver installation script and a language package installation script, and the virtual machine is called by the system manufacturing container to run the configuration file import script, which comprises: calling a virtual machine to run an application program import script through a system manufacturing container; the application program import script is used for importing the customized application program to an initial operating system; calling a virtual machine to run a hardware driver installation script through a system manufacturing container; the hardware driver installation script is used for installing a hardware driver to an initial operating system; calling a virtual machine running language package installation script through a system manufacturing container; the language package installation script is used for installing a language package to an initial operating system; and obtaining the target operating system.
The customized application program may be an application program that is generated after the operating system software code in the customized code is compiled and can run in the target operating system.
The hardware driver may be a software code program for implementing data transmission between the target operating system and the hardware device in the customized code, and may communicate the functions of the hardware device to the target operating system, or may communicate standard instructions of the target operating system to the hardware device.
The language package may be a program for converting the language originally displayed by the operating system into the language of another country when the target operating system is created.
The application import script may be a script for importing a compiled customized application into a target operating system.
The hardware driver installation script may be a script for importing a hardware driver required by the target operating system into the target operating system.
The language package installation script may be a script for importing a language package required by the target operating system into the target operating system.
In a specific implementation, the server may run an application program import script in an initial operating system created in the virtual machine in the manufacturing environment to import an application program required by the target operating system, run a hardware driver installation script to install a hardware driver required by the target operating system, and run a language package installation script to install a language package required by the target operating system.
For example, when the WinPE is manufactured, the server may run a customized exe program in which an application import script in a cmd script is imported into a target operating system in a virtual machine, run a hardware driver installation script in the cmd script to install a hardware driver required by the target operating system, and run a language package installation script in the cmd script to install a language package required by the target operating system. Therefore, bat scripts can be run in a WinPE production environment, and customized exe programs, hardware drivers, language packages and the like are imported into the generated WinPE, so that generation of the target WinPE is controlled.
According to the technical scheme, the virtual machine is called through the system manufacturing container to run the application program importing script, the customized application program is imported to the initial operating system, the hardware driver installing script is run, the hardware driver is installed to the initial operating system, the language package installing script is run, and the language package is installed to the initial operating system, so that generation of the target operating system is controlled, manufacturing of the operating system is easier, the customizing process of the operating system is not required to be concerned, and only the customized content of the operating system is required to be concerned.
In another embodiment, obtaining a customized configuration file comprises: acquiring a customized application program code in a customized code; compiling the customized application program codes through pre-installed compiling software to obtain a customized application program; and taking the customized application program as a customized configuration file.
Wherein the customized application code may be software code required by the target operating system.
The compiled software may be software that compiles software code required by the target operating system to generate an executable customized application program.
Wherein the customized application may be an application required by the target operating system.
Wherein the customized configuration file may be a file required to configure the target operating system in the initial operating system.
In a specific implementation, the server may install compiling software, and the server may compile a customized application program code in the acquired customized code by using the compiling software to generate a customized application program of the configurable target operating system.
For example, when the server makes WinPE, the server may install C + + compiling software, and compile a customized application program code in the acquired customized code of the target WinPE version by using the C + + compiling software to generate a customized exe program capable of running in WinPE.
According to the technical scheme of the embodiment, the customized application program codes in the customized codes are obtained, the customized application program is obtained by compiling the customized application program codes through the pre-installed compiling software, and the customized application program is used as the customized configuration file, so that the operating system software codes in the customized codes are generated into the executable application program, namely the configuration file required by the customized operating system is generated, and the problem of software integration of the customized operating system is solved.
In another embodiment, booting a virtual machine in a system production container in accordance with an operating system production environment image includes: installing virtual machine manufacturing software in a system manufacturing container; creating a virtual machine in a system creation container according to an operating system creation environment mirror image by using the installed virtual machine creation software; the virtual machine is started in the system fabrication container.
The virtual machine creation software may refer to software for creating a virtual machine. For example, the virtual machine authoring software may be KVM virtualization software.
In a specific implementation, the server may run a customized code script in the system production container to install the virtual machine production software and download the operating system production environment image, and then call the virtual machine production software, and create and start the virtual machine in the operating system production container according to the operating system production environment image.
For example, when a customized WinPE system is manufactured in the CentOS container, a script in the customized code is run to install KVM virtualization software and download a manufacturing environment image of the WinPE system, and a virtual machine is created and started in the CentOS container according to the manufacturing environment image of the WinPE system. The KVM virtualization technology can virtualize a WinPE system manufacturing environment (i.e., a Windows environment in which Windows ADK/AIK software is installed), and manage the WinPE system manufacturing environment of each version by using a mirror image technology.
According to the technical scheme of the embodiment, the server calls the virtual machine manufacturing software installed in the system manufacturing container, the virtual machine is created and started according to the operating system manufacturing environment mirror image, and therefore the problem of software compatibility conflict is avoided in the manufacturing process of operating systems of different versions due to the fact that the operating system manufacturing environments of the versions are managed by the aid of the virtualization method and the mirror image.
In another embodiment, in response to the operating system customization request, at least one container corresponding to the operating system customization request is started to run in the server; and taking at least one container corresponding to the operating system customization request as a system manufacturing container.
Where a container may be a process or set of processes isolated from the rest of the server operating system.
In a specific implementation, when the server receives a plurality of operating system customization requests, the server may respectively start corresponding containers according to the operating system customization codes of each version, and the containers serve as corresponding system manufacturing containers.
For example, when a Docker server is called to start a CentOS to produce a target operating system, as shown in fig. 4, a plurality of CentOS containers may be simultaneously started, and production of target operating systems of different versions is completed in each CentOS container, and production processes of each operating system are not affected by each other, that is, a container isolation mechanism of Docker is used to implement a function of a batched customized WinPE system. As can be seen, docker containerization may manage the pulling of customized code, the downloading of drivers, the downloading of images, and the starting of virtual machines.
According to the technical scheme of the embodiment, the plurality of containers capable of running the plurality of operating system customizing requests are started in the server by responding to the plurality of operating system customizing requests and are respectively used as corresponding system manufacturing containers, so that the operating systems are customized in batches.
In another embodiment, as shown in fig. 5, a method for generating an image file of an operating system is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
step 502, responding to an operating system customization request, and acquiring a customization code;
step 504, downloading the operating system production environment image of the specified version through the image downloading script in the customized code;
step 506, according to the operating system manufacturing environment mirror image, starting a virtual machine in a system manufacturing container operated by a server; the virtual machine is used for constructing an operating system manufacturing environment;
step 508, calling the virtual machine to run the operating system to create a script through the system manufacturing container; the operating system creating script is used for creating an initial operating system;
step 510, obtaining a customized application program code in the customized code;
step 512, compiling the customized application program code through the pre-installed compiling software to obtain a customized application program;
step 514, taking the customized application program as a customized configuration file, and calling a virtual machine to run the configuration file and import a script through the system manufacturing container; the configuration file import script is used for importing a customized configuration file to an initial operating system so as to carry out configuration operation on the initial operating system to obtain a target operating system;
step 516, packaging the target operating system and generating an image file of the target operating system.
It should be noted that, for the specific limitations of the above steps, reference may be made to the above specific limitations of the image file generation method of the operating system, and details are not repeated again.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides an image file generation apparatus of an operating system, which is used for implementing the image file generation method of the operating system. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so specific limitations in the following embodiments of one or more image file generation devices of an operating system may refer to the above limitations on the image file generation method of the operating system, and are not described herein again.
In one embodiment, as shown in fig. 6, there is provided an image file generating apparatus of an operating system, including:
an obtaining module 602, configured to obtain a customized code in response to an operating system customization request;
a downloading module 604, configured to download the operating system production environment image of the specified version through an image downloading script in the customized code;
an execution module 606, configured to start a virtual machine in a system production container run by a server according to the operating system production environment image; the virtual machine is used for constructing an operating system manufacturing environment;
a calling module 608, configured to call, through the system manufacturing container, the virtual machine to run a preset operating system configuration script; the operating system configuration script is used for carrying out configuration operation on the initial operating system in the operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system;
the packaging module 610 is configured to package the target operating system and generate an image file of the target operating system.
In one embodiment, the os configuration script includes an os creation script and a configuration file import script, and the calling module 608 is specifically configured to call, through the system production container, the virtual machine to run the os creation script; the operating system creating script is used for creating an initial operating system; acquiring a customized configuration file, and calling a virtual machine to run the configuration file import script through a system manufacturing container; the configuration file import script is used for importing a customized configuration file to the initial operating system so as to perform configuration operation on the initial operating system to obtain a target operating system.
In one embodiment, the customized configuration file includes a customized application, a hardware driver, and a language package, the configuration file import script includes an application import script, a hardware driver installation script, and a language package installation script, and the calling module 608 is specifically configured to call the virtual machine to run the application import script through the system manufacturing container; the application program import script is used for importing the customized application program to an initial operating system; calling a virtual machine to run a hardware driver installation script through a system manufacturing container; the hardware driver installation script is used for installing a hardware driver to an initial operating system; calling a virtual machine running language package installation script through a system manufacturing container; the language package installation script is used for installing a language package to an initial operating system; and obtaining the target operating system.
In one embodiment, the method includes acquiring a customized configuration file, and acquiring module 602, specifically configured to acquire a customized application code in a customized code; compiling the customized application program codes through pre-installed compiling software to obtain a customized application program; and taking the customized application program as a customized configuration file.
In one embodiment, according to the os production environment image, a virtual machine is started in a system production container, and the execution module 606 is specifically configured to install virtual machine production software in the system production container; creating a virtual machine in a system creation container according to an operating system creation environment mirror image by using the installed virtual machine creation software; the virtual machine is started in the system fabrication container.
In one embodiment, the apparatus further comprises: the response module is used for responding to the operating system customizing request and starting and running at least one container corresponding to the operating system customizing request in the server; and the determining module is used for taking at least one container corresponding to the customizing request of the operating system as a system manufacturing container.
All or part of each module in the image file generation device of the operating system can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing image file generation data of an operating system. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an image file generation method of an operating system.
It will be appreciated by those skilled in the art that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform the steps of the above-described image file generation method for an operating system. Here, the steps of an image file generation method of an operating system may be the steps in an image file generation method of an operating system according to the above embodiments.
In one embodiment, a computer-readable storage medium is provided, which stores a computer program, which, when executed by a processor, causes the processor to perform the steps of the above-mentioned image file generation method for an operating system. Here, the steps of an image file generation method of an operating system may be steps in an image file generation method of an operating system according to the foregoing embodiments.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, causes the processor to perform the steps of the above-described image file generation method for an operating system. Here, the steps of an image file generation method of an operating system may be steps in an image file generation method of an operating system according to the foregoing embodiments.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims (10)

1. A method for generating an image file of an operating system is applied to a server and comprises the following steps:
responding to an operating system customization request, and acquiring a customization code;
downloading the operating system manufacturing environment mirror image of the specified version through the mirror image downloading script in the customized code;
according to the operating system manufacturing environment mirror image, starting a virtual machine in a system manufacturing container operated by the server; the virtual machine is used for constructing an operating system manufacturing environment;
calling the virtual machine to run a preset operating system configuration script through the system manufacturing container; the operating system configuration script is used for carrying out configuration operation on an initial operating system in the operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system;
and encapsulating the target operating system to generate an image file of the target operating system.
2. The method of claim 1, wherein the os configuration script comprises an os creation script and a configuration file import script, and the invoking the virtual machine by the system production container to run a preset os configuration script comprises:
calling the virtual machine to run the operating system creating script through the system manufacturing container; the operating system creating script is used for creating the initial operating system;
acquiring a customized configuration file, and calling the virtual machine to run the configuration file import script through the system manufacturing container; the configuration file import script is used for importing the customized configuration file to the initial operating system so as to perform configuration operation on the initial operating system to obtain the target operating system.
3. The method of claim 2, wherein the customized configuration file comprises a customized application, a hardware driver, and a language package, wherein the configuration file import script comprises an application import script, a hardware driver installation script, and a language package installation script, and wherein invoking the virtual machine through the system authoring container to run the configuration file import script comprises:
calling the virtual machine to run the application program import script through the system manufacturing container; the application program import script is used for importing the customized application program to the initial operating system;
calling the virtual machine to run the hardware driver installation script through the system manufacturing container; the hardware driver installation script is used for installing the hardware driver to the initial operating system;
calling the virtual machine to run the language package installation script through the system manufacturing container; the language package installation script is used for installing the language package to the initial operating system; and obtaining the target operating system.
4. The method of claim 2, wherein obtaining the customized configuration file comprises:
acquiring a customized application program code in the customized code;
compiling the customized application program codes through pre-installed compiling software to obtain a customized application program;
and taking the customized application program as the customized configuration file.
5. The method of claim 1, wherein said starting a virtual machine in a system production container run by the server according to the operating system production environment image comprises:
installing virtual machine manufacturing software in the system manufacturing container;
creating the virtual machine in the system manufacturing container according to the operating system manufacturing environment mirror image by using the installed virtual machine manufacturing software;
starting the virtual machine in the system fabrication container.
6. The method of claim 1, further comprising:
responding to the operating system customization request, and starting to run at least one container corresponding to the operating system customization request in the server;
and taking at least one container corresponding to the operating system customization request as the system manufacturing container.
7. An image file generation device of an operating system, which is applied to a server, the device comprising:
the acquisition module is used for responding to the operating system customization request and acquiring the customization code;
the downloading module is used for downloading the operating system manufacturing environment mirror image of the specified version through the mirror image downloading script in the customized code;
the execution module is used for starting a virtual machine in a system manufacturing container operated by the server according to the operating system manufacturing environment mirror image; the virtual machine is used for constructing an operating system manufacturing environment;
the calling module is used for calling the virtual machine to run a preset operating system configuration script through the system manufacturing container; the operating system configuration script is used for carrying out configuration operation on an initial operating system in the operating system manufacturing environment to obtain a target operating system; the target operating system is a system which meets the customization requirement corresponding to the customization request of the operating system;
and the packaging module is used for packaging the target operating system and generating the mirror image file of the target operating system.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202210977143.2A 2022-08-15 2022-08-15 Method and device for generating image file of operating system and computer equipment Pending CN115344275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210977143.2A CN115344275A (en) 2022-08-15 2022-08-15 Method and device for generating image file of operating system and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210977143.2A CN115344275A (en) 2022-08-15 2022-08-15 Method and device for generating image file of operating system and computer equipment

Publications (1)

Publication Number Publication Date
CN115344275A true CN115344275A (en) 2022-11-15

Family

ID=83952241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210977143.2A Pending CN115344275A (en) 2022-08-15 2022-08-15 Method and device for generating image file of operating system and computer equipment

Country Status (1)

Country Link
CN (1) CN115344275A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661951A (en) * 2023-06-02 2023-08-29 北京首都在线科技股份有限公司 Mirror image file processing method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108322490A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 The method, apparatus and server of virtual machine configuration and the distributed cloud service system of deployment
CN108614701A (en) * 2016-12-26 2018-10-02 中移(苏州)软件技术有限公司 A kind of (SuSE) Linux OS method for customizing and device
CN108664313A (en) * 2018-05-18 2018-10-16 广州杰赛科技股份有限公司 The online production method of image file, device, server, system and storage medium
CN109117148A (en) * 2018-07-12 2019-01-01 湖北省楚天云有限公司 A kind of method and system of the application deployment on cloud computing platform
CN110413293A (en) * 2019-07-23 2019-11-05 深圳忆联信息系统有限公司 The method and device that system deployment process modifies to standard mirror image
US10782952B1 (en) * 2016-03-30 2020-09-22 Amazon Technologies, Inc. Generating machine images from software packages
CN112486505A (en) * 2019-09-12 2021-03-12 无锡江南计算技术研究所 Containerized cross-platform operating system image building method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10782952B1 (en) * 2016-03-30 2020-09-22 Amazon Technologies, Inc. Generating machine images from software packages
CN108614701A (en) * 2016-12-26 2018-10-02 中移(苏州)软件技术有限公司 A kind of (SuSE) Linux OS method for customizing and device
CN108322490A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 The method, apparatus and server of virtual machine configuration and the distributed cloud service system of deployment
CN108664313A (en) * 2018-05-18 2018-10-16 广州杰赛科技股份有限公司 The online production method of image file, device, server, system and storage medium
CN109117148A (en) * 2018-07-12 2019-01-01 湖北省楚天云有限公司 A kind of method and system of the application deployment on cloud computing platform
CN110413293A (en) * 2019-07-23 2019-11-05 深圳忆联信息系统有限公司 The method and device that system deployment process modifies to standard mirror image
CN112486505A (en) * 2019-09-12 2021-03-12 无锡江南计算技术研究所 Containerized cross-platform operating system image building method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661951A (en) * 2023-06-02 2023-08-29 北京首都在线科技股份有限公司 Mirror image file processing method and device, electronic equipment and storage medium
CN116661951B (en) * 2023-06-02 2024-05-14 北京首都在线科技股份有限公司 Mirror image file processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107766126B (en) Container mirror image construction method, system and device and storage medium
CN111176802B (en) Task processing method and device, electronic equipment and storage medium
CN105378689B (en) Method and apparatus for unified Extensible Firmware Interface (UEFI) driver and agreement
US20040010734A1 (en) Deployment and execution of a program on an embedded device
EP3336690A1 (en) Extensible data transformation authoring and validation system
US11667033B2 (en) Systems and methods for robotic process automation
US20110078672A1 (en) Classloading Technique for an Application Server that Provides Dependency Enforcement
CN105335173A (en) Method, apparatus and system for initializing intelligent terminal device
CN112189187B (en) Extensibility of unified platform
CA2621810A1 (en) Extensible mechanism for object composition
WO2022148390A1 (en) Methods for deploying, updating and calling smart contract in blockchain
CN107239309B (en) Patch generation method and device, updating method, electronic device and storage medium
CN115309562A (en) Operator calling system, operator generating method and electronic equipment
CN106796521B (en) API version control independent of product release
CN115344275A (en) Method and device for generating image file of operating system and computer equipment
US20110078659A1 (en) Java-Based Application Server that Supports Multiple Component Models
US7421715B1 (en) System and method for dynamic late-binding of persistent object implementations in software-based systems
CN112748905B (en) Method and device for initializing and calling basic library, electronic equipment and storage medium
US10552135B1 (en) Reducing a size of an application package
CN110659022B (en) Method for automatically calling Python script based on Java
US9965260B2 (en) Software product release automation framework
CN114237760B (en) Method for packaging industrial mechanism model into container mirror image and publishing web service
CN106951288B (en) Development and application method and device of hot upgrade resource
CN114237638A (en) Operating system installation method and device, computer equipment and storage medium
CN114860202A (en) Project operation method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20221115