Summary of the invention
The invention provides a kind of installation method and system of operating system, to overcome the technical matters that installation method versatility is poor, flexibility ratio is not high of existing operating system.
The installation method that the invention provides a kind of operating system, comprising:
Boot initialization server in the first boot media;
Boot in described the first boot media by the control program in described the first boot media, kernel file system documentation library storage in the internal memory of described server, wherein, described kernel file system documentation storehouse comprises at least two cover operating system files, and every cover operating system file comprises kernel and file system;
The control program that boot in described the first boot media triggers in described server memory is carried out;
Control program in described server memory receives configuration parameter, OS Type and the version of user's input;
Control program in described server memory is according to configuration parameter, OS Type and the version of user's input, generating configuration file;
Control program in described server memory, according to OS Type and the version of user's input, obtains corresponding operating system file in the kernel file system documentation storehouse from described server memory;
The kernel that control program in described server memory comprises the operating system file of described configuration file, described correspondence and file system store in the fdisk of described server;
The described fdisk of control program in described server memory is set to boot disk;
Control program in described server memory guides described server to restart from described boot disk;
The kernel that described boot disk comprises according to the operating system file of the described configuration file of storing in described boot disk, described correspondence and file system are prepared installation environment, and obtain operating system installation program from the second boot media, for described server installing operating system, wherein, the operating system installation program in described the second boot media is corresponding with OS Type and version that user selects.
The present invention also provides a kind of installation system of operating system, comprising: the first boot media, the second boot media, server, wherein:
Described the first boot media, comprising:
Boot, for initialization server, by the control program in described the first boot media, kernel file system documentation library storage, in the internal memory of described server, the control program triggering in described server memory is carried out;
Control program in described server memory, for receiving the configuration parameter of user's input, OS Type and version, according to the configuration parameter of user's input, OS Type and version, generating configuration file, according to OS Type and the version of user's input, in kernel file system documentation storehouse from described server memory, obtain corresponding operating system file, by described configuration file, the kernel that the operating system file of described correspondence comprises and file system store in the fdisk of described server, described fdisk is set to boot disk, guide described server to restart from described boot disk,
Kernel file system documentation storehouse in described server memory, described kernel file system documentation storehouse comprises at least two cover operating system files, every cover operating system file comprises kernel and file system;
Described the second boot media, comprising: OS Type and the corresponding operating system installation program of version selected with user;
Described server, the kernel comprising according to the operating system file of the described configuration file of storing in described boot disk, described correspondence for the boot disk of described server and file system are prepared installation environment, and obtain operating system installation program from the second boot media.
Technique effect of the present invention is: by the dynamically generating configuration file of configuration parameter, OS Type and version of inputting according to user, realize the individual operation system of satisfied different configuration parameter demands and installed, solved the technical matters that installation method versatility is poor, flexibility ratio is not high of existing operating system.
Embodiment
Fig. 1 is the process flow diagram of the installation method embodiment mono-of operating system of the present invention.As shown in Figure 1, the method for the present embodiment can comprise:
Boot initialization server in step 101, the first boot media.
Particularly, boot in the first boot media can start by Boot Server, make server complete initialization, the initialization of server can include, but are not limited to: in the internal memory of server, form linux root file system, the CD-ROM drive of subregion, initialization server, the USB interface of initialization server etc. are set in the hard disk of server.More specifically, in boot, comprise a set of operating system file, operating system file refers to the set of kernel (kernel) and file system (initrd), wherein operating system file can be the operating system file of any OS Type, any operating system version, it will be understood by those skilled in the art that: kernel is mutually to mate with file system.Boot is discharged into kernel and file system in the internal memory of server, creates interim linux root file system in the internal memory of server.It should be noted that, take Red Hat5(red cap 5) as example, in the present embodiment, the OS Type of indication refers to " Red Hat ", and in the present embodiment, the operating system version of indication refers to " 5 ".
Boot in step 102, described the first boot media by the control program in described the first boot media, kernel file system documentation library storage in the internal memory of described server, wherein, described kernel file system documentation storehouse comprises at least two cover operating system files, and every cover operating system file comprises kernel and file system.
Particularly, after boot initialization server, after being step 101, boot by the control program in the first boot media, kernel file system documentation library storage in the internal memory of server, that is to say, in the first boot media, except including boot, also include control program and kernel file system documentation storehouse.Control program in the first boot media, kernel file system documentation library storage are copied in the internal memory of server to the control program, the kernel file system documentation storehouse that are about in the first boot media in the internal memory of server, more specifically, control program is copied under interim linux root file system.Kernel file system documentation storehouse comprises at least two cover operating system files, comprise the kernel (kernel) of the mutual coupling of at least two covers and the set of file system (initrd), preferably, kernel file system documentation storehouse comprises all operations system type of selling on the market, the operating system file of all operations system version.It will be understood by those skilled in the art that: the corresponding kernel file system of dissimilar operating system likely difference is also likely identical, when but the version of the identical operating system of type of operating system is different, kernel file system likely difference is also likely identical.
The control program that boot in step 103, described the first boot media triggers in described server memory is carried out.
Particularly, boot is by after control program copy is under interim linux root file system, and, after step 102, boot triggers control program and carries out.Boot triggers after control program execution, no longer carries out boot in subsequent step.
Control program in step 104, described server memory receives configuration parameter, OS Type and the version of user's input.
Particularly, boot triggers after control program execution, and, after step 103, user arranges server configuration parameter according to different demands, for example, if user need to be set to KEYBUS by keyboard, in keyboard placement input " American "; If user need to coded format be set to Chinese character code environment, in coded format place input " Chinese "; If user need to subnet mask be set to 255.255.255.0, in subnet mask place input " 255.255.255.0 "; If user need to be set to 10.1.17.1 by gateway, in gateway input " 10.1.17.1 " etc.For example, it is red cap that user selects OS Type, and it is 5 that user selects operating system version.It should be noted that, concrete setting, the concrete selection to OS Type to configuration parameter, be all exemplary to the concrete selection of operating system version, is not used in the present embodiment is limited.
Control program in step 105, described server memory is according to configuration parameter, OS Type and the version of user's input, generating configuration file.
Particularly, control program receives after configuration parameter, OS Type and the version of user's input, after step 104, according to configuration parameter, OS Type and the version generating configuration file of user's input.For example, if the OS Type that user selects is red cap, generate anaconda-ks configuration file.
Control program in step 106, described server memory, according to OS Type and the version of user's input, obtains corresponding operating system file in the kernel file system documentation storehouse from described server memory.
Particularly, control program receives after configuration parameter, OS Type and the version of user's input, after being step 104, according to OS Type and the version of user's input, in the kernel file system documentation storehouse of storing, obtain corresponding operating system file from server memory.
It should be noted that, after execution step 104, can first perform step 105 and perform step again 106, can also first perform step 106 and perform step again 105, can also perform step simultaneously 105 with step 106, the present embodiment does not limit with the sequencing of step 106 performing step 105, but perform step 105 and execution step 106 all need be after execution step 104.Execution sequence for step 105 with step 106, those skilled in the art, when implementing the present embodiment, can arrange according to needs.
Kernel and file system that control program in step 107, described server memory comprises the operating system file of described configuration file, described correspondence store in the fdisk of described server.
Particularly, obtain after the operating system file of configuration file and correspondence at control program,, after step 105 and step 106, control program stores configuration file and operating system file in the fdisk of server into.More specifically, control program stores configuration file and operating system file in first subregion of first hard disk of server into." storing " operation into can be specifically " copy " operation, in the internal memory of server, still preserve the configuration file and the corresponding operating system file that obtain, or can be " migration " operation, in the internal memory of server, not preserve the configuration file and the corresponding operating system file that obtain.
The described fdisk of control program in step 108, described server memory is set to boot disk.
Particularly, after the operating system file of configuration file, described correspondence being stored at control program in the fdisk of server,, after step 107, the fdisk of control program server is set to boot disk.More specifically, first subregion of first of control program server hard disk is set to boot disk.
Control program in step 109, described server memory guides described server to restart from described boot disk.
Particularly, at the hard disk of control program server, be set to after boot disk,, after step 108, control program restarts server.Because the fdisk of server has been set to boot disk, when server starts again, can start from the fdisk of server.After server restarts, the internal memory of storer will be reset, and the data that are stored in before step 108 in server memory will be cleared.
The kernel that step 110, described boot disk comprise according to the operating system file of the described configuration file of storing in described boot disk, described correspondence and file system are prepared installation environment, and obtain operating system installation program from the second boot media, for described server installing operating system, wherein, the operating system installation program in described the second boot media is corresponding with OS Type and version that user selects.
Particularly, boot disk can arrange server according to configuration file, and for example keyboard is set to KEYBUS, coded format and is set to that Chinese character code environment, subnet mask are set to 255.255.255.0, gateway is set to 10.1.17.1 etc.Boot disk can tie up in the fdisk of server and create linux root file system according to kernel and file.It should be noted that, the interim linux root file system creating in step 101 is different from the linux root file system creating in step 110, the interim linux root file system creating in step 101 can be cleared after server is restarted, and may mate also and may not mate with the final installing operating system type of server and version, and the linux root file system creating in step 110 can not be cleared after server is restarted, and system type and version match certain and the operation system that server is installed.After installation environment is ready to, from the second boot media, obtaining operating system installation program, is server installing operating system.
The present embodiment, by the dynamically generating configuration file of configuration parameter, OS Type and version of inputting according to user, realize the individual operation system of satisfied different configuration parameter demands and installed, solved the technical matters that installation method versatility is poor, flexibility ratio is not high of existing operating system.
On the basis of above-described embodiment, the installation method embodiment bis-of operating system of the present invention, boot in described the first boot media triggers control program in described server memory carry out after, and at described server from restart described fdisk, also comprise:
Control program in described server memory ejects dialog box on display interface, and described dialog box is for pointing out user to take out described the first boot media from the CD-ROM drive of described server or the USB interface of described server.
Particularly, after step 103, and before step 109, control program for example ejects the dialog box of " please take out CD " or " please take out USB flash disk " etc. on display interface, and prompting user takes out the first boot media from CD-ROM drive or the USB interface of server.Display interface can be any display device being connected with server, such as display etc.
The present embodiment, by eject dialog box prompting user on display interface, take out the first boot media, user can, when no longer needing to use the first boot media, take out the first boot media the installation method of operating system hommization more that the present embodiment is provided in time.
On the basis of above-described embodiment, the installation method embodiment tri-of operating system of the present invention, boot in described the first boot media triggers after the control program execution in described server memory, and the control program in described server memory receives before configuration parameter, OS Type and the version of user's input, also comprises:
Control program in described server memory, by graphical user interface, receives configuration parameter, OS Type and the version of user's input.
Particularly, after step 103, and before step 104, control program can show user friendly type graphical interfaces on the face being connected with server, facilitates user's input configuration parameter.Display interface can be any display device being connected with server, such as display etc.
The present embodiment, by graphical user interface, receives configuration parameter, OS Type and the version of user's input, the installation method of operating system hommization more that the present embodiment is provided.
On the basis of above-described embodiment, the installation method embodiment tetra-of operating system of the present invention, described the first boot media, comprising: digital versatile disc, USB memory device; Described the second boot media, comprising: digital versatile disc, USB memory device.
Particularly, the first boot media can be that digital versatile disc or the first boot media can be USB memory devices.It should be noted that, when the first boot media is digital versatile disc, in step 101 during initialization server, only needs the CD-ROM drive of initialization server and do not need the USB interface of initialization server; When the first boot media is USB memory device, in step 101 during initialization server, only needs the USB interface of initialization server and do not need the CD-ROM drive of initialization server.And user, take out after the first boot media, and before step 110, put into the second boot media.If the second boot media is USB memory device, the second boot media is connected with the USB interface of server, if the second boot media is digital versatile disc, the second boot media is connected with the CD-ROM drive of server.
Fig. 2 is the structural representation of the installation system embodiment mono-of operating system of the present invention.As shown in Figure 2, the system of the present embodiment can comprise: the first boot media 101, the second boot media 102, server 103.Wherein, the first boot media 101 also comprises boot 1011, control program 1012, kernel file system documentation storehouse 1013.
Wherein, described the first boot media 101, comprising:
Boot 1011, for initialization server 103, control program 1012 in described the first boot media 101, kernel file system documentation storehouse 1013 are stored in the internal memory of described server 103, and in server 103 internal memories formation control program 1031, kernel file system documentation storehouse 1032, the control program 1031 triggering in described server 103 internal memories is carried out;
Control program 1031 in described server 103 internal memories, for receiving the configuration parameter of user's input, OS Type and version, according to the configuration parameter of user's input, OS Type and version, generating configuration file, according to OS Type and the version of user's input, in kernel file system documentation storehouse 1032 from described server 103 internal memories, obtain corresponding operating system file, by described configuration file, the kernel that the operating system file of described correspondence comprises and file system store in the fdisk of described server 103, described fdisk is set to boot disk, guide described server 103 to restart from described boot disk,
Kernel file system documentation storehouse 1032 in described server 103 internal memories, described kernel file system documentation storehouse comprises at least two cover operating system files, every cover operating system file comprises kernel and file system;
Described the second boot media 102, comprising: OS Type and the corresponding operating system installation program of version selected with user;
Described server 103, the kernel comprising according to the operating system file of the described configuration file of storing in described boot disk, described correspondence for the boot disk of described server 103 and file system are prepared installation environment, and obtain operating system installation program from the second boot media 102.
The operating system installation system of the present embodiment, can be for the technical scheme of embodiment of the method shown in execution graph 1, and it realizes principle and technique effect is similar, repeats no more herein.
On the basis of above-described embodiment, the installation system embodiment bis-of operating system of the present invention, described control program 1031, also for:
Boot 1011 in described the first boot media 101 triggers after control program 1031 execution in described server 103 internal memories, and at described server 103 from restart described fdisk, described control program 1031 ejects dialog box on display interface, and described dialog box is for pointing out user to take out described the first boot media 101 from the CD-ROM drive of subordinate server or the USB interface of described server.
The operating system installation system of the present embodiment, can be for the technical scheme of the installation method embodiment bis-of execution operating system of the present invention, and it realizes principle and technique effect is similar, repeats no more herein.
On the basis of above-described embodiment, the installation system embodiment tri-of operating system of the present invention, described control program 1031, also for:
Boot 1011 in described the first boot media 101 triggers after control program 1031 execution in described server 103 internal memories, and the control program 1031 in described server 103 internal memories receives before configuration parameter, OS Type and the version of user's input, control program 1031 in described server 103, by graphical user interface, receives configuration parameter, OS Type and the version of user's input.
The operating system installation system of the present embodiment, can be for the technical scheme of the installation method embodiment tri-of execution operating system of the present invention, and it realizes principle and technique effect is similar, repeats no more herein.
On the basis of above-described embodiment, the installation system embodiment tetra-of operating system of the present invention, described the first boot media 101, specifically: digital versatile disc, USB memory device; Described the second boot media 102, specifically: digital versatile disc, USB memory device.
The operating system installation system of the present embodiment, can be for the technical scheme of the installation method embodiment tetra-of execution operating system of the present invention, and it realizes principle and technique effect is similar, repeats no more herein.
Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.