CN109840096B - Installation method and device of operating system - Google Patents

Installation method and device of operating system Download PDF

Info

Publication number
CN109840096B
CN109840096B CN201910003077.7A CN201910003077A CN109840096B CN 109840096 B CN109840096 B CN 109840096B CN 201910003077 A CN201910003077 A CN 201910003077A CN 109840096 B CN109840096 B CN 109840096B
Authority
CN
China
Prior art keywords
file
initramfs
driver
network card
operating system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910003077.7A
Other languages
Chinese (zh)
Other versions
CN109840096A (en
Inventor
孙海龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
New H3C Information Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Information Technologies Co Ltd filed Critical New H3C Information Technologies Co Ltd
Priority to CN201910003077.7A priority Critical patent/CN109840096B/en
Publication of CN109840096A publication Critical patent/CN109840096A/en
Application granted granted Critical
Publication of CN109840096B publication Critical patent/CN109840096B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides an installation method and a device of an operating system, which relate to the technical field of data communication, and the method comprises the following steps: storing the first initramfs file in a storage area of a second initramfs file; and generating a user-level file, adding a download link of the first initramfs file, a download link of the user-level file and indication information for indicating that the rdinit parameter is started after the kernel of the terminal operating system runs into a configuration file in the first mirror image file, and generating and providing a second mirror image file for the terminal to install the operating system. The installation method and device of the operating system effectively avoid the situation of installation failure of the operating system, improve the installation efficiency of the operating system, reduce the workload and contribute to improving the experience of a user.

Description

Installation method and device of operating system
Technical Field
The present application relates to the field of data communication technologies, and in particular, to a method and an apparatus for installing an operating system.
Background
PXE (Preboot execution Environment) is the latest technology developed by Intel corporation, works in the network mode of Client/Server, supports Client (Client) to download image files from a remote Server through the network, and thus supports the Client side terminal to start the operating system through the network. By using the PXE technology, the installation and deployment of the operating system on the terminal at the client side can be realized through the network. Because the PXE technology has the characteristics of high speed, convenience in use, batch deployment and the like, the PXE technology is applied in more and more occasions.
Generally, when a terminal installs an operating system through the PXE technology, a network card of the terminal on the client side is first required to support the PXE function, so as to perform a subsequent installation process of the operating system. In the installation process of the operating system, the firmware inside the network card performs basic initialization work on the network card to provide a basic network channel and the like, but in the subsequent network initialization process, a driver corresponding to the network card needs to be loaded, and if the memory file downloaded by the terminal does not contain the driver corresponding to the current network card, the installation process of the whole operating system fails, so that the installation efficiency of the operating system is reduced, the workload is increased, and the experience of a user is also reduced.
Disclosure of Invention
In view of the above, an object of the present invention is to provide an installation method and an installation device for an operating system, so as to alleviate the technical problem of the reduced user experience caused by the low installation efficiency of the operating system.
In a first aspect, the present application provides an installation method of an operating system, where the method is applied to a server, where the server stores a first initramfs file and a first mirror image file including a second initramfs file, the first initramfs file includes a driver for a first type of network card, and the second initramfs file includes a driver for a second type of network card, and the method includes:
storing the first initramfs file in a storage area of a second initramfs file;
generating a user-level file, wherein the user-level file comprises an effective command for enabling a driver of the first type network card to take effect and a calling command for calling the network initialization file in the second initramfs file;
adding a download link of a first initramfs file, a download link of a user-level file and indication information for indicating that a terminal operating system kernel starts a rdinit parameter after running into a configuration file in a first mirror image file; the rdinit parameter is used for executing the user-level file;
generating and providing a second image file for a terminal to install an operating system; the second mirror image file comprises a configuration file, a first initramfs file, a second initramfs file and a user-level file.
With reference to the first aspect, in a first possible implementation manner, the method further includes: and updating a driver of the first type network card of the first initramfs file according to a set period.
In a second aspect, the present application further provides an installation method of an operating system, where the method is applied to a terminal, and the method includes:
acquiring a bootstrap program for installing an image file of an operating system from a server; downloading a configuration file of the mirror image file through a bootstrap program; the configuration file comprises a download link of a file to be downloaded and indication information used for indicating that the rdinit parameter is started after the kernel of the terminal operating system runs;
downloading a kernel program, a first initramfs file, a second initramfs file and a user-level file according to a download link in the configuration file; wherein, the first initramfs file comprises a driver of the first type network card; the second initramfs file comprises a driver of the second type network card;
running a kernel program, and starting a rdinit parameter according to the indication information;
according to the rdinit parameter, executing an effective process of a driver of the first type network card in the user-level file, and starting a network initialization file in a second initramfs file after the effective process is executed; and completing the installation of the operating system through the started network initialization file.
With reference to the second aspect, in a first possible implementation manner, the validation process of the driver of the first type network card includes:
and adding the version number of a driver of the first type network card and the terminal type supported by the first type network card into the database through a depmod command.
With reference to the second aspect, in a second possible implementation manner, the method further includes: the first initramfs file and the second initramfs file are merged by the bootstrap.
In a third aspect, the present application provides an installation apparatus for an operating system, where the apparatus is disposed in a server, a first initramfs file and a first mirror image file including a second initramfs file are stored in the server, the first initramfs file includes a driver for a first type of network card, the second initramfs file includes a driver for a second type of network card, and the apparatus includes: the storage module is used for storing the first initramfs file in a storage area of the second initramfs file; the generation module is used for generating a user-level file, wherein the user-level file comprises an effective command for enabling a driver of the first type network card to take effect and a calling command for calling the network initialization file in the second initramfs file; the adding module is used for adding a download link of the first initramfs file, a download link of the user-level file and indication information for indicating that the rdinit parameter is started after the kernel of the terminal operating system runs into a configuration file in the first mirror image file; wherein the rdinit parameter is used for executing user-level files; the first installation module is used for generating and providing a second image file for the terminal to install the operating system; the second mirror image file comprises the configuration file, the first initramfs file, the second initramfs file and the user-level file.
With reference to the third aspect, in a first possible implementation manner, the apparatus further includes: and the updating module is used for updating the driving program of the first type network card of the first initramfs file according to a set period.
In a fourth aspect, the present application provides an installation apparatus of an operating system, the apparatus being disposed in a terminal, and including: the acquisition module is used for acquiring a bootstrap program for installing an image file of an operating system from a server; the first downloading module is used for downloading the configuration file of the mirror image file through a bootstrap program; the configuration file includes: the method comprises the steps of downloading a file to be downloaded, and indicating information used for indicating that the rdinit parameter is started after the kernel of a terminal operating system runs; the second downloading module is used for downloading the kernel program, the first initramfs file, the second initramfs file and the user-level file according to the downloading link in the configuration file; wherein, the first initramfs file comprises a driver of the first type network card; the second initramfs file comprises a driver of the second type network card; the running module is used for running the kernel program and starting the rdinit parameter according to the indication information; the execution module is used for executing an effective process of a driver of the first type network card in the user-level file according to the rdinit parameter, and starting a network initialization file in the second initramfs file after the effective process is executed; and the second installation module is used for completing the installation of the operating system through the started network initialization file.
With reference to the fourth aspect, in a first possible implementation manner, the executing module is configured to: and adding the version number of a driving program of the first type network card and the terminal type supported by the first type network card into the database through a depmod command.
With reference to the fourth aspect, in a second possible implementation manner, the apparatus further includes: and the merging module is used for merging the first initramfs file and the second initramfs file through a bootstrap program.
In a fifth aspect, the present application provides a network terminal comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method of the first and second aspects.
The application brings the following beneficial effects:
according to the installation method and device of the operating system, the server adds the driver of the first type network card in the first initramfs file, the first initramfs file is stored in the storage area of the second initramfs file, and the configuration file of the first image file is modified, so that the configuration file, the first initramfs file, the second image file of the second initramfs file and the user-level file with download link and indication information are provided for the terminal to install the operating system.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and drawings.
In order to make the aforementioned objects, features and advantages of the present application comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an installation method of an operating system according to an embodiment of the present application;
FIG. 2 is a flowchart of another operating system installation method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating an installation process of an operating system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an installation apparatus of an operating system according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of an installation apparatus of another operating system according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an installation apparatus of another operating system according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of an installation apparatus of another operating system according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a network terminal according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings. All other embodiments obtained by a person skilled in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Generally, if a network card driver in an initramfs file (memory file system file) of an image file is not matched with a current network card of a terminal, or if a driver of a corresponding network card is absent in the initramfs file of the image file, a kernel cannot complete network initialization after being started, that is, cannot establish connection with a PXE server, and subsequent steps cannot be completed, resulting in failure of the whole PXE installation process. This situation will increase as more and more new network cards are added. Because only the existing network card driver is contained in the initramfs file for a specific os version (e.g., red Hat 7.2) at the time of release, a corresponding driver is absent for a new type of network card appearing after release. Especially for some operating systems that have been released for many years (such as Red Hat 6.4).
In order to simplify the installation process of the operating system and improve the installation efficiency of the operating system, embodiments of the present application provide an installation method and apparatus of the operating system, so as to improve the installation efficiency of the operating system.
For the convenience of understanding the present embodiment, a method for installing an operating system disclosed in the embodiments of the present application will be described in detail first.
The embodiment of the application provides an installation method of an operating system, which is applied to a Server, for example, a PXE Server working in a network mode of a Client/Server, and specifically, the Server stores a first initramfs file and a first image file containing a second initramfs file, where the first initramfs file contains a driver of a first type network card, and the second initramfs file contains a driver of a second type network card.
Generally, the first initramfs file is an initramfs file added later in an image file of an operating system, a driver of a first type network card included in the first initramfs file is a driver not included in an original initramfs file (a second initramfs file), and a subsequent installation process of the operating system is realized by adding the driver of the first type network card.
Fig. 1 shows a flowchart of an installation method of an operating system, which includes the following steps:
step S102, storing the first initramfs file in a storage area of a second initramfs file;
step S104, generating a user-level file, wherein the user-level file comprises an effective command for enabling a driver of the first type network card to take effect and a calling command for calling the network initialization file in the second initramfs file;
in general, the second initramfs file may be a compressed file in which the network initialization file may be stored. In a specific implementation, the network initialization file may be a/sbin/init file.
Step S106, adding a download link of the first initramfs file, a download link of the user-level file and indication information for indicating that the rdinit parameter is started after the operation of a terminal operating system kernel to a configuration file in the first mirror image file;
the rdinit parameter is used for executing the user-level file;
and step S108, generating and providing a second image file for the terminal to install the operating system.
The second mirror image file comprises a configuration file added with the download link and the indication information, a first initramfs file, a second initramfs file and a user-level file.
According to the installation method of the operating system, the server adds the driver of the first type network card in the first initramfs file, stores the first initramfs file in the storage area of the second initramfs file, and modifies the configuration file of the first mirror image file, so that the configuration file with the added download link and the indication information, the first initramfs file, the second initramfs file and the second mirror image file of the user-level file are provided for the terminal to install the operating system.
Compared with the method that the initramfs file in the original mirror image file is directly modified to increase the network card driver, the method is simpler to operate. Generally, for a mode of adding a new driver by modifying an initramfs file in an original image file, it is necessary to consider that the initramfs files corresponding to different versions of operating systems are different, for example, after the initramfs file of the version a is modified and driven, if the initramfs file of the version B is installed, the initramfs file is modified again, which results in a large number of modifications, and the original file of the image file is modified, which requires backup of the original file, which increases the complexity of operation, not only increases the workload, but also affects the installation efficiency of the operating system.
According to the method, the first initramfs file is introduced, the first initramfs file is used for storing the driver of the first type network card, if a new network card appears or the driver of the network card is upgraded, the first initramfs file can be directly modified, and the initramfs file in the mirror image of the original operating system (namely the second initramfs file) does not need to be modified each time, so that the operation is simplified, and the installation efficiency of the operating system is improved.
Generally, the second initramfs file is a self-contained file In an image file, which is essentially a file compressed by gzip or lzma algorithm, and is preceded by an archive package In CPIO (CoPy In and Out) format, which contains all directories and files In a small Linux system (Live OS).
In the installation method of the operating system provided in the embodiment of the present application, when the network card driver in the original initramfs file (second initramfs file) is not suitable for the current network card, a new driver may be added in the first initramfs file by adding a driver of the first type network card, and meanwhile, the new driver may be a driver of a version different from that of the network card of the original driver, or a driver after upgrading the network card on the basis of the original version. For the driver after the network card is upgraded, a regular updating mode can be adopted.
Accordingly, the above method further comprises: and updating the driver of the first type network card of the first initramfs file according to a set period. By the updating method, the driver corresponding to the network card can be added to the first initramfs file in time after the network card is upgraded, so that the driver can be installed when the operating system is installed, and the condition that the operating system is failed to install is effectively avoided.
Corresponding to the installation method of the operating system described in the foregoing embodiment, an embodiment of the present application further provides another installation method of an operating system, where the method is applied to a terminal, and the terminal establishes a connection with a server through a client of the server, as shown in a flowchart of another installation method of an operating system in fig. 2, the method includes the following steps:
step S202, a bootstrap program for installing the mirror image file of the operating system is obtained from a server;
the bootstrap program is a program which plays a role in booting from the terminal startup power-on to the operating system startup process, such as a Network Bootloader, and can be requested and downloaded from the server side after the terminal configures an IP address.
Step S204, downloading the configuration file of the mirror image file through a bootstrap program;
the configuration file comprises a download link of a file to be downloaded and indication information used for indicating that the rdinit parameter is started after the kernel of the terminal operating system runs.
In actual use, the driver of the first-type network card included in the first initramfs file is usually added to the server, and after receiving the driver of the first-type network card transmitted by the user, the server may add the driver of the first-type network card to the first initramfs file, and the added driver of the first-type network card, the version number, the download address, and other information may be recorded in the configuration file, so that after the terminal downloads the configuration file, the terminal may obtain the download link and download the download link.
Step S206, according to the download link in the configuration file, downloading the kernel program, the first initramfs file, the second initramfs file and the user-level file.
Wherein, the first initramfs file comprises a driver of the first type network card; the second initramfs file includes a driver for the second type of network card.
And step S208, after the kernel program is run, starting the rdinit parameter according to the indication information.
Step S210, according to the rdinit parameter, executing an effective process of a driver of the first type network card in the user-level file, and starting a network initialization file in the second initramfs file after the effective process is executed.
And step S212, finishing the installation of the operating system through the started network initialization file.
In a specific implementation, the network initialization file may be the/sbin/init file described in the foregoing embodiment. In a specific implementation, at the server side, after a driver of the first type network card is added to the first initramfs file, the server may store the first initramfs file in a storage area of the second initramfs file, so that, in the process of executing the step S206 to download the file, the terminal may download and merge the first initramfs file and the second initramfs file in the storage area.
In a specific implementation, the merging process may be implemented by a bootstrap program, that is, the first initramfs file and the second initramfs file are merged by the bootstrap program. Specifically, the initramfs file may be merged by pxelinux.0 and grub commands in the bootstrap. For example, the pxelinux.0 command is transferred to two initramfs files of a kernel program through parameters by means of functions provided by the kernel program; and the grub command directly merges the two initramfs files before passing them together to the kernel. The final effect of the merging process of different commands is the same, namely, the contents in a plurality of initramfs files are dynamically merged together in the process of installing the system. By the method, the terminal can acquire the driver corresponding to the latest network card, so that the process of 'from scratch' of the driver is realized, and the occurrence of the event of failure in the installation process of the whole operating system is effectively avoided.
In a specific implementation, after the terminal side downloads the driver corresponding to the network card, the method further includes an effective process of the driver, and specifically, the effective process of the driver of the first type of network card includes: and adding the version number of a driving program of the first type network card and the terminal type supported by the first type network card into the database through a depmod command.
The depmod command is a basic command provided by a kernel program, and the process of adding the version number of the driver of the first type network card and the terminal type supported by the first type network card in the database through the depmod command can modify the database, for example, adding the version number of a new driver and the terminal type supported by the first type network card in the database so that when the driver is installed by a terminal, the database is searched for whether the driver corresponding to the first type network card exists according to the model of the first type network card, and if the driver exists, the driver can be called to install. Therefore, the validation process of the driver of the first type network card can be regarded as a process of modifying the database.
After the driver of the first type network card takes effect, the installation process of the operating system needs to be completed through a network initialization file, and specifically, the network initialization file may be a/sbin/init file. Generally, after the kernel program is loaded and executed and initialized, the second initramfs file in the mirror file may be decompressed, and the decompressed directory is used as a root file system, and the network initialization file (/ sbin/init file) may be stored in the root file system, so as to automatically execute the/sbin/init file under the root file system.
If the downloaded file includes the first initramfs file, the kernel is loaded and executed, and after initialization is completed, the rdinit parameter may be started to execute the user-level file, specifically, the rdinit parameter may specify an automatically executed file, and in consideration of that indication information for starting the rdinit parameter may be included in the configuration file, therefore, when the kernel is started, the kernel may be notified by the configuration file, so that the kernel specifies the user-level file, such as rdinit =/myinit parameter, when the kernel is started, so that the kernel first automatically executes/myinit this file after running, and when the indication information for starting the rdinit parameter is not included in the configuration file, the/sbin/init file is executed by default.
Therefore, through the rdinit parameter, the instruction information for starting the rdinit parameter can be transmitted to the kernel program through the bootstrap program, the user-level file (myinit file) is executed firstly, then the depmod command in the user-level file is executed to enable the driver of the first type network card to take effect, and finally the/sbin/init file is called to start the original flow, namely a 'cushion layer' is added in the existing starting flow through the rdinit parameter to realize that an additional flow (such as the execution of the user-level file) is executed firstly, and then the original flow is executed, so that the purpose of enabling the driver of the first type network card to take effect is achieved.
In summary, in the installation method of the operating system provided in the foregoing embodiment, the terminal can dynamically merge the contents of the first initramfs file and the second initramfs file together by using the function provided by the bootstrap program, and then add an action to the original startup flow by using the rdinit parameter provided by the kernel program, so that the driver of the first type network card added in the first initramfs file becomes effective, and the problem that the installation operating system lacks a driver of a corresponding network card is effectively solved. Moreover, for a homologous system, the merged initramfs file can be shared, and only needs to be manufactured once, so that the workload is greatly reduced, and the installation efficiency of an operating system is improved.
In order to facilitate understanding of the installation method of the operating system, the installation method of the operating system is described below with reference to the schematic installation process diagram of the operating system shown in fig. 3.
In the schematic diagram shown in fig. 3, the interaction between a terminal (also referred to as a Client) and a Server (also referred to as a Server) is involved, and specifically, the Server is taken as a PXE Server as an example for explanation. The PXE Server is a PXE technology-based Server, belongs to a Client/Server (terminal/Server) network mode, and supports a terminal to download an image file and an operating system for starting the terminal through a network. In the starting process, the terminal requests the server to allocate an IP address, and then uses a TFTP (simple file transfer protocol) or MTFTP (multipoint TFTP) protocol to download a network starting software package to the local memory for execution, and the starting software package completes the basic software setting of the terminal (client) and the installation or guidance of a subsequent operating system.
An operating system is installed through a PXE technology, a network card of a terminal is required to support a PXE function, a PXE Server (PXE Server) environment is also required to be established, the PXE Server generally comprises a DHCP (Dynamic Host Configuration Protocol) Server, a TFTP Server and a File Server, and the File Server can be an HTTP (Hypertext Transfer Protocol) Server or an FTP (File Transfer Protocol) Server. The DHCP server is used for allocating an IP address for the terminal; the TFTP server is used for the terminal to download the kernel and the kernel image file, the TFTP server is used for providing a network starting software package for the terminal, and the terminal completes basic software setting, subsequent operating system installation and the like through the network starting software package; the file server can mount an image file of the operating system on the PXE server to provide an installation source for the client.
After the PXE Server environment is built, the current mainstream Linux operating system can be installed through the PXE technology, and in the schematic diagram of the installation process of the operating system shown in fig. 3, the interaction between a terminal (also called Client terminal) and a PXE Server (also called Server terminal) is involved, as shown in fig. 3, the whole process can be divided into two major stages, and the first stage can be called Pre OS stage; the second phase is from kernel boot and may be referred to as the Live OS phase. These two phases are described below:
in the first stage, the following processes are mainly divided:
step S301, the terminal sends a DHCP request to the PXE server to request an IP address;
after the terminal is started, the network card of the terminal actively sends a DHCP request to the outside.
In step S302, the PXE server returns the IP address and the TFTP path of the downloaded boot program to the terminal.
After receiving the DHCP request, the PXE server allocates an IP address for the terminal and simultaneously tells the terminal the TFTP path of a bootstrap program (also called Network Bootloader) to be downloaded next.
For the computer system, a bootstrap program is needed for booting from startup to startup of the operating system, the embedded Linux system also cannot leave the bootstrap program, and the bootstrap program can be a Network Bootloader.
Step S303, after the terminal uses the IP address to connect the network, the terminal downloads the bootstrap program from the PXE server through the TFTP path;
after receiving the IP address, the terminal uses the IP address as its own Network address, and then requests a PXE server to download a bootstrap (Network Bootloader) file through a TFTP path, where the bootstrap may be pxelinux.0 and grub bootstrap;
step S304, the terminal loads the bootstrap program, after the bootstrap program is started to run, a configuration file is downloaded from the PXE server, and the configuration file records the file which the terminal needs to download and the relevant configuration information such as whether rdinit parameter transmission needs to be executed when the kernel is started.
The configuration file generally includes link addresses of a kernel file and a memory file system file (i.e., an Initramfs file), and the terminal can download the kernel file and the Initramfs file based on the link addresses.
Generally, the above steps S301 to S303 are functions inherent to all network cards supporting the PXE function, and the firmware inside the network card performs basic initialization work on the network card at this moment, and provides a basic network message transceiving function, and provides a basic network channel for sending various requests and downloading files; in step S304, the boot program continues to use the previously initialized network channel when downloading the file from the PXE server. Therefore, the first stage can be realized by the inherent function of the network card without an additional network card driving program.
After the first stage is completed, the terminal will continue to start the process of the second stage, specifically, in the second stage, the following processes are mainly divided:
step S305, the terminal runs the kernel file and starts the kernel;
in the second phase, after the kernel is started, the kernel unpacks the compressed packet of the initramfs file in the memory, and takes the decompressed directory as its own root file system, thus forming a small Linux system, which is totally present in the memory and therefore also called Live OS. In Live OS, operations such as driver loading, network environment configuration, hard disk partitioning, and the like are performed. And finally, continuously downloading various software packages from the PXE server side through the network to complete the final system installation. In the Live OS stage, since the OS (Operating System) level is reached, if network initialization is to be completed, a driver for a corresponding network card, that is, a driver for a network card included in an initramfs file in an image file, may be loaded.
If the PXE server executes the installation method of the operating system, a first initramfs file is stored in a storage area of an initramfs file of the image file, and a configuration file in the image file is modified according to the first initramfs file and the user-level file.
At this time, in step S304, after the terminal acquires the bootstrap of the image file, the file downloaded from the PXE server may include the first initramfs file and the user-level file in addition to the original kernel file (i.e., the kernel program described above) and the initramfs file, i.e., the second initramfs file described in this embodiment, and then the first initramfs file and the second initramfs file are merged by the bootstrap and are together transferred to the kernel program.
After the terminal loads the kernel file, the above step S305 may be executed to run the kernel file, start the kernel, and then execute the following processes.
Step S306, the terminal starts the rdinit parameter to execute the depmod command in the user-level file to enable the driver of the first type network card to take effect;
step S307, the terminal calls a network initialization file to start the original process;
specifically, the network initialization file may be a/sbin/init file; starting the original process, which may include operations such as driver loading, network environment configuration, hard disk partitioning, and the like, and finally continuously downloading various software packages from the PXE server through the network to complete the final system installation.
The installation process of the operating system effectively solves the problem that the installation operating system lacks a driver of a corresponding network card. Moreover, for a homologous system, the merged initramfs file can be shared, and only needs to be manufactured once, so that the workload is greatly reduced, and the installation efficiency of an operating system is improved.
Corresponding to the installation method of the operating system provided in the foregoing embodiment, an installation apparatus of the operating system is further provided in this application embodiment, where the apparatus is disposed in a server, and a first initramfs file and a first image file including a second initramfs file are stored in the server, where the first initramfs file includes a driver for a first type of network card, and the second initramfs file includes a driver for a second type of network card.
Fig. 4 is a schematic structural diagram of an installation apparatus of an operating system, the apparatus including:
the storage module 40 is used for storing the first initramfs file in a storage area of the second initramfs file;
a generating module 42, configured to generate a user-level file, where the user-level file includes an effective command for enabling a driver of the first-type network card to take effect and a call command for calling a network initialization file in the second initramfs file;
an adding module 44, configured to add a download link between the first initramfs file and the user-level file, the download link of the user-level file, and indication information used to indicate that the rdinit parameter is started after the kernel of the terminal operating system runs, to a configuration file in the first image file;
wherein the rdinit parameter is used for executing user-level files;
a first installation module 46, configured to generate and provide a second image file for the terminal to install the operating system; the second mirror image file comprises the configuration file, the first initramfs file, the second initramfs file and the user-level file.
In specific implementation, as shown in fig. 5, the schematic structural diagram of another installation apparatus for an operating system further includes: and the updating module 48 is configured to update the driver of the first-type network card of the first initramfs file according to a set period.
An embodiment of the present application further provides another installation apparatus for an operating system, where the installation apparatus is disposed in a terminal, and the terminal establishes a connection with a server through a client of the server, and as shown in fig. 6, the installation apparatus for another operating system includes:
an obtaining module 50, configured to obtain a boot program for installing an image file of an operating system from a server;
a first downloading module 52, configured to download, by the boot program, a configuration file of the image file, where the configuration file includes: the method comprises the steps of downloading a file to be downloaded, and indicating information used for indicating that the rdinit parameter is started after the kernel of a terminal operating system runs;
a second downloading module 54, configured to download the kernel program, the first initramfs file, the second initramfs file, and the user-level file according to the download link in the configuration file;
the first initramfs file comprises a driver of the first type network card; the second initramfs file comprises a driver of the second type network card;
the running module 56 is used for running the kernel program and starting the rdinit parameter according to the indication information;
the execution module 58 is configured to execute an effective process of a driver of the first type network card in the user-level file according to the rdinit parameter, and start a network initialization file in the second initramfs file after the effective process is executed;
and a second installation module 60, configured to complete installation of the operating system through the started network initialization file.
In specific implementation, the execution module 58 is configured to:
and adding the version number of a driving program of the first type network card and the terminal type supported by the first type network card into a database through a depmod command.
Based on the schematic structural diagram of the installation apparatus of another operating system shown in fig. 6, fig. 7 also shows a schematic structural diagram of an installation apparatus of another operating system, which includes, in addition to the structure shown in fig. 6:
the merging module 62 is configured to merge the first initramfs file and the second initramfs file through a bootstrap.
The installation device of the operating system provided by the embodiment of the application has the same technical characteristics as the installation method of the operating system provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
The embodiment of the present application further provides a network terminal, where the network terminal includes a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the installation method of the foregoing operating system.
Further, the present application also provides a machine-readable storage medium, which stores machine-executable instructions, when called and executed by a processor, the machine-executable instructions cause the processor to implement the installation method of the operating system described in the foregoing embodiment.
Referring to fig. 8, an embodiment of the present application further provides a schematic structural diagram of a network terminal, including: a processor 800, a memory 801, a bus 802 and a communication interface 803, the processor 800, the communication interface 803 and the memory 801 being connected by the bus 802; the processor 800 is used to execute executable modules, such as computer programs, stored in the memory 801.
The Memory 801 may include a high-speed Random Access Memory (RAM), and may also include a Random Access Memory (RAM)
Non-volatile memory (non-volatile memory) can also be included, such as at least one disk memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 803 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
Bus 802 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 8, but that does not indicate only one bus or one type of bus.
The memory 801 is used for storing a program, and the processor 800 executes the program after receiving an execution instruction, and the method executed by the installation apparatus of the operating system disclosed in any of the foregoing embodiments of the present application may be applied to the processor 800, or implemented by the processor 800.
The processor 800 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 800. The Processor 800 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801 and completes the steps of the method in combination with the hardware thereof.
The computer program product of the method and the apparatus for installing an operating system provided in the embodiment of the present application includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment, which is not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer terminal (which may be a personal computer, a server, or a network terminal) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only specific embodiments of the present application, and are used to illustrate the technical solutions of the present application, but not to limit the technical solutions, and the scope of the present application is not limited to the above embodiments, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (4)

1. An installation method of an operating system is characterized in that the method is applied to a server, a first initramfs file and a first image file including a second initramfs file are stored in the server, the first initramfs file includes a driver of a first type network card, the second initramfs file includes a driver of a second type network card, the driver of the first type network card is a driver not included in the second initramfs file, and the method includes:
storing the first initramfs file in a storage area of the second initramfs file;
generating a user-level file, wherein the user-level file comprises an effective command for enabling a driver of the first type network card to take effect and a calling command for calling a network initialization file in the second initramfs file;
adding a download link of the first initramfs file, a download link of the user-level file and indication information for indicating that a terminal operating system kernel starts a rdinit parameter after running into a configuration file in the first mirror image file; wherein the rdinit parameter is used to execute the user-level file;
generating and providing a second mirror image file for the terminal to install an operating system; wherein the second image file comprises the configuration file, the first initramfs file, the second initramfs file, and the user-level file;
the method further comprises the following steps:
and updating the driver of the first type network card of the first initramfs file according to a set period.
2. An installation method of an operating system, which is applied to a terminal, and comprises the following steps:
acquiring a bootstrap program for installing an image file of an operating system from a server;
downloading the configuration file of the mirror image file through the bootstrap program; the configuration file comprises a download link of a file to be downloaded and indication information used for indicating that the rdinit parameter is started after the kernel of the terminal operating system runs;
downloading a kernel program, a first initramfs file, a second initramfs file and a user-level file according to the download link in the configuration file; the first initramfs file comprises a driver of a first type network card; the second initramfs file comprises a driver of a second type network card; the driver of the first type network card is a driver not contained in the second initramfs file, and the user-level file comprises an effective command for enabling the driver of the first type network card to take effect and a call command for calling the network initialization file in the second initramfs file;
running the kernel program, and starting a rdinit parameter according to the indication information;
according to the rdinit parameter, executing an effective process of a driver of a first type network card in the user-level file, and starting a network initialization file in the second initramfs file after the effective process is executed;
the installation of the operating system is completed through the started network initialization file;
the validation process of the driver of the first type of network card comprises the following steps:
adding the version number of the driver of the first type network card and the terminal type supported by the first type network card into a database through a depmod command;
the method further comprises the following steps:
merging the first initramfs file and the second initramfs file through the bootstrap program.
3. An installation apparatus of an operating system, the apparatus is disposed in a server, a first initramfs file and a first image file including a second initramfs file are stored in the server, the first initramfs file includes a driver of a first type network card, the second initramfs file includes a driver of a second type network card, the driver of the first type network card is a driver not included in the second initramfs file, the apparatus includes:
the storage module is used for storing the first initramfs file in a storage area of the second initramfs file;
the generating module is used for generating a user-level file, wherein the user-level file comprises an effective command for enabling a driver of the first type network card to take effect and a calling command for calling a network initialization file in the second initramfs file;
an adding module, configured to add a download link of the first initramfs file, a download link of the user-level file, and indication information for indicating that a terminal operating system kernel starts an rdinit parameter after running to a configuration file in the first mirror image file; wherein the rdinit parameter is used to execute the user-level file;
the first installation module is used for generating and providing a second image file for the terminal to install the operating system; wherein the second image file comprises the configuration file, the first initramfs file, the second initramfs file, and the user-level file;
the device further comprises:
and the updating module is used for updating the driving program of the first type network card of the first initramfs file according to a set period.
4. An installation device of an operating system, wherein the installation device is provided in a terminal, the installation device comprising:
the acquisition module is used for acquiring a bootstrap program for installing an image file of the operating system from a server;
the first downloading module is used for downloading the configuration file of the mirror image file through the bootstrap program; the configuration file includes: the method comprises the steps of downloading a file to be downloaded, and indicating information used for indicating that the rdinit parameter is started after the kernel of a terminal operating system runs;
the second downloading module is used for downloading the kernel program, the first initramfs file, the second initramfs file and the user-level file according to the downloading link in the configuration file; the first initramfs file comprises a driver of a first type network card; the second initramfs file comprises a driver of a second type network card; the driver of the first type network card is a driver not contained in the second initramfs file, and the user-level file comprises an effective command for enabling the driver of the first type network card to take effect and a call command for calling the network initialization file in the second initramfs file;
the running module is used for running the kernel program and starting the rdinit parameter according to the indication information;
the execution module is used for executing an effective process of a driver of the first type network card in the user-level file according to the rdinit parameter, and starting a network initialization file in the second initramfs file after the effective process is executed;
the second installation module is used for completing installation of the operating system through the started network initialization file;
the execution module is configured to:
adding the version number of the driver of the first type network card and the terminal type supported by the first type network card into a database through a depmod command;
the device further comprises:
and the merging module is used for merging the first initramfs file and the second initramfs file through the bootstrap program.
CN201910003077.7A 2019-01-02 2019-01-02 Installation method and device of operating system Active CN109840096B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910003077.7A CN109840096B (en) 2019-01-02 2019-01-02 Installation method and device of operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910003077.7A CN109840096B (en) 2019-01-02 2019-01-02 Installation method and device of operating system

Publications (2)

Publication Number Publication Date
CN109840096A CN109840096A (en) 2019-06-04
CN109840096B true CN109840096B (en) 2023-02-07

Family

ID=66883690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910003077.7A Active CN109840096B (en) 2019-01-02 2019-01-02 Installation method and device of operating system

Country Status (1)

Country Link
CN (1) CN109840096B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888650B (en) * 2019-10-12 2022-08-16 苏州浪潮智能科技有限公司 Method and system for customizing operating system mirror image
CN111104129B (en) * 2019-12-11 2023-02-28 秒针信息技术有限公司 Memory operating system manufacturing method and device, electronic equipment and storage medium
CN112000382B (en) * 2020-08-26 2023-10-13 绿盟科技集团股份有限公司 Linux system starting method and device and readable storage medium
CN112346748A (en) * 2020-11-09 2021-02-09 万兴科技集团股份有限公司 PE mirror image file manufacturing method and device, computer equipment and storage medium
CN113656049B (en) * 2021-08-30 2023-12-29 浪潮商用机器有限公司 Operating system deployment method and device, electronic equipment and storage medium
CN114443582B (en) * 2021-12-22 2022-11-29 科东(广州)软件科技有限公司 File system mounting method, device, equipment and medium on operating system
CN115033299B (en) * 2022-07-06 2024-06-14 福州创实讯联信息技术有限公司 Method and terminal for starting production test system
CN116016159A (en) * 2022-12-16 2023-04-25 北京云端智度科技有限公司 Tamper-proof installation method, tamper-proof installation system, tamper-proof installation medium and tamper-proof installation equipment for application system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8332844B1 (en) * 2004-12-30 2012-12-11 Emendable Assets Limited Liability Company Root image caching and indexing for block-level distributed application management
CN103777953A (en) * 2014-01-26 2014-05-07 宝龙计算机系统(湖南)有限公司 Method and device for manufacturing Unix-like operating system upgrade patch
US8752039B1 (en) * 2009-08-19 2014-06-10 Juniper Networks, Inc. Dynamic upgrade of operating system in a network device
CN104834546A (en) * 2015-05-12 2015-08-12 浪潮电子信息产业股份有限公司 Method for upgrading cluster system through network
CN105335168A (en) * 2014-05-27 2016-02-17 阿里巴巴集团控股有限公司 System, method and apparatus for remotely configuring operating system
WO2016112825A1 (en) * 2015-01-13 2016-07-21 华为技术有限公司 Remote control method, terminal device, management server, and remote control system
CN106126273A (en) * 2016-06-16 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of method of upgrading BIOS
CN106547602A (en) * 2016-12-09 2017-03-29 中南大学 A kind of manufacture method of the operating system mirror image suitable for the loading of iSCSI protocol long distance wireless
CN106873970A (en) * 2016-12-29 2017-06-20 紫光华山信息技术有限公司 The installation method and device of a kind of operating system
CN108388449A (en) * 2018-01-11 2018-08-10 郑州云海信息技术有限公司 A kind of method of data center's update linux system trawl performance

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060095479A1 (en) * 2004-11-01 2006-05-04 International Business Machines Corporation Primary and recovery file system management
CN107729083B (en) * 2014-04-30 2021-02-12 华为技术有限公司 Method for loading driver and embedded device
US10725808B2 (en) * 2017-01-04 2020-07-28 International Business Machines Corporation Virtual machine image conversion

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8332844B1 (en) * 2004-12-30 2012-12-11 Emendable Assets Limited Liability Company Root image caching and indexing for block-level distributed application management
US8752039B1 (en) * 2009-08-19 2014-06-10 Juniper Networks, Inc. Dynamic upgrade of operating system in a network device
CN103777953A (en) * 2014-01-26 2014-05-07 宝龙计算机系统(湖南)有限公司 Method and device for manufacturing Unix-like operating system upgrade patch
CN105335168A (en) * 2014-05-27 2016-02-17 阿里巴巴集团控股有限公司 System, method and apparatus for remotely configuring operating system
WO2016112825A1 (en) * 2015-01-13 2016-07-21 华为技术有限公司 Remote control method, terminal device, management server, and remote control system
CN104834546A (en) * 2015-05-12 2015-08-12 浪潮电子信息产业股份有限公司 Method for upgrading cluster system through network
CN106126273A (en) * 2016-06-16 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of method of upgrading BIOS
CN106547602A (en) * 2016-12-09 2017-03-29 中南大学 A kind of manufacture method of the operating system mirror image suitable for the loading of iSCSI protocol long distance wireless
CN106873970A (en) * 2016-12-29 2017-06-20 紫光华山信息技术有限公司 The installation method and device of a kind of operating system
CN108388449A (en) * 2018-01-11 2018-08-10 郑州云海信息技术有限公司 A kind of method of data center's update linux system trawl performance

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
How to execute bash script through pxe boot[closed];Pat;《https://serverfault.com/questions/714747/how-to-execute-bash-script-through-pxe-boot》;20150817;第3页 *
ramfs、tmpfs、rootfs、ramdisk介绍;Michaelwubo;《https://blog.csdn.net/Michaelwubo/article/details/47418639》;20150811;全文 *
定制initrd,网络安装Linux;魏苗等;《福建电脑》;20091101(第11期);第168-169页 *

Also Published As

Publication number Publication date
CN109840096A (en) 2019-06-04

Similar Documents

Publication Publication Date Title
CN109840096B (en) Installation method and device of operating system
US20210216360A1 (en) Virtual machine migration method and apparatus
JP5307706B2 (en) Operating system gradual boot process
CN108089913B (en) Virtual machine deployment method of super-fusion system
CN105786538B (en) software upgrading method and device based on android system
CN111966384B (en) System updating method, device, equipment and computer readable storage medium
CN112416377B (en) Method and device for manufacturing boot image, electronic equipment and storage medium
WO2013078951A1 (en) Method and system for upgrading software
EP3270320A1 (en) Method and device for creating virtual machine
CN111475172B (en) Bare metal deployment method and device
CN110955494B (en) Virtual machine disk image construction method, device, equipment and medium
CN110597542A (en) Automatic OTA (over the air) software upgrading method and device and electronic equipment
CN111930396B (en) Upgrading method of communication module in 4G router based on notify mechanism
JP7454011B2 (en) Firmware publishing method for multiple binary images and electronic devices
CN112445495A (en) Mirroring and recovery method for high-performance computing cluster nodes
CN111273924A (en) Software updating method and device
CN106547602B (en) Method for manufacturing operating system mirror image suitable for iSCSI protocol remote wireless loading
CN111163167A (en) System installation method and device
CN111061496A (en) PXE installation method and device for Linux operating system
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN111813504B (en) Method and device for automatically configuring effective virtual machine and electronic equipment
CN114115920A (en) Operating system deployment method, system, device and computer-readable storage medium
CN114662102A (en) File processing method and device and storage medium
JP5619999B2 (en) Method for executing utility program, computer system and computer program product
CN110830550A (en) Computer cluster and diskless starting method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310000 11/F, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310000 11/F, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: UNIS HUASHAN INFORMATION TECHNOLOGIES Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant