A mirror filling method, device, equipment and storage medium

By building a boot image package containing the target network card driver on the server and installing it to the PXE server, the problem of Linux mirroring being unable to fill normally is solved, improving the image installation efficiency and network card test coverage, and reducing costs.

CN115098118BActive Publication Date: 2025-09-02JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210751003.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2025-09-02
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

The problem that existing Linux images cannot be filled normally through the network is mainly because the newer version of network card device drivers cannot be recognized in the lower version of Linux images.

Method used

Create a new directory on the target server, copy and decompress the startup image package, build a target startup image package containing the network card driver corresponding to the target network card, and copy it to the PXE server, and install the operating system corresponding to the target image file through the PXE server.

Benefits of technology

The mirror filling is realized through network PXE, which improves the efficiency of mirror installation in server testing and production, reduces the cost of manpower and material resources, and improves the coverage and product quality of network card testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098118B_ABST
    Figure CN115098118B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device and storage medium for image filling, which relates to the field of computer technology, and includes: copying a boot image package to a newly created directory, and decompressing the boot image package in the newly created directory; the newly created directory is a directory newly created on a target server, and the target server is a server that has been configured with a target network card; constructing a target boot image package containing a network card driver corresponding to the target network card based on the decompressed boot image package; copying the target boot image package to a pre-built PXE server; and installing the operating system corresponding to the target image file using the target image file via the PXE server. The present application achieves customization of the network card driver by adding the customized target boot image package to the network card driver, and performs image filling via a network PXE method, thereby improving the efficiency of server testing and image installation in production, and reducing the cost of manpower and material resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a mirror image filling method, device, equipment and storage medium. Background Art

[0002] Currently, Linux is the most frequently used operating system on server platforms. There are numerous methods for installing Linux system images on servers, including remote mounting images from KVM, USB flash drives, and PXE (Preboot Execute Environment) network installation. However, the most convenient and suitable method for large-scale image installation in server testing, as well as for batch importing operating systems on production lines, is PXE network installation. PXE network installation requires network card support, but the rapidly developing computer communications industry has led to a wide variety of network card types and manufacturers. Commonly used standard operating system images, such as CentOS (Community Enterprise Operating System), RHEL (Red Hat Enterprise Linux, a Linux operating system for enterprise users released by Red Hat), and Ubuntu (a Linux operating system primarily focused on desktop applications), cannot fully cover drivers for all network cards.

[0003] Therefore, how to provide a solution to the problem that the Linux image cannot be normally installed through PXE over the network is a problem that those skilled in the art currently need to solve. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide an image installation method, apparatus, device and storage medium, which can solve the problem that a newer version of the network card device driver cannot be recognized in an older version of the Linux image, resulting in the inability to properly install the Linux image through PXE over the network, thereby realizing image installation in a PXE manner. The specific solution can be:

[0005] In a first aspect, the present application discloses a mirror filling method, comprising:

[0006] Copying the boot image package to a newly created directory and decompressing the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server that has been configured with a target network card;

[0007] Constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package;

[0008] Copy the target boot image package to the pre-built PXE server;

[0009] The operating system corresponding to the target image file is installed by using the target image file through the PXE server.

[0010] Optionally, before copying the boot image package to the newly created directory, the method further includes:

[0011] The network card driver corresponding to the target network card is copied to the target server, and the network card driver is installed on the target server.

[0012] Optionally, copying the network card driver corresponding to the target network card to the target server includes:

[0013] Copy the network card driver corresponding to the target network card to the first target directory on the target server.

[0014] Optionally, the step of installing the network card driver on the target server includes:

[0015] The network card driver is installed in the second target directory on the target server.

[0016] Optionally, constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package includes:

[0017] Using the modules.* in the decompressed boot image package to replace the modules.* in the network card driver to obtain a replaced file;

[0018] A target boot image package including a network card driver corresponding to the target network card is constructed based on the replaced file and the decompressed boot image package in the newly created directory.

[0019] Optionally, before replacing modules.* in the network card driver with modules.* in the decompressed boot image package to obtain a replaced file, the method further includes:

[0020] The driver folder corresponding to the network card driver is copied to the third target directory, and the target firmware version corresponding to the target network card is copied to the fourth target directory.

[0021] Optionally, before installing the operating system corresponding to the target image file by using the target image file through the PXE server, the method further includes:

[0022] Setting the target network card as the first startup item;

[0023] Restart the target server using the target network card.

[0024] In a second aspect, the present application discloses a mirror filling device, comprising:

[0025] a first copy module, configured to copy the boot image package to a newly created directory and decompress the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server configured with a target network card;

[0026] An image package construction module, configured to construct a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package;

[0027] A second copy module is used to copy the target boot image package to a pre-built PXE server;

[0028] The image filling module is used to install the operating system corresponding to the target image file using the target image file through the PXE server.

[0029] In a third aspect, the present application discloses an electronic device, comprising:

[0030] Memory, used to store computer programs;

[0031] The processor is used to execute the computer program to implement the steps of the aforementioned image filling method.

[0032] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed image filling method are implemented.

[0033] It can be seen that the present application provides a method for image filling, including: copying the boot image package to a newly created directory, and decompressing the boot image package under the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server that has been configured with a target network card; constructing a target boot image package containing the network card driver corresponding to the target network card based on the decompressed boot image package; copying the target boot image package to a pre-built PXE server; and installing the operating system corresponding to the target image file using the target image file through the PXE server. It can be seen that the present application copies the boot image package to a newly created directory, and then decompresses the boot image package under the newly created directory, and then constructs a target boot image package containing the network card driver corresponding to the target network card, thereby copying the target boot image package to the PXE server, and installing the corresponding operating system through the PXE server. That is, this application realizes the customization of the network card driver by adding the customized boot image package to the network card driver, and performs image filling through the network PXE method, thereby improving the efficiency of server testing and image installation in production, and can greatly reduce the cost of manpower and material resources. Moreover, in the network card test, the PXE function can also improve the coverage of the network card test and improve product quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0035] Figure 1 This is a flow chart of a mirror filling method disclosed in this application;

[0036] Figure 2 This is a flow chart of a specific mirror image filling method disclosed in this application;

[0037] Figure 3 This is a flow chart of a specific mirror image filling method disclosed in this application;

[0038] Figure 4 This is a flow chart of a specific mirror image filling method disclosed in this application;

[0039] Figure 5 This is a schematic structural diagram of a mirror filling device disclosed in this application;

[0040] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0042] Currently, PXE network installation cannot be separated from the support of network cards. However, with the rapid development of the computer communications industry, there are many types and manufacturers of network cards. Commonly used standard operating system images cannot cover all network card drivers. Therefore, this application provides an image installation solution that can solve the problem that newer network card device drivers cannot be recognized in older Linux images, resulting in the inability to properly install the Linux image through PXE over the network, thereby realizing image installation in a PXE manner.

[0043] The embodiment of the present invention discloses a mirror filling method, see Figure 1 As shown, the method includes:

[0044] Step S11: copying the boot image package to a newly created directory, and decompressing the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server that has been configured with a target network card.

[0045] In this embodiment, a new directory, i.e., a new directory, is created in a target server that has been configured with a target network card. The new directory can be set to initrd-new. The target network card can be a Cavium CN2350 10G 10G network card, and the target server can be a server equipped with a PCIE (Peripheral Component Interconnect Express) slot. In other words, a new directory is created on the target server that has been configured with the Cavium CN2350 10G 10G network card. The command for creating a new directory can be:

[0046] #mkdir / root / Desktop / initrd-new;

[0047] The mkdir command indicates the creation of a subdirectory, / root / Desktop / initrd-new is the newly created directory, and initrd is initial ramdisk, which indicates a temporary root file system mounted during the system boot process and can be used as part of the Linux startup process.

[0048] In this embodiment, after the creation of the new directory is completed, the boot image package is copied to the new directory, and the command for copying the boot image package to the new directory can be:

[0049] #cp / mnt / cdrom / images / pxeboot / initrd.img / root / Desktop / initrd-new;

[0050] The initrd.img is the boot image package, and the cp command means copying one or more source files or directories to the specified destination file or directory. That is, copying / mnt / cdrom / images / pxeboot / initd.img to the newly created directory initrd-new. After copying the boot image package initrd.img to the newly created directory / root / Desktop / initrd-new, decompress the boot image package in the newly created directory. The command corresponding to the operation of decompressing the boot image package in the newly created directory can be:

[0051] #cd / root / Desktop / initrd-new;

[0052] #xz-dc initrd.img|cpio–id;

[0053] #rm –r initrd.img;

[0054] Among them, the cd command indicates the directory to be entered, the xz command indicates compressing or decompressing files in .xz format, xz–dc indicates decompressing files, the rm command indicates deleting a file or directory, and rm–r indicates deleting the directory and the files below it one by one.

[0055] In this embodiment, before creating a new directory, it is necessary to copy the target image file to the target server and mount the target image file. For example, copy the Redhat 7.2 ISO image file to the SUT server and mount the ISO image file. The command corresponding to the ISO image file mounting operation can be:

[0056] #mount–o loop xx.iso / mnt / cdrom;

[0057] The mount command is used to mount files outside the Linux system.

[0058] Step S12: constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package.

[0059] In this embodiment, after the boot image package is copied and decompressed, a target boot image package containing the network card driver corresponding to the target network card can be constructed based on the decompressed boot image package. In other words, the target boot image package containing the network card driver corresponding to the target network card can be constructed using the following command:

[0060] #cd / root / Desktop / initrd-new;

[0061] #find.-print|cpio-oH newc|xz--format=lzma>.. / initrd-new.img;

[0062] The find command indicates searching for files in a specified directory, and the initrd-new.img indicates the target startup image package.

[0063] Step S13: copying the target boot image package to a pre-built PXE server.

[0064] In this embodiment, after the target boot image package including the network card driver corresponding to the target network card is constructed, the target boot image package can be copied to the pre-built PXE server. In other words, the newly created initrd-new.img file is copied to the pre-built PXE server.

[0065] Step S14: installing the operating system corresponding to the target image file using the target image file through the PXE server.

[0066] In this embodiment, after the target boot image package is copied to a pre-built PXE server, the operating system corresponding to the target image file is installed by the PXE server using the target image file.

[0067] As can be seen, the embodiment of the present application copies the boot image package to a newly created directory, then decompresses the boot image package in the newly created directory, and then constructs a target boot image package containing the network card driver corresponding to the target network card, thereby copying the target boot image package to the PXE server and installing the corresponding operating system through the PXE server. In other words, the present application achieves customization of the network card driver by adding the customized boot image package to the network card driver, and performs image filling through the network PXE method, thereby improving the efficiency of server testing and image installation in production, and can greatly reduce manpower and material costs. In other words, in the embodiment of the present application, the method of adding the network card driver corresponding to the target network card to the Linux boot image allows the Linux system to be installed on the server via the PXE network. Moreover, the PXE function can also improve the coverage of the network card test in the network card test, that is, through the PXE network, any version of the Linux system can be filled for any model of network card, thereby improving product quality. In other words, the technical solution in the embodiment of the present application makes it possible to add the network card driver image to the Linux image, which is executable, scalable and universal, and has more reference value.

[0068] See also Figure 2 As shown, the embodiment of the present invention discloses a specific mirror filling method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.

[0069] Step S21: copying the network card driver corresponding to the target network card to the target server, and installing the network card driver on the target server.

[0070] In this embodiment, the target network card is configured on the target server, and the target image file of the full software package is installed for the target server. For example, the Cavium CN2350 10G 10G network card is configured on the server SUT, and the Redhat 7.2 image file of the full software package is installed for the server SUT. Then, the latest network card driver corresponding to the target network card downloaded in advance is copied to the target server. For example, the latest Cavium CN2350 10G network card driver is downloaded. The driver package corresponding to the network card driver is: liquidio-linux-driver-fwbin-1.6.0. The driver package is copied to the target server, thereby installing the network card driver on the target server. It can be understood that when a user is monitored to log in to the target server, the network card driver corresponding to the target network card is installed. For example, when the root user is monitored to log in to the server SUT, the network card driver corresponding to the Cavium network card device is installed. The relevant command can be:

[0071] #unzip liquidio-linux-driver-fwbin-1.6.0.zip;

[0072] #. / configure;

[0073] #make;

[0074] #make install;

[0075] Wherein, the unzip command represents decompressing the ".zip" compressed package compressed by the zip command. It should be noted that when installing an application under Linux, generally the configure script is run first, then make is used to compile the source program, and then make install is run.

[0076] Step S22: copying the boot image package to a newly created directory, and decompressing the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server that has been configured with a target network card.

[0077] Step S23: constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package.

[0078] Step S24: copying the target boot image package to a pre-built PXE server.

[0079] Step S25: installing the operating system corresponding to the target image file using the target image file through the PXE server.

[0080] For the specific contents of the above steps S22 to S25, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0081] As can be seen, the embodiment of the present application copies the boot image package to a newly created directory, then decompresses the boot image package in the newly created directory, and then constructs a target boot image package containing the network card driver corresponding to the target network card, thereby copying the target boot image package to the PXE server and installing the corresponding operating system through the PXE server. In other words, the present application achieves customization of the network card driver by adding the customized boot image package to the network card driver, and performs image filling through the network PXE method, thereby improving the efficiency of server testing and image installation in production, and can greatly reduce the cost of manpower and material resources. In addition, the PXE function in network card testing can also improve the coverage of network card testing and improve product quality.

[0082] See also Figure 3As shown, the embodiment of the present invention discloses a specific mirror filling method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.

[0083] Step S31: copy the network card driver corresponding to the target network card to the first target directory on the target server.

[0084] In this embodiment, a target network card is configured on a target server, and the target image file of the full software package is installed on the target server. For example, a Cavium CN2350 10G 10G network card is configured on the server SUT, and the Redhat 7.2 image file of the full software package is installed on the server SUT. Then, the latest network card driver corresponding to the target network card that has been downloaded in advance is copied to the first directory on the target server. For example, the latest Cavium CN2350 10G network card driver is downloaded. The driver package corresponding to the network card driver is: liquidio-linux-driver-fwbin-1.6.0. The driver package is copied to the / root / Desktop directory of the server SUT.

[0085] Step S32: Install the network card driver into the second target directory on the target server.

[0086] In this embodiment, after the network card driver corresponding to the target network card is copied to the first target directory on the target server, the network card driver is installed to the second target directory on the target server. For example, the network card driver is installed on the target server. It is understandable that when a user is monitored to log in to the target server, the network card driver corresponding to the target network card is installed. For example, when the root user is monitored to log in to the server SUT, the network card driver corresponding to the Cavium network card device is installed. The relevant command can be:

[0087] #unzip liquidio-linux-driver-fwbin-1.6.0.zip

[0088] #. / configure

[0089] #make

[0090] #make install

[0091] The network card driver will be installed in the directory:

[0092] / lib / modules / <kernelversion> / kernel / drivers / net / ethernet / cavium

[0093] / liquidio / liquidio.ko

[0094] Since the LiquidIO driver depends on the PTP module in the host kernel, if the network card driver is not installed on the system, a related warning command is generated:

[0095] #modprobe ptp;

[0096] #cd $LIQUIDIO_ROOT / bin;

[0097] #insmod liquidio.ko;

[0098] Wherein, the modprobe command and the insmod command are both used to load a kernel driver module.

[0099] Step S33: copying the boot image package to a newly created directory, and decompressing the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server that has been configured with a target network card.

[0100] Step S34: copy the driver folder corresponding to the network card driver to the third target directory, and copy the target firmware version corresponding to the target network card to the fourth target directory.

[0101] In this embodiment, after copying the boot image package to the newly created directory and decompressing the boot image package in the newly created directory, the driver folder corresponding to the network card driver can be copied to the third target directory. For example, the liquidio folder corresponding to the network card driver of the Cavium CN2350 10G 10G network card is copied to the third target directory. The third target directory contains the liquidio.ko file. The command corresponding to the operation of copying the driver folder corresponding to the network card driver to the third target directory can be:

[0102] #cd / root / Desktop / initrdnew;

[0103] / lib / modules / 3.10.0327.el7.x86_64 / kernel / drivers / net / ethernet;

[0104] #mkdir cavium;

[0105] #cp–r / lib / modules / 3.10.0-327.el7.x86_64 / kernel / drivers / net / Ethernet;

[0106] / cavium / liquidio.;

[0107] The character "." represents the current directory.

[0108] In this embodiment, after completing the operation of copying the driver folder corresponding to the network card driver to the third target directory, the target firmware version corresponding to the target network card is copied to the fourth target directory. For example, the latest firmware version corresponding to the target network card is copied to the fourth target directory. The command corresponding to the operation of copying the latest firmware version corresponding to the target network card to the fourth target directory can be:

[0109] #cd / root / Desktop / initrd-new;

[0110] #mkdir–p / lib / fireware / liquidio;

[0111] #cp / root / Desktop / liquidio-linux-driver-fwbin-1.6.0 / bin / octeon

[0112] / lio_23xx_nic.bin / root / Desktop / initrd-new / lib / fireware / liquidio / ;

[0113] The mkdir –p command recursively creates directories. Even if the parent directory does not exist, the directory will be automatically created according to the directory hierarchy.

[0114] Step S35: using the modules.* in the decompressed boot image package to replace the modules.* in the network card driver to obtain a replaced file.

[0115] In this embodiment, the modules.* in the network card driver are replaced with the modules.* in the decompressed boot image package to obtain the replaced file. For example, the modules.* in the network card driver information are replaced with the modules.* in initrd.img to obtain the latest modules.*.bin file. The command corresponding to the operation of replacing the modules.* in the network card driver with the modules.* in the decompressed boot image package to obtain the replaced file can be:

[0116] #cd / lib / modules / 3.10.0-327.el7.x86_64;

[0117] #egrep'liquidio'

[0118] modules.symbols>> / root / Desktop / initrd-new / lib / modules / 3.10.0-327.el7.x86_64 / modules.symbols;

[0119] #egrep'liquidio'

[0120] modules.alias>> / root / Desktop / initrd-new / lib / modules / 3.10.0-327.el7.x86_64 / modules.alias;

[0121] #egrep'liquidio'

[0122] modules.dep>> / root / Desktop / initrd-new / lib / modules / 3.10.0-327.el7.x86_64 / modules.dep;

[0123] The egrep command is used to search for a specified character string in a file.

[0124] Step S36: constructing a target boot image package including a network card driver corresponding to the target network card based on the replaced file and the decompressed boot image package in the newly created directory.

[0125] In this embodiment, the modules.* in the network card driver are replaced with the modules.* in the decompressed boot image package to obtain a replaced file, and after the boot image package is copied to a newly created directory and the boot image package in the newly created directory is decompressed, a target boot image package containing the network card driver corresponding to the target network card can be constructed based on the replaced file and the decompressed boot image package in the newly created directory. That is, the latest modules.*.bin file obtained by replacing the modules.* in the network card driver information with the modules.* in initrd.img is added to the boot image package initrd.img to obtain a target boot image package containing the network card driver corresponding to the target network card, that is, a target boot image package containing the network card driver corresponding to the Cavium CN2350 10G 10G network card is obtained. The relevant command can be:

[0126] #chroot / root / Desktop / initrd-new;

[0127] #depmod-a–v;

[0128] #exit;

[0129] The chroot command is used to change the root directory location referenced during program execution, and the depmod command is used to analyze the dependencies of loadable modules.

[0130] Step S37: copy the target boot image package to a pre-built PXE server.

[0131] Step S38: installing the operating system corresponding to the target image file using the target image file through the PXE server.

[0132] For the specific contents of the above-mentioned steps S33, S37 to S38, please refer to the corresponding contents disclosed in the above-mentioned embodiments, which will not be repeated here.

[0133] As can be seen, the embodiment of the present application copies the boot image package to a newly created directory, then decompresses the boot image package in the newly created directory, and then constructs a target boot image package containing the network card driver corresponding to the target network card, thereby copying the target boot image package to the PXE server and installing the corresponding operating system through the PXE server. In other words, the present application achieves customization of the network card driver by adding the customized boot image package to the network card driver, and performs image filling through the network PXE method, thereby improving the efficiency of server testing and image installation in production, and can greatly reduce the cost of manpower and material resources. In addition, the PXE function in network card testing can also improve the coverage of network card testing and improve product quality.

[0134] See also Figure 4 As shown, the embodiment of the present invention discloses a specific mirror filling method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.

[0135] Step S41: copying the boot image package to a newly created directory, and decompressing the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server configured with a target network card.

[0136] Step S42: constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package.

[0137] Step S43: copying the target boot image package to a pre-built PXE server.

[0138] Step S44: setting the target network card as the first startup item, and restarting the target server using the target network card.

[0139] In this embodiment, the target network card is set as the first startup item, and the target server is restarted using the target network card. For example, a Cavium CN2350 10G 10G network card is set as the first startup item, and when the server is restarted, it is started from the Cavium CN2350 10G 10G network card.

[0140] Step S45: installing the operating system corresponding to the target image file using the target image file through the PXE server.

[0141] For the specific contents of the above steps S41 to S43 and step S45, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0142] As can be seen, the embodiment of the present application copies the boot image package to a newly created directory, then decompresses the boot image package in the newly created directory, and then constructs a target boot image package containing the network card driver corresponding to the target network card, thereby copying the target boot image package to the PXE server and installing the corresponding operating system through the PXE server. In other words, the present application achieves customization of the network card driver by adding the customized boot image package to the network card driver, and performs image filling through the network PXE method, thereby improving the efficiency of server testing and image installation in production, and can greatly reduce the cost of manpower and material resources. In addition, the PXE function in network card testing can also improve the coverage of network card testing and improve product quality.

[0143] For example, the addition of the Cavium CN2350 10G network card, which is less used in the market, to the RedHat 7.2 image is explained in detail.

[0144] First, the hardware preparation requires a server with a PCIe slot and a Cavium CN2350 10G 10G network card. For software preparation, you'll need the Red Hat 7.2 image file, the latest driver version of the Cavium CN2350 10G 10G network card, and the latest firmware version of the Cavium CN2350 10G 10G network card.

[0145] Then, start preparing the test environment. For example, configure the Cavium CN2350 10G 10G network card to the server SUT and install the Red Hat 7.2 image file with the full software package on the server SUT. Download the latest Cavium CN2350 10G network card driver and obtain the corresponding network card driver package: liquidio-linux-driver-fwbin-1.6.0. Copy the driver package to the / root / Desktop directory of the server SUT. When the root user logs in to the server SUT, install the network card driver corresponding to the Cavium CN2350 10G network card. The network card driver will be installed in the following directory: / lib / modules / <kernelversion> / kernel / drivers / net / ethernet / cavium / liquidio / liquidio.ko, where the liquidio driver depends on the ptp module in the host kernel. If it is not installed on the system, issue the corresponding warning command. ko file, and copy the latest firmware version of the CN2350 10G 10G network card to the specified directory, and then replace the modules.* in the network card driver information with the modules.* in initrd.img. After the replacement is completed, the latest modules.*.bin file is made into initrd.img to obtain the target boot image package initrd-new.img containing the CN2350 10G 10G network card driver. Finally, copy the target boot image package initrd-new.img file to the built PXE server and install the CN2350 Set the 10G network card as the first boot item, restart the server, boot from the network card, and install the Redhat 7.2 image through the PXE network.

[0146] Correspondingly, the embodiment of the present application also discloses a mirror filling device, see Figure 5 As shown, the device includes:

[0147] The first copy module 11 is used to copy the boot image package to a newly created directory and decompress the boot image package in the newly created directory; the newly created directory is a directory newly created on the target server, and the target server is a server that has been configured with a target network card;

[0148] An image package construction module 12 is configured to construct a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package;

[0149] The second copy module 13 is used to copy the target boot image package to a pre-built PXE server;

[0150] The image filling module 14 is used to install the operating system corresponding to the target image file using the target image file through the PXE server.

[0151] In this embodiment, a new directory, i.e., a new directory, is created in a target server that has been configured with a target network card. The new directory can be set to initrd-new. The target network card can be a Cavium CN2350 10G 10G network card, and the target server can be a server equipped with a PCIE (Peripheral Component Interconnect Express) slot. In other words, a new directory is created on the target server that has been configured with the Cavium CN2350 10G 10G network card. The command for creating a new directory can be:

[0152] #mkdir / root / Desktop / initrd-new;

[0153] The mkdir command creates a subdirectory, and / root / Desktop / initrd-new is the new directory.

[0154] In this embodiment, after the creation of the new directory is completed, the boot image package is copied to the new directory by the first copy module 11, and the command for the first copy module 11 to copy the boot image package to the new directory may be:

[0155] #cp / mnt / cdrom / images / pxeboot / initrd.img / root / Desktop / initrd-new;

[0156] The initrd.img is the boot image package, and the cp command means copying one or more source files or directories to the specified destination file or directory, that is, copying / mnt / cdrom / images / pxeboot / initd.img to the newly created directory initrd-new. After the first copy module 11 copies the boot image package initrd.img to the newly created directory / root / Desktop / initrd-new, the boot image package in the newly created directory is decompressed. The command corresponding to the operation of the first copy module 11 to decompress the boot image package in the newly created directory can be:

[0157] #cd / root / Desktop / initrd-new;

[0158] #xz-dc initrd.img|cpio–id;

[0159] #rm –r initrd.img;

[0160] Among them, the cd command indicates the directory to be entered, the xz command indicates compressing or decompressing files in .xz format, xz–dc indicates decompressing files, the rm command indicates deleting a file or directory, and rm–r indicates deleting the directory and the files below it one by one.

[0161] After the boot image package is copied and decompressed, the image package construction module 12 can construct a target boot image package containing the network card driver corresponding to the target network card based on the decompressed boot image package. In other words, the target boot image package containing the network card driver corresponding to the target network card is constructed, and the relevant commands executed by the image package construction module 12 can be:

[0162] #cd / root / Desktop / initrd-new;

[0163] #find.-print|cpio-oH newc|xz--format=lzma>.. / initrd-new.img;

[0164] The find command indicates searching for files in a specified directory, and the initrd-new.img indicates the target startup image package.

[0165] In this embodiment, after the target boot image package including the network card driver corresponding to the target network card is constructed, the target boot image package can be copied to the pre-built PXE server through the second copy module 13. In other words, the second copy module 13 can copy the newly created initrd-new.img file to the pre-built PXE server.

[0166] In this embodiment, after the target boot image package is copied to a pre-built PXE server by the second copying module 13, the image filling module 14 executes an operation of installing the operating system corresponding to the target image file through the PXE server using the target image file.

[0167] As can be seen from the above, the embodiment of the present application copies the boot image package to a newly created directory, then decompresses the boot image package in the newly created directory, and then constructs a target boot image package containing the network card driver corresponding to the target network card, thereby copying the target boot image package to the PXE server and installing the corresponding operating system through the PXE server. In other words, the present application customizes the network card driver by adding the customized boot image package to the network card driver, and performs image filling through the network PXE method, thereby improving the efficiency of server testing and image installation in production, and can greatly reduce the cost of manpower and material resources. In addition, the PXE function in network card testing can also improve the coverage of network card testing and improve product quality.

[0168] In some specific embodiments, the mirror filling device may further include:

[0169] A driver copy module, used for copying the network card driver corresponding to the target network card to the target server;

[0170] A driver installation module is used to install the network card driver on the target server.

[0171] In some specific embodiments, the driver copy module may specifically include:

[0172] The driver copying unit is used to copy the network card driver corresponding to the target network card to the first target directory on the target server.

[0173] In some specific embodiments, the driver installation module may specifically include:

[0174] A driver installation unit is used to install the network card driver into the second target directory on the target server.

[0175] In some specific embodiments, the image package construction module 12 may specifically include:

[0176] a replacement unit, configured to replace modules.* in the network card driver with modules.* in the decompressed boot image package to obtain a replaced file;

[0177] A target boot image package including a network card driver corresponding to the target network card is constructed based on the replaced file and the decompressed boot image package in the newly created directory.

[0178] In some specific embodiments, before replacing modules.* in the network card driver with modules.* in the decompressed boot image package to obtain a replaced file, the following steps may be further performed:

[0179] A folder copying unit, configured to copy a driver folder corresponding to the network card driver to a third target directory;

[0180] The firmware version copying unit is configured to copy the target firmware version corresponding to the target network card to a fourth target directory.

[0181] In some specific embodiments, the mirror filling device may further include:

[0182] A startup item setting module, used to set the target network card as the first startup item;

[0183] A restart module is used to restart the target server using the target network card.

[0184] Furthermore, an embodiment of the present application also provides an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.

[0185] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the image filling method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may be a computer.

[0186] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0187] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0188] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, and can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of performing the image installation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of performing other specific tasks.

[0189] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the image filling method disclosed in any of the aforementioned embodiments are implemented.

[0190] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0191] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a set of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0192] The above is a detailed introduction to the image filling method, device, equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.< / kernelversion> < / kernelversion>

Claims

1. A mirror filling method, characterized in that: include: Copy the boot image package to the newly created directory, and decompress the boot image package in the newly created directory; The newly created directory is a directory newly created on the target server, and the target server is a server configured with a target network card; Constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package; Copy the target boot image package to the pre-built PXE server; Installing the operating system corresponding to the target image file using the target image file through the PXE server; Before copying the boot image package to the newly created directory, the following steps are also included: Copying the network card driver corresponding to the target network card to the target server, and installing the network card driver on the target server; The mirror image filling method further includes: Configuring the target network card to the target server and installing the target image file of the full software package for the target server; Before installing the operating system corresponding to the target image file by using the target image file through the PXE server, the method further includes: The target network card is set as the first startup item; and the target server is restarted using the target network card.

2. The mirror filling method according to claim 1, characterized in that: The copying of the network card driver corresponding to the target network card to the target server includes: Copy the network card driver corresponding to the target network card to the first target directory on the target server.

3. The mirror filling method according to claim 1, characterized in that: The step of installing the network card driver on the target server includes: The network card driver is installed in the second target directory on the target server.

4. The mirror filling method according to claim 1, characterized in that: The step of constructing a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package includes: Using the modules.* in the decompressed boot image package to replace the modules.* in the network card driver to obtain a replaced file; A target boot image package including a network card driver corresponding to the target network card is constructed based on the replaced file and the decompressed boot image package in the newly created directory.

5. The mirror filling method according to claim 4, characterized in that: Before replacing modules.* in the network card driver with modules.* in the decompressed boot image package to obtain a replaced file, the method further includes: The driver folder corresponding to the network card driver is copied to the third target directory, and the target firmware version corresponding to the target network card is copied to the fourth target directory.

6. A mirror filling device, characterized in that: include: A first copy module, configured to copy the boot image package to a newly created directory and decompress the boot image package in the newly created directory; The newly created directory is a directory newly created on the target server, and the target server is a server configured with a target network card; An image package construction module, configured to construct a target boot image package including a network card driver corresponding to the target network card based on the decompressed boot image package; A second copy module is used to copy the target boot image package to a pre-built PXE server; An image filling module is used to install the operating system corresponding to the target image file using the target image file through the PXE server; The mirror filling device is specifically used for: Copying the network card driver corresponding to the target network card to the target server, and installing the network card driver on the target server; The mirror filling device is specifically used for: Configuring the target network card to the target server and installing the target image file of the full software package for the target server; The mirror filling device is specifically used for: The target network card is set as the first startup item; and the target server is restarted using the target network card.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the mirror filling method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the mirror filling method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for updating network card drivers of Linux systems via data center

    CN108388449A