CN110888650B - Method and system for customizing operating system mirror image - Google Patents

Method and system for customizing operating system mirror image Download PDF

Info

Publication number
CN110888650B
CN110888650B CN201910966458.5A CN201910966458A CN110888650B CN 110888650 B CN110888650 B CN 110888650B CN 201910966458 A CN201910966458 A CN 201910966458A CN 110888650 B CN110888650 B CN 110888650B
Authority
CN
China
Prior art keywords
file
operating system
drive
image
customized
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.)
Active
Application number
CN201910966458.5A
Other languages
Chinese (zh)
Other versions
CN110888650A (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910966458.5A priority Critical patent/CN110888650B/en
Publication of CN110888650A publication Critical patent/CN110888650A/en
Application granted granted Critical
Publication of CN110888650B publication Critical patent/CN110888650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

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

Abstract

The embodiment of the invention discloses a method and a system for customizing an operating system mirror image, which comprises the steps of obtaining version information and a drive file of a current operating system; judging whether the drive file is a drive source code file, if so, compiling the drive source code file, storing the compiled drive file and the version information of the operating system, and if not, directly storing the drive file and the version information of the operating system; and adding the stored drive file into the original operating system image to generate a customized operating system image file. The invention realizes the automation and progress visualization of the mirror image adding drive process of the operating system, and the system and the device can be adapted to all operating systems. The system can be used as basic equipment, so that the working efficiency is improved, the customer requirements are met, and the customer satisfaction is improved.

Description

Method and system for customizing operating system mirror image
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for customizing an operating system mirror image.
Background
The development speed of computer hardware is faster and faster, and the development of client services is far behind the development of hardware technology. In order to maintain the technical advancement and business stability, the latest Intel platform server product is usually purchased by the client, but the business system is required to run on the old version of the operating system for several years. And the old versions of operating systems either do not support some hardware of the new platforms, or the hardware drive versions contained in the old versions of operating systems are too old to support the operation of the new hardware well. The best solution is to upgrade the operating system, but this new operating system is often not accepted quickly by most people and is less practical. Often the customer requirements still continue to use the previous, older version of the operating system and ensure that the business runs stably on the new hardware platform.
The solution in this environment is to add or upgrade hardware drivers in the guest operating system, with two solutions: one is to install the old version of the operating system, then install or upgrade the driver, and finally deploy the business system. However, in the step of installing the old version of the operating system, the operating system may not be installed and may be down after installation because the operating system does not support the new hardware platform. The second scheme is to customize the operating system image, add the new driver to the operating system image, regenerate the operating system image file, install the system using the customized operating system image file, and deploy the service. The second approach overcomes the problems that may be encountered with the first approach, but currently requires the use of different tools or a series of different commands to customize the image for different operating systems, which is very complex and error prone.
Disclosure of Invention
The embodiment of the invention provides a method and a system for customizing an operating system mirror image, which are optimized aiming at the second scheme of adding a new hardware drive customized mirror image and solve the problems of complex operation and easy error.
In order to solve the technical problem, the embodiment of the invention discloses the following technical scheme:
the invention provides a method for customizing an operating system image in a first aspect, which comprises the following steps:
acquiring version information and a drive file of a current operating system;
judging whether the drive file is a drive source code file, if so, compiling the drive source code file, storing the compiled drive file and the version information of the operating system, and if not, directly storing the drive file and the version information of the operating system;
and adding the stored drive file into the original operating system image to generate a customized operating system image file.
Further, the method comprises the steps of:
and displaying the generated storage address of the operating system image file on a web interface.
Further, the specific process of compiling the driving source code file is as follows:
installing the operating system of the corresponding version in a PXE mode according to the operating system version information;
and copying the drive source code file to an operating system directory, executing a make command, and generating a ko file.
Further, the specific process of generating the customized operating system image file is as follows:
extracting a corresponding operating system file from an original operating system image according to the type of the operating system;
adding the stored driver file into one of a start file, a kernel file or an installation file according to the type of the driver;
copying a starting file, a kernel file and an installation file to a directory corresponding to an original operating system image, and storing the starting file, the kernel file and the installation file as a customized operating system image, wherein the starting file, the kernel file or the installation file comprises a drive file.
Further, when the stored drive file is added to an installation file, the index value of the current installation file is judged; and obtaining an index corresponding to the current operating system version, and adding the stored drive file to the part corresponding to the index.
Further, the method further comprises the steps of copying the boot files, the kernel files and the installation files before the boot files, the kernel files and the installation files are not modified back to the original operating system image files after the customized operating system image is obtained, and recovering the original operating system image files to be in the initial state.
A second aspect of the present invention provides a system for customizing an operating system image, the system comprising:
the customized information receiving module corresponds to the web interface and is used for receiving the version information of the operating system and the driving file input by the user on the web interface,
the storage module is used for storing and backing up an original operating system image file, a customized operating system image file and a drive file in a classified manner, wherein the drive file is a non-source code drive file and a compiled drive file;
the drive compiling module is used for compiling the drive source code file acquired by the customized information receiving module to generate a ko file;
and the drive adding module is used for adding the stored drive files into the original operating system image and generating the customized operating system image files.
Furthermore, the system also comprises a customized mirror image monitoring module, wherein the customized mirror image monitoring module is used for monitoring the whole mirror image customization process, displaying the manufacturing progress of the customized operating system mirror image on a WEB interface through a progress bar, and returning to the storage position of the customized operating system mirror image.
Further, the drive adding module includes:
the operating system file acquisition unit is used for extracting a corresponding operating system file from an original operating system image according to the type of the operating system;
the file modification unit is used for adding the stored drive file into one of a start file, a kernel file or an installation file according to the type of the drive;
and the customized image unit is used for copying the starting file, the kernel file and the installation file to a directory corresponding to the original operating system image and storing the starting file, the kernel file and the installation file as a customized operating system image.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
the method improves the scheme of adding a new hardware drive customized mirror image at present, and avoids the defects that different methods, different tools and step-by-step manual execution are needed to be adopted for different operating systems in the prior art. The invention obtains the version information and the drive file of the operating system input by a user through the web interface, identifies the version and the type of the drive file of the operating system, extracts the corresponding operating system file from the original mirror image, modifies the boot file, the kernel file or the installation file, generates the customized operating system mirror image, realizes the automation and the visualization of the progress of the process of adding the drive to the operating system mirror image, and the system and the device can be adapted to all operating systems. The system can be used as basic equipment, so that the working efficiency is improved, the customer requirements are met, and the customer satisfaction is improved.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of the process of the present invention;
FIG. 2 is a schematic structural diagram of embodiment 1 of the system of the present invention;
fig. 3 is a schematic structural diagram of embodiment 2 of the system of the present invention.
Detailed Description
In order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
As shown in FIG. 1, the method for customizing an operating system image of the present invention comprises the following steps:
s1, acquiring version information and drive files of the current operating system;
s2, judging whether the drive file is a drive source code file;
s3, if yes, compiling the drive source code file, and storing the compiled drive file and the version information of the operating system;
s4, if not, directly storing the drive file and the version information of the operating system;
and S5, adding the stored driver file into the original operating system image to generate a customized operating system image file.
And S6, displaying the generated saving address of the operating system image file on a web interface.
In step S1, the version letter and the driver file of the operating system are obtained by acquiring the information input by the user on the web interface.
In step S2, the non-driver source code file includes a driver file already compiled for a ko file of a Linux system, an inf file of a Windows system, and the like. And judging whether the acquired drive file is the file of the type, and knowing whether the drive file is a drive source code file.
In step S3, if it is determined to be a drive source file, the drive source file includes the h file, the c file, and the Makefile related to the drive. The specific process of compiling the drive source code file comprises the following steps:
installing the operating system of the corresponding version in a PXE mode according to the version information of the operating system; and copying the drive source code file to an operating system directory, executing a make command, and generating a ko file. The make command determines files to be compiled, corresponding compiling methods and methods for connecting the files into ko files according to the content of the Makefile in the drive source code file.
The process of compiling the drive source code file in step S3 is mainly for the Linux operating system, because the Windows operating system is a closed-loop system, and all the files obtained in step S1 are already compiled inf files, so step S3 finally generates a ko file.
In step S5, the specific process of generating the customized operating system image file is as follows:
s51, extracting corresponding operating system files, such as boot. wim file and install. wim file of Windows system, vmlinux file and initramfs/initrd file of Linux system, from the original operating system image according to the operating system type; to prevent subsequent revisions, these files need to be backed up at the same time.
S52, according to the type of the driver, adding the stored driver file to one of a boot file, a kernel file or an installation file, where the boot file is a boot. The display card driver generally responsible for display and the RAID card driver responsible for storage control need to be added to the boot file, and other drivers that do not affect system boot installation may be added to the kernel file or the installation file.
The method for adding the driver into the kernel file or the installation file uses slightly different tools, commands or methods according to different operating systems, but the principle is consistent, namely, the kernel file and the installation file are firstly decompressed, then the driver file is copied into the kernel file and the installation file, and finally the kernel file and the installation file are packaged. For example, Windows system uses the command related to the dis tool, Linux system uses the related commands of gzip, cp, mkinitrd, etc. to decompress, copy and then pack into new kernel file and installation file.
For a Windows system, for example, any image file of the Windows server2016 includes installation files of all versions, and it is necessary to determine the value of index of the installation file install. Wim of Windows Server2016, contains all versions of installation files, and the Index has a value of 4. Each Index corresponds to a different version and a different function of the Windows server2016, and different indexes are operated according to different version information of the operating system acquired in step S1. If the version information of the operating system input by the user is a standard Chinese version, the index is judged to be 1, and only the part of the index of 1 in install. The phenomenon that the same drive is added in each index to cause that the mirror image file of the operating system is too large and cannot be stored in a U disk or an optical disk is avoided.
And S53, copying the boot file, the kernel file and the installation file to a directory corresponding to the original operating system image, and storing the boot file, the kernel file or the installation file as a customized operating system image, wherein the boot file, the kernel file or the installation file comprises a drive file.
According to the steps S1-S5, the customization of the operating system mirror image is realized, the method is a universal method and is not limited by the version of the operating system, the whole process is automatically completed, manual participation is not needed, the working efficiency is improved, and the error rate is reduced.
To further improve the above steps, step S6 is further included, after obtaining the customized os image, copying the boot files, kernel files, and installation files before being modified in step S5 back to the original os image file, and restoring the original os image file to the original state. And simultaneously displaying the manufacturing progress of the customized operating system mirror image on a WEB interface through a progress bar, and returning the storage position of the customized operating system mirror image for the user to download.
As shown in fig. 2, the customization system of the operating system image of the present invention includes a customization information receiving module 1, a storage module, a driver compiling module 3, and a driver adding module 4.
The customized information receiving module 1 corresponds to the web interface, and is configured to receive the operating system version information and the driver file input by the user on the web interface, and simultaneously determine whether the driver file is a driver source code file, if so, send the driver file to the driver compiling module 3, and if not, send the acquired operating system version information and the driver file to the storage module 2 through the network.
After receiving the version information of the operating system and the drive file sent by the customized information receiving module, the storage module 2 first determines whether the operating system image is stored in the storage server, if not, downloads the corresponding operating system version image from the network, and stores the drive file in a specific position on the storage server according to the type of the drive file and the corresponding operating system version. The storage module 2 stores and backups the original operating system image file, the customized operating system image file and the drive file in a classified manner, wherein the drive file is a non-source code drive file and a compiled drive file. The backup time and the backup number can be customized, and the storage module 2 automatically scans all files on the storage server in the backup time period and performs backup operation on the files without backup.
And the drive compiling module 3 compiles the drive source code file acquired by the customized information receiving module to generate a ko file.
The driver adding module 4 is configured to add the stored driver file to the original operating system image, and generate a customized operating system image file. The drive adding module comprises an operating system file obtaining unit, a file modifying unit and a customized mirror image unit. The operating system file acquisition unit is used for extracting a corresponding operating system file from an original operating system image according to the type of the operating system; the file modification unit is used for adding the drive file in the storage module 2 to one of a start file, a kernel file or an installation file according to the type of the drive; and the customized image unit is used for copying the starting file, the kernel file and the installation file to a directory corresponding to the original operating system image and storing the starting file, the kernel file and the installation file as a customized operating system image.
As shown in fig. 3, on the basis of the foregoing embodiment, the customization system for operating system image of the present embodiment further includes a customization image monitoring module 5. The customized image monitoring module 5 is used for monitoring the whole image customizing process, displaying the making progress of the customized operating system image on a WEB interface through a progress bar, and returning the storage position of the customized operating system image, so that the user can download the customized operating system image conveniently.
The foregoing is only a preferred embodiment of the present invention, and it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the principle of the invention, and such modifications and improvements are also considered to be within the scope of the invention.

Claims (9)

1. A method for customizing an operating system image is characterized by comprising the following steps:
obtaining version information and a drive file of an operating system by obtaining information input by a user on a web interface;
judging whether the drive file is a drive source code file, if so, compiling the drive source code file, storing the compiled drive file and version information of an operating system, and if not, directly storing the drive file and the version information of the operating system;
and adding the stored drive file into the original operating system image to generate a customized operating system image file.
2. The method for customizing an operating system image of claim 1, further comprising the steps of:
and displaying the generated storage address of the operating system image file on a web interface.
3. The method for customizing an operating system image according to claim 1 or 2, wherein the specific process of compiling the driver source code file is as follows:
installing the operating system of the corresponding version in a PXE mode according to the operating system version information;
and copying the drive source code file to an operating system directory, executing a make command, and generating a ko file.
4. The method for customizing an operating system image according to claim 1 or 2, wherein the specific process for generating the customized operating system image file comprises:
extracting a corresponding operating system file from an original operating system image according to the type of the operating system;
adding the stored driver file into one of a start file, a kernel file and an installation file according to the type of a driver;
copying a starting file, a kernel file and an installation file to a directory corresponding to an original operating system image, and storing the starting file, the kernel file and the installation file as a customized operating system image, wherein the starting file, the kernel file or the installation file comprises a drive file.
5. The method of claim 4, wherein when the stored driver file is added to an installation file, determining an index value of a current installation file; and obtaining an index corresponding to the current operating system version, and adding the stored drive file to the part corresponding to the index.
6. The method of claim 4, further comprising, after obtaining the customized operating system image, copying boot files, kernel files, and installation files before modification back to the original operating system image, and restoring the original operating system image to its original state.
7. A system for customizing an operating system image, the system comprising:
the customized information receiving module corresponds to the web interface and is used for receiving the version information of the operating system and the driving file input by the user on the web interface,
the storage module is used for storing and backing up an original operating system image file, a customized operating system image file and a drive file in a classified manner, wherein the drive file is a non-source code drive file and a compiled drive file;
the drive compiling module is used for compiling the drive source code file acquired by the customized information receiving module to generate a ko file;
and the drive adding module is used for adding the stored drive files into the original operating system image and generating the customized operating system image files.
8. The system of claim 7, further comprising a customized image monitoring module, wherein the customized image monitoring module is configured to monitor the entire image customization process, and display the progress of the customized image of the operating system on the WEB interface via a progress bar, and return the storage location of the customized image of the operating system.
9. The operating system image customization system according to claim 8, wherein the driver addition module comprises:
the operating system file acquisition unit is used for extracting a corresponding operating system file from an original operating system image according to the type of the operating system;
the file modification unit is used for adding the stored drive file into one of a start file, a kernel file and an installation file according to the type of the drive;
and the customized image unit is used for copying the starting file, the kernel file and the installation file to a directory corresponding to the original operating system image and storing the starting file, the kernel file and the installation file as a customized operating system image.
CN201910966458.5A 2019-10-12 2019-10-12 Method and system for customizing operating system mirror image Active CN110888650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910966458.5A CN110888650B (en) 2019-10-12 2019-10-12 Method and system for customizing operating system mirror image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910966458.5A CN110888650B (en) 2019-10-12 2019-10-12 Method and system for customizing operating system mirror image

Publications (2)

Publication Number Publication Date
CN110888650A CN110888650A (en) 2020-03-17
CN110888650B true CN110888650B (en) 2022-08-16

Family

ID=69746028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910966458.5A Active CN110888650B (en) 2019-10-12 2019-10-12 Method and system for customizing operating system mirror image

Country Status (1)

Country Link
CN (1) CN110888650B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552479A (en) * 2020-05-06 2020-08-18 湖南国科微电子股份有限公司 Mirror image file compiling method and device and electronic equipment
CN111857754A (en) * 2020-07-22 2020-10-30 深圳忆联信息系统有限公司 Universal Windows driver deployment method and device, computer equipment and storage medium
CN112130930B (en) * 2020-09-23 2023-08-22 平安科技(深圳)有限公司 Mirror image system generation method, device, equipment and medium
CN112256290B (en) * 2020-11-02 2022-06-14 北京中宏立达信创科技有限公司 Device and method for deploying integrated operating system
CN116775058A (en) * 2023-06-25 2023-09-19 深圳市青葡萄科技有限公司 Mirror image starting method compatible with heterogeneous hardware, terminal and server
CN117648110A (en) * 2024-01-29 2024-03-05 麒麟软件有限公司 Method for independently packaging kernel images by separating AOSP compiling environment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614701A (en) * 2016-12-26 2018-10-02 中移(苏州)软件技术有限公司 A kind of (SuSE) Linux OS method for customizing and device
CN109783117A (en) * 2019-01-18 2019-05-21 中国人民解放军国防科技大学 Mirror image file making and starting method of diskless system
CN109840096A (en) * 2019-01-02 2019-06-04 紫光华山信息技术有限公司 The installation method and device of operating system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614701A (en) * 2016-12-26 2018-10-02 中移(苏州)软件技术有限公司 A kind of (SuSE) Linux OS method for customizing and device
CN109840096A (en) * 2019-01-02 2019-06-04 紫光华山信息技术有限公司 The installation method and device of operating system
CN109783117A (en) * 2019-01-18 2019-05-21 中国人民解放军国防科技大学 Mirror image file making and starting method of diskless system

Also Published As

Publication number Publication date
CN110888650A (en) 2020-03-17

Similar Documents

Publication Publication Date Title
CN110888650B (en) Method and system for customizing operating system mirror image
US8387045B2 (en) Cloning image creation using virtual machine environment
US8261253B2 (en) Method for restoring software applications on desktop computers
US7356816B2 (en) Method and apparatus for multiplatform migration
CN102375764B (en) Method and system for managing deployment failure in software deployment
EP1906302A1 (en) Usage of virtualization software for shipment of software products
US8584115B2 (en) Automated operating system device driver updating system
EP1073955B1 (en) Method, system, apparatus and program product for distribution and instantiation of software upgrades
US7047403B2 (en) Method and system for operating system recovery and method of using build-to-configuration mode to model computer system
US20150339149A1 (en) Techniques for performing virtual machine software upgrades using virtual disk swapping
JP2002196945A (en) Upgrading system and method of device driver
CN104881314A (en) Method for installing driver and driver installation device
US20120167090A1 (en) Hypervisor for starting a virtual machine
WO2008132032A1 (en) Remotely deploying and automatically customizing workstation images
EP1654670A1 (en) Servicing a component-base software product
CN102567051A (en) Method and device for preparing graphical installation system of Loongson platform
US20200026524A1 (en) System and method for performing an image-based update
CN105389187B (en) System updating method
US20120254859A1 (en) Method and apparatus for downloading software updates to place user terminal into a desired configuration state
CN102937902B (en) A kind of method and apparatus of drive installation
CN114064113A (en) Host version control method and device
CN111475175A (en) Method, device and medium for installing and guiding operation system based on ARM server
CN107704249A (en) A kind of system and method for installing configuration automatically for physical machine
CN111782236A (en) System software upgrading method and device, storage medium and all-in-one machine equipment
CN115357355A (en) Method, device and equipment for software cross-system migration and readable storage medium

Legal Events

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