A cross-distribution replacement system for a Linux operating system

CN118170401BActive Publication Date: 2026-08-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2023-12-08
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

没办法做到跨操作系统发行版的情况下直接升级

Benefits of technology

[0024]与现有技术相比,本发明通过提供一种Linux操作系统的跨发行版替换系统,系统包括通信连接的系统检测模块、系统构建模块以及系统切换模块,其中,系统检测模块用于执行待替换操作系统的检测,并存储用于升级待替换操作系统所需的检测结果信息,系统构建模块用于生成目标操作系统,系统切换模块用于生成目标操作系统内核、内存文件系统以及根文件系统替换工具,以实现待替换操作系统与目标操作系统的替换。它通过跨发行版操作系统的智能化替换,可以无需人工参与操作系统的集成和部署工作,大大缩短工期和工作量,降低操作系统替换的难度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170401B_ABST
    Figure CN118170401B_ABST
Patent Text Reader

Abstract

The application discloses a cross-distribution replacement system of a Linux operating system, and comprises a system detection module, a system construction module and a system switching module which are communicatively connected, wherein the system detection module is used for detecting an operating system to be replaced and storing detection result information required for upgrading the operating system to be replaced, the system construction module is used for generating a target operating system, and the system switching module is used for generating a target operating system kernel, a memory file system and a root file system replacement tool to realize replacement of the operating system to be replaced and the target operating system. The intelligent replacement of the cross-distribution operating system can realize integration and deployment of the operating system without manual participation, greatly shorten the construction period and workload, and reduce the difficulty of operating system replacement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of operating system upgrades, and in particular to a cross-distribution replacement system for the Linux operating system. Background Technology

[0002] Public cloud and cloud server users run various Linux operating systems in their production environments. Vendors and users choose suitable operating system distributions as their foundation based on their technology and operational capabilities. Currently, there are many mainstream operating system distributions, such as RHEL, CentOS, Fedora, SUSE, and openSUSE which use RPM packages for software distribution; and Debian and Ubuntu which use DEB packages for software distribution. Currently, there is no mature, intelligent solution for replacing operating systems across distributions. Most upgrades are performed on minor versions of the operating system using package management tools, making direct upgrades across different distributions impossible. Therefore, an automated and intelligent solution for replacing operating systems across distributions is needed to address the challenge of replacing the underlying operating system across distributions. This problem urgently requires a solution. Summary of the Invention

[0003] The purpose of this invention is to provide a cross-distribution replacement system for the Linux operating system to overcome the shortcomings of the existing technology. Through intelligent replacement of cross-distribution operating systems, it can eliminate the need for manual intervention in the integration and deployment of the operating system, greatly shortening the project time and workload, and reducing the difficulty of operating system replacement.

[0004] One embodiment of this application provides a cross-distribution replacement system for the Linux operating system, the system comprising:

[0005] The system includes a communication connection detection module, a system construction module, and a system switching module; among which,

[0006] The system detection module is used to perform detection on the operating system to be replaced and to store the detection result information required for upgrading the operating system to be replaced.

[0007] The system building module is used to generate the target operating system;

[0008] The system switching module is used to generate replacement tools for the target operating system kernel, memory file system, and root file system, so as to replace the operating system to be replaced with the target operating system.

[0009] Optionally, the system detection module includes:

[0010] The communication connection installation package list unit, network configuration unit, system disk partition unit, data disk partition unit, system configuration unit, business software configuration unit, and system boot startup software unit.

[0011] Optionally, the installation package list unit is used to obtain a package list based on a pre-installed operating system distribution package management tool, the package list including one or more packages constituting the operating system to be replaced.

[0012] Optionally, the network configuration unit is used to store the configuration file of the network interface to ensure that the network interface configuration of the operating system to be replaced is consistent with that of the target operating system.

[0013] Optionally, the system configuration unit is used to obtain the configuration information of the operating system to be replaced, and determine the system parameter settings of the target operating system based on the configuration information.

[0014] Optionally, the system building module includes:

[0015] The target operating system base root file construction unit is used to generate the target operating system base root file based on directory information.

[0016] The target operating system full root file construction unit is used to receive the output information of the system detection module and generate the target operating system full root file.

[0017] Optionally, the system switching module includes:

[0018] The replacement flag setting unit is used to replace the boot entry in the partition of the operating system to be replaced and set the replacement flag;

[0019] The system restart unit is used to obtain the boot parameters of the target operating system and execute the restart command.

[0020] Optionally, the system further includes:

[0021] The system rollback module is used to modify the target operating system kernel boot entry, execute the rollback program, and restore the current target operating system to the operating system to be replaced.

[0022] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the system described above when it runs.

[0023] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the system described above.

[0024] Compared with existing technologies, this invention provides a cross-distribution replacement system for the Linux operating system. The system includes a system detection module, a system building module, and a system switching module connected by communication. The system detection module performs detection on the operating system to be replaced and stores the detection results required for upgrading the target operating system. The system building module generates the target operating system, and the system switching module generates replacement tools for the target operating system kernel, memory file system, and root file system, thereby achieving the replacement of the target operating system with the one to be replaced. Through intelligent replacement across distribution operating systems, it eliminates the need for manual intervention in operating system integration and deployment, significantly shortening the project time and workload, and reducing the difficulty of operating system replacement. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of a cross-distribution replacement system framework for a Linux operating system provided in an embodiment of the present invention;

[0026] Figure 2 A schematic diagram illustrating the construction process of a target operating system provided in an embodiment of the present invention;

[0027] Figure 3 This is a schematic diagram of a system detection module structure provided in an embodiment of the present invention;

[0028] Figure 4 A schematic diagram of another cross-distribution replacement system framework for a Linux operating system provided in an embodiment of the present invention;

[0029] Figure 5 This is a schematic diagram of a replacement process after the target operating system is built, provided by an embodiment of the present invention;

[0030] Figure 6 This is a hardware structure block diagram of a computer terminal for a cross-distribution replacement system of the Linux operating system, provided as an embodiment of the present invention. Detailed Implementation

[0031] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0032] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0033] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.

[0034] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0035] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0036] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0037] Linux, short for GNU / Linux, is a free and open-source Unix-like operating system. It is a multi-user, multi-tasking operating system that supports multi-threading and multi-processors. With the development of the internet, Linux has gained support from software enthusiasts, organizations, and companies worldwide. Besides maintaining strong momentum in the server field, it has also made significant progress in personal computers and embedded systems. Users can not only intuitively understand the implementation mechanism of this operating system, but also modify and improve Linux according to their own needs, maximizing its adaptability to user requirements.

[0038] Linux is not only stable in performance but also open-source software. Its core firewall component is highly efficient and easy to configure, ensuring system security. In many enterprise networks, in pursuit of speed and security, Linux is not only used by network administrators as a server but also as a network firewall, which is a major advantage of Linux.

[0039] Linux is characterized by its open-source nature, lack of copyright restrictions, and large technical community. Its open-source nature allows users to freely customize it, resulting in high flexibility, powerful functionality, and low cost. In particular, its embedded network protocol stack, with proper configuration, can function as a router. These features make Linux an ideal development platform for routing and switching devices.

[0040] Linux operating system distributions refer to versions that integrate the Linux operating system and various application software. Users do not need to recompile; they can install them directly on the target platform and use them with only minor configuration changes. Linux distributions typically include desktop environments, media players, databases, and other application software, and usually use a package management system to manage these applications.

[0041] See Figure 1 , Figure 1This is a schematic diagram of a cross-distribution replacement system framework for a Linux operating system provided in an embodiment of the present invention. The system 100 may include: a system detection module 101, a system building module 102, and a system switching module 103 connected by communication. The system detection module 101 is used to perform detection on the operating system to be replaced and store the detection result information required for upgrading the operating system to be replaced. The system building module 102 is used to generate the target operating system. The system switching module 103 is used to generate the target operating system kernel, memory file system, and root file system replacement tools to realize the replacement of the operating system to be replaced with the target operating system.

[0042] For easier understanding, please refer to Figure 2 , Figure 2 This diagram illustrates a target operating system construction process according to an embodiment of the present invention. The original operating system to be replaced undergoes system detection through a system detection module, and then outputs the detection information to a system construction module for building the target operating system. After the target operating system is generated, the original operating system to be replaced is replaced by the target operating system through a system switching module. If there is a subsequent need to roll back the original operating system to be replaced, a rollback procedure can be executed, which will be explained below and will not be repeated here.

[0043] Specifically, system detection tools can be used to check the operating system to be replaced, retaining all the information needed for system replacement, such as system information, network information, and application software information.

[0044] For example, see Figure 3 , Figure 3 This is a schematic diagram of a system detection module structure provided in an embodiment of the present invention. The system detection module may include: a communication connection installation package list unit, a network configuration unit, a system disk partitioning unit, a data disk partitioning unit, a system configuration unit, a business software configuration unit, and a system boot startup software unit.

[0045] It should be noted that each unit module in the system detection module can provide feedback on detection results through the system detection tool.

[0046] The installation package list unit is used to obtain a package list based on a pre-installed operating system distribution package management tool. The package list includes one or more packages that constitute the operating system to be replaced.

[0047] Operating system distribution package management tools can be used to detect package information installed on the operating system to be replaced. For example:

[0048] RPM series distributions use:

[0049] rpm-qa>rpmlist.log

[0050] The deb series of releases uses:

[0051] dpkg --get-selections|grep -v "deinstall"|awk'{print$1}'>deblist.log.

[0052] In one optional implementation, the network configuration unit is used to store configuration files for the network interface to ensure that the network interface configurations of the operating system to be replaced and the target operating system are consistent.

[0053] For example, you can back up all the files in the / etc / sysconfig / network-scripts / directory. These files are configuration files for network interfaces. After the operating system is replaced, these configuration files will be used to set the network information of the target operating system, ensuring the consistency of network interface configuration before and after the system replacement, and not affecting the use of upper-layer configurations.

[0054] The system disk partition unit can back up the / etc / fstab file, which can store information about the system disk partitions that are automatically mounted at boot, such as / boot / boot / efi / var. Combined with the block device partition information output by lsblk, the system disk and the partition information on the system disk can be determined.

[0055] Data disk partitioning units can be identified using the lsblk output information to determine whether the disk has a TYPE of 'disk', a partition has a TYPE of 'part', or a partition has a TYPE of 'lvm'. This information, combined with the auto-mount information in / etc / fstab and / etc / rc.d / rc.local, confirms the data disk partitioning details.

[0056] The system configuration unit is used to obtain the configuration information of the operating system to be replaced, and to determine the system parameter settings of the target operating system based on the configuration information.

[0057] For example, the current configuration information of the operating system to be replaced is collected by the system tools sysctl -a and ulimit -a. Then, the parameters are compared with those of the target operating system. Finally, the system parameter settings of the target operating system are determined according to preset rules. The preset rules can be that compatible parameters retain the configuration of the operating system to be replaced, while incompatible parameters use the new parameters of the target operating system.

[0058] The business software configuration unit can perform a full comparison of configuration file differences based on the business software list. For example, it can obtain a list of all files installed by the software through rpm –qf xxx.rpm or dpkg –L xxx.deb. Then, by comparing the configuration file differences between the operating system to be replaced and the target operating system, it can analyze the difference items and finally choose to synchronize the difference parts or retain the new configuration according to the actual needs.

[0059] The system startup software units can be identified using the `systemctl list-unit-files|grep enabled>systemd-enabled.log` file. This file contains services that start automatically at boot on the target operating system. These services must also be configured to start automatically at boot on the target operating system. Each service can be retrieved from this file; for example, a service can be configured to start automatically at boot using `systemctlenable "service_item"`.

[0060] Specifically, the system construction module 102 may include:

[0061] The target operating system base root file construction unit is used to generate the target operating system base root file based on directory information.

[0062] The target operating system full root file construction unit is used to receive the output information of the system detection module and generate the target operating system full root file.

[0063] For example, building a target operating system using an operating system building tool can be mainly divided into the following steps:

[0064] First, the basic system is built: for example, the basic root file system is generated in the $HOME / rootfs directory using the following command:

[0065] For deb package management distributions:

[0066] sudo debootstrap --variant=minbase "distro-tricyname" $HOME / rootfs "target-OS-repo"

[0067] For RPM package management distributions:

[0068] febootstrap-g"base""OS-name"$HOME / rootfs\"target-OS-repo"

[0069] The second step is to perform a full build based on the installation package information of the operating system to be replaced:

[0070] Perform a full installation based on the installation package information of the operating system to be replaced recorded by the operating system detection tool.

[0071] Switching to the root directory can be achieved using the following program:

[0072] chroot$HOME / rootfs

[0073] For deb package management distributions:

[0074] #! / bin / bash

[0075] for line in `cat deblist.log`

[0076] do

[0077] apt-get install-y$line

[0078] done

[0079] For RPM package management distributions:

[0080] #! / bin / bash

[0081] for line in `cat rpmlist.log`

[0082] do

[0083] yum install-y$line

[0084] done

[0085] Finally, the target operating system configuration and application software configuration are synchronized. The information saved from the system detection tool, network configuration file, system configuration file, application software configuration file and target operating system are compared and detected, and replacements and modifications are made.

[0086] Specifically, the system switching module may include:

[0087] The replacement flag setting unit is used to build a system replacement boot entry on the partition of the operating system to be replaced and set the replacement flag; the system restart unit is used to obtain the boot parameters of the target operating system and execute the restart command.

[0088] For example, after the target operating system is built, a new kernel vmlinux and a memory file system initramfs are generated in the boot partition. At this time, a customized initramfs-tool is generated for the replacement tool, and a GRUB boot option item is added, with initramfs-tool set as the default boot entry. The bootloader in initramfs-tool modifies the name of the root partition directory of the operating system to be replaced by adding the prefix "old-OS", modifies the root file system $HOME / rootfs directory of the target operating system to be the root file system, and after the root file system replacement is completed, it modifies the GRUB boot entry initramfs to the target operating system file, restarts the target operating system, and completes the target operating system boot process.

[0089] As can be seen, this invention provides a cross-distribution replacement system for the Linux operating system. The system includes a system detection module, a system building module, and a system switching module connected by communication. The system detection module performs detection on the operating system to be replaced and stores the detection results required for upgrading the target operating system. The system building module generates the target operating system, and the system switching module generates replacement tools for the target operating system kernel, memory file system, and root file system, thereby achieving the replacement of the target operating system with the one to be replaced. Through intelligent replacement across distribution operating systems, it eliminates the need for manual intervention in operating system integration and deployment, significantly shortening the project time and workload, and reducing the difficulty of operating system replacement.

[0090] In one alternative implementation, see [link to implementation details]. Figure 4 , Figure 4 This is a schematic diagram of another Linux operating system cross-distribution replacement system framework provided by an embodiment of the present invention. The system 100 may further include: a system rollback module 104, which is used to modify the kernel boot entry of the target operating system, execute the rollback program, and restore the current target operating system to the operating system to be replaced.

[0091] For example, when the target operating system needs to be rolled back to the original operating system to be replaced (the original operating system to be replaced has not been cleared), the default kernel boot entry can be modified to start the rollback program initramfs-tool, modify the root file system name of the original operating system to be replaced, remove the prefix, add the prefix "target-OS" to the root file system of the target operating system, start the original operating system to be replaced, and restore the original operating system to be replaced 100%, increasing the security of system replacement.

[0092] See Figure 5 , Figure 5This is a schematic diagram illustrating the replacement process after the target operating system is built, according to an embodiment of the present invention. Once the target operating system is built, a system replacement boot entry can be created in the original partition of the operating system to be replaced, and a replacement flag can be set. After restarting the original operating system, in response to the system replacement operation, the original root file system and the target root file system directories are modified, and the boot entry is set to the target operating system. Then, by setting a rollback flag, the previously set replacement flag is cleared, and after another restart, the target operating system can be accessed. If, after restarting the original operating system, in response to the system not performing a replacement operation, it is further determined whether a rollback procedure needs to be executed. If so, the original root file system and the target root file system are modified, and the boot entry is set to the original operating system to be replaced. After restarting, the original operating system to be replaced can be accessed. If it is determined that a rollback procedure is not needed, the boot entry of either the original system to be replaced or the target operating system is directly selected, and the boot menu is returned.

[0093] It is evident that an intelligent replacement scheme for cross-distribution Linux operating systems ensures absolute isolation between the original operating system to be replaced and the target operating system. During the upgrade and replacement process, the original operating system to be replaced and the target operating system are completely isolated and do not interfere with each other. There is no situation where the two systems depend on or reference each other. At the same time, a reliable recovery mechanism is implemented, which can quickly and efficiently restore 100% to the original operating system to be replaced, improve the reliability of system replacement failure scenarios, and significantly shorten the fault recovery time.

[0094] The following detailed explanation uses a computer terminal as an example. Figure 6 This is a hardware structure block diagram of a computer terminal for a cross-distribution replacement system of the Linux operating system, provided as an embodiment of the present invention. Figure 6 As shown, a computer terminal may include one or more ( Figure 6 Only one is shown in the diagram. A processor 202 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 204 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 206 for communication functions and an input / output device 208. Those skilled in the art will understand that... Figure 6 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown.

[0095] The memory 204 can be used to store software programs and modules for application software, such as the program instructions / modules corresponding to the cross-distribution replacement system of the Linux operating system in this embodiment of the application. The processor 202 executes various functional applications and data processing by running the software programs and modules stored in the memory 204, thereby implementing the above-described method. The memory 204 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 204 may further include memory remotely located relative to the processor 202, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0096] The transmission device 206 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 206 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 206 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0097] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above system embodiments when it runs.

[0098] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above system embodiments.

[0099] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.

[0100] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0101] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0102] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0103] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0104] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0105] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0106] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A cross-distribution replacement system for the Linux operating system, characterized in that, The system includes: The system detection module, system construction module, and system switching module for communication connections; The system detection module is used to perform detection on the operating system to be replaced and to store the detection result information required for upgrading the operating system to be replaced. The system detection module includes: a communication connection installation package list unit, a network configuration unit, a system disk partitioning unit, a data disk partitioning unit, a system configuration unit, a business software configuration unit, and a system boot software unit. The installation package list unit obtains a package list based on a pre-installed operating system distribution package management tool. The package list includes one or more packages constituting the operating system to be replaced. The operating system distribution package management tool detects the package information installed in the current operating system to be replaced. The network configuration unit stores configuration files for the network interface to ensure that the network interface configuration of the operating system to be replaced is consistent with that of the target operating system. The system configuration unit obtains the configuration information of the operating system to be replaced and determines the system parameter settings of the target operating system based on the configuration information. Specifically, this includes collecting the current configuration information of the operating system to be replaced using the system tools sysctl-a and ulimit-a, comparing it with the parameters of the target operating system, and finally determining the system parameter settings of the target operating system according to preset rules. The preset rules include retaining the configuration of the operating system to be replaced for compatible parameters, and using the new parameters of the target operating system for incompatible parameters. The system building module is used to generate the target operating system; The system switching module is used to generate replacement tools for the target operating system kernel, memory file system, and root file system, so as to replace the operating system to be replaced with the target operating system. The system construction module includes: The target operating system base root file building unit is used to generate the target operating system's base root file from directory information using debootstrap and febootstrap. The target operating system full root file construction unit is used to receive the output information of the system detection module to generate the target operating system full root file and perform a full installation according to the installation package information of the operating system to be replaced recorded by the operating system to be replaced detection tool; The system switching module includes: The replacement flag setting unit is used to generate the base root file of the target operating system according to the directory information; specifically, it is used to generate an initramfs-tool customized for the replacement tool on the partition of the operating system to be replaced, add the grub boot option item, and set initramfs-tool as the default boot item. The system restart unit is used to obtain the boot parameters of the target operating system and execute the restart command. Specifically, it uses the boot program in initramfs-tool to modify the name of the root partition directory of the operating system to be replaced and add the prefix old-OS. It also modifies the root file system directory of the target operating system to the root file system. After the root file system replacement is completed, it modifies the grub boot entry initramfs to the target operating system file and restarts the target operating system.

2. The system according to claim 1, characterized in that, The system also includes: The system rollback module is used to modify the target operating system kernel boot entry, execute the rollback program, and restore the current target operating system to the operating system to be replaced.

3. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the system according to any one of claims 1 to 2 when it is run.

4. An electronic device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to execute the system according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Method for switching RPM packet management tool into DPKG packet management tool in Redhat series release edition

    CN112286531A

  • Method, system and equipment for replacing operating system and storage medium

    CN116126390A

  • Operating system replacement method and device, electronic equipment and readable storage medium

    CN116132276A