CN106383703A - Hard disk driver loading method and apparatus for linux operation system - Google Patents

Hard disk driver loading method and apparatus for linux operation system Download PDF

Info

Publication number
CN106383703A
CN106383703A CN201610786738.4A CN201610786738A CN106383703A CN 106383703 A CN106383703 A CN 106383703A CN 201610786738 A CN201610786738 A CN 201610786738A CN 106383703 A CN106383703 A CN 106383703A
Authority
CN
China
Prior art keywords
file
original
inited
img
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.)
Pending
Application number
CN201610786738.4A
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201610786738.4A priority Critical patent/CN106383703A/en
Publication of CN106383703A publication Critical patent/CN106383703A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a hard disk driver loading method for a linux operation system. The method comprises the steps of extracting an original inited.img file in a mirror image of the linux operation system; searching for a directory, in which original driver files corresponding to SAS and RAID cards are located, in the original inited.img file; copying new driver files corresponding to the SAS and RAID cards into the directory; updating associated files in the directory to obtain a target update file; compressing the target update file to the original inited.img file again to obtain a target inited.img file for replacing the original inited.img file; and packing the mirror image again. According to the method, automatic installation of driver programs can be realized and the problem that the operation system cannot be installed because a hard disk cannot be identified due to lack of the driver programs of the SAS and RADIS cards can be solved. In addition, the invention discloses a hard disk driver loading apparatus for the linux operation system, and the apparatus has the abovementioned effects.

Description

A kind of hard drive loading method of linux operating system and device
Technical field
The present invention relates to field of computer technology, more particularly to a kind of hard drive loading side of linux operating system Method and device.
Background technology
SAS and RAID card are the parts being connected with hard disk, and for server, SAS and RAID card are important parts. When the new generation product of SAS and RAID card substitutes, its driver can not be covered by early version linux operating system.Thus When leading to, in linux operating system, hard disk is installed, due to lacking SAS and RAID card driver, lead to system None- identified Hard disk, thus installation operation system cannot be continued.Solution is to need manually to install driver, could solve because Lack SAS and RAID card driver and None- identified hard disk, so cannot installation operation system problem.It will be apparent that it is this Situation is particularly inconvenient for the installment work of unattended linux operating system.
Therefore, how to solve unattended linux operating system hard disk installment work be those skilled in the art urgently Problem to be solved.
Content of the invention
It is an object of the invention to provide a kind of hard drive loading method of linux operating system, for solving unmanned value The hard disk installment work of the linux operating system kept.
For solving above-mentioned technical problem, the present invention provides a kind of hard drive loading method of linux operating system, bag Include:
Extract the original inited.img file in the mirror image of linux operating system;
SAS and the corresponding original mesh driving file to be located of RAID card is searched in described original inited.img file Record;
By corresponding to described SAS and RAID card new driving file copy in described catalogue, and update under described catalogue Associated file obtains target update file;
Described target update file is re-compressed and obtains target inited.img to described original inited.img file File is to replace described original inited.img file, and described mirror image is repacked.
Preferably, the original inited.img file in the mirror image of described extraction linux operating system specifically includes:
Described mirror image is decompressed;
Described original inited.img file is found in the file after decompression according to file type.
Preferably, described described mirror image is decompressed opens instrument especially by Ultraiso.
Preferably, described lookup SAS and the corresponding original driving literary composition of RAID card in described original inited.img file The catalogue that part is located specifically includes:
Described original inited.img file is unpacked;
SAS and the corresponding original catalogue driving file to be located of RAID card is searched in directory listing.
Preferably, the file being associated under the described catalogue of described renewal obtains target update file and specifically includes:
The another name of the described new driving file of modification;
Update the described original driving corresponding dependent file of file.
For solving above-mentioned technical problem, the present invention provides a kind of hard drive charger of linux operating system, bag Include:
Extraction unit, for extracting the original inited.img file in the mirror image of linux operating system;
Searching unit, for searching SAS and the corresponding original driving of RAID card in described original inited.img file The catalogue that file is located;
Updating block, for by corresponding to described SAS and RAID card new driving file copy in described catalogue, and more Newly associated file under described catalogue obtains target update file;
Packaged unit, obtains mesh for re-compressing described target update file to described original inited.img file Mark inited.img file is to replace described original inited.img file, and described mirror image is repacked.
Preferably, described extraction unit specifically includes:
Decompression module, for decompressing to described mirror image;
Parsing module, for finding described original inited.img literary composition according to file type in the file after decompression Part.
Preferably, described decompression module is opened instrument especially by Ultraiso and described mirror image is decompressed.
Preferably, described searching unit specifically includes:
Unpack module, for described original inited.img file is unpacked;
Searching modul, for searching SAS and the corresponding original catalogue driving file to be located of RAID card in directory listing.
Preferably, described updating block specifically includes:
Copy module, for by corresponding to described SAS and RAID card new driving file copy to described catalogue;
Modified module, for changing the another name of described new driving file;
Update module, for updating the described original driving corresponding dependent file of file.
The hard drive loading method of linux operating system provided by the present invention and device, including:Extract linux behaviour Make the original inited.img file in the mirror image of system, original inited.img file is searched SAS corresponding with RAID card The catalogue that is located of original driving file, by corresponding to SAS and RAID card new driving file copy to catalogue, and update mesh The lower associated file of record obtains target update file, target update file is re-compressed and obtains to original inited.img file To target inited.img file to replace original inited.img file, and mirror image is repacked.As can be seen here, this method The automatic installation of driver can be realized, can solve the problem that because lacking SAS and RAID card driver and None- identified hard disk, And then cannot installation operation system problem.
Brief description
In order to be illustrated more clearly that the embodiment of the present invention, the accompanying drawing of use required in embodiment will be done simply below Introduce it should be apparent that, drawings in the following description are only some embodiments of the present invention, for ordinary skill people For member, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of flow chart of the hard drive loading method of linux operating system provided in an embodiment of the present invention;
Fig. 2 is a kind of structure chart of the hard drive charger of linux operating system provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.Based on this Embodiment in invention, under the premise of not making creative work, obtained is every other for those of ordinary skill in the art Embodiment, broadly falls into the scope of the present invention.
The core of the present invention is to provide a kind of hard drive loading method of linux operating system and device.
In order that those skilled in the art more fully understand the present invention program, with reference to the accompanying drawings and detailed description The present invention is described in further detail.
Fig. 1 is a kind of flow chart of the hard drive loading method of linux operating system provided in an embodiment of the present invention.As Shown in Fig. 1, the hard drive loading method of linux operating system includes:
S10:Extract the original inited.img file in the mirror image of linux operating system.
S11:SAS and the corresponding original mesh driving file to be located of RAID card is searched in original inited.img file Record.
S12:By corresponding to SAS and RAID card new driving file copy to catalogue, and be associated under more new directory File obtains target update file.
S13:Target update file is re-compressed and obtains target inited.img file to original inited.img file To replace original inited.img file, and mirror image is repacked.
In being embodied as, in inited.img file, include SAS and the corresponding original driving file of RAID card, because This, when receiving hard drive load request it is necessary to find original inited.img file by mirror image.Original Contain a lot of files in inited.img file, different catalogues had according to the type of file, thus need by SAS and The corresponding original catalogue driving file to be located of RAID card makes a look up.When finding this catalogue, will be corresponding to SAS and RAID card New driving file copy, to catalogue, is now just provided with new driving file in catalogue.Due to multiple in same catalogue Relevant between file, if substituted for driving file it is possible to affect other types of file, accordingly, it would be desirable to accordingly more Under new directory, associated file obtains target update file.It is understood that only target update file puts into mirror image Can normally be used.So this step is contrary with first step, need to re-compress target update file to original Inited.img file is thus obtain new inited.img file, i.e. target inited.img file.Finally again by mirror image weight Corresponding position is put back in new packing.Because new inited.img file contains SAS and the corresponding new driving literary composition of RAID card Part, therefore, it is possible to normal mounting SAS and RAID card, and then can complete hard drive loading work.
The corresponding code of step S13 is:
[root@localhost home] #find. | cpio-c-o | xz-9--format=lzma>initrd.img
The hard drive loading method of the linux operating system that the present embodiment provides, including:Extract linux operating system Mirror image in original inited.img file, in original inited.img file search SAS and RAID card corresponding original Drive the catalogue that file is located, by corresponding to SAS and RAID card new driving file copy to catalogue, and phase under more new directory The file of association obtains target update file, target update file is re-compressed and obtains target to original inited.img file Inited.img file is to replace original inited.img file, and mirror image is repacked.As can be seen here, this method can be real The automatic installation of existing driver, can solve the problem that because lacking SAS and RAID card driver and None- identified hard disk, Jin Erwu The problem of method installation operation system.
Preferably embodiment, the original inited.img file extracting in the mirror image of linux operating system is concrete Including:
Mirror image is decompressed;
Original inited.img file is found in the file after decompression according to file type.
In being embodied as, extract original inited.img file and be divided into two steps, one is that mirror image is decompressed, One is to look for.Due to containing a lot of files in mirror image, therefore, without feature go search talk about very expend when Between, in the present embodiment, with file type for searching feature, therefore, it is possible to accelerate the speed searched, improve and load hard drive Efficiency.
Concrete operations are as follows:
[root@localhost home]#file initrd.img
initrd.img:LZMA compressed data,streamed
[root@localhost home]#xz-dc initrd.img|cpio–id 144444blocks
It is understood that lookup mode has many kinds, it is that one kind is specifically real using file type as searching feature Apply mode, do not represent a kind of only this embodiment.
Preferably embodiment, is decompressed to mirror image and is opened instrument especially by Ultraiso.
It is a kind of special image decompressing instrument that Ultraiso opens instrument, directly can be reduced using this instrument and develop into This.
Preferably embodiment, searches SAS and the corresponding original drive of RAID card in original inited.img file The catalogue that dynamic file is located specifically includes:
Original inited.img file is unpacked;
SAS and the corresponding original catalogue driving file to be located of RAID card is searched in directory listing.
The file being associated under preferably embodiment, more new directory obtains target update file and specifically includes:
The another name of the new driving file of modification;
Update the original driving corresponding dependent file of file.
In being embodied as, new drives file different from the another name of original driving file, in order to ensure smooth reality Existing hard drive loads, and needs the another name of new driving file is modified, then to original drive that file is associated according to Bad file is changed accordingly.
Concrete operations are as follows:
[root@localhost home]#cp-r
/root/bbb/lib/modules/3.10.0-229.el7.x86_64/extra/
/home/modules/2.6.32-358.el6.x86_64/extra
[root@localhost 2.6.32-358.el6.x86_64]#modinfo-F alias
kernel/extra/mpt3sas/mpt3sas.ko|sed-e's/^/alias/'-e's/$/
mpt3sas/'>>modules.alias
Fig. 2 is a kind of structure chart of the hard drive charger of linux operating system provided in an embodiment of the present invention. The hard drive charger of linux operating system, including:
Extraction unit 10, for extracting the original inited.img file in the mirror image of linux operating system;
Searching unit 11, for searching SAS and the corresponding original driving literary composition of RAID card in original inited.img file The catalogue that part is located;
Updating block 12, for by corresponding to SAS and RAID card new driving file copy to catalogue, and more new directory Lower associated file obtains target update file;
Packaged unit 13, obtains target for re-compressing target update file to original inited.img file Inited.img file is to replace original inited.img file, and mirror image is repacked.
The hard drive charger of the linux operating system that the present embodiment provides, including:Extraction unit, for extracting Original inited.img file in the mirror image of linux operating system;Searching unit, in original inited.img file Search SAS and the corresponding original catalogue driving file to be located of RAID card;Updating block, for will be corresponding to SAS and RAID card New driving file copy is to catalogue, and associated file under more new directory obtains target update file;Packaged unit, uses In re-compressing target update file, to obtain target inited.img file to original inited.img file original to replace Inited.img file, and mirror image is repacked.As can be seen here, this device can realize the automatic installation of driver, energy Enough solve because lacking SAS and RAID card driver and None- identified hard disk, and then cannot installation operation system problem.
Preferably embodiment, extraction unit specifically includes:
Decompression module, for decompressing to mirror image;
Parsing module, for finding original inited.img file according to file type in the file after decompression.
Preferably embodiment, decompression module is opened instrument especially by Ultraiso and mirror image is decompressed.
Preferably embodiment, searching unit specifically includes:
Unpack module, for original inited.img file is unpacked;
Searching modul, for searching SAS and the corresponding original catalogue driving file to be located of RAID card in directory listing.
Preferably embodiment, updating block specifically includes:
Copy module, for by corresponding to SAS and RAID card new driving file copy to catalogue;
Modified module, for changing the another name of new driving file;
Update module, for updating the original driving corresponding dependent file of file.
Because the embodiment of device part is mutually corresponding with the embodiment of method part, therefore the embodiment of device part please Referring to the description of the embodiment of method part, wouldn't repeat here.
Above detailed Jie is carried out to the hard drive loading method and device of linux operating system provided by the present invention Continue.In specification, each embodiment is described by the way of going forward one by one, and what each embodiment stressed is and other embodiment Difference, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment, by Correspond to the method disclosed in Example in it, so description is fairly simple, referring to method part illustration in place of correlation. It should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention, can also be right The present invention carries out some improvement and modifies, and these improve and modify and also fall in the protection domain of the claims in the present invention.
Professional further appreciates that, in conjunction with the unit of each example of the embodiments described herein description And algorithm steps, can with electronic hardware, computer software or the two be implemented in combination in, in order to clearly demonstrate hardware and The interchangeability of software, generally describes composition and the step of each example in the above description according to function.These Function to be executed with hardware or software mode actually, the application-specific depending on technical scheme and design constraint.Specialty Technical staff can use different methods to each specific application realize described function, but this realization should Think beyond the scope of this invention.
The step of the method in conjunction with the embodiments described herein description or algorithm can directly be held with hardware, processor The software module of row, or the combination of the two is implementing.Software module can be placed in random access memory (RAM), internal memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In known any other form of storage medium in field.

Claims (10)

1. a kind of hard drive loading method of linux operating system is it is characterised in that include:
Extract the original inited.img file in the mirror image of linux operating system;
SAS and the corresponding original catalogue driving file to be located of RAID card is searched in described original inited.img file;
By corresponding to described SAS and RAID card new driving file copy in described catalogue, and update related under described catalogue The file of connection obtains target update file;
Described target update file is re-compressed and obtains target inited.img file to described original inited.img file To replace described original inited.img file, and described mirror image is repacked.
2. the hard drive loading method of linux operating system according to claim 1 is it is characterised in that described extraction Original inited.img file in the mirror image of linux operating system specifically includes:
Described mirror image is decompressed;
Described original inited.img file is found in the file after decompression according to file type.
3. linux operating system according to claim 2 hard drive loading method it is characterised in that described to institute State mirror image and decompressed and open instrument especially by Ultraiso.
4. linux operating system according to claim 1 hard drive loading method it is characterised in that described in institute State lookup SAS and the corresponding original catalogue driving file to be located of RAID card in original inited.img file to specifically include:
Described original inited.img file is unpacked;
SAS and the corresponding original catalogue driving file to be located of RAID card is searched in directory listing.
5. the hard drive loading method of linux operating system according to claim 1 is it is characterised in that described renewal The file being associated under described catalogue obtains target update file and specifically includes:
The another name of the described new driving file of modification;
Update the described original driving corresponding dependent file of file.
6. a kind of hard drive charger of linux operating system is it is characterised in that include:
Extraction unit, for extracting the original inited.img file in the mirror image of linux operating system;
Searching unit, for searching SAS and the corresponding original driving file of RAID card in described original inited.img file The catalogue being located;
Updating block, and updates institute for by corresponding to described SAS and RAID card new driving file copy in described catalogue State associated file under catalogue and obtain target update file;
Packaged unit, obtains target for re-compressing described target update file to described original inited.img file Inited.img file is to replace described original inited.img file, and described mirror image is repacked.
7. the hard drive charger of linux operating system according to claim 6 is it is characterised in that described extraction Unit specifically includes:
Decompression module, for decompressing to described mirror image;
Parsing module, for finding described original inited.img file according to file type in the file after decompression.
8. the hard drive charger of linux operating system according to claim 6 is it is characterised in that described decompression Module is opened instrument especially by Ultraiso and described mirror image is decompressed.
9. the hard drive charger of linux operating system according to claim 6 is it is characterised in that described lookup Unit specifically includes:
Unpack module, for described original inited.img file is unpacked;
Searching modul, for searching SAS and the corresponding original catalogue driving file to be located of RAID card in directory listing.
10. the hard drive charger of linux operating system according to claim 6 is it is characterised in that described renewal Unit specifically includes:
Copy module, for by corresponding to described SAS and RAID card new driving file copy to described catalogue;
Modified module, for changing the another name of described new driving file;
Update module, for updating the described original driving corresponding dependent file of file.
CN201610786738.4A 2016-08-30 2016-08-30 Hard disk driver loading method and apparatus for linux operation system Pending CN106383703A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610786738.4A CN106383703A (en) 2016-08-30 2016-08-30 Hard disk driver loading method and apparatus for linux operation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610786738.4A CN106383703A (en) 2016-08-30 2016-08-30 Hard disk driver loading method and apparatus for linux operation system

Publications (1)

Publication Number Publication Date
CN106383703A true CN106383703A (en) 2017-02-08

Family

ID=57938810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610786738.4A Pending CN106383703A (en) 2016-08-30 2016-08-30 Hard disk driver loading method and apparatus for linux operation system

Country Status (1)

Country Link
CN (1) CN106383703A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388449A (en) * 2018-01-11 2018-08-10 郑州云海信息技术有限公司 A kind of method of data center's update linux system trawl performance
CN110045966A (en) * 2019-04-01 2019-07-23 龙芯中科(合肥)技术有限公司 Processing method, device and the equipment of erector
CN112000342A (en) * 2020-08-14 2020-11-27 北京浪潮数据技术有限公司 Operating system installation method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070101342A1 (en) * 2005-10-31 2007-05-03 Microsoft Corporation Automated device driver management
CN101515237A (en) * 2008-02-20 2009-08-26 英业达股份有限公司 Method for installing third-party driver in mode of execution environment installation before starting up
CN104714814A (en) * 2013-12-13 2015-06-17 贝壳网际(北京)安全技术有限公司 Drive program mounting method and client terminal device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070101342A1 (en) * 2005-10-31 2007-05-03 Microsoft Corporation Automated device driver management
CN101515237A (en) * 2008-02-20 2009-08-26 英业达股份有限公司 Method for installing third-party driver in mode of execution environment installation before starting up
CN104714814A (en) * 2013-12-13 2015-06-17 贝壳网际(北京)安全技术有限公司 Drive program mounting method and client terminal device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张超: "Hacking initrd.img-添加网卡驱动,网络安装Linux"", 《HTTPS://WWW.IBM.COM/DEVELOPERWORKS/CN/LINUX/L-LINUX-NETINST/》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388449A (en) * 2018-01-11 2018-08-10 郑州云海信息技术有限公司 A kind of method of data center's update linux system trawl performance
CN110045966A (en) * 2019-04-01 2019-07-23 龙芯中科(合肥)技术有限公司 Processing method, device and the equipment of erector
CN112000342A (en) * 2020-08-14 2020-11-27 北京浪潮数据技术有限公司 Operating system installation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US7313792B2 (en) Method and system for servicing software
CN104793946B (en) Dispositions method and system are applied based on cloud computing platform
US9052977B2 (en) Installation of software onto a computer
US9069635B2 (en) Process for compressing application deployments
US8364638B2 (en) Automated filer technique for use in virtualized appliances and applications
CN102193817B (en) Simplify the management of physics and virtual deployment
CN103795759B (en) The dispatching method and system of a kind of virtual machine image file
Gilbert et al. Pocket ISR: Virtual machines anywhere
CN103530148A (en) Distribution method for large-scale Linux software package
CN103077043B (en) A kind of method of quick Start-up and operating performance Linux
CN103309706B (en) Memory file system preparation method based on (SuSE) Linux OS and unit
EP2788875A2 (en) Universal pluggable cloud disaster recovery system
US20100023520A1 (en) Encapsulated file management systems
CN105468686A (en) Method and device for reducing redundant data
CN103902265A (en) Application implementation method and application implementation device
CN105786538A (en) Software upgrading method and device based on Android system
US20180309841A1 (en) Apparatus, method, and computer program product for heterogenous compression of data streams
CN103514022A (en) RAID card drive integration method under LINUX
CN102375695A (en) Disc accessing method and computer system
CN106383703A (en) Hard disk driver loading method and apparatus for linux operation system
CN104714812A (en) Method and system for quickly deploying and loading Java applications in cloud environment
US20100287205A1 (en) Operating system / electronic device and method for storing or reading a file
US8806477B2 (en) Space efficient software package management
CN106406923A (en) Processing method and device of dynamic library file
US7478386B2 (en) Resource-conservative installation of compressed archives

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170208