Method and system for downloading and starting linux system image

By pre-installing hardware drivers and client programs in the Euler system and using a USB boot disk for hardware adaptation and image download, the compatibility issues and network boot anomalies of iPXE on ARM architecture terminals were resolved, and the adaptation efficiency was improved.

CN117270974BActive Publication Date: 2025-11-07FUJIAN CENTM INFORMATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311098850.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2025-11-07
Estimated Expiration
2043-08-29

Smart Images

  • Figure CN117270974B_ABST
    Figure CN117270974B_ABST
Patent Text Reader

Abstract

The application discloses a Linux system image downloading and starting method and system, which comprises the following steps: after partitioning and formatting the hard disk of a first terminal, installing an Euler system, and installing corresponding hardware drivers and client programs in the Euler system; backing up the hard disk partition table of the first terminal and system files of the Euler system to a U disk starting disk; after a second terminal detects that the U disk starting disk is inserted, starting the U disk through the U disk starting disk; importing the hard disk partition table and the Euler system into the second terminal, and repartitioning according to the hard disk partition table; after restarting the second terminal, entering the Euler system, and downloading a Linux system image through the client program in the Euler system; and booting and starting the Linux system image. The application can solve the problem that iPXE adaptation is very difficult and the workload is large, and can avoid the problem of network abnormal interruption when crossing a network or the network environment is poor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of operating system technology, and in particular to a method and system for downloading and booting a Linux system image. Background Technology

[0002] In existing cloud PC projects, clients connect to iSCSI (a storage technology based on the Internet and the SCSI-3 protocol) via iPXE (open-source network boot firmware) to boot the system from the network. After booting from the network, the Linux system qcow2 image is downloaded within the system. Once the image is downloaded, it is booted from the iPXE, thus enabling the qcow2 image to start.

[0003] However, on terminals based on ARM architecture CPUs, due to inconsistent component specifications and significant differences in interface standards for CPUs, network cards, hard drives, etc., the iPXE program is incompatible with various non-standard hardware. This makes iPXE adaptation on ARM architecture terminals extremely difficult, as the adapted hardware lacks universality, requiring re-adaptation for different hardware combinations, resulting in a very large workload. Furthermore, when using iSCSI for remote booting, network fluctuations may cause abnormal boot interruptions, rendering the terminal unable to perform any operations and requiring a forced shutdown or restart, leading to a poor user experience. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a method and system for downloading and booting a Linux system image, which can solve the problem of iPXE adaptation being very difficult and labor-intensive, and can avoid the problem of abnormal network interruption when crossing networks or in poor network environments.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by this invention is: a method for downloading and booting a Linux system image, comprising:

[0006] After partitioning and formatting the hard drive of the first terminal, the Euler system is installed, and the corresponding hardware driver and client program are installed in the Euler system.

[0007] Back up the hard disk partition table of the first terminal and the system files of the Euler system to a USB boot disk;

[0008] When the second terminal detects that the USB boot disk is inserted, it boots from the USB boot disk.

[0009] The hard disk partition table and Euler system are imported into the second terminal, and the hard disk of the second terminal is repartitioned according to the hard disk partition table;

[0010] After the second terminal is restarted, the second terminal enters the Euler system, and the Linux system image is downloaded in the Euler system through the client program;

[0011] The Linux system image is boot-started.

[0012] The application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the method.

[0013] The application has the beneficial effects that: by pre-installing the hardware driver and the client program in the Euler system, the second terminal can be matched with the same type of hardware after being imported into the Euler system, and for different hardware, the corresponding driver can be updated when the Euler system is pre-installed to realize the adaptation of new hardware, thereby reducing the adaptation workload caused by the difference of new hardware; meanwhile, the Linux system image is downloaded through the client program and boot-started, and since the network boot is not performed through iSCSI, the network environment is not affected, and the problem of network abnormal interruption when crossing the network or the network environment is poor is avoided. The application can solve the problem that the iPXE adaptation is very difficult and the workload is large, improve the hardware compatibility of the ARM architecture terminal, simplify the development difficulty, and improve the adaptation efficiency; meanwhile, the iSCSI network boot is replaced, and the problem that the network boot cannot be normally performed for downloading the image due to network fluctuation when crossing the network segment is solved. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 The application is a flowchart of a Linux system image downloading and boot-starting method.

[0015] Figure 2 The application is a flowchart of a method of the first embodiment. DETAILED DESCRIPTION

[0016] To explain the technical content, the achieved purposes and effects of the application in detail, the following will be described in detail in combination with the embodiments and the drawings.

[0017] NOMENCLATURE:

[0018] VOI (Virtual Operating System Infrastructure) is a virtual operating system infrastructure without any hardware virtualization layer, and has the characteristics of centralized storage and distributed operation.

[0019] qcow2 (QEMU Copy-On-Write), qcow2 is an image format of qemu, which is a virtual block device and a disk image format of QEMU emulator. qcow2 optimizes the dynamic changes of data in the file system, minimizes space occupation, and provides snapshot, encryption and other functions. qcow2 is often used as the image format of VOI architecture to realize the rapid deployment and installation of terminal.

[0020] iPXE is an open source network boot firmware with wide protocol support, good compatibility with X86 architecture CPU and other hardware, but needs to be updated for ARM architecture CPU, and poor compatibility with other hardware of ARM architecture.

[0021] iSCSI (Internet Small Computer System Interface) is a storage technology based on Internet and SCSI-3 protocol, which uses TCP / IP port 860 and 3260 as the communication channel. Two computers use the iSCSI protocol to exchange SCSI commands, allowing computers to simulate SAN (Storage Area Network) as local storage through high-speed local area network hub. A commonly used high-performance local storage bus is simulated using a wide area network, thus realizing the network boot of remote system

[0022] openEuler, Euler system. Euler operating system is an operating system for digital infrastructure, supporting server, cloud computing, edge computing, embedded and other application scenarios, supporting diversity computing, and committed to providing safe, stable and easy-to-use operating system.

[0023] See Figure 1 A Linux system image downloading and starting method, comprising:

[0024] After partitioning and formatting the hard disk of the first terminal, install the Euler system, and install the corresponding hardware driver and client program in the Euler system;

[0025] Backup the hard disk partition table of the first terminal and the system file of the Euler system to the U disk startup disk;

[0026] When the second terminal detects that the U disk startup disk is inserted, perform U disk startup through the U disk startup disk;

[0027] Import the hard disk partition table and Euler system in the second terminal, and repartition the hard disk of the second terminal according to the hard disk partition table;

[0028] After restarting the second terminal, entering the Euler system, and downloading the Linux system image in the Euler system through the client program;

[0029] Boot starting the Linux system image.

[0030] From the above description, the beneficial effects of the present application are that the adaptation workload caused by new hardware differences can be reduced, and the problem of network abnormal interruption when crossing the network or the network environment is poor can be avoided.

[0031] Further, the boot starting the Linux system image is specifically:

[0032] Extracting and updating the Linux kernel in the Linux system image;

[0033] According to the Linux kernel, updating the GRUB boot program, and booting the Linux system image through the GRUB boot program.

[0034] From the above description, the Linux system image is boot started through the GRUB boot program, which is not affected by the network environment, and the iSCSI network start may be disturbed by the network.

[0035] Further, the re-partitioning of the hard disk of the second terminal is specifically:

[0036] Re-partitioning the data partition of the hard disk of the second terminal except the system primary partition.

[0037] Further, the first terminal and the second terminal are both terminals based on ARM architecture CPU.

[0038] From the above description, the terminal based on ARM architecture CPU and other non-standard network cards and other hardware can be compatible with all systems supporting the Linux kernel of ARM architecture CPU.

[0039] Further, the Linux system image is a qcow2 image.

[0040] The present application also provides a Linux system image downloading and starting system, comprising a U disk starting disk, a first terminal and at least one second terminal.

[0041] The first terminal is used for partitioning and formatting the hard disk, installing the Euler system, and installing the corresponding hardware driver and client program in the Euler system; the hard disk partition table of the first terminal and the system file of the Euler system are backed up to the U disk starting disk.

[0042] The second terminal is used to perform U disk starting through the U disk starting disk after detecting that the U disk starting disk is inserted; import the hard disk partition table and the Euler system, and re-partition the hard disk according to the hard disk partition table; enter the Euler system after restarting, and download the Linux system image through the client program in the Euler system; and boot the Linux system image.

[0043] Embodiment one

[0044] Please refer to Figure 2 Embodiment one of the present application is a Linux system image downloading and starting method, which is based on a terminal of ARM architecture CPU and can be applied to a cloud computer project based on VOI mode.

[0045] The embodiment realizes downloading and starting Linux qcow2 image through a U disk starting disk, an Euler system, a Linux client program, a script and a driver program. The embodiment needs to use two or more terminals and a U disk. The terminals are all terminals based on ARM architecture CPU, one of which is used to install the Euler system and extract backup, and the others are used to restore the Euler system and download and GRUB boot the qcow2 image; the U disk is used to make a starting disk and restore and install the Euler system.

[0046] As shown in Figure 2 The method of the embodiment includes the following steps:

[0047] S1: making a U disk starting disk, specifically, using UltraISO software to make a U disk Linux starting disk according to the software manual.

[0048] S2: after partitioning and formatting the hard disk of the first terminal, installing the Euler system and installing corresponding hardware drivers and client programs in the Euler system; that is, installing the Euler system after partitioning and formatting the first terminal, and then installing corresponding hardware drivers and client programs into the Euler system. The first terminal is a terminal based on ARM architecture CPU.

[0049] S3: backing up the hard disk partition table of the first terminal and the system file of the Euler system to the U disk starting disk.

[0050] Specifically, the Euler system is extracted and backed up into the U disk starting disk through disk copying, the extracted information contains all system files and hard disk partition table information, ensuring that the restored partition information and partition ID are consistent after restoring in a new terminal, and the Euler system after restoring in the new terminal can be normally started.

[0051] At this time, the U disk startup disk of the Euler system is completed, and the U disk contains the startup system and the backup file of the Euler system, and the Euler system contains the pre-installed client program.

[0052] S4: When the second terminal detects that the U disk startup disk is inserted, the U disk is started through the U disk startup disk; that is, after the U disk startup disk is inserted into the new terminal, the U disk is started, and the U disk startup is a technology of starting some backup restoration, PE operating system and the like from the U disk. Among them, the second terminal is also a terminal based on an ARM architecture CPU.

[0053] S5: Import the hard disk partition table and the Euler system in the second terminal, and repartition the hard disk of the second terminal according to the hard disk partition table.

[0054] Specifically, importing the backup file in the U disk startup disk in the second terminal will also import the Euler system and the hard disk partition table and the like. At this time, the data partition other than the system main partition can be repartitioned, and the normal startup of the Euler system will not be affected.

[0055] S6: Restart the second terminal to enter the Euler system, and download the Linux system image in the Euler system through the client program.

[0056] Specifically, after repartitioning the data partition, the Euler system is restarted to enter the Euler system, and the qcow2 image of Linux is downloaded in the Euler system through the pre-installed client program. At this time, the imported Euler system is pre-installed with hardware drivers and client programs, so it can completely match the same type of hardware. When the hardware information changes, only the corresponding driver needs to be updated when the Euler system is pre-installed to realize the adaptation to the new hardware, without the need to redevelop or modify the code.

[0057] S7: Extract and update the Linux kernel in the Linux system image.

[0058] S8: Update the GRUB boot program according to the Linux kernel, and boot the Linux system image through the GRUB boot program.

[0059] Specifically, after downloading the qcow2 image in the Euler system through the client program, the Linux kernel in the qcow2 image is extracted, and the GRUB boot program is updated by using a script, that is, the start item configuration is updated, the self-developed driver is installed in the extracted qcow2 image, and the direct startup of the qcow2 image is realized. The embodiment can be compatible with all systems supporting the Linux kernel of the ARM architecture CPU.

[0060] The embodiment can adapt to the terminal of ARM architecture CPU and other non-standard network cards and the like, and for different hardware, only the driver needs to be updated, thereby reducing the adaptation workload caused by new hardware differences, so that the problem that iPXE needs to be re-adapted to different hardware combinations on the terminal of ARM architecture, the problem of difficult adaptation and great workload, and the problem of risk of not being able to completely adapt can be solved. Meanwhile, since the embodiment does not use iSCSI for network startup, there is no network dependence, and it is not affected by the network environment, thereby avoiding the problem of network abnormal interruption when crossing the network or the network environment is poor, and perfect support for complex network environment is achieved.

[0061] In summary, the present application provides a Linux system image download and startup method and system, by pre-installing hardware drivers and client programs in the Euler system, the second terminal can be easily matched with the same type of hardware after importing the Euler system, and for different hardware, only the corresponding driver needs to be updated when the Euler system is pre-installed, so that the adaptation of new hardware can be realized, and the adaptation workload caused by new hardware differences is reduced; at the same time, the Linux system image is downloaded and started by the client program, since iSCSI is not used for network startup, it is not affected by the network environment, thereby avoiding the problem of network abnormal interruption when crossing the network or the network environment is poor. The present application can solve the problem of difficult adaptation and great workload of iPXE, improve the hardware compatibility of the terminal of ARM architecture, simplify the development difficulty, and improve the adaptation efficiency; at the same time, the iSCSI network startup is replaced, and the problem of network fluctuation when network startup is used to download the image is solved.

[0062] The above is only an embodiment of the present application, and does not limit the patent range of the present application, and any equivalent transformation or direct or indirect application in the related technical field by using the content of the specification and drawings of the present application is also included in the patent protection range of the present application.

Claims

1. A Linux system image downloading and starting method, characterized in that, The method comprises the following steps: partitioning and formatting a hard disk of a first terminal, installing an Euler system, and installing corresponding hardware drivers and a client program in the Euler system; backing up a hard disk partition table of the first terminal and system files of the Euler system to a U disk start disk; when a second terminal detects that the U disk start disk is inserted, starting the U disk through the U disk start disk; importing the hard disk partition table and the Euler system in the second terminal, and repartitioning a hard disk of the second terminal according to the hard disk partition table; after restarting the second terminal, entering the Euler system, and downloading a Linux system image through the client program in the Euler system; booting the Linux system image; the booting of the Linux system image specifically comprises: extracting and updating a Linux kernel in the Linux system image; updating a GRUB boot program according to the Linux kernel, and booting the Linux system image through the GRUB boot program. The first terminal and the second terminal are both terminals based on an ARM architecture CPU.

2. The method of claim 1, wherein, The repartitioning of the hard disk of the second terminal specifically comprises: repartitioning data partitions of the hard disk of the second terminal except for a system main partition.

3. The method of claim 1, wherein the Linux system image is downloaded and booted by, The Linux system image is a qcow2 image.

4. A Linux system image download and boot system, characterized in that, The method comprises the following steps: partitioning and formatting a hard disk of a first terminal, installing an Euler system, and installing corresponding hardware drivers and a client program in the Euler system; backing up a hard disk partition table of the first terminal and system files of the Euler system to a U disk start disk; when a second terminal detects that the U disk start disk is inserted, starting the U disk through the U disk start disk; importing the hard disk partition table and the Euler system in the second terminal, and repartitioning a hard disk according to the hard disk partition table; after restarting the second terminal, entering the Euler system, and downloading a Linux system image through the client program in the Euler system; booting the Linux system image; 5. The Linux system image downloading and booting system according to claim 4, wherein, the booting of the Linux system image specifically comprises: extracting and updating a Linux kernel in the Linux system image; 6. The Linux system image downloading and booting system according to claim 4, wherein, updating a GRUB boot program according to the Linux kernel, and booting the Linux system image through the GRUB boot program. The repartitioning of the hard disk specifically comprises: repartitioning data partitions of the hard disk except for a system main partition. The Linux system image is a qcow2 image.

Citation Information

Patent Citations

  • Multiple operation system switching method applicable to ARM (advanced risc machine) framework mobile equipment

    CN103761088A

  • Linux system startup method, device and equipment

    CN108647119A