CN114650273A - Initialization method, device, equipment and storage medium for operating system configuration - Google Patents

Initialization method, device, equipment and storage medium for operating system configuration Download PDF

Info

Publication number
CN114650273A
CN114650273A CN202210348300.3A CN202210348300A CN114650273A CN 114650273 A CN114650273 A CN 114650273A CN 202210348300 A CN202210348300 A CN 202210348300A CN 114650273 A CN114650273 A CN 114650273A
Authority
CN
China
Prior art keywords
address
data
information
operating system
dhcp
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.)
Pending
Application number
CN202210348300.3A
Other languages
Chinese (zh)
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.)
Henan Chuangxinke Information Technology Co ltd
Original Assignee
Henan Chuangxinke Information Technology 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 Henan Chuangxinke Information Technology Co ltd filed Critical Henan Chuangxinke Information Technology Co ltd
Priority to CN202210348300.3A priority Critical patent/CN114650273A/en
Publication of CN114650273A publication Critical patent/CN114650273A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides an initialization method, a device, equipment and a storage medium for operating system configuration, and relates to the technical field of operating system configuration. Moreover, compared with the traditional mode that the IP address needs to be manually configured after installation operation, the method and the device fundamentally solve the problems of high possibility of error, much time consumption, low efficiency and the like existing in the process of manually acquiring the IP address.

Description

Initialization method, device, equipment and storage medium for operating system configuration
Technical Field
The present invention relates to the field of operating system configuration technologies, and in particular, to an operating system configuration initialization method, apparatus, device, and storage medium.
Background
A Preboot execution Environment (PXE) is a mainstream technology at present, and is mainly applied to a Client/Server (Client/Server, C/S for short) for downloading a boot image file from a remote Server (i.e., a resource pool) through a network by the Client, and the Client guides an operating system image pre-deployed in the remote Server according to the boot image file, so as to start an operating system on the Client.
After the installation is finished, the operating system needs to be initialized and configured to normally operate and provide resources and services to the outside, wherein the IP address provided to the outside is randomly allocated by the DHCP service, so that the IP address of the terminal server cannot be predicted, certain inconvenience is brought to subsequent installation, and certain potential safety hazard exists in the use process of the IP address, so that the static IP address is suitable, the IP can be more stably fixed, and the subsequent installation is facilitated. Therefore, the initialization information of the IP address of each terminal needs to be modified manually, and the initialization efficiency is low.
Disclosure of Invention
It is an object of the present invention to provide an initialization method, apparatus, device and storage medium for operating system configuration to improve the above problems. In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, the present application provides an initialization method for operating system configuration, including:
acquiring first data and second data, wherein the first data is network card configuration file information of a target server configured with a PXE server side, the target server is a server of an operating system to be installed, the network card configuration file information at least comprises a dynamic IP address, the dynamic IP address is an IP address obtained based on a DHCP (dynamic host configuration protocol) IP address distribution mode, and the second data is an automatic response file corresponding to the target server;
modifying based on the automatic response file to obtain updated second data, wherein the updated second data is used for describing information for executing a preset program in the automatic response file after an operating system is installed, and the preset program is an instruction for converting a dynamic IP address into static IP address information;
and responding to the updated second data, and converting the dynamic IP address in the first data into static IP address information to finish initialization of operating system configuration.
In a second aspect, the present application provides an initialization apparatus for operating system configuration, including an obtaining module, an updating module, and an initialization module, where:
an acquisition module: the network card configuration file information at least comprises a dynamic IP address, wherein the dynamic IP address is an IP address obtained based on a DHCP (dynamic host configuration protocol) IP address distribution mode, and the second data is an automatic response file corresponding to the target server;
an update module: the automatic response file is used for modifying based on the automatic response file to obtain updated second data, the updated second data is used for describing information for executing a preset program in the automatic response file after the operating system is installed, and the preset program is an instruction for converting a dynamic IP address into static IP address information;
an initialization module: and the second data is used for responding to the updated second data, and converting the dynamic IP address in the first data into static IP address information so as to complete the initialization of the configuration of the operating system.
In a third aspect, the present application further provides an initialization device for operating system configuration, including:
a memory for storing a computer program; and the processor is used for realizing the steps of the initialization method of the operating system configuration when executing the computer program.
In a fourth aspect, the present application further provides a storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the initialization method based on the operating system configuration.
The beneficial effects of the invention are as follows:
according to the method and the device, the automatic response file corresponding to the target server is modified, so that the operating system automatically executes the preset program after the installation operation is completed, the dynamic IP address distributed through the DHCP is converted into the static IP address, and the stability and the safety of the network are ensured to a certain extent. Moreover, compared with the traditional mode that the IP address needs to be manually configured after installation operation, the method and the device fundamentally solve the problems of high possibility of error, much time consumption, low efficiency and the like existing in the process of manually acquiring the IP address.
Additional features and advantages of the invention 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 embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of an initialization method for an operating system configuration in an embodiment of the invention;
FIG. 2 is a block diagram of an initialization apparatus for an operating system configuration according to an embodiment of the present invention;
fig. 3 is a block diagram of an initialization apparatus of an operating system configuration in an embodiment of the present invention.
The labels in the figure are: 700-initialization means of operating system configuration; 710-an acquisition module; 711-a third acquisition subunit; 712-a mapping unit; 713-a fourth fetch subunit; 714-a communication unit; 715-a fifth obtaining subunit; 716-a sixth acquisition subunit; 720-multi-network segment module; 721-a judging unit; 722-a fourth processing unit; 723-a fifth processing unit; 724-a sixth processing unit; 725-seventh processing unit; 726-eighth processing unit; 727-a ninth processing unit; 730-an update module; 731-first subunit; 732-a second subunit; 733 — third subunit; 740 — an initialization module; 741 — a first modification unit; 742 — a first fetch subunit; 743-a second fetch subunit; 744-a second modification unit; 745-third modification unit; 746-first processing unit; 747-a second processing unit; 748 — a third processing unit; 800-initialization device for operating system configuration; 801-a processor; 802-a memory; 803-multimedia components; 804 — an I/O interface; 805-communication component.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1:
referring to fig. 1, fig. 1 is a block flow diagram illustrating an initialization method for an operating system configuration in this embodiment. The present embodiment provides an initialization method of an operating system configuration, which includes step S1, step S2, and step S3.
Step S1, obtaining first data and second data, where the first data is network card configuration file information of a target server configured with a PXE server, the target server is a server of an operating system to be installed, the network card configuration file information at least includes a dynamic IP address, the dynamic IP address is an IP address obtained based on a DHCP distribution IP address, and the second data is an auto-answer file corresponding to the target server.
It is understood that in this step, the PXE operates in the Client/Server network mode, enabling the workstation to download images from remote servers over the network, and thus supporting the boot process of the operating system from the network. In the starting process, a target server configured with a PXE server side sends a DHCP request, applies for an IP address from the DHCP server, the DHCP server responds to the request of the target server, automatically allocates a dynamic IP address from an IP address pool to the target server, and configures a corresponding subnet mask and a gateway address according to the dynamic IP address to obtain first data. Meanwhile, the DHCP server informs the target server of the IP address of the TFTP server and the PXE bootstrap file pxelinux.0. The target server initiates a request for acquiring the pxelinux.0 bootstrap file to the TFTP server, and the TFTP server responds to the request of the target server and transmits the pxelinux.0 file shared by the TFTP server to the target server. The target server initiates a host interface to the system installation over the network. The target server initiates a request for obtaining a centros or windows system installation file to the file sharing server, the file sharing service responds to the request of the target server and transmits the shared system installation file to the target server, and the target server enters an installation prompt guide interface. A system auto-install answer file, ks.cfg, (i.e., second data) is created on the PXE server with the vim or kiskstart tool and shared with the file sharing service. Cfg auto-answer files are recorded installation operation steps, and when a client enters an installation interface, the client automatically completes installation operation according to contents in the ks cfg files.
In step S1, the PXE server supports multi-network-segment remote installation, and the PXE server building method includes step S101, step S102, step S103, step S104, step S105, step S106, and step S107, where:
step S101, judging whether a PXE server side is provided with a DHCP software package, if so, obtaining configured network card information, wherein the configured network card information is obtained after the first IP address and the first gateway address of the network card are reset.
In this step, it can be understood that the software package with the DHCP installed is checked by inputting root @ localhost root ] # rpm-qa | grep DHCP, and if the software package is already installed, the version of the already installed software package is prompted, and if the software package is not installed, the installation can be performed by using root @ localhost root ] # rpm-ivh DHCP-3.0pl 2-6.14.1. If one target server is needed, only a first IP address and a first gateway address of one eth physical network port need to be configured; if a plurality of target servers are needed, corresponding configuration needs to be performed according to a one-to-one ratio, and [ root @ local host root ] # vi/etc/sysconfig/network-scripts/ifcfg-eth1 can be input to call out a configuration interface to set a first IP address and a first gateway address, so as to obtain configured network card information.
Step S102, based on the configured network card information, obtaining an IP address pool, wherein the IP address pool is obtained after configuring the address pool initial address and the address pool end address of the DHCP according to the preset IP number.
In this step, it can be understood that, the DHCP service of the current network card is configured, a configuration interface may be called by using a root @ local root ] # vi/etc/dhcpd.conf, and according to the preset number of IPs in actual demand, a start address and an end address of the IP address pool are set within the range of the first IP address in the configured network card information. When a plurality of network cards are configured, different network cards are configured in different network segments, and each IP address pool is only configured with one IP address according to the range of the first IP address, so that the IP addresses can be known in advance in subsequent operation and can be correspondingly set.
Step S103, obtaining a corresponding second gateway address based on each second IP address in the IP address pool.
Step S104, obtaining the configured DHCP based on each second IP address and the second gateway address.
In this step, it can be understood that the second gateway address is used as an IP address on the switch, and the configuration of the Linux DHCP can be completed by restarting the DHCP service after the configuration is completed and the default route is designated according to the second IP address.
Step S105, obtaining a lease request, wherein the lease request is used for describing the information of requesting the lease IP address from the configured DHCP service.
In this step, it can be understood that the client sends a DHCP DISCOVER message to the DHCP server to request the DHCP server to lease the IP address.
Step S106, responding to the lease request, and acquiring a broadcast packet of DHCP.
In this step, it can be understood that, after receiving the DISCOVER message sent by the client, the DHCP server returns a broadcast packet providing an IP address lease to the client according to the message information.
Step S107, forwarding the broadcast packet of the DHCP based on a preset switch to realize that the target server cross-network segments obtain the second IP address in the IP address pool corresponding to the DHCP, wherein the preset switch comprises at least three layers of computer network architectures.
Further, the method for acquiring the first data in this step includes step S111, step S112, step S113, step S114, step S115, and step S116, where:
step S111, a first MAC address is obtained, wherein the first MAC address is a physical address of a network card in a PXE server side, and the PXE server side at least comprises 2 network interfaces.
It can be understood that, in this step, the PXE server configures multiple physical network ports, and acquires the first MAC address corresponding to each network card according to the physical network ports.
Step S112, establishing a one-to-one mapping relationship based on each of the first MAC address and the second IP address.
It is to be understood that, in this step, each first MAC address is mapped to each second IP address in the IP pool.
Step S113, a second MAC address is obtained, wherein the second MAC address is the physical address of the network card in the target server.
And step S114, establishing a network communication relation based on the first MAC address and the second MAC address.
And step S115, acquiring the request of the target server for allocating the IP address.
Step S116, in response to the request for allocating an IP address, obtaining the second IP address according to the second MAC address, where the second IP address is the first data.
It can be understood that, in this step, the first MAC address corresponding to the second MAC address is obtained according to the second MAC address, and then the corresponding second IP address is obtained according to the first MAC address, that is, the first data allocated by the DHCP server.
Step S2, modifying the auto-answer file to obtain updated second data, where the updated second data is used to describe information for executing a preset program in the auto-answer file after the operating system is installed, and the preset program is an instruction for converting a dynamic IP address into static IP address information.
It is understood that, in this step, the preset program in the ks.cfg response file data is automatically executed according to the modified ks.cfg response file data.
Step S201, step S202, and step S203 are also included in step S2, in which:
and step S201, obtaining ks.cfg response file data according to the second data.
Step S202, adding a post parameter based on the ks.cfg response file data to obtain the modified ks.cfg response file data; the post parameter comprises download IP address information, preset coding format information and authority information of the preset program.
Cfg response file data informs an installation program of the position of the response file in the step, and the installation configuration can be automatically read from the response file in the installation process, so that multiple man-machine interactions in the installation process are avoided, and unattended automatic installation is realized. And moreover, post parameters are added in ks.cfg response file data to inform the preset program of the download address, coding format information and authority information, so that the static IP address can be automatically configured in the later period conveniently and rapidly, and manual operation is not needed. The POST parameter setting in this embodiment is as follows:
%post
cd/root
wget hTTp://192.168.11.201/centos8/initialize/initialize.sh
dos2unix*initialize.sh
sh initialize.sh>/root/initialize.txt 2>&1
%end
step S203, obtaining the updated second data based on the modified ks.cfg response file data.
Step S3, in response to the updated second data, converting the dynamic IP address in the first data into static IP address information to complete initialization of the operating system configuration.
It can be understood that, in this step, the target server executes the preset program to convert the dynamic IP address into the static IP address information according to the updated second data, so as to automatically complete the initialization of the fixed IP configuration of the operating system, thereby fundamentally solving the problems of error proneness and time consumption of manually acquiring the IP.
Step S301, step S302, step S303, step S304, and step S305 are further included in step S3, in which:
and S301, responding to the updated second data to obtain the modified ks.
Step S302, obtaining the post parameter based on the modified ks.cfg response file data.
It can be understood that, in this step, the corresponding post parameter is found according to the modified ks.
And step S303, downloading the preset program based on the downloading IP address information of the preset program in the post parameter.
It can be understood that, in this step, according to the IP address information in the post parameter, the corresponding preset program is found and downloaded, and the program can be downloaded in the HTTP, SAMBA, NFS, or other manners.
And step S304, carrying out coding formatting processing on the preset program based on the preset coding format information in the post parameter to obtain the formatted preset program.
It can be understood that, in this step, the process of transmitting the preset program from the network involves the process of reading the file by the sender and storing the file by the receiver, and there is a conversion of the code in this process, which further causes the downloaded preset program to be incompatible with the environment of the PXE and thus cannot be executed, and the process of encoding and formatting the preset program can avoid this situation.
Step S305, executing the formatted preset program based on the permission information of the preset program in the post parameter.
Further, the execution method of the preset program in step S305 includes step S3051, step S3052 and step S3053, in which:
and S3051, obtaining a dynamic IP address and a gateway address corresponding to the target server according to the first data.
It can be understood that, in this step, after receiving the DISCOVER message sent by the client, the DHCP server allocates a dynamic IP address and a corresponding gateway address to the client according to the message information, and the IP address allocated from the DHCP server in this embodiment is set to 192.168.11.1.
Step S3052, obtaining a static network card configuration file based on the dynamic IP address and the gateway address, wherein the static network card configuration file comprises first sub information and second sub information, the first sub information is used for describing that the current IP address obtaining mode is changed into static obtaining information, and the second self information is used for describing information configured according to the dynamic IP address and the gateway address when the static network card is configured.
It can be understood that, in this step, the first sub-information is information reflecting that the manner of dynamically acquiring the IP address is changed to static acquisition, and the second self-information is information reflecting that the configuration information of the static network card is consistent with the configuration information of the dynamic network card.
Step S3053, responding to the static network card configuration file, enabling static configuration to take effect, and converting the dynamic IP address into a static IP address.
It is understood that in this step, the dynamic IP address 192.168.11.1 obtained by the target server through DHCP allocation is translated into the static IP address 192.168.11.1.
Example 2:
referring to fig. 2, fig. 2 is a block diagram of an initialization apparatus 700 of an operating system configuration according to an exemplary embodiment, including an acquisition module 710, an update module 730, and an initialization module 740, wherein:
the obtaining module 710: the network card configuration file information at least comprises a dynamic IP address, wherein the dynamic IP address is an IP address obtained based on a DHCP (dynamic host configuration protocol) IP address distribution mode, and the second data is an automatic response file corresponding to the target server.
Further, the initialization apparatus 700 for operating system configuration further includes a multi-segment module 720, where the multi-segment module 720 includes a determination unit 721, a fourth processing unit 722, a fifth processing unit 723, a sixth processing unit 724, a seventh processing unit 725, an eighth processing unit 726, and a ninth processing unit 727, where:
the judgment unit 721: the network card information configuration method comprises the steps that a software package used for judging whether a PXE server side is provided with a DHCP or not is judged, if yes, the configured network card information is obtained, and the configured network card information is obtained after a first IP address and a first gateway address of a network card are reset;
the fourth processing unit 722: the network card information configuration module is used for obtaining an IP address pool based on the configured network card information, wherein the IP address pool is obtained by configuring the starting address of the DHCP address pool and the ending address of the DHCP address pool according to the preset number of IP;
the fifth processing unit 723: the gateway device is used for obtaining a corresponding second gateway address based on each second IP address in the IP address pool;
the sixth processing unit 724: the second gateway address is used for obtaining the configured DHCP based on each second IP address and the second gateway address;
the seventh processing unit 725: the system comprises a configuration module, a configuration module and a server, wherein the configuration module is used for configuring a DHCP service of a DHCP server;
the eighth processing unit 726: a broadcast packet for acquiring DHCP in response to the lease request;
the ninth processing unit 727: the method and the device are used for forwarding the broadcast packet of the DHCP based on a preset switch so as to realize that the target server obtains the second IP address in the IP address pool corresponding to the DHCP in a cross-network segment manner, and the preset switch comprises at least three layers of computer network architectures.
In detail, the acquisition module 710 further includes a third acquisition sub-unit 711, a mapping unit 712, a fourth acquisition sub-unit 713, a communication unit 714, a fifth acquisition sub-unit 715, and a sixth acquisition sub-unit 716, wherein:
the third acquisition subunit 711: the system comprises a PXE server and a network interface module, wherein the system is used for acquiring a first MAC address, the first MAC address is a physical address of a network card in the PXE server, and the PXE server at least comprises 2 network interfaces;
the mapping unit 712: the first MAC address and the second IP address are used for establishing a one-to-one mapping relation;
the fourth acquisition subunit 713: the system comprises a network card and a first MAC address, wherein the network card is used for acquiring the first MAC address;
the communication unit 714: for establishing a network communication relationship based on the first MAC address and the second MAC address;
the fifth acquiring subunit 715: a request for obtaining an allocated IP address of the target server;
sixth acquisition subunit 716: and the second data processing unit is used for responding to the request for allocating the IP address, obtaining the second IP address according to the second MAC address, wherein the second IP address is the first data.
The update module 730: and the second data is used for modifying based on the automatic response file to obtain updated second data, the updated second data is used for describing information for executing a preset program in the automatic response file after the operating system is installed, and the preset program is an instruction for converting a dynamic IP address into static IP address information.
In detail, the update module 730 includes a first subunit 731, a second subunit 732, and a third subunit 733, wherein:
first subunit 731: the system is used for obtaining ks.cfg response file data according to the second data;
second subunit 732: adding a post parameter based on the ks.cfg response file data to obtain the modified ks.cfg response file data; the post parameter comprises download IP address information, preset coding format information and authority information of the preset program.
The third sub-unit 733: obtaining the updated second data based on the modified ks.cfg response file data.
The initialization module 740: and the second data is used for responding to the updated second data and converting the dynamic IP address in the first data into static IP address information so as to complete the initialization of the configuration of the operating system.
In detail, the initialization module 740 includes a first modification unit 741, a first obtaining sub-unit 742, a second obtaining sub-unit 743, a second modification unit 744, and a third modification unit 745, wherein:
the first modification unit 741: to obtain the modified ks.cfg response file data in response to the updated second data.
First obtaining subunit 742: cfg response file data after modification, to obtain the post parameter.
The second acquiring subunit 743: and the system is used for downloading the preset program based on the downloading IP address information of the preset program in the post parameter.
The second modification unit 744: and the processing unit is used for carrying out coding formatting processing on the preset program based on the preset coding format information in the post parameter to obtain the formatted preset program.
The third modification unit 745: and the preset program is used for executing the formatted preset program based on the authority information of the preset program in the post parameter.
Further, the initialization module 740 further comprises a first processing unit 746, a second processing unit 747, and a third processing unit 748, wherein:
the first processing unit 746: the gateway server is used for acquiring a dynamic IP address and a gateway address corresponding to the target server according to the first data;
second processing unit 747: the static network card configuration file comprises first sub information and second sub information, the first sub information is used for describing that the current IP address obtaining mode is changed into static obtaining information, and the second sub information is used for describing information configured according to the dynamic IP address and the gateway address when the static network card is configured;
the third processing unit 748: and the static configuration is effective in response to the static network card configuration file, and the dynamic IP address is converted into a static IP address.
It should be noted that, regarding the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Example 3:
corresponding to the above method embodiment, the present embodiment further provides an initialization apparatus 800 for an operating system configuration, and the initialization apparatus 800 for an operating system configuration described below and the initialization method for an operating system configuration described above may be referred to correspondingly.
Fig. 3 is a block diagram illustrating an initialization apparatus 800 for one operating system configuration in accordance with an exemplary embodiment. As shown in fig. 3, the initialization apparatus 800 of the operating system configuration may include: a processor 801, a memory 802. The operating system configured initialization device 800 may also include one or more of a multimedia component 803, an I/O interface 804, and a communication component 805.
The processor 801 is configured to control the overall operation of the initialization apparatus 800 for the os configuration, so as to complete all or part of the steps in the initialization method for the os configuration. The memory 802 is used to store various types of data to support the operation of the operating system configured initialization device 800, such data may include, for example, instructions for any application or method operating on the operating system configured initialization device 800, as well as application-related data such as contact data, messages sent or received, pictures, audio, video, and so forth. The Memory 802 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 803 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 802 or transmitted through the communication component 805. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, such as a keyboard, mouse, buttons, and the like. These buttons may be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the initialization apparatus 800 of the operating system configuration and other apparatuses. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding Communication component 805 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the initialization apparatus 800 of the operating system configuration may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components, and is used to perform the initialization method of the operating system configuration.
In another exemplary embodiment, a computer storage medium comprising program instructions which, when executed by a processor, implement the steps of the initialization method of the operating system configuration described above is also provided. For example, the computer storage medium may be the memory 802 described above that includes program instructions executable by the processor 801 of the operating system configuration initialization apparatus 800 to perform the operating system configuration initialization method described above.
Example 4:
corresponding to the above method embodiment, a storage medium is also provided in this embodiment, and a storage medium described below and an initialization method for an operating system configuration described above may be referred to in correspondence with each other.
A storage medium having stored thereon a computer program for implementing the steps of the method for initializing an operating system configuration of the above-described method embodiments when executed by a processor.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and it will be apparent to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for initializing an operating system configuration, comprising:
acquiring first data and second data, wherein the first data is network card configuration file information of a target server configured with a PXE server side, the target server is a server of an operating system to be installed, the network card configuration file information at least comprises a dynamic IP address, the dynamic IP address is an IP address obtained based on a DHCP (dynamic host configuration protocol) IP address distribution mode, and the second data is an automatic response file corresponding to the target server;
modifying the automatic response file to obtain updated second data, wherein the updated second data is used for describing information for executing a preset program in the automatic response file after the operating system is installed, and the preset program is an instruction for converting a dynamic IP address into static IP address information;
and responding to the updated second data, and converting the dynamic IP address in the first data into static IP address information to finish initialization of operating system configuration.
2. The method for initializing configuration of operating system according to claim 1, wherein modifying the updated second data based on the auto-answer file comprises:
obtaining ks.cfg response file data according to the second data;
adding a post parameter based on the ks.cfg response file data to obtain the modified ks.cfg response file data; the post parameter comprises download IP address information, preset coding format information and authority information of the preset program;
obtaining the updated second data based on the modified ks.cfg response file data.
3. The method for initializing an operating system configuration according to claim 2, wherein the step of responding to the updated second data comprises:
obtaining the modified ks.cfg response file data in response to the updated second data;
cfg response file data after modification, obtaining the post parameter;
downloading a preset program based on the downloading IP address information of the preset program in the post parameter;
coding and formatting the preset program based on the preset coding format information in the post parameter to obtain the formatted preset program;
and executing the formatted preset program based on the authority information of the preset program in the post parameter.
4. The operating system configuration initialization method according to claim 1, wherein the PXE server supports multi-network-segment remote installation, and the PXE server building method comprises:
judging whether a PXE server side is provided with a DHCP software package, if so, obtaining configured network card information, wherein the configured network card information is obtained after a first IP address and a first gateway address of a network card are reset;
based on the configured network card information, obtaining an IP address pool, wherein the IP address pool is obtained by configuring the starting address of the address pool and the ending address of the address pool of the DHCP according to the preset number of IPs;
obtaining a corresponding second gateway address based on each second IP address in the IP address pool;
obtaining the configured DHCP based on each second IP address and the second gateway address;
acquiring a lease request, wherein the lease request is used for describing the information of the IP address leased by the configured DHCP service request;
responding to the lease request, and acquiring a broadcast packet of DHCP;
and forwarding the broadcast packet of the DHCP based on a preset switch so as to realize that the target server obtains the second IP address in the IP address pool corresponding to the DHCP in a cross-network segment manner, wherein the preset switch comprises at least three layers of computer network system structures.
5. An apparatus for initializing an operating system configuration, comprising:
an acquisition module: the network card configuration file information at least comprises a dynamic IP address, wherein the dynamic IP address is obtained based on a DHCP distribution IP address mode, and the second data is an automatic response file corresponding to the target server;
an update module: the automatic response file is used for modifying based on the automatic response file to obtain updated second data, the updated second data is used for describing information for executing a preset program in the automatic response file after the operating system is installed, and the preset program is an instruction for converting a dynamic IP address into static IP address information;
an initialization module: and the second data is used for responding to the updated second data, and converting the dynamic IP address in the first data into static IP address information so as to complete the initialization of the configuration of the operating system.
6. The device for initializing an operating system configuration according to claim 5, wherein the updating module comprises:
a first subunit: the system is used for obtaining ks.cfg response file data according to the second data;
a second subunit: adding a post parameter based on the ks.cfg response file data to obtain the modified ks.cfg response file data; the post parameter comprises download IP address information, preset coding format information and authority information of the preset program;
a third subunit: obtaining the updated second data based on the modified ks.cfg response file data.
7. The device for initializing an operating system configuration according to claim 6, wherein the initialization module comprises:
a first modification unit: responsive to the updated second data, obtaining the modified ks.cfg response file data;
a first acquisition subunit: obtaining the post parameter based on the modified ks.cfg response file data;
a second acquisition subunit: the system comprises a post parameter used for downloading a preset program based on the IP address information of the preset program in the post parameter;
a second modification unit: the processing module is used for carrying out coding formatting processing on the preset program based on the preset coding format information in the post parameter to obtain the formatted preset program;
a third modification unit: the preset program executing module is used for executing the formatted preset program based on the authority information of the preset program in the post parameter.
8. The os configuration initialization apparatus of claim 5, wherein the os configuration initialization apparatus further comprises a multi-segment module, the multi-segment module comprises:
a judging unit: the network card information configuration method comprises the steps that a software package used for judging whether a PXE server side is provided with a DHCP or not is judged, if yes, the configured network card information is obtained, and the configured network card information is obtained after a first IP address and a first gateway address of a network card are reset;
a fourth processing unit: the network card information configuration module is used for obtaining an IP address pool based on the configured network card information, wherein the IP address pool is obtained by configuring the starting address of the DHCP address pool and the ending address of the DHCP address pool according to the preset number of IP;
a fifth processing unit: the gateway device is used for obtaining a corresponding second gateway address based on each second IP address in the IP address pool;
a sixth processing unit: the second gateway address is used for obtaining the configured DHCP based on each second IP address and the second gateway address;
a seventh processing unit: the system comprises a configuration module, a configuration module and a server, wherein the configuration module is used for configuring a DHCP service of a DHCP server;
an eighth processing unit: a broadcast packet for acquiring DHCP in response to the lease request;
a ninth processing unit: the method and the device are used for forwarding the broadcast packet of the DHCP based on a preset switch so as to realize that the target server obtains the second IP address in the IP address pool corresponding to the DHCP in a cross-network segment manner, and the preset switch comprises at least three layers of computer network architectures.
9. An operating system configuration initialization device, comprising:
a memory for storing a computer program;
processor for implementing the steps of the initialization method of the operating system configuration according to any of claims 1 to 4 when executing said computer program.
10. A storage medium, characterized by: the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the initialization method of the operating system configuration according to any one of claims 1 to 4.
CN202210348300.3A 2022-04-01 2022-04-01 Initialization method, device, equipment and storage medium for operating system configuration Pending CN114650273A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210348300.3A CN114650273A (en) 2022-04-01 2022-04-01 Initialization method, device, equipment and storage medium for operating system configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210348300.3A CN114650273A (en) 2022-04-01 2022-04-01 Initialization method, device, equipment and storage medium for operating system configuration

Publications (1)

Publication Number Publication Date
CN114650273A true CN114650273A (en) 2022-06-21

Family

ID=81996258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210348300.3A Pending CN114650273A (en) 2022-04-01 2022-04-01 Initialization method, device, equipment and storage medium for operating system configuration

Country Status (1)

Country Link
CN (1) CN114650273A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115102926A (en) * 2022-07-25 2022-09-23 大陆汽车研发(重庆)有限公司 IP configuration method, device, controller and storage medium
CN115174525A (en) * 2022-06-30 2022-10-11 北京百佑科技有限公司 Method and device for allocating equipment IP addresses
CN115174556A (en) * 2022-06-29 2022-10-11 浪潮云信息技术股份公司 Configuration method and system of server operating system, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141924A (en) * 2010-01-29 2011-08-03 迈普通信技术股份有限公司 Batch production method of Linux boards and production server
CN105959134A (en) * 2016-04-22 2016-09-21 汉柏科技有限公司 Automatic installation deployment method based on PXE, and PXE server
US20180212924A1 (en) * 2017-01-25 2018-07-26 Mitac Computing Technology Corporation Method for ascertaining an ip address and a mac address of a unit under test mounted in a rack server
CN111061496A (en) * 2019-12-27 2020-04-24 浪潮电子信息产业股份有限公司 PXE installation method and device for Linux operating system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141924A (en) * 2010-01-29 2011-08-03 迈普通信技术股份有限公司 Batch production method of Linux boards and production server
CN105959134A (en) * 2016-04-22 2016-09-21 汉柏科技有限公司 Automatic installation deployment method based on PXE, and PXE server
US20180212924A1 (en) * 2017-01-25 2018-07-26 Mitac Computing Technology Corporation Method for ascertaining an ip address and a mac address of a unit under test mounted in a rack server
CN111061496A (en) * 2019-12-27 2020-04-24 浪潮电子信息产业股份有限公司 PXE installation method and device for Linux operating system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174556A (en) * 2022-06-29 2022-10-11 浪潮云信息技术股份公司 Configuration method and system of server operating system, storage medium and electronic equipment
CN115174525A (en) * 2022-06-30 2022-10-11 北京百佑科技有限公司 Method and device for allocating equipment IP addresses
CN115174525B (en) * 2022-06-30 2024-03-15 北京百佑科技有限公司 Equipment IP address allocation method and device
CN115102926A (en) * 2022-07-25 2022-09-23 大陆汽车研发(重庆)有限公司 IP configuration method, device, controller and storage medium
CN115102926B (en) * 2022-07-25 2023-07-21 大陆汽车研发(重庆)有限公司 IP configuration method, device, controller and storage medium

Similar Documents

Publication Publication Date Title
CN114650273A (en) Initialization method, device, equipment and storage medium for operating system configuration
CN108536524B (en) Resource updating method, device, terminal and storage medium
CN107615716B (en) Multi-tenant aware Dynamic Host Configuration Protocol (DHCP) mechanism for cloud networking
CN109558212B (en) Virtualization management method and system of physical equipment, physical equipment and medium
US10855528B2 (en) Viral system discovery and installation for distributed networks
US9614931B2 (en) Identifying a resource set require for a requested application and launching the resource set in a container for execution in a host operating system
JP5870471B2 (en) Method, apparatus, and system for sharing software between terminals
EP2717516A1 (en) Method of protection of data shared between local area network devices and apparatus implementing the method
US20120005321A1 (en) Router and remote boot method using the router
CN106911500B (en) Physical machine configuration method and device and physical machine
CN110493028A (en) A kind of clustered deploy(ment) method, system, device and computer readable storage medium
JP7241770B2 (en) TERMINAL APPLICATION LAUNCH METHOD, DEVICE AND SYSTEM
CN111294416A (en) Method for obtaining IP address and related product
US9229733B2 (en) System and method for providing an image to an information handling system
CN110971689B (en) System installation method, device, system, equipment and storage medium
ES2728679T3 (en) Operating system establishment procedure and device
CN115333933B (en) Automatic management method, medium and equipment for servers on machine room
CN109144520B (en) Information interaction method, device, equipment and storage medium among different objects in Android
CN107528875B (en) File downloading method and device
CN112910956B (en) Resource creation method and device and electronic equipment
CN111638896B (en) Upgrade method, upgrade device, storage medium, processor and mobile terminal
US11363113B1 (en) Dynamic micro-region formation for service provider network independent edge locations
CN111151009A (en) Game data processing method, device and system, electronic equipment and storage medium
CN115333932B (en) Automatic networking method of server, storage medium and electronic equipment
CN113543364A (en) Proxy service method, screen projection method, terminal device, electronic device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination