Method and system for installing Linux operating system based on PXE adaptive hard drive

By enhancing the PXE protocol and the mapping file of hard drive driver RPM packages, automatic adaptation and installation of the Linux operating system on different hard drives is achieved, solving the problems of recompiling the kernel and creating ISO image files in existing technologies, and improving installation efficiency.

CN117850815BActive Publication Date: 2026-04-21CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 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-14
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing Linux operating system installation methods require recompiling the kernel and creating ISO image files when dealing with different types of hard drives, which makes them inflexible and time-consuming.

Method used

By enhancing the PXE protocol to transmit hard drive driver RPM package software repository paths, a mapping file between hard drive information and driver RPM packages is created. The hard drive model is automatically identified and the corresponding driver is downloaded in the Live memory system environment, avoiding the need to recompile the kernel and create ISO image files.

Benefits of technology

It enables automatic adaptation and installation of the Linux operating system on various types of hard drives, improving R&D and operation and maintenance efficiency, and avoiding technical inflexibility and cost consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117850815B_ABST
    Figure CN117850815B_ABST
Patent Text Reader

Abstract

This invention provides an installation method and system for a Linux operating system based on a PXE-adaptive hard disk driver. The method includes: creating a hard disk driver RPM package software repository; creating a mapping file between hard disk information and its driver RPM packages; updating the path of the hard disk driver RPM package repository on the PXE server via the PXE protocol; automatically detecting and obtaining the hard disk's device type, device ID, and alias in the Live memory system environment; determining whether the target hard disk is supported in the Live memory system environment; configuring the hard disk driver RPM package repository in the Live memory system environment; downloading the mapping file between hard disk information and its driver RPM packages; matching and downloading the hard disk driver RPM package from the PXE server; installing and loading the hard disk driver RPM package in the Live memory system environment; installing the operating system software package according to normal logic in the Linux operating system installer in the Live memory system environment; installing the hard disk driver RPM package on the hard disk file system and updating the kernel module configuration file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Linux operating system distribution development, mainly targeting the installation of Linux operating system on physical servers, especially in scenarios using PXE for installation. Specifically, it relates to an installation method and system for Linux operating system based on PXE adaptive hard disk driver. Background Technology

[0002] In recent years, with the development of the cloud computing industry, cloud computing has changed the way people access information and how enterprises build their information systems. Cloud computing is also considered the third wave of IT, a service related to information technology, software, and the internet. The rapid development of cloud computing also requires strong infrastructure support, among which the operating system that manages the server hardware and service capabilities of cloud resource pools is extremely important. Currently, cloud computing operating systems are generally Linux operating systems such as Red Hat and CentOS.

[0003] Currently, Linux operating systems are generally installed in two ways: one is to copy the Linux operating system ISO image file to a CD or USB drive and then insert it into the physical server for installation; the other is to import the Linux operating system ISO image file into a PXE server and then configure the appropriate environment for installation. In real-world projects, cloud computing resource pools contain a large number of servers of various models, which may be configured with different types of hard drives, such as RAID and NVMe. However, a Linux operating system distribution cannot be released simultaneously to support installation on all types of hard drives, because the ISO image file may lack drivers for certain types of hard drives. Current techniques generally require developers to unpack the Linux operating system distribution ISO image file, recompile the kernel vmlinuz or inject hard drive drivers to recreate the Initramfs, and then reconstruct and release the ISO image file before integrators can continue the installation. Therefore, current techniques suffer from problems such as the need for ISO image file re-distribution, lack of flexibility, and excessive time consumption. Summary of the Invention

[0004] In view of this, the present invention proposes an installation method and system for a Linux operating system based on a PXE adaptive hard disk driver. This method can make full use of the existing Linux operating system PXE installation mechanism, enabling the Linux operating system to automatically adapt to installation on various types of hard disks. When the Linux operating system does not support a certain hard disk driver, there is no need to recompile the kernel vmlinuz, inject the hard disk driver to recreate the Initramfs, or rebuild the ISO image file, thus improving R&D and operation and maintenance efficiency.

[0005] To achieve the above objectives, in a first aspect, the present invention provides an installation method for a Linux operating system based on a PXE adaptive hard disk driver, comprising the following steps:

[0006] Enhanced PXE protocol for transmitting hard drive driver RPM package software repository paths;

[0007] Create a hard drive driver RPM package software repository in the first directory of the PXE server;

[0008] Create a file in the second directory of the PXE server containing hard disk information and a hard disk driver mapping relationship file for the driver RPM package;

[0009] Update the PXE protocol, transfer the path of the hard drive driver rpm package software repository on the PXE server, and identify the hard drive model in the Live memory system environment;

[0010] Determine whether the target hard drive is supported in the Live memory system environment;

[0011] If the target hard drive is not supported, download the hard drive mapping file from the second directory of the PXE server;

[0012] Configure yum based on the PXE server IP and the hard drive driver rpm package repository path;

[0013] Download and cache the hard drive driver RPM to the Live memory system cache;

[0014] Install the hard drive driver RPM package and load the driver in the Live memory system environment;

[0015] Normal operating system software package installation; if the target hard drive is supported, proceed directly with the normal operating system software package installation.

[0016] Install the hard drive driver RPM package on the hard drive file system and update the kernel module configuration file.

[0017] As a further aspect of the present invention, the hard disk driver rpm package can be obtained from the hard disk hardware manufacturer, or a custom hard disk driver rpm package can be made for a specific Linux operating system distribution.

[0018] As a further aspect of the present invention, each line of data recorded in the hard disk driver mapping relationship file is used to indicate the name of the rpm package corresponding to the driver kernel module compiled by the hard disk for a specific Linux Kernel version.

[0019] As a further aspect of the present invention, the PXE protocol is used to transmit PXE server driver rpm package repository information. According to the RFC standard, Options 178, which has not yet been allocated in DHCP Options, is used as the carrier. In this case, the DHCP configuration file dhcpd.conf in the PXE server has an additional configuration item for the server driver rpm package repository information path.

[0020] As a further aspect of the present invention, when identifying the hard disk model in the Live memory system environment, the Live memory system environment automatically detects and obtains the hard disk's device type, device ID, and alias. When the Linux operating system selects the target hard disk during the installation process, it automatically detects the hard disk based on the / dev and / sys file systems to obtain the hard disk's device type, device ID, and alias.

[0021] As a further aspect of the present invention, determining whether the target hard disk is supported in the Live memory system environment includes the following steps:

[0022] Based on the obtained target hard drive alias information, search the system file / usr / lib / modules / 'kernel version' / module.alias to see if the system has a driver for the target hard drive;

[0023] If a driver for the target hard drive is available, use the `lsmod` command to check if the driver has been loaded. If not, use `insmod` to load the driver and proceed directly to the normal operating system package installation. If no driver for the target hard drive is available, configure the hard drive driver RPM package repository.

[0024] As a further aspect of the present invention, the hard disk driver rpm package repository is configured in the Live memory system environment, and the rpm package repository is configured according to the IP address of the PXE server and the path of the transmitted hard disk driver rpm package repository on the PXE server.

[0025] As a further aspect of the present invention, the installation method of the Linux operating system based on the PXE adaptive hard disk driver further includes:

[0026] Download the file containing the mapping relationship between hard disk information and PXE server driver rpm packages from the second directory on the PXE server;

[0027] Download the hard drive driver RPM package from the PXE server;

[0028] Install and load the hard drive driver RPM package in the Live memory system environment;

[0029] In a Live memory system environment, the Linux operating system installer installs the operating system packages according to normal logic.

[0030] As a further aspect of the present invention, the rpm package of the hard disk driver is downloaded from the PXE server, including:

[0031] Based on the hard disk information and the hard disk information driver rpm package mapping file obtained when configuring the hard disk driver rpm package repository in the Live memory system environment, as well as the obtained hard disk device type, device ID, and kernel version, the hard disk driver rpm package name is matched.

[0032] If the match is successful, the hard drive driver RPM package will be downloaded and cached in the Live memory system environment; otherwise, the installation will fail.

[0033] As a further aspect of the present invention, installing and loading the hard disk driver rpm package in the Live memory system environment includes:

[0034] Obtain the path to the hard disk driver RPM package cached in the Live memory system environment;

[0035] Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package in the Live memory system environment.

[0036] Use the system command insmod to load the hard drive driver.

[0037] As a further aspect of the present invention, after directly performing normal operating system software package installation, it further includes:

[0038] Determine if the hard drive is supported;

[0039] If the hard drive is not supported, copy the hard drive driver rpm package from the Live memory system environment to the hard drive file system.

[0040] Switch to the hard drive file system;

[0041] Install the hard drive driver RPM package in the hard drive file system and update the kernel configuration file.

[0042] As a further aspect of the present invention, installing the hard disk driver rpm package on the hard disk file system and updating the kernel module configuration file includes:

[0043] In the Live memory system environment, locate the hard disk file system mount point / sysroot;

[0044] Use the system command `mkdir` to create a temporary directory ` / sysroot / new_disk`, and copy the hard drive driver RPM package to this directory;

[0045] Use the system command chroot / sysroot / to switch from the Live memory system environment file system to the hard disk file system;

[0046] Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package on the hard disk file system. The corresponding hard disk driver ko file will be installed in the correct directory of the hard disk file system.

[0047] Use the system command 'depmod -a' to update the contents of the kernel module configuration file on the hard disk file system.

[0048] Secondly, the present invention also provides an installation system for a Linux operating system based on a PXE adaptive hard disk driver, comprising the following modules:

[0049] PXE Protocol Enhancement Module: Used to transmit the hard disk driver rpm package software repository path, using Option 178, which has not yet been assigned in DHCPOptions, as the carrier according to the RFC standard;

[0050] Hard disk driver software repository creation module: Creates a hard disk driver rpm package software repository in the first directory of the PXE server to store various types of hard disk driver rpm packages;

[0051] Hard disk information and driver mapping relationship creation module: Creates a hard disk driver mapping relationship file in the second directory of the PXE server, which contains hard disk information and driver rpm packages. Each line of data indicates the name of the rpm package corresponding to the driver kernel module compiled for a specific Linux Kernel version.

[0052] PXE Protocol Path Update Module: Updates the PXE protocol, transfers the path of the hard drive driver rpm package software repository on the PXE server, and identifies the hard drive model in the Live memory system environment;

[0053] Hard drive identification and support determination module: Automatically detects and obtains the device type, device ID and alias of the target hard drive in the Live memory system environment, and determines whether it supports installing an operating system on the target hard drive based on the obtained hard drive information;

[0054] Target hard drive processing module not supported: If the target hard drive is not supported, download the hard drive driver mapping file from the second directory of the PXE server;

[0055] PXE Server Configuration Module: Configures yum based on the PXE server's IP address and the hard drive driver rpm package repository path;

[0056] Hard drive driver download and caching module: Downloads and caches hard drive driver RPMs to the Live memory system cache for subsequent installation operations;

[0057] Hard disk driver installation and loading module: Installs and loads the hard disk driver RPM package in the Live memory system environment;

[0058] Normal operating system software package installation module: After the hard drive driver installation is completed, the normal operating system software package is installed;

[0059] Supports direct module installation on the target hard drive: If the target hard drive is supported, proceed directly with the normal operating system software package installation.

[0060] In another aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, which, when executed by the processor, performs any of the above-described installation methods of the Linux operating system based on a PXE adaptive hard disk drive according to the present invention.

[0061] In another aspect, the present invention provides a computer-readable storage medium storing computer program instructions that, when executed, implement any of the above-described installation methods of the Linux operating system based on a PXE adaptive hard disk drive according to the present invention.

[0062] Compared with existing technologies, the installation method and system for a Linux operating system based on a PXE adaptive hard disk driver proposed in this invention have the following advantages:

[0063] 1. Automatically detect and determine whether the installation of the operating system on the target device is supported during installation;

[0064] 2. Enhance the PXE protocol to enable it to transmit information such as the hard drive driver RPM package repository path;

[0065] 3. The Live memory system environment and hard disk file system work together in two stages to install hard disk drivers, solving the problems of not being able to install the operating system due to missing hard disk drivers in ISO image files and accessing the hard disk normally after the operating system is installed.

[0066] In summary, the installation method of the Linux operating system based on PXE adaptive hard disk driver of the present invention enables the Linux operating system to automatically adapt to the installation on various types of hard disks. When the Linux operating system does not support a certain hard disk driver, there is no need to recompile the kernel vmlinuz, inject the hard disk driver to recreate Initramfs, or rebuild the ISO image file, thus avoiding problems such as inflexibility and excessive cost.

[0067] These or other aspects of this application will become more apparent from the following description of embodiments. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the scope of this application. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0069] In the diagram:

[0070] Figure 1 This is a flowchart illustrating an installation method for a Linux operating system based on a PXE adaptive hard disk driver, according to an embodiment of the present invention.

[0071] Figure 2 This is a flowchart illustrating the process of identifying and downloading RPM packages in the installation method of the Linux operating system based on PXE adaptive hard disk driver according to an embodiment of the present invention.

[0072] Figure 3 This is a flowchart illustrating the installation of the hard disk driver rpm package in the Live memory system environment of the installation method for the Linux operating system based on the PXE adaptive hard disk driver according to an embodiment of the present invention.

[0073] Figure 4 This is a schematic diagram illustrating the addition of a DHCP configuration item to the installation method of the Linux operating system based on the PXE adaptive hard disk driver according to an embodiment of the present invention. Detailed Implementation

[0074] The present application will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.

[0075] To make the objectives, technical solutions, and advantages of this invention clearer, the embodiments of this invention will be further described in detail below with reference to specific examples and the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit this application.

[0076] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0077] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0078] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0079] The purpose of this invention is to provide an installation method and system for a Linux operating system based on a PXE adaptive hard drive driver. This method fully utilizes the existing Linux operating system's PXE installation mechanism, enabling the Linux operating system to automatically adapt to installation on various types of hard drives. Even when the Linux operating system does not support a certain hard drive driver, there is no need to recompile the kernel (vmlinuz), inject the hard drive driver to recreate Initramfs, or rebuild the ISO image file, thus improving development and maintenance efficiency.

[0080] To achieve the above objectives, this invention provides an installation method for a Linux operating system based on a PXE adaptive hard disk driver, comprising the following steps:

[0081] Step 1: Create a hard drive driver RPM package software repository

[0082] Hard drive driver RPM packages can be obtained from hard drive hardware manufacturers, or custom hard drive driver RPM packages can be created for a specific Linux operating system distribution. A software repository containing various types of hard drive driver RPM packages can be created in the first directory of the PXE server.

[0083] Step 2: Create a file mapping the hard drive information to its driver RPM package.

[0084] Create a file in the second directory of the PXE server that maps hard drive information to their corresponding driver RPM packages. This directory should be accessible to the PXE server process. Each line in the mapping file indicates the name of the RPM package corresponding to the driver kernel module compiled for a specific Linux Kernel version on that hard drive.

[0085] Step 3: Update the path of the PXE protocol transfer hard disk driver RPM package repository on the PXE server.

[0086] In the PXE protocol, to transmit PXE server driver RPM package repository information, Option 178, which is not yet assigned or used in DHCPOptions, is used as the bearer, according to the RFC standard. Simultaneously, the DHCP configuration file dhcpd.conf on the PXE server needs to add a configuration item for the server driver RPM package repository path, such as... Figure 4 As shown.

[0087] Step 4: The Live memory system environment automatically detects and obtains the hard drive's device type, device ID, and alias.

[0088] When selecting a target hard drive during the installation process, the Linux operating system automatically detects the hard drive based on the / dev and / sys file systems to obtain the hard drive's device type, device ID, and alias.

[0089] Step 5: Determine whether the target hard drive is supported in the Live memory system environment.

[0090] Based on the target hard drive alias information obtained in step 4, search the system file / usr / lib / modules / 'kernel version' / module.alias to see if the system has a driver for the target hard drive;

[0091] If a driver for the target hard drive is available, use the `lsmod` command to check if the driver is loaded. If not, use `insmod` to load the driver and proceed to step 10. If no driver is available for the target hard drive, proceed to step 6.

[0092] Step 6: Configure the hard disk driver RPM package repository in the Live memory system environment.

[0093] Configure the RPM package repository based on the PXE server's IP address and the path of the hard drive RPM package repository transmitted in step 3 on the PXE server.

[0094] Step 7: Download the file mapping the hard drive information to its driver RPM package.

[0095] Download the file containing the mapping relationship between the hard drive information and its driver rpm package from the second directory on the PXE server.

[0096] Step 8: Download the hard drive driver RPM package from the PXE server.

[0097] Based on the hard drive information and its driver RPM package mapping file obtained in step 6, and the hard drive's device type, device ID, and kernel version obtained in step 4, the hard drive driver RPM package name is matched. If the match is successful, the hard drive driver RPM package is downloaded and cached in the Live memory system environment; otherwise, the installation fails.

[0098] Step 9: Install and load the hard drive driver RPM package in the Live memory system environment.

[0099] Obtain the path to the hard disk driver RPM package cached in the Live memory system environment;

[0100] Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package in the Live memory system environment.

[0101] Use the system command insmod to load the hard drive driver.

[0102] Step 10: The Linux operating system installer in the Live Memory System environment installs the operating system packages according to normal logic;

[0103] Step 11: Install the hard drive driver RPM package on the hard drive file system and update the kernel module configuration file.

[0104] In the Live memory system environment, locate the hard disk file system mount point / sysroot;

[0105] Use the system command `mkdir` to create a temporary directory ` / sysroot / new_disk`, and copy the hard drive driver RPM package to this directory;

[0106] Use the system command chroot / sysroot / to switch from the Live memory system environment file system to the hard disk file system;

[0107] Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package on the hard disk file system. The corresponding hard disk driver ko file will be installed in the correct directory of the hard disk file system.

[0108] Use the system command 'depmod -a' to update the contents of the kernel module configuration file on the hard disk file system.

[0109] The embodiments of the present invention provide an installation method for a Linux operating system based on a PXE adaptive hard disk driver. During the installation, the method automatically detects and determines whether the installation of the operating system on the target device is supported. It enhances the PXE protocol to enable it to transmit information such as the hard disk driver rpm package repository path. The two-stage linkage of the Live memory system environment and the hard disk file system for hard disk driver installation solves the difficulties of not being able to install the operating system due to missing hard disk drivers in ISO image files and the difficulty of accessing the hard disk normally after the operating system is installed.

[0110] The present invention provides an installation method for a Linux operating system based on a PXE adaptive hard disk driver, which enables the Linux operating system to automatically adapt to the installation on various types of hard disks. When the Linux operating system does not support a certain hard disk driver, there is no need to recompile the kernel vmlinuz, inject the hard disk driver to recreate the Initramfs, or rebuild the ISO image file, thus avoiding problems such as inflexibility and excessive cost.

[0111] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of this invention will be further described below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them.

[0112] In this embodiment, the Linux operating system ISO image file installed on the cloud computing resource pool server is ctyunos-2.0.1-220311-x86_64-dvd, the Linux kernel version is 4.19.90, the PXE server uses cobbler, and the hard disk controller is a RAID controller.

[0113] This embodiment describes an installation method for a Linux operating system based on a PXE adaptive hard disk driver, which includes the following steps:

[0114] Step 1: Obtain the hard drive driver RPM package from the hard drive hardware manufacturer, or create your own hard drive driver RPM package for a specific Linux operating system distribution. Create a first directory disk_repo under the / var / www / cobbler / directory on the PXE server, and use createrepo to create a software repository in this directory.

[0115] Step 2: Create a second directory `mapping_dir` under the ` / var / www / cobbler / ` directory on the PXE server, and create a file named `disk_rpm_mapping` in this directory that maps hard information to the names of their driver RPM packages. The file content is as follows:

[0116] v00009005d0000028->4.19.90-2102.2.0.0062->kmod-megaraid_sas;

[0117] v00009005d0000028->5.10.60-1->kmod-megaraid_sas;

[0118] v00008001d0000010->4.19.90-2102.2.0.0062->kmod-aacraid.

[0119] Step 3: Modify the configuration file ` / etc / dhcpd.conf` and add the configuration item `driver-repo: / var / www / cobbler / driver-repo / x86_64 / `. The PXE server stores the driver-repo in DHCPOptions 178 in its DHCP Offer message reply to PXE clients. The PXE client passes this to the PXE server when starting the Live Memory System environment.

[0120] Step 4: The installation environment automatically detects and obtains the hard drive's device type, device ID, and alias;

[0121] Based on the hard disk device type 00009005 and device ID 0000028 detected by the kernel, the corresponding modalias file is searched in the system file directory / sys / devices, and the alias of the target hard disk is obtained from the file: v00009005d0000028sv*sd*sc*.

[0122] Step 5: Determine whether the target hard drive is supported in the Live memory system environment;

[0123] According to the hard drive device alias, it is located in the system file / usr / lib / modules / 4.19.

[0124] The system searches for a corresponding hard drive driver .ko file in 90-2102.2.0.0062 / modules.alias. In this case, since there is no corresponding RAID .ko file, the process skips directly to step 6.

[0125] Step 6: The driver-repo obtained from the above steps: / var / www / cobbler / driver-repo / x86_64 /

[0126] And the IP address of the PXE server, next-server. Create the rpm package repository configuration file disk-driver.repo in the / etc / yum.repos.d / directory. The specific steps are as follows:

[0127] Set the baseurl in the disk-driver.repo configuration file to http: / / next-server / var / www / cobbler / driver-repo / x86_64

[0128] To enable the use of the software repository, set enabled=1 in the disk-driver.repo configuration file.

[0129] Use the system command `yum makecache` to download the metadata information of the hard drive driver RPM package repository from the PXE server and complete the RPM package software repository configuration.

[0130] Step 7: Use the command wget to download the disk information and its driver RPM package mapping file disk_rpm_mapping from the second directory mapping_dir on the PXE server;

[0131] Step 8: Based on the hard drive device type and device ID obtained in Step 4, determine the corresponding hard drive driver RPM package name as kmod-megaraid_sa-3.2-x86_64.rpm in the mapping file disk_rpm_mapping. Use the system command yumdownloader kmod-megaraid_sas to download the hard drive driver RPM package and cache it in the Live memory system environment;

[0132] Step 9: In the Live memory system environment, use the system command "rpm -ivh kmod-megaraid_sa-3.2-x86_64.rpm" to install the hard drive driver rpm package, and use the system command insmod megaraid_sas.ko to load the memory environment;

[0133] Step 10: The Linux operating system installer in the Live Memory System environment installs the operating system packages according to normal logic;

[0134] Step 11: Install the hard drive driver RPM package on the hard drive file system and update the kernel module configuration file. The specific steps are as follows:

[0135] The mount point of the hard disk device file / dev / sda is found to be / sysroot;

[0136] Create a new directory / sysroot / new_disk, and use the command cp kmod-megaraid_sa-3.2-x86_64.rpm / sysroot / new_disk to copy the driver to the hard drive file;

[0137] Use the system command "chroot / sysroot" to switch from the Live memory system environment file system to the hard disk file system;

[0138] Use the system command "rpm -ivhkmod-megaraid_sa-3.2-x86_64.rpm" to install the hard drive driver rpm package into the hard drive's file system;

[0139] Use the system command `depmod -a` to update the kernel module-related configuration files on the hard disk file system.

[0140] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may, for example, be executed synchronously or asynchronously in multiple modules.

[0141] It should be understood that although the above description follows a certain order, these steps are not necessarily executed in that order. Unless otherwise expressly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, some steps in this embodiment may include multiple steps or multiple stages, which are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least a portion of the steps or stages in other steps.

[0142] A second aspect of this invention also provides an installation system for a Linux operating system based on a PXE adaptive hard disk driver, comprising the following modules:

[0143] PXE Protocol Enhancement Module: Used to transmit the hard drive driver rpm package software repository path, using Option 178, which has not yet been assigned in DHCPOptions, as the carrier according to the RFC standard.

[0144] Hard disk driver software repository creation module: Creates a hard disk driver RPM package software repository in the first directory of the PXE server to store various types of hard disk driver RPM packages.

[0145] Hard disk information and driver mapping relationship creation module: Creates a hard disk driver mapping relationship file in the second directory of the PXE server, which contains hard disk information and driver rpm packages. Each line of data indicates the name of the rpm package corresponding to the driver kernel module compiled for the specific Linux Kernel version.

[0146] PXE Protocol Path Update Module: Updates the PXE protocol, transfers the path of the hard drive driver rpm package software repository on the PXE server, and identifies the hard drive model in the Live memory system environment.

[0147] Hard drive identification and support determination module: Automatically detects and obtains the device type, device ID and alias of the target hard drive in the Live memory system environment, and determines whether the hard drive supports the installation of an operating system on the target hard drive based on the obtained hard drive information.

[0148] Target hard drive processing module not supported: If the target hard drive is not supported, download the hard drive driver mapping file from the second directory of the PXE server.

[0149] PXE Server Configuration Module: Configures yum based on the PXE server's IP address and the hard drive driver rpm package repository path.

[0150] Hard drive driver download and caching module: Downloads and caches hard drive driver RPMs to the Live memory system cache for subsequent installation operations.

[0151] Hard disk driver installation and loading module: Installs and loads the hard disk driver rpm package in the Live memory system environment.

[0152] Normal operating system software package installation module: After the hard drive driver is installed, the normal operating system software package is installed.

[0153] Supports direct module installation on the target hard drive: If the target hard drive is supported, proceed directly with the normal operating system software package installation.

[0154] In this embodiment, the hard disk driver RPM package acquisition module can obtain the hard disk driver RPM package from the hard disk hardware manufacturer, or create a custom hard disk driver RPM package for a specific Linux operating system distribution.

[0155] Disk drive mapping file module: In the disk drive mapping file, each line of data indicates the name of the rpm package corresponding to the driver kernel module compiled for a specific Linux Kernel version.

[0156] The PXE protocol transmission module is used to transmit PXE server driver RPM package repository information. According to the RFC standard, it uses Option 178, which is not yet assigned in DHCPOptions, as the bearer. An entry for configuring the server driver RPM package repository path is added to the DHCP configuration file dhcpd.conf in the PXE server.

[0157] Target hard drive identification module: When identifying the hard drive model in the Live memory system environment, it automatically detects and obtains the hard drive's device type, device ID, and alias. When selecting the target hard drive during the Linux operating system installation process, it automatically detects the hard drive based on the / dev and / sys file systems to obtain the hard drive's device type, device ID, and alias.

[0158] In this embodiment, a target hard disk determination module is supported: determining whether a target hard disk is supported in the Live memory system environment, including:

[0159] Based on the obtained target hard drive alias information, search the system file / usr / lib / modules / 'kernel version' / module.alias to see if the system has a driver for the target hard drive;

[0160] If there is a driver for the target hard drive, use the lsmod command to check if the driver has been loaded. If not, use insmod to load the driver and then proceed directly to the normal operating system software package installation.

[0161] If there is no driver for the target hard drive, then configure the hard drive driver RPM package repository.

[0162] In this embodiment, the hard disk driver rpm package repository configuration module configures the hard disk driver rpm package repository in the Live memory system environment, based on the PXE server's IP address and the path of the transmitted hard disk driver rpm package repository on the PXE server.

[0163] In this embodiment, the hard disk information download and matching module includes the following steps:

[0164] Download the file containing the mapping relationship between hard disk information and PXE server driver rpm packages from the second directory of the PXE server;

[0165] The PXE server is used to match and download the hard drive driver RPM package. Based on the hard drive information and hard drive information driver RPM package mapping relationship file obtained when configuring the hard drive driver RPM package repository in the Live memory system environment, as well as the obtained hard drive device type, device ID, and kernel version, the hard drive driver RPM package name is matched.

[0166] If the match is successful, the hard drive driver RPM package will be downloaded and cached in the Live memory system environment; otherwise, the installation will fail.

[0167] In this embodiment, the hard disk driver installation and loading module: **Installs and loads the hard disk driver rpm package in the Live memory system environment, including:

[0168] Obtain the path to the hard disk driver RPM package cached in the Live memory system environment;

[0169] Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package in the Live memory system environment.

[0170] Use the system command insmod to load the hard drive driver.

[0171] In this embodiment, the normal operating system software package installation module: ** The Linux operating system installer in the Live memory system environment installs the operating system software package according to normal logic.

[0172] In this embodiment, the hard disk driver module is installed on the hard disk file system: ** The hard disk driver RPM package is installed on the hard disk file system and the kernel module configuration file is updated, including:

[0173] In the Live memory system environment, locate the hard disk file system mount point / sysroot;

[0174] Use the system command `mkdir` to create a temporary directory ` / sysroot / new_disk`, and copy the hard drive driver rpm package to this directory;

[0175] Use the system command chroot / sysroot / to switch from the Live memory system environment file system to the hard disk file system;

[0176] Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package on the hard disk file system. The corresponding hard disk driver ko file will be installed in the correct directory of the hard disk file system.

[0177] Use the system command 'depmod -a' to update the contents of the kernel module configuration file on the hard disk file system.

[0178] A third aspect of the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the method of any of the above embodiments.

[0179] The computer device includes a processor and a memory, and may also include input devices and output devices. The processor, memory, input devices, and output devices can be connected via a bus or other means. The input devices can receive input digital or character information and generate signal inputs related to the migration of the installation of a Linux operating system based on a PXE adaptive hard drive. The output devices may include display devices such as a screen.

[0180] Memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the installation method of the Linux operating system based on the PXE adaptive hard disk driver in the embodiments of this application. Memory may include a program storage area and a data storage area, wherein the program storage area may store the application program required for operating the device and at least one function; the data storage area may store data created by using the installation method of the Linux operating system based on the PXE adaptive hard disk driver, etc. Furthermore, memory may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the local module 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.

[0181] In some embodiments, the processor may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is typically used to control the overall operation of a computer device. In this embodiment, the processor is used to run program code stored in memory or process data. In this embodiment, the processors of multiple computer devices execute various server functions and data processing by running non-volatile software programs, instructions, and modules stored in memory, thereby implementing the steps of the installation method for the Linux operating system based on a PXE adaptive hard disk drive described in the above embodiment.

[0182] It should be understood that, without conflict, all the embodiments, features and advantages described above for the installation method of the Linux operating system based on the PXE adaptive hard disk driver according to the present invention are equally applicable to the installation and storage media of the Linux operating system based on the PXE adaptive hard disk driver according to the present invention.

[0183] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the overall device. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.

[0184] Finally, it should be noted that the computer-readable storage medium (e.g., memory) described herein can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. By way of example, and not limitation, non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which can act as external cache memory. By way of example, and not limitation, RAM can be obtained in various forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices disclosed herein are intended to include, but are not limited to, these and other suitable types of memory.

[0185] The various exemplary logic blocks, modules, and circuits described herein can be implemented or performed using the following components designed to perform the functions herein: general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general-purpose processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP, and / or any other such configuration.

[0186] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.

[0187] It should be understood that, as used herein, the singular form "a" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the associatedly listed items. The embodiment numbers disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0188] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. An installation method for a Linux operating system based on a PXE adaptive hard disk driver, characterized in that, Includes the following steps: Enhance the software repository path for PXE protocol transmission of hard drive driver RPM packages; Create a software repository for hard drive RPM packages in the first directory of the PXE server; Create a disk information and disk driver mapping file containing disk driver RPM packages in the second directory of the PXE server; Update the PXE protocol, transfer the path of the software repository for the hard drive driver rpm package on the PXE server, and identify the hard drive model in the Live memory system environment; Determine whether the target hard drive is supported in the Live memory system environment; If the target hard drive is not supported, download the hard drive information and the hard drive driver mapping file of the hard drive driver rpm package from the second directory of the PXE server; Configure yum based on the PXE server IP and the repository path of the hard drive driver rpm package; Download and cache the hard drive driver RPM package to the Live memory system environment cache; Install the hard drive driver RPM package and load the driver in the Live memory system environment; Normal operating system software package installation; If the target hard drive is supported, proceed directly with the normal operating system software installation. Install the hard drive driver RPM package on the hard drive file system and update the kernel module configuration file.

2. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 1, characterized in that, Hard drive driver RPM packages can be obtained from hard drive hardware manufacturers or custom-made for specific Linux operating system distributions.

3. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 2, characterized in that, Each line of data recorded in the hard disk driver mapping file indicates the name of the hard disk driver rpm package corresponding to the driver kernel module compiled for a specific Linux Kernel version.

4. The installation method of Linux operating system based on PXE adaptive hard disk driver according to claim 3, characterized in that, The PXE protocol is used to transmit repository information for hard drive driver RPM packages. According to the RFC standard, it uses Option 178, which has not yet been assigned in DHCP Options, as the carrier. Specifically, the DHCP configuration file dhcpd.conf in the PXE server has an additional configuration for the repository information path of hard drive driver RPM packages.

5. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 4, characterized in that, When identifying the hard drive model in the Live memory system environment, the Live memory system environment automatically detects and obtains the hard drive's device type, device ID, and alias. When the Linux operating system selects the target hard drive during installation, it automatically detects and obtains the hard drive's device type, device ID, and alias based on the / dev and / sys file systems.

6. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 1, characterized in that, Determining whether the target hard drive is supported in a Live memory system environment includes the following steps: Based on the obtained target hard drive alias information, search the system file / usr / lib / modules / 'kernel version' / module.alias to see if the system has a driver for the target hard drive; If a driver for the target hard drive is available, use the `lsmod` command to check if the driver has been loaded. If not, use `insmod` to load the driver and proceed directly to the normal operating system package installation. If no driver for the target hard drive is available, configure the hard drive driver RPM package repository.

7. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 6, characterized in that, Configure the hard drive driver RPM package repository in the Live memory system environment. The repository configuration is based on the PXE server's IP address and the path of the hard drive driver RPM package repository on the PXE server.

8. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 7, characterized in that, The installation method for the Linux operating system based on the PXE adaptive hard disk driver also includes: Download the hard drive information and hard drive driver mapping file containing the hard drive driver RPM package from the second directory on the PXE server; Download the hard drive driver RPM package from the PXE server; Install and load the hard drive driver RPM package in the Live memory system environment; In a Live memory system environment, the Linux operating system installer installs the operating system packages according to normal logic.

9. The installation method for a Linux operating system based on a PXE adaptive hard disk driver according to claim 8, characterized in that, Download the hard drive driver RPM package from the PXE server, including: Based on the hard disk information and hard disk driver mapping file of the hard disk driver rpm package obtained when configuring the repository in the Live memory system environment, as well as the obtained hard disk device type, device ID, and kernel version, the name of the hard disk driver rpm package is matched. If the match is successful, the hard drive driver RPM package will be downloaded and cached in the Live memory system environment; otherwise, the installation will fail.

10. The installation method of Linux operating system based on PXE adaptive hard disk driver according to claim 9, characterized in that, Installing and loading the hard drive driver RPM package in a Live memory system environment includes: Get the path to the hard disk driver RPM package cached in the Live memory system environment; Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package in the Live memory system environment. Use the system command insmod to load the hard drive driver.

11. The installation method of Linux operating system based on PXE adaptive hard disk driver according to claim 1, characterized in that, After performing a normal operating system software installation, it also includes: Determine if the hard drive is supported; if not, copy the hard drive driver rpm package from the Live memory system environment to the hard drive file system. Switch to the hard disk file system, install the hard disk driver RPM package and update the kernel configuration file in the hard disk file system.

12. The installation method of Linux operating system based on PXE adaptive hard disk driver according to claim 11, characterized in that, Install the hard drive driver RPM package on the hard drive file system and update the kernel module configuration file, including: In the Live memory system environment, locate the hard disk file system mount point / sysroot; Use the system command `mkdir` to create a temporary directory ` / sysroot / new_disk`, and copy the hard drive driver RPM package to this directory; Use the system command chroot / sysroot / to switch from the Live memory system environment file system to the hard disk file system; Use the system command `rpm -ivh 'hard disk driver rpm package'` to install the hard disk driver rpm package on the hard disk file system. The corresponding hard disk driver ko file will be installed in the correct directory of the hard disk file system. Use the system command 'depmod -a' to update the contents of the kernel module configuration file on the hard disk file system.

13. An installation system for a Linux operating system based on a PXE adaptive hard disk driver, characterized in that, The installation system for the PXE-adaptive hard disk driver-based Linux operating system is used to execute the installation method for the PXE-adaptive hard disk driver-based Linux operating system as described in any one of claims 1-12. The system includes the following modules: PXE Protocol Enhancement Module: Used to transmit the software repository path of hard disk driver rpm packages, using Options 178, which has not yet been assigned in DHCPOptions, as the carrier according to the RFC standard; Hard disk driver software repository creation module: Creates a software repository for hard disk driver RPM packages in the first directory of the PXE server, used to store various types of hard disk driver RPM packages; Hard disk information and driver mapping relationship creation module: Creates a hard disk information and hard disk driver rpm package mapping relationship file in the second directory of the PXE server. Each line of data indicates the name of the hard disk driver rpm package corresponding to the driver kernel module compiled for the specific Linux Kernel version. PXE Protocol Path Update Module: Updates the PXE protocol, transmits the path of the software repository of the hard drive driver rpm package on the PXE server, and identifies the hard drive model in the Live memory system environment. Hard drive identification and support determination module: Automatically detects and obtains the device type, device ID and alias of the target hard drive in the Live memory system environment, and determines whether it supports installing an operating system on the target hard drive based on the obtained hard drive information; Target hard drive processing module not supported: If the target hard drive is not supported, download the hard drive information and hard drive driver mapping file of the hard drive driver rpm package from the second directory of the PXE server; PXE Server Configuration Module: Performs yum configuration based on the PXE server's IP address and the repository path of the hard drive driver rpm package; Hard drive driver download and caching module: Downloads and caches hard drive driver RPM packages to the Live memory system environment cache for subsequent installation operations; Hard disk driver installation and loading module: Installs and loads the hard disk driver RPM package in the Live memory system environment; Normal operating system software package installation module: After the hard drive driver installation is completed, the normal operating system software package is installed; Supports direct module installation on the target hard drive: If the target hard drive is supported, proceed with the normal operating system software installation, install the hard drive driver RPM package on the hard drive file system, and update the kernel module configuration file.

Citation Information

Patent Citations

  • Linux system remote installation configuration management method aiming at disk-free server

    CN105007290A

  • Old utilization method and device, computer equipment and storage medium

    CN116301942A