CN111324497B - Partition self-checking method and system for linux system - Google Patents

Partition self-checking method and system for linux system Download PDF

Info

Publication number
CN111324497B
CN111324497B CN202010104030.2A CN202010104030A CN111324497B CN 111324497 B CN111324497 B CN 111324497B CN 202010104030 A CN202010104030 A CN 202010104030A CN 111324497 B CN111324497 B CN 111324497B
Authority
CN
China
Prior art keywords
self
checking
partition
integrity
check
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010104030.2A
Other languages
Chinese (zh)
Other versions
CN111324497A (en
Inventor
周杰
程磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya 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 Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN202010104030.2A priority Critical patent/CN111324497B/en
Publication of CN111324497A publication Critical patent/CN111324497A/en
Application granted granted Critical
Publication of CN111324497B publication Critical patent/CN111324497B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a linux system partition self-checking method, which comprises the following steps: when a system enters a preset scene, a self-checking module is called to check the integrity of the system; and when the preset time period passes, calling a self-checking module to check the integrity of the system. Compared with the prior art, the application has the following beneficial effects: the condition of incomplete burning of a factory is solved through two modes of periodic self-checking of a system partition and active self-checking on demand and an abnormality alarming mechanism, and the first starting process of the system adopts the active self-checking on demand. And checking out the incomplete part of the mirror image burning of the system partition, and timely alarming and informing the production line staff to re-burn the equipment. The production defective rate caused by human errors can be shielded without depending on external instruments.

Description

Partition self-checking method and system for linux system
Technical Field
The application relates to the field of system inspection, in particular to a linux system partition self-checking method.
Background
The device based on the linux is started, generally needs to be started through bootloader, loads the linux kernel, and finally installs and starts the root file system. The above is collectively called as the startup phase of the linux system, and the startup program is stored in the system partition. The user program can be really entered after the above steps are completed. If any of the system partition images is corrupted, the device will not function properly. In the factory firmware burning stage, when a user system is upgraded or the equipment runs for a long time, the system partition image based on the flash memory medium can be damaged by non-human factors.
The current practice in the prior art mainly comprises the following steps:
the prior art generally guarantees the integrity of the upgraded firmware in the upgrading process, such as by checking a firmware signature, writing and reading a comparison mode. However, the above method has two problems.
1) Factory programming firmware relies entirely on verification of the programming tool at the time of programming. The human interference factor is relatively large, for example, the programming process only carries out erasing, the verification is missed or no verification failure is perceived.
2) And (3) a device running for a long time, wherein the flash memory medium is erased and written unstably or the flash memory reaches the service life to cause the mirror image damage of the system partition. Both conditions cannot detect that the system image is damaged in time, and the next time the equipment is restarted, the equipment is down.
Disclosure of Invention
The application mainly aims to provide a linux system partition self-checking method, which comprises the following steps:
when a system enters a preset scene, a self-checking module is called to check the integrity of the system;
and when the preset time period passes, calling a self-checking module to check the integrity of the system.
Optionally, the preset scene includes: and the initial start of the system and the upgrading of the system are completed.
Optionally, when the preset scenario is the initial start of the system, the calling the self-checking module includes:
the firmware of the system is programmed offline;
judging whether the system is electrified for the first time according to the flash storage flag bit;
when the judgment result is yes, calculating the signature value of the partition mirror image of the system for verification;
and when the verification fails, adopting a board-level peripheral alarm to prompt a user.
Optionally, when a preset time period elapses, invoking the self-checking module to check the integrity of the system includes: routine self-checking in a conventional starting stage and self-checking in a running process period.
Optionally, the routine start-up phase routine self-test includes:
acquiring mirror image calculation verification according to the storage address of the system partition in the bootloader stage of the equipment starting process;
transmitting the verification mark to a kernel through a reference;
when the start-up procedure has self-checked, routine self-checking is skipped.
Optionally, the run-time period self-test comprises:
starting self-checking alarm service in rootfs;
periodically checking whether the partition mirror image is good or not;
when an abnormality is found, an alarm prompts the user.
The application also provides a linux system partition self-checking system, which comprises:
the timing module is used for calculating a preset period;
the self-checking module is used for calling the self-checking module to check the integrity of the system when the system enters a preset scene; and when a preset time period passes, invoking a self-checking module to check the integrity of the system.
The application also discloses a computer device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, the processor implementing the method of any one of the above when executing the computer program.
The application also discloses a computer readable storage medium, a non-volatile readable storage medium having stored therein a computer program which, when executed by a processor, implements the method of any of the above.
The application also discloses a computer program product comprising computer readable code which, when executed by a computer device, causes the computer device to perform the method of any of the preceding claims.
Compared with the prior art, the application has the following beneficial effects:
the condition of incomplete burning of a factory is solved through two modes of periodic self-checking of a system partition and active self-checking on demand and an abnormality alarming mechanism, and the first starting process of the system adopts the active self-checking on demand. And checking out the incomplete part of the mirror image burning of the system partition, and timely alarming and informing the production line staff to re-burn the equipment. The production defective rate caused by human errors can be shielded without depending on external instruments.
After the equipment system is upgraded, the integrity of the firmware after the firmware is upgraded is checked by adopting active self-checking according to the requirement, and the problem that the firmware is incomplete due to abnormal system upgrade is solved. The dual-guarantee function can be achieved on the basis of upgrading and checking.
The device runs for a long time and periodically performs routine self-checking, so that the data damage caused by the service life of the storage medium or erasure can be solved. And before the equipment is not restarted, the self-detection mirror image damage is timely alarmed to prompt a user.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, are incorporated in and constitute a part of this specification. The drawings and their description are illustrative of the application and are not to be construed as unduly limiting the application. In the drawings:
FIG. 1 is a flow chart of a method for self-checking a partition of a linux system according to one embodiment of the application;
FIG. 2 is a flow chart of a method for self-checking a partition of a linux system according to one embodiment of the application;
FIG. 3 is a flow chart of a method for self-checking a partition of a linux system according to one embodiment of the present application;
FIG. 4 is a flow chart of a method for self-checking a partition of a linux system according to one embodiment of the present application;
FIG. 5 is a schematic diagram of a computer device according to one embodiment of the application; and
FIG. 6 is a schematic diagram of a computer-readable storage medium according to one embodiment of the application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Referring to fig. 1 to 4, an embodiment of the present application provides a method for partition self-checking of a linux system, including:
s2: when a system enters a preset scene, a self-checking module is called to check the integrity of the system;
s4: and when the preset time period passes, calling a self-checking module to check the integrity of the system.
In an embodiment of the present application, in the above method for partition self-checking of a linux system, the preset scene includes: and the initial start of the system and the upgrading of the system are completed.
In an embodiment of the present application, in the above method for partition self-checking of a linux system, when the preset scene is the initial start of the system, invoking the self-checking module includes:
the firmware of the system is programmed offline;
judging whether the system is electrified for the first time according to the flash storage flag bit;
when the judgment result is yes, calculating the signature value of the partition mirror image of the system for verification;
and when the verification fails, adopting a board-level peripheral alarm to prompt a user.
In an embodiment of the present application, in the above-mentioned linux system partition self-checking method, when a preset time period elapses, invoking a self-checking module to check the integrity of the system includes: routine self-checking in a conventional starting stage and self-checking in a running process period.
In an embodiment of the present application, in the above method for performing a partition self-test on a linux system, the routine self-test in the conventional startup phase includes:
acquiring mirror image calculation verification according to the storage address of the system partition in the bootloader stage of the equipment starting process;
transmitting the verification mark to a kernel through a reference;
when the start-up procedure has self-checked, routine self-checking is skipped.
In an embodiment of the present application, in the above-mentioned linux system partition self-checking method, the running process cycle self-checking includes:
starting self-checking alarm service in rootfs;
periodically checking whether the partition mirror image is good or not;
when an abnormality is found, an alarm prompts the user.
The application also provides a linux system partition self-checking system, which comprises:
the timing module is used for calculating a preset period;
the self-checking module is used for calling the self-checking module to check the integrity of the system when the system enters a preset scene; and when a preset time period passes, invoking a self-checking module to check the integrity of the system.
For example, when the compiling system generates a system partition image, sign content information is signed at the same time.
On-demand self-checking is to actively call to a self-checking module with a user specific scene.
After the factory firmware is programmed offline, the device is judged to be electrified for the first time according to the flash storage zone bit, the factory self-checking requirement is met, and the calculation of the signature value of the partition mirror image of the system is started to verify. And if the verification fails, prompting a user by adopting a board-level peripheral alarm.
After the user upgrades the system, the self-checking module is actively called for checking the signature in a self-checking mode according to the requirement.
The periodic routine self-checking mode is divided into routine self-checking at a conventional starting stage and periodic self-checking in an operation process.
And in the bootloader stage of the device starting process, firstly obtaining mirror image calculation verification according to the storage address of the system partition. The check mark is passed to kernel. If the start-up procedure has already self-checked, the following module skips routine self-checking.
After the equipment operates, a self-checking alarm service is started at rootfs. The quality of the partition mirror image is checked periodically. If an abnormality is found, an alarm prompts the user. Such as prompting the user to upgrade the device as soon as possible.
Compared with the prior art, the application has the following beneficial effects:
the condition of incomplete burning of a factory is solved through two modes of periodic self-checking of a system partition and active self-checking on demand and an abnormality alarming mechanism, and the first starting process of the system adopts the active self-checking on demand. And checking out the incomplete part of the mirror image burning of the system partition, and timely alarming and informing the production line staff to re-burn the equipment. The production defective rate caused by human errors can be shielded without depending on external instruments.
After the equipment system is upgraded, the integrity of the firmware after the firmware is upgraded is checked by adopting active self-checking according to the requirement, and the problem that the firmware is incomplete due to abnormal system upgrade is solved. The dual-guarantee function can be achieved on the basis of upgrading and checking.
The device runs for a long time and periodically performs routine self-checking, so that the data damage caused by the service life of the storage medium or erasure can be solved. And before the equipment is not restarted, the self-detection mirror image damage is timely alarmed to prompt a user.
Referring to fig. 5, the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, where the processor implements the method of any one of the above when executing the computer program.
Referring to fig. 6, a computer readable storage medium, a non-volatile readable storage medium, has stored therein a computer program which, when executed by a processor, implements the method of any of the above.
A computer program product comprising computer readable code which, when executed by a computer device, causes the computer device to perform the method of any of the preceding claims.
It will be apparent to those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (7)

1. The method for the partition self-checking of the linux system is characterized by comprising the following steps of:
when a system enters a preset scene, a self-checking module is called to check the integrity of the system, wherein the preset scene comprises the following steps: when the preset scene is the initial start of the system, the calling the self-checking module comprises the following steps:
the firmware of the system is programmed offline;
judging whether the system is electrified for the first time according to the flash storage flag bit;
when the judgment result is yes, calculating the signature value of the partition mirror image of the system for verification;
when the verification fails, adopting a board-level peripheral alarm to prompt a user;
and when the preset time period passes, calling a self-checking module to check the integrity of the system.
2. The linux system partition self-checking method according to claim 1, wherein when a preset time period elapses, invoking a self-checking module to check the integrity of the system comprises: routine self-checking in a conventional starting stage and self-checking in a running process period.
3. The linux system partition self-checking method according to claim 2, wherein the routine start-up phase routine self-checking includes:
acquiring mirror image calculation verification according to the storage address of the system partition in the bootloader stage of the equipment starting process;
transmitting the verification mark to a kernel through a reference;
when the start-up procedure has self-checked, routine self-checking is skipped.
4. The linux system partition self-checking method according to claim 3, wherein the running process cycle self-checking includes:
starting self-checking alarm service in rootfs;
periodically checking whether the partition mirror image is good or not;
when an abnormality is found, an alarm prompts the user.
5. The linux system partition self-checking system is characterized by comprising:
the timing module is used for calculating a preset period;
the self-checking module is used for calling the self-checking module to check the integrity of the system when the system enters a preset scene; and when a preset time period passes, invoking a self-checking module to check the integrity of the system, wherein the preset scene comprises: when the preset scene is the initial start of the system, the calling the self-checking module comprises the following steps:
the firmware of the system is programmed offline;
judging whether the system is electrified for the first time according to the flash storage flag bit;
when the judgment result is yes, calculating the signature value of the partition mirror image of the system for verification;
and when the verification fails, adopting a board-level peripheral alarm to prompt a user.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, wherein the processor implements the method of any of claims 1-4 when executing the computer program.
7. A computer readable storage medium, in which a computer program is stored which, when executed by a processor, implements the method according to any of claims 1-4.
CN202010104030.2A 2020-02-20 2020-02-20 Partition self-checking method and system for linux system Active CN111324497B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010104030.2A CN111324497B (en) 2020-02-20 2020-02-20 Partition self-checking method and system for linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010104030.2A CN111324497B (en) 2020-02-20 2020-02-20 Partition self-checking method and system for linux system

Publications (2)

Publication Number Publication Date
CN111324497A CN111324497A (en) 2020-06-23
CN111324497B true CN111324497B (en) 2023-10-27

Family

ID=71172854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010104030.2A Active CN111324497B (en) 2020-02-20 2020-02-20 Partition self-checking method and system for linux system

Country Status (1)

Country Link
CN (1) CN111324497B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591376B1 (en) * 2000-03-02 2003-07-08 Hewlett-Packard Development Company, L.P. Method and system for failsafe recovery and upgrade of an embedded operating system
KR20080023841A (en) * 2006-09-12 2008-03-17 카시와야마 토요히테 The method of firmware upgrade and automatic firmware recovery system
CN103457974A (en) * 2012-06-01 2013-12-18 中兴通讯股份有限公司 Safety control method and device for virtual machine mirror images
CN106126116A (en) * 2016-06-16 2016-11-16 北京航空航天大学 A kind of integrity measurement optimization method of virtual machine image file
CN106384052A (en) * 2016-08-26 2017-02-08 浪潮电子信息产业股份有限公司 Method for realizing BMC U-boot trusted boot control
CN106648953A (en) * 2016-12-30 2017-05-10 郑州云海信息技术有限公司 File integrity checking method and device
CN107679423A (en) * 2017-10-10 2018-02-09 上海闻泰电子科技有限公司 Partition integrity inspection method and device
CN108399339A (en) * 2018-02-12 2018-08-14 广东为辰信息科技有限公司 A kind of credible startup method based on safety chip
CN110263545A (en) * 2019-05-22 2019-09-20 西安理工大学 A kind of start-up course integrity measurement detection method based on android system
CN110334515A (en) * 2019-07-05 2019-10-15 北京可信华泰信息技术有限公司 A kind of method and device generating measurement report based on credible calculating platform

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7953980B2 (en) * 2005-06-30 2011-05-31 Intel Corporation Signed manifest for run-time verification of software program identity and integrity
US20090271780A1 (en) * 2008-04-24 2009-10-29 Moschip Semiconductor Technology Limited Automatic complete firmware upgrade
US10073966B2 (en) * 2013-04-29 2018-09-11 Sri International Operating system-independent integrity verification
CN104142838A (en) * 2014-07-02 2014-11-12 青岛海信移动通信技术股份有限公司 Method and equipment for starting up mobile communication terminal
US10740186B2 (en) * 2017-05-15 2020-08-11 The Boeing Company High data integrity processing system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591376B1 (en) * 2000-03-02 2003-07-08 Hewlett-Packard Development Company, L.P. Method and system for failsafe recovery and upgrade of an embedded operating system
KR20080023841A (en) * 2006-09-12 2008-03-17 카시와야마 토요히테 The method of firmware upgrade and automatic firmware recovery system
CN103457974A (en) * 2012-06-01 2013-12-18 中兴通讯股份有限公司 Safety control method and device for virtual machine mirror images
CN106126116A (en) * 2016-06-16 2016-11-16 北京航空航天大学 A kind of integrity measurement optimization method of virtual machine image file
CN106384052A (en) * 2016-08-26 2017-02-08 浪潮电子信息产业股份有限公司 Method for realizing BMC U-boot trusted boot control
CN106648953A (en) * 2016-12-30 2017-05-10 郑州云海信息技术有限公司 File integrity checking method and device
CN107679423A (en) * 2017-10-10 2018-02-09 上海闻泰电子科技有限公司 Partition integrity inspection method and device
CN108399339A (en) * 2018-02-12 2018-08-14 广东为辰信息科技有限公司 A kind of credible startup method based on safety chip
CN110263545A (en) * 2019-05-22 2019-09-20 西安理工大学 A kind of start-up course integrity measurement detection method based on android system
CN110334515A (en) * 2019-07-05 2019-10-15 北京可信华泰信息技术有限公司 A kind of method and device generating measurement report based on credible calculating platform

Also Published As

Publication number Publication date
CN111324497A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN104025047B (en) Information processor, information processing method and computer program
CN106095620B (en) A kind of development approach of built-in Linux partition holding
EP3879399B1 (en) Method and apparatus for upgrading vehicle-mounted tbox, device, and storage medium
CN110737481A (en) Starting method of embedded LINUX operating system based on multiple backup bootstrap programs
CN103577201A (en) Embedded dual system updating method and system
CN114691025A (en) Log recording method, device, equipment and storage medium
CN111045712A (en) Single system upgrading method and system with backup function
CN111651304B (en) Software recovery method and device based on double-core intelligent ammeter and computer equipment
CN111552491A (en) Method, device and storage medium for upgrading firmware of transfer equipment of mobile carrier
CN107168750B (en) Firmware upgrade protection method and system
CN113157303A (en) Upgrading method, embedded system, terminal and computer storage medium
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN115237647A (en) Firmware abnormity repairing method and device, electronic equipment and computer storage medium
CN111324497B (en) Partition self-checking method and system for linux system
CN113220319A (en) Data updating method and device and vehicle
CN111273928B (en) Bootloader design method for self-upgrading
CN112394965B (en) Battery management system upgrade and operation method, controller, battery management system and storage medium
CN113114730B (en) Upgrading method and device, terminal equipment and storage medium
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
CN114356658A (en) Processing method of firmware upgrading exception, computer equipment and readable storage medium
CN114398087A (en) Method for improving running stability of single chip microcomputer after program updating and single chip microcomputer
CN117472291B (en) Data block verification method and device, storage medium and electronic equipment
CN116185461B (en) Firmware upgrading method and system
CN110795294B (en) Equipment abnormality analysis method, analysis device, analysis system, and readable storage medium
CN114461254A (en) Software program updating method and related device

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
GR01 Patent grant
GR01 Patent grant