CN104461645A - Kexec based firmware updating method and kexec based firmware updating device - Google Patents
Kexec based firmware updating method and kexec based firmware updating device Download PDFInfo
- Publication number
- CN104461645A CN104461645A CN201410788434.2A CN201410788434A CN104461645A CN 104461645 A CN104461645 A CN 104461645A CN 201410788434 A CN201410788434 A CN 201410788434A CN 104461645 A CN104461645 A CN 104461645A
- Authority
- CN
- China
- Prior art keywords
- firmware
- kexec
- upgrading
- initramfs
- upgrade
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Abstract
The invention relates to the field of network equipment security and discloses a kexec based firmware updating method and a kexec based firmware updating device. The method includes: generating firmware supporting kexec updating and performing firmware updating based on kexec; by downloading normal firmware and checking, copying the normal firmware into a specific path in an initramfs root file system, recompiling a Linux kernel supporting the initramfs to obtain the firmware supporting kexec updating; utilizing the kexec to load the Linux kernel, running the kernel into the nitramfs, checking the firmware supporting the kexec updating, and updating. By the method, the new kernel of the Linux system is started quickly by the kexec, the new and clean environmental updating firmware is constructed, risks of firmware updating failure caused by previous potential problems of the Linux system are avoided completely, firmware updating is finished quickly and simply, and robustness and security in firmware updating are guaranteed.
Description
Technical field
The present invention relates to network equipment security fields, particularly a kind of firmware upgrade method based on kexec and device for upgrading firmware.
Background technology
In recent years, computer network is popularized fast, and cybertimes formally arrive, and not only network will be installed by single household, even public arena, comprises cinema, bus and megastore etc. and is all equipped with wireless network.Therefore, the router for network interconnection seems particularly important.(SuSE) Linux OS is the mainstream operation system that router adopts, and at present, the mode of the firmware updating that the router based on (SuSE) Linux OS adopts has two kinds: download upgrading and bootloader upgrading.Download upgrading is adopted to comprise step:
1, by firmware downloads in internal memory;
2, calibration firmware;
3, firmware updating,
When making to upgrade to firmware in this way, usually there is RAM leakage, memory overwriting or some destructive actions occurring in linux kernel, these problems are all unknown usually, may cause firmware upgrade failure, and then cause router normally to use; Bootloader upgrading is adopted to comprise step:
1, mark needs to carry out firmware upgrade;
2, restarter;
3, Bootloader is by tftp download firmware;
4, calibration firmware;
5, firmware updating,
When making to upgrade to firmware in this way, firmware is upgraded in bootloader, although ensure that firmware is upgraded in new, a clean environment, firmware upgrade failure can not be caused, but this mode needs user to participate in restarting router, arranges IP, firmware and tftp server, to ensure that bootloader can pass through tftp download firmware, this is for domestic consumer, can not complete.
Summary of the invention
For the defect of prior art, technical matters to be solved by this invention is, provides a kind of firmware upgrade method based on kexec, to evade the potential risk in linux system kernel, and solves the problems such as upgrading complexity, poor user experience.
For solving the problem, the invention provides the firmware upgrade method based on kexec, the described firmware upgrade method based on kexec comprises step:
The firmware that kexec upgrades is supported in S1, generation;
S2, carry out firmware upgrade based on kexec.
Preferably, described step S1 comprises step:
S101, generation also calibration normal firmware;
S102, described normal firmware is copied initramfs root file system particular path under;
The Linux kernel of S103, the described initramfs of recompility support, obtains the firmware of described support kexec upgrading.
Preferably, described step S2 comprises step:
S201, described kexec load Linux kernel;
S202, described Linux kernel run and load described initramfs root file system;
S203, the firmware finding described support kexec to upgrade under the particular path of described initramfs root directory system;
S204, calibration and upgrade described support kexec upgrading firmware.
Preferably, under described normal firmware copies the particular path of described initramfs root file system by automatic compiling.
Preferably, described Linux kernel is a new linux kernel, and the environment of formation is clean.
To achieve these goals, according to a further aspect in the invention, provide the device for upgrading firmware based on kexec, the described device for upgrading firmware based on kexec comprises:
Generate firmware module, for generating the firmware supporting kexec upgrading;
Firmware upgrade module, for carrying out firmware upgrade based on kexec.
Preferably, described generation firmware module comprises:
First generates firmware submodule, is used for generating and calibration normal firmware;
Second generates firmware submodule, under being used for that described normal firmware is copied the particular path of initramfs root file system;
3rd generates firmware submodule, is used for recompilating the Linuxkernel supporting described initramfs, obtains the firmware of described support kexec upgrading.
Preferably, described firmware upgrade module comprises:
First firmware upgrade submodule, loads Linux kernel for utilizing described kexec;
Second firmware upgrade submodule, runs for utilizing described Linux kernel and loads described initramfs root file system;
3rd firmware upgrade submodule, for finding the firmware of described support kexec upgrading under the particular path of described initramfs root directory system;
4th firmware upgrade submodule, for calibration and upgrade described support kexec upgrading firmware
Preferably, under described normal firmware copies the particular path of described initramfs root file system by automatic compiling.
Preferably, described Linux kernel is a new linux kernel, and the environment of formation is clean.
Compared with prior art, the invention provides the firmware upgrade method based on kexec and device for upgrading firmware, by the normal firmware automatic compiling that will download to, under copying the particular path of initramfs root file system, recompilate, obtain the firmware supporting kexec upgrading, ensure that Linux kernel can find corresponding firmware, and upgrade, meet kernel upgrading whole-course automation completely, do not need the requirement of user operation, Consumer's Experience is good, really achieves safe and simple firmware updating; Kexec loads a new Linux kernel, for firmware upgrade builds new, a clean environment, has evaded the risk of directly upgrading in linux system existing for kernel completely, ensure that robustness and the security of firmware upgrade.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet based on the firmware upgrade method of kexec in a preferred embodiment of the present invention;
Fig. 2 is the schematic flow sheet generating the firmware supporting kexec upgrading in a preferred embodiment of the present invention;
Fig. 3 is the schematic flow sheet carrying out firmware upgrade in a preferred embodiment of the present invention based on kexec;
Fig. 4 is the block diagram based on the device for upgrading firmware of kexec in a preferred embodiment of the present invention.
Embodiment
Following examples only for technical scheme of the present invention is clearly described, and can not limit the scope of the invention with this.Instructions subsequent descriptions is for implementing better embodiment of the present invention, and right described description still to illustrate for the purpose of rule of the present invention, and is not used to limit scope of the present invention.Protection scope of the present invention is when being as the criterion depending on the claims person of defining.
See Fig. 1, embodiments provide the firmware upgrade method based on kexec, the method comprising the steps of:
The firmware that kexec upgrades is supported in S1, generation;
S2, carry out firmware upgrade based on kexec.
In the present invention, based on the firmware upgrade method of kexec by under the particular path of firmware being copied initramfs root file system, recompilate the Linuxkernel that initramfs root file system is corresponding, normal firmware is converted into the firmware supporting kexec upgrading, guarantee that Linux kernel can find firmware and upgrade, meet the simple and quick requirement completing firmware upgrade completely; Utilize kexec to start a new kernel fast, for firmware upgrade provides new, a clean environment, can evade completely in linux system and may there are some destructive behavior and control unknown risks, ensure robustness and the security of firmware upgrade.
Further, see Fig. 2, step S1 comprises step:
S101, generation also calibration normal firmware;
S102, normal firmware is copied initramfs root file system particular path under;
The Linux kernel of S103, recompility support initramfs, obtains the firmware supporting kexec upgrading.
Between step S101 and step S102, kexec starts a new Linux kernel fast; In step S102, by the mode of automatic compiling, under normal firmware being copied automatically the particular path of initramfs root file system; In step S103, load initramfs root file system, Linuxkernel finds the firmware supporting kexec upgrading.
In the present invention, normal firmware is changed into the firmware supporting kexec upgrading by step S1, and do not need user to participate in, system can complete by automatic compiling, guarantees that user does not need to participate in too complicated operation; Firmware is copied in initramfs root file system, guarantee that Linux kernel loads root file system and can find corresponding firmware, simple and quickly complete firmware upgrade.
Further, see Fig. 3, step S2 comprises step:
S201, kexec load Linux kernel;
S202, Linux kernel runs and loads initramfs root file system;
S203, the firmware finding support kexec to upgrade under the particular path of initramfs root directory system;
The firmware of kexec upgrading is supported in S204, calibration also upgrading.
In step S201, kexec starts a new Linux kernel fast, and carries out corresponding initialization operation; In step S202, load initramfs root file system, start (SuSE) Linux OS.
In the present invention, step S2 achieves the upgrading to the firmware supporting kexec, a new Linux kernel is started fast by kexec, guarantee that kernel upgrading carries out in clean environment, evade the destructive behavior and control unknown risks that may exist in linux system completely, guarantee robustness and the security of firmware upgrade.
Fig. 4 is the block diagram based on the device for upgrading firmware of kexec in the present embodiment, and as shown in Figure 4, this device comprises: generate firmware module and firmware upgrade module, wherein,
Generate firmware module and comprise the first generation firmware submodule, the second generation firmware submodule and the 3rd generation firmware submodule; Firmware upgrade module comprises the first firmware upgrade submodule, the second firmware upgrade submodule and the 3rd firmware upgrade submodule.
Generate firmware module and generate the generation of firmware submodule and calibration normal firmware by first, under normal firmware is copied the particular path of initramfs root file system by the second generation firmware submodule, 3rd generate firmware submodule recompilate the Linux kernel that supports initramfs thus, obtain the firmware supporting kexec upgrading.
Firmware upgrade module utilizes kexec to load Linux kernel by the first firmware upgrade submodule, second firmware upgrade submodule utilizes Linux kernel to run and loads initramfs root file system, 3rd firmware upgrade submodule finds the firmware supporting kexec upgrading under the particular path of initramfs root directory system, and the firmware of kexec upgrading is supported in the 4th firmware upgrade submodule calibration also upgrading.
In the present embodiment, generate firmware module and complete the firmware automatically normal firmware being transformed into and supporting kexec upgrading, under firmware being placed on the particular path of initramfs root file system, file system starts and can load, whole process does not need user to participate in, and kernel can load automatically, convenient and swift; The linux kernel that firmware upgrade CMOS macro cell is new, the firmware that this kernel finds the support kexec under initramfs root file system to upgrade, it is upgraded, ensure that the clean of upgrade environments, prevent from existing in kernel the upgrading failure that potential risk causes, substantially increase the success ratio of firmware upgrade.
Compared with prior art, the invention provides a kind of firmware upgrade method based on kexec, kexec is utilized to start new Linux kernel fast, for firmware provides clean upgrade environments, evade because the Latent destruction sexual behaviour of linux system and control unknown risks cause failed risk of upgrading in firmware upgrade completely, the robustness of guarantee firmware upgrade and security; The normal firmware of download is automatically changeb to the firmware supporting kexec upgrading, whole process does not need user to participate in, realize the simple and quick upgrading of firmware, this firmware upgrade method is very applicable to routers internal operation and unfamiliar user, simple firmware updating fast can be realized completely, ensure firmware upgrade success to the full extent, even if router upgrade is frequent, also can not impact user.
Although below invention has been described in conjunction with the preferred embodiments, but it should be appreciated by those skilled in the art, method and system of the present invention is not limited to the embodiment described in embodiment, when not deviating from the spirit and scope of the invention be defined by the appended claims, can various amendment, increase be made to the present invention and replace.
Claims (10)
1. based on the firmware upgrade method of kexec, it is characterized in that, the described firmware upgrade method based on kexec comprises step:
The firmware that kexec upgrades is supported in S1, generation;
S2, carry out firmware upgrade based on kexec.
2., as claimed in claim 1 based on the firmware upgrade method of kexec, it is characterized in that, described step S1 comprises step:
S101, generation also calibration normal firmware;
S102, described normal firmware is copied initramfs root file system particular path under;
The Linux kernel of S103, the described initramfs of recompility support, obtains the firmware of described support kexec upgrading.
3., as claimed in claim 1 based on the firmware upgrade method of kexec, it is characterized in that, described step S2 comprises step:
S201, described kexec load Linux kernel;
S202, described Linux kernel run and load described initramfs root file system;
S203, the firmware finding described support kexec to upgrade under the particular path of described initramfs root directory system;
S204, calibration and upgrade described support kexec upgrading firmware.
4., as claimed in claim 2 based on the firmware upgrade method of kexec, it is characterized in that, under described normal firmware copies the particular path of described initramfs root file system by automatic compiling.
5., as claimed in claim 3 based on the firmware upgrade method of kexec, it is characterized in that, described Linux kernel is a new linux kernel, and the environment of formation is clean.
6. based on the device for upgrading firmware of kexec, it is characterized in that, the described device for upgrading firmware based on kexec comprises:
Generate firmware module, for generating the firmware supporting kexec upgrading;
Firmware upgrade module, for carrying out firmware upgrade based on kexec.
7., as claimed in claim 6 based on the device for upgrading firmware of kexec, it is characterized in that, described generation firmware module comprises:
First generates firmware submodule, is used for generating and calibration normal firmware;
Second generates firmware submodule, under being used for that described normal firmware is copied the particular path of initramfs root file system;
3rd generates firmware submodule, is used for recompilating the Linux kernel supporting described initramfs, obtains the firmware of described support kexec upgrading.
8., as claimed in claim 6 based on the device for upgrading firmware of kexec, it is characterized in that, described firmware upgrade module comprises:
First firmware upgrade submodule, loads Linux kernel for utilizing described kexec;
Second firmware upgrade submodule, runs for utilizing described Linux kernel and loads described initramfs root file system;
3rd firmware upgrade submodule, for finding the firmware of described support kexec upgrading under the particular path of described initramfs root directory system;
4th firmware upgrade submodule, for calibration and upgrade described support kexec upgrading firmware.
9., as claimed in claim 7 based on the device for upgrading firmware of kexec, it is characterized in that, under described normal firmware copies the particular path of described initramfs root file system by automatic compiling.
10., as claimed in claim 8 based on the device for upgrading firmware of kexec, it is characterized in that, described Linux kernel is a new linux kernel, and the environment of formation is clean.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410788434.2A CN104461645B (en) | 2014-12-17 | 2014-12-17 | Firmware upgrade method and device for upgrading firmware based on kexec |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410788434.2A CN104461645B (en) | 2014-12-17 | 2014-12-17 | Firmware upgrade method and device for upgrading firmware based on kexec |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104461645A true CN104461645A (en) | 2015-03-25 |
CN104461645B CN104461645B (en) | 2017-11-14 |
Family
ID=52907750
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410788434.2A Expired - Fee Related CN104461645B (en) | 2014-12-17 | 2014-12-17 | Firmware upgrade method and device for upgrading firmware based on kexec |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104461645B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106126273A (en) * | 2016-06-16 | 2016-11-16 | 浪潮(北京)电子信息产业有限公司 | A kind of method of upgrading BIOS |
CN107450939A (en) * | 2016-06-01 | 2017-12-08 | 中兴通讯股份有限公司 | The method and device that a kind of RRU systems quickly start |
US10216649B2 (en) | 2016-02-29 | 2019-02-26 | Red Hat Israel, Ltd. | Kernel transitioning in a protected kernel environment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101582029A (en) * | 2009-06-05 | 2009-11-18 | 中兴通讯股份有限公司 | System and method for realizing embedded application |
CN102053848A (en) * | 2009-11-06 | 2011-05-11 | 英业达集团(天津)电子技术有限公司 | Automatic installation method for Linux operating system |
US20110271270A1 (en) * | 2010-04-28 | 2011-11-03 | Novell, Inc. | System and method for upgrading kernels in cloud computing environments |
CN102331947A (en) * | 2011-10-14 | 2012-01-25 | 中科创达软件科技(北京)有限公司 | Restarting method for Android system |
US8352933B2 (en) * | 2009-03-26 | 2013-01-08 | International Business Machines Corporation | Concurrent patching of operating systems |
-
2014
- 2014-12-17 CN CN201410788434.2A patent/CN104461645B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8352933B2 (en) * | 2009-03-26 | 2013-01-08 | International Business Machines Corporation | Concurrent patching of operating systems |
CN101582029A (en) * | 2009-06-05 | 2009-11-18 | 中兴通讯股份有限公司 | System and method for realizing embedded application |
CN102053848A (en) * | 2009-11-06 | 2011-05-11 | 英业达集团(天津)电子技术有限公司 | Automatic installation method for Linux operating system |
US20110271270A1 (en) * | 2010-04-28 | 2011-11-03 | Novell, Inc. | System and method for upgrading kernels in cloud computing environments |
CN102331947A (en) * | 2011-10-14 | 2012-01-25 | 中科创达软件科技(北京)有限公司 | Restarting method for Android system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10216649B2 (en) | 2016-02-29 | 2019-02-26 | Red Hat Israel, Ltd. | Kernel transitioning in a protected kernel environment |
CN107450939A (en) * | 2016-06-01 | 2017-12-08 | 中兴通讯股份有限公司 | The method and device that a kind of RRU systems quickly start |
CN106126273A (en) * | 2016-06-16 | 2016-11-16 | 浪潮(北京)电子信息产业有限公司 | A kind of method of upgrading BIOS |
CN106126273B (en) * | 2016-06-16 | 2019-05-10 | 浪潮(北京)电子信息产业有限公司 | A kind of method of upgrading BIOS |
Also Published As
Publication number | Publication date |
---|---|
CN104461645B (en) | 2017-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI581188B (en) | The way to load the driver and the embedded device | |
CN103942065B (en) | For updating the method and system of firmware compatibility data | |
CN102289397B (en) | Method and device for automatically restoring embedded system of set top box | |
US9507604B2 (en) | Boot method and boot system | |
CN108898230B (en) | Equipment management method and management server | |
KR20180137554A (en) | PATCH UPGRADE BASED FILE PROCESSING METHOD AND DEVICE, TERMINAL, | |
WO2019062703A1 (en) | Update method, and embedded system | |
CN103745158A (en) | Method and device for repairing system bugs | |
CN103530156A (en) | Method and device for dynamically loading and calling program | |
CN104679530A (en) | Server system and firmware updating method | |
CN103580908A (en) | Server configuration method and system | |
CN106325953A (en) | Weblogic cluster one-key automatic deployment method | |
CN105117268A (en) | Installing method and system for automatically installing linux systems | |
US9513762B1 (en) | Static content updates | |
CN103793248A (en) | Method and device for upgrading application program | |
TW201621647A (en) | Operating system updating method | |
CN103019764B (en) | The detection method of Andriod resource bag installability and system | |
JP6198229B2 (en) | Installation engine and package format for parallelizable and reliable installation | |
CN104461645A (en) | Kexec based firmware updating method and kexec based firmware updating device | |
CN105094878A (en) | System library file integration method and apparatus | |
CN103840968A (en) | Version updating method, version updating device and terminal equipment | |
CN103514014A (en) | Method for designing boot system of embedded terminal equipment | |
CN105204910A (en) | Script hot updating method and system | |
CN109726052A (en) | Method and device for realizing server thermal repair and electronic equipment | |
CN105573913A (en) | Program debugging method and program debugging system in optical network unit (ONU) system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: Kexec based firmware updating method and kexec based firmware updating device Effective date of registration: 20180625 Granted publication date: 20171114 Pledgee: Beijing first financing Company limited by guarantee Pledgor: BEIJING GEEK-GEEK TECHNOLOGY Co.,Ltd. Registration number: 2018990000486 |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171114 Termination date: 20211217 |