Full-automatic generation method for root file system of specified operating system in Linux operating system

By constructing a universal root file system fully automatic generation template in the Linux operating system, the fully automatic generation of root file systems for different operating systems is realized, solving the problem of tedious traditional manual configuration, improving the degree of automation and user-friendliness, and expanding OpenEuler Operating system application scope.

CN119356742APending Publication Date: 2025-01-24QUFU NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411404247.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In traditional operating system deployment, the generation of the root file system depends on manual configuration, the process is cumbersome and error-prone, especially the lack of complete support on the OpenEuler operating system platform, which limits the rapid deployment and wide application of the operating system root file system.

Method used

Put forward a fully automatic generating method of the specified operating system root file system under the LINUX operating system. Based on the establishment of a general root file system, it is automatically generated on the basis of libguestfs and Virt-Install. The root file system of the operating system.

Benefits of technology

It realizes the fully automatic generation of the operating system root file system, simplifies the user acquisition process, improves the degree of automation and user-friendliness, is suitable for the OpenEuler operating system, and expands its application scope.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356742A_ABST
    Figure CN119356742A_ABST
Patent Text Reader

Abstract

The invention discloses a full-automatic generation method for a root file system of a specified operating system under a Linux operating system, and belongs to the technical field of computers. The invention provides a full-automatic generation method for a root file system of a specified operating system under a Linux operating system, and full-automatic generation of root file systems of different Linux and Windows operating systems under the Linux operating system is realized by executing an iso2rootfs command with parameters. By constructing the universal root file system full-automatic generation template, full-automatic generation of the root file system of the specified operating system under the Linux operating system is realized for the first time, and the technical innovation of the generation mode of the root file system of the specified operating system under the Linux operating system from semi-automation to full automation is realized. The method is also suitable for an OpenEuler operating system, and the full-automatic generation of the root file system of the specified operating system of the OpenEuler operating system from nothing to existence is realized. The full-automatic generation method for the root file system is high in flexibility, wide in application range, low in learning cost and high in efficiency, and the efficiency of testing, developing, producing and deploying the operating system by a user is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology, and in particular relates to a fully automatic generation method for a root file system of a specified operating system. Background Art

[0002] As an important part of the operating system, the root file system contains the key directories and files necessary for system startup, as well as the files necessary for mounting other file systems. Therefore, during the operating system startup process, the root file system is the first file system that must be mounted. If the operating system cannot mount the root file system from the specified device, other file systems will not be loaded correctly, and the operating system will not be able to start normally. Therefore, the root file system is crucial to the normal operation of the operating system, and its stability and reliability have a decisive impact on the operation of the entire operating system.

[0003] In traditional operating system deployment, the generation of the root file system relies on manual configuration, which is not only cumbersome and time-consuming, but also prone to errors and heavily dependent on the professional knowledge and experience of technicians. Especially on the emerging operating system platform OpenEuler, due to the immaturity of the software ecosystem and development tools, there is currently no complete support for the generation of the specified operating system root file system under the OpenEuler operating system, which makes it impossible for developers to deploy and test the root file system of OpenEuler or other operating systems under the OpenEuler operating system, which greatly restricts the expansion of the application scope of the OpenEuler operating system. In addition, the existing technology also has many shortcomings in cross-platform compatibility, automation and user-friendliness, which greatly limits the rapid deployment and wide application of the operating system root file system. Summary of the invention

[0004] In view of the above problems existing in the deployment of operating system root file systems, the present invention proposes a method for fully automatic generation of a specified operating system root file system under a Linux operating system, which can realize fully automatic generation of a specified operating system root file system under different Linux distributions.

[0005] The method for automatically generating a root file system of a specified operating system under a Linux operating system of the present invention is characterized by:

[0006] (1) A method for fully automatically generating a root file system of a specified operating system under a Linux operating system, which can realize fully automatic generation of root file systems of a specified operating system, i.e., different Linux and Windows operating systems, under a Linux operating system. Under a Linux operating system, the fully automatic generation of a root file system of a specified operating system is realized by executing an iso2rootfs command with parameters;

[0007] (2) The method for automatically generating a root file system of a specified operating system under the Linux operating system includes the following two steps:

[0008] S1: Construction of fully automatic generation template for universal root file system;

[0009] Based on the libguestfs file repository and virt-install instruction set, a template for fully automatic generation of a universal root file system is constructed;

[0010] S2: Automatically generate the root file system of the specified operating system;

[0011] Furthermore, the fully automatic generation method of the root file system of the specified operating system under the Linux operating system is characterized in that: the specified operating system is different Linux and Windows operating systems, and the specific operating system versions are described as follows:

[0012] (1) Linux operating system: CentOS7 and CentOS8, all versions of OpenEuler, RHEL3 to 8, Debian6 and above, FreeBSD13 and FreeBSD14, Ubuntu10.04 and above, Fedora25 and above;

[0013] (2) Windows operating system: Windows 7, Windows Server 2008R2, WindowsServer2012, Windows Server 2012R2, Windows Server 2016.

[0014] Furthermore, the method for fully automatic generation of a root file system of a specified operating system under a Linux operating system is characterized in that: the construction of the fully automatic generation template of a universal root file system in step S1 is specifically described as follows:

[0015] S11: Configuration of the general root file system generation template;

[0016] S12: Generate template target file for general root file system;

[0017] S13: Generate a fully automatic executable file using a general root file system generation template.

[0018] Furthermore, the fully automatic generation method of the root file system of the specified operating system under the Linux operating system is characterized in that: the configuration of the general root file system generation template in step S11 is specifically described as follows:

[0019] S111: Install libguestfs and virt-install packages;

[0020] S112: Install libguestfs source package;

[0021] S113: Add the template for the specified operating system to the make-template.ml file in the builder / template / directory:

[0022] (1) Open the make-template.ml file;

[0023] (2) Use the get_virtual_size_gb function to obtain the virtual disk size virtual_size_gb;

[0024] (3) Use the make_kickstart function to generate a kickstart file;

[0025] (4) Use the make_boot_media function to obtain the boot media;

[0026] (5) Use the tmpname command to create a domain name for the libvirt domain;

[0027] (6) Use the output command to generate the output file name;

[0028] Repeat step S113 to add other specified operating system templates;

[0029] Furthermore, the fully automatic generation method of the root file system of the specified operating system under the Linux operating system is characterized in that: the compilation of the template target file for generating the general root file system in step S12 is specifically described as follows:

[0030] S121: Write the virt-builder-template command and write it into the Makefile.am file in the libguestfs-1.40.2 / builder / directory;

[0031] S122: Return to libguestfs-1.40.2 directory;

[0032] S123: execute automake command;

[0033] S124: Execute the . / configure command;

[0034] S125: Execute the make command.

[0035] Furthermore, the fully automatic generation method of the root file system of the specified operating system under the Linux operating system is characterized in that: the step S13 of generating the fully automatic executable file of the universal root file system generation template is specifically described as follows:

[0036] S131: Enter the libguestfs-1.40.2 / builder directory;

[0037] S132: Execute the . / virt-builder-template <specified target operating system> command to generate an image file;

[0038] S133: Execute the xz -d <specified target operating system> command to decompress the image file;

[0039] S134: Execute the virt-builder --get-kernel command to extract the image kernel;

[0040] S135: Execute the virt-tar-out-a <specified target operating system> command to extract the root file system;

[0041] S136: Write a shell script to link the above commands and perform parameter parsing, environment verification, error handling, and disk space checking. The execution process of this step is as follows: Figure 1 shown.

[0042] Furthermore, the method for fully automatically generating the root file system of the specified operating system under the Linux operating system is characterized in that: the root file system of the specified operating system is fully automatically generated in step S2, which is specifically described as follows:

[0043] S21: Open the operating system for which the root file system is to be generated and enter the command line interface;

[0044] S22: Install virt-install, qemu-img, and git software;

[0045] Use Git to clone the project source code to the operating system where the root file system is to be generated. The specific operations are as follows:

[0046] (1) Create a new directory and enter it;

[0047] (2) Execute the git clone --single-branch --branch openEuler-22.03-LTS-Next https: / / gitee.com / wangguoquan03 / libguestfs.git command;

[0048] (3) Execute the git clone https: / / gitee.com / openeuler / compass-ci / tree / master / lib / iso2rootfs command;

[0049] (4) Enter the cloned libguestfs directory;

[0050] (5) Unzip libguestfs-1.40.2.tar.gz;

[0051] (6) Enter the libguestfs-1.40.2 directory;

[0052] (7) Execute the patch-p1<.. / oe-template.patch command;

[0053] (8) Execute the automake command;

[0054] (9) Execute the . / configure command;

[0055] (10) Execute the make command;

[0056] S23: Automatically generate the root file system of the specified operating system:

[0057] (1) Return to the newly created directory;

[0058] (2) Enter the compass-ci / lib / iso2rootfs directory;

[0059] (3) Execute . / run-d <dist> -r <release> [-f] <iso>[-p][ / path / virt-x-dir / ] command, automatically generate the root file system of the specified operating system;

[0060] Among them, the parameter -d <dist>It is a required parameter used to specify the target operating system name. The parameter -r <release>It is a required parameter used to specify the target operating system version number. The parameter [-f] <iso>It is an optional parameter used to specify the ISO file path. The parameter [-p][ / path / virt-x-dir / ] is an optional parameter used to customize the build tool path.

[0061] Compared with the prior art, the present invention has the following beneficial effects:

[0062] The present invention constructs a universal root file system fully automatic generation template, which greatly simplifies the process of users obtaining the operating system root file system; the present invention realizes the fully automatic generation of the specified operating system root file system under the Linux operating system for the first time, and realizes the technical innovation from semi-automatic to fully automatic generation of the specified operating system root file system under the Linux operating system. The method described in the present invention is also applicable to the fully automatic generation of the specified operating system root file system under the OpenEuler operating system, realizing a leap forward from scratch to fully automatic generation of the specified operating system root file system under the OpenEuler operating system; the fully automatic generation method of the root file system of the present invention has high flexibility, wide applicability, low learning cost and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 It is a diagram of the process of fully automatic executable file generation of the universal root file system generation template of the present invention.

[0064] Figure 2 This is a system parameter configuration diagram of an operating system for generating a root file system according to an embodiment of the present invention.

[0065] Figure 3 This is a diagram of the iso2rootfs command execution process according to an embodiment of the present invention.

[0066] Figure 4 This is a diagram of the execution result of the iso2rootfs command according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0068] The embodiment of the present invention provides a method for automatically generating a root file system of an OpenEuler 22.03-LTS operating system under an OpenEuler 23.03 operating system. Figure 2 This is the system parameter configuration diagram of the OpenEuler 23.03 operating system.

[0069] The fully automatic generation method of the root file system of the OpenEuler 22.03-LTS operating system under the OpenEuler 23.03 operating system includes the following two steps:

[0070] S1: Construction of the fully automatic generation template of the root file system of the OpenEuler 22.03-LTS operating system;

[0071] Based on the libguestfs file repository and virt-install instruction set, a fully automatic root file system generation template for the OpenEuler 22.03-LTS operating system is built;

[0072] S2: Automatically generate the root file system of the OpenEuler 22.03-LTS operating system;

[0073] Furthermore, the method for fully automatic generation of the root file system of the OpenEuler 22.03-LTS operating system under the OpenEuler 23.03 operating system is characterized in that: the construction of the fully automatic generation template of the root file system of the OpenEuler 22.03-LTS operating system in step S1 is specifically performed as follows:

[0074] S11: Configuration of the root file system generation template of the OpenEuler 22.03-LTS operating system;

[0075] S12: Compilation of template target files generated by the root file system of OpenEuler 22.03-LTS operating system;

[0076] S13: Generate fully automatic executable files for the OpenEuler 22.03-LTS operating system root file system generation template.

[0077] Furthermore, the method for fully automatically generating the root file system of the OpenEuler 22.03-LTS operating system under the OpenEuler 23.03 operating system is characterized in that: the configuration of the OpenEuler 22.03-LTS operating system root file system generation template in step S11 is as follows:

[0078] S111: Install libguestfs and virt-install packages;

[0079] S112: Install libguestfs source package;

[0080] S113: Add the template for the OpenEuler22.03-LTS operating system to the make-template.ml file in the builder / template / directory:

[0081] (1) Open the make-template.ml file, configure it, and add the template of the OpenEuler 22.03-LTS operating system;

[0082] (2) Use the get_virtual_size_gb function to obtain the virtual disk size virtual_size_gb;

[0083] (3) Use the make_kickstart function to generate a kickstart file;

[0084] (4) Use the make_boot_media function to obtain the boot media;

[0085] (5) Use the tmpname command to create a domain name for the libvirt domain;

[0086] (6) Use the output command to generate the output file name;

[0087] Furthermore, the fully automatic generation method of the root file system of the OpenEuler 22.03-LTS operating system under the OpenEuler 23.03 operating system is characterized in that: the compilation of the template target file generated by the root file system of the OpenEuler 22.03-LTS operating system in step S12 is specifically as follows:

[0088] S121: Write the virt-builder-template command and write it into the Makefile.am file in the libguestfs-1.40.2 / builder / directory;

[0089] S122: Return to libguestfs-1.40.2 directory;

[0090] S123: execute automake command;

[0091] S124: Execute the . / configure command;

[0092] S125: Execute the make command.

[0093] Furthermore, the method for fully automatic generation of the root file system of the OpenEuler 22.03-LTS operating system under the OpenEuler 23.03 operating system is characterized in that: the generation of the fully automatic executable file of the root file system generation template of the OpenEuler 22.03-LTS operating system in step S13 is as follows:

[0094] S131: Enter the libguestfs-1.40.2 / builder directory;

[0095] S132: Execute the . / virt-builder-template OpenEuler 22.03-LTS command to generate an image;

[0096] S133: Execute the xz -d OpenEuler-22.03-LTS.xz command to decompress the image file;

[0097] S134: Execute the virt-builder --get-kernel command to extract the image kernel;

[0098] S135: Execute the virt-tar-out-a OpenEuler 22.03-LTS command to extract the root file system;

[0099] S136: Write a shell script to link the above commands and perform parameter parsing, environment verification, error handling, and disk space checking.

[0100] Furthermore, the method for fully automatically generating the root file system of the OpenEuler 22.03-LTS operating system under the OpenEuler 23.03 operating system is characterized in that: the root file system of the OpenEuler 22.03-LTS operating system is fully automatically generated in step S2, specifically as follows:

[0101] S21: Open the OpenEuler 23.03 operating system and enter the command line interface;

[0102] S22: Install virt-install, qemu-img, and git software;

[0103] Use Git to clone the project source code to the OpenEuler 23.03 operating system. The specific operations are as follows:

[0104] (1) Create a new directory and enter it;

[0105] (2) Execute the git clone --single-branch --branch openEuler-22.03-LTS-Next https: / / gitee.com / wangguoquan03 / libguestfs.git command;

[0106] (3) Execute the git clone https: / / gitee.com / openeuler / compass-ci / tree / master / lib / iso2rootfs command;

[0107] (4) Enter the cloned libguestfs directory;

[0108] (5) Unzip libguestfs-1.40.2.tar.gz;

[0109] (6) Enter the libguestfs-1.40.2 directory;

[0110] (7) Execute the patch-p1<.. / oe-template.patch command;

[0111] (8) Execute the automake command;

[0112] (9) Execute the . / configure command;

[0113] (10) Execute the make command;

[0114] S23: Automatically generate the root file system of the OpenEuler 22.03-LTS operating system:

[0115] (1) Return to the newly created directory;

[0116] (2) Enter the compass-ci / lib / iso2rootfs directory;

[0117] (3) Execute the . / run-d OpenEuler-r 22.03-lts command to automatically generate the OpenEuler 22.03-LTS operating system root file system under the OpenEuler 23.03 operating system. The execution process and results of this step are as follows: Figure 3 , 4 shown.

[0118] By adopting the fully automatic generation method of a specified operating system root file system of the embodiment of the present invention described above in combination with the accompanying drawings, the specified (multiple Linux and Windows operating systems) operating system root file system can be quickly deployed under different types of Linux operating systems through automated scripts and tools. In addition, the universal root file system template and the setting of custom parameters implemented by the present invention realize the automatic processing of user-specific needs, improve the flexibility of the present invention, and broaden the application of the present invention. However, the present invention is not limited to the described implementation methods, and these modifications and replacements to the implementation methods still fall within the protection scope of the present invention without departing from the principles and spirit of the present invention.< / iso> < / release> < / dist> < / iso> < / release> < / dist>

Claims

1. A method for automatically generating a root file system of a specified operating system under a Linux operating system, characterized in that: The method for fully automatic generation of a root file system of a specified operating system under a Linux operating system can realize fully automatic generation of root file systems of a specified operating system, i.e., different Linux and Windows operating systems, under a Linux operating system. Under a Linux operating system, fully automatic generation of a root file system of a specified operating system is realized by executing an iso2rootfs command with parameters; The method for fully automatically generating a root file system of a specified operating system comprises the following two steps: S1: Construction of fully automatic generation template for universal root file system; Based on the libguestfs file repository and virt-install instruction set, a template for fully automatic generation of a universal root file system is constructed; S2: Automatically generate the root file system of the specified operating system.

2. The method for automatically generating a root file system of a specified operating system under a Linux operating system according to claim 1, characterized in that: The specified operating systems are different Linux and Windows operating systems. The specific operating system versions are described as follows: (1) Linux operating system: CentOS7 and CentOS8, all versions of OpenEuler, RHEL3 to 8, Debian6 and above, FreeBSD13 and FreeBSD14, Ubuntu10.04 and above, Fedora25 and above; (2) Windows operating system: Windows7, Windows Server 2008R2, Windows Server 2012, Windows Server 2012R2, Windows Server 2016.

3. The method for automatically generating a root file system of a specified operating system under a Linux operating system according to claim 1, characterized in that: The construction of the fully automatic generation template of the universal root file system in step S1 is specifically described as follows: S11: Configuration of the general root file system generation template; S12: Generate template target file for general root file system; S13: Generate a fully automatic executable file using a general root file system generation template.

4. The method for automatically generating a root file system of a specified operating system under a Linux operating system according to claim 3, characterized in that: The configuration of the general root file system generation template in step S11 is specifically described as follows: S111: Install libguestfs and virt-install packages; S112: Install libguestfs source package; S113: Add the template for the specified operating system to the make-template.ml file in the builder / template / directory: (1) Open the make-template.ml file; (2) Use the get_virtual_size_gb function to obtain the virtual disk size virtual_size_gb; (3) Use the make_kickstart function to generate a kickstart file; (4) Use the make_boot_media function to obtain the boot media; (5) Use the tmpname command to create a domain name for the libvirt domain; (6) Use the output command to generate the output file name; Repeat step S113 to add other specified operating system templates.

5. The method for automatically generating a root file system of a specified operating system under a Linux operating system according to claim 3, characterized in that: The compilation of the template target file generated by the general root file system in step S12 is specifically described as follows: S121: Write the virt-builder-template command and write it into the Makefile.am file in the libguestfs-1.40.2 / builder / directory; S122: Return to libguestfs-1.40.2 directory; S123: execute automake command; S124: Execute the . / configure command; S125: Execute the make command.

6. The method for automatically generating a root file system of a specified operating system under a Linux operating system according to claim 3, characterized in that: The step S13 is to generate a fully automatic executable file of the universal root file system generation template, which is specifically described as follows: S131: Enter the libguestfs-1.40.2 / builder directory; S132: Execute the . / virt-builder-template <specified target operating system> command to generate an image file; S133: Execute the xz -d <specified target operating system> command to decompress the image file; S134: Execute the virt-builder --get-kernel command to extract the image kernel; S135: Execute the virt-tar-out-a <specified target operating system> command to extract the root file system; S136: Write a shell script to link the above commands and perform parameter parsing, environment verification, error handling, and disk space checking.

7. The method for automatically generating a root file system of a specified operating system under a Linux operating system according to claim 1, characterized in that: The step S2 is to automatically generate the root file system of the specified operating system, which is specifically described as follows: S21: Open the operating system for which the root file system is to be generated and enter the command line interface; S22: Install virt-install, qemu-img, and git software; Use Git to clone the project source code to the operating system where the root file system is to be generated. The specific operations are as follows: (1) Create a new directory and enter it; (2) Execute the git clone --single-branch --branch openEuler-22.03-LTS-Next https: / / gitee.com / wangguoquan03 / libguestfs.git command; (3) Execute the git clone https: / / gitee.com / openeuler / compass-ci / tree / master / lib / iso2rootfs command; (4) Enter the cloned libguestfs directory; (5) Unzip libguestfs-1.40.2.tar.gz; (6) Enter the libguestfs-1.40.2 directory; (7) Execute the patch-p1<.. / oe-template.patch command; (8) Execute the automake command; (9) Execute the . / configure command; (10) Execute the make command; S23: Automatically generate the root file system of the specified operating system: (1) Return to the newly created directory; (2) Enter the compass-ci / lib / iso2rootfs directory; (3) Execute . / run-d <dist> -r <release> [-f] <iso> [-p][ / path / virt-x-dir / ] command, automatically generate the root file system of the specified operating system;< / iso> < / release> < / dist> Among them, the parameter -d <dist>It is a required parameter used to specify the target operating system name. The parameter -r <release>It is a required parameter used to specify the target operating system version number. The parameter [-f] <iso> It is an optional parameter used to specify the ISO file path. The parameter [-p][ / path / virt-x-dir / ] is an optional parameter used to customize the build tool path.< / iso> < / release> < / dist>