CN108958767B - Safety mode automatic upgrading method based on minimum system backup implementation - Google Patents

Safety mode automatic upgrading method based on minimum system backup implementation Download PDF

Info

Publication number
CN108958767B
CN108958767B CN201810643037.4A CN201810643037A CN108958767B CN 108958767 B CN108958767 B CN 108958767B CN 201810643037 A CN201810643037 A CN 201810643037A CN 108958767 B CN108958767 B CN 108958767B
Authority
CN
China
Prior art keywords
upgrading
environment variable
upgrade
mode
minimum
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
CN201810643037.4A
Other languages
Chinese (zh)
Other versions
CN108958767A (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.)
Xiamen Yealink Network Technology Co Ltd
Original Assignee
Xiamen Yealink Network 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 Xiamen Yealink Network Technology Co Ltd filed Critical Xiamen Yealink Network Technology Co Ltd
Priority to CN201810643037.4A priority Critical patent/CN108958767B/en
Publication of CN108958767A publication Critical patent/CN108958767A/en
Application granted granted Critical
Publication of CN108958767B publication Critical patent/CN108958767B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention relates to a safety mode automatic upgrading method based on minimum system backup, which is characterized in that the safety mode automatic upgrading method is realized in an automatic mode, when the upgrading fails, an environment variable bootmode is set to be equal to a safemode, so that the safety mode upgrading is carried out, and firmware is upgraded in a url mode. After the safe mode is started, the target firmware can be automatically upgraded again without redundant operation of a user, and user experience is optimized. In addition, the invention carries out the backup of the minimum system after the firmware is upgraded, only needs to backup the basic system and the upgrading module, and omits a large number of programs of a business layer.

Description

Safety mode automatic upgrading method based on minimum system backup implementation
Technical Field
The invention relates to the technical field of system upgrading, in particular to a safety mode automatic upgrading method based on minimum system backup.
Background
At present, many electronic products on the market have a firmware upgrading function, and due to the fact that a certain time is needed for firmware to be written into a flash memory during upgrading, equipment is easy to change into a brick and cannot be started by itself when power is removed or tripping is caused in the writing process.
In the prior art, some products have a recovery and upgrade function, for example, when a computer is upgraded and changed into a brick, an optical drive or a usb disk is mostly used to reinstall a system, that is, the computer enters an upgrade boot program first, and then the optical drive or the usb disk with a system file is used to manually recover and upgrade the system. And the time-varying brick is also a use type method like the iPhone mobile phone upgrading, and the upgrading is recovered by means of an iTunes tool. The same points of this type of recovery upgrade scheme as the secure mode automatic upgrade scheme described herein are: and after half of the upgrade is powered off, the system can be upgraded to the target system again. Still other users may use a function to back up the current system, such as a one-key ghost function, which may be used to restore the original backed up system after upgrading the tile.
For the product which is restored and upgraded by the bootstrap program, when the upgrade is changed into the brick, the product needs to be upgraded manually by means of a disk tool, the operation is complicated, and the user experience is poor. For the product which uses the backup function to recover and upgrade, the required backup space is large, and the system backup is also manually carried out in advance, so the operation is complicated.
Disclosure of Invention
The invention aims to provide a safety mode automatic upgrading method based on minimum system backup, which can automatically complete firmware upgrading after firmware upgrading fails.
In order to achieve the purpose, the invention adopts the technical scheme that:
a safety mode automatic upgrading method based on minimum system backup is specifically as follows:
when the firmware is upgraded in an automatic mode, setting an environment variable url for storing a url path; after upgrading is started, if upgrading is successful, setting an environment variable update state to be 0; if the upgrade fails, setting an environment variable update state to be 1;
after upgrading is finished, when the system is restarted to uboot, judging whether the environment variable update state is 1, if not, normally starting the system; if the number of the nodes is 1, the upgrading is failed, an environment variable bootmode is set to be equal to safemode, bin and rfs are read from the partition to a memory to guide the system, and the safe mode upgrading is started;
after entering a safe mode for upgrading, reading a value of a bootmode from an environment variable, if the value of the bootmode is equal to a safemode, upgrading in a url mode, namely reading a value of a url from the environment variable, and then downloading firmware through a url path for upgrading;
and after the upgrade is successful, the system performs the action of automatically backing up the minimum system, if the power is cut off when the minimum system is backed up, the system remembers the corresponding state, and the uboot bootstrap program backs up the minimum system again according to the state when the minimum system is powered on again next time.
After the scheme is adopted, the invention has the following beneficial effects:
1. the invention can automatically finish firmware upgrading after firmware upgrading fails, namely, the invention enters a safety mode after upgrading fails, and the firmware can be automatically upgraded again without redundant operation of a user after the safety mode is started, thereby optimizing user experience.
2. The invention automatically performs minimum system backup after the upgrade is finished, only needs to backup the basic system and the upgrade module, and omits a large number of programs of a service layer, thereby reducing the occupied space of backup.
Drawings
FIG. 1 is a flowchart of the inventive autop upgrade;
FIG. 2 is a flow chart of the security mode upgrade of the present invention.
Detailed Description
The invention discloses a safe mode automatic upgrading method based on minimum system backup, when a user starts to upgrade through auto provisioning, upgrading configuration and upgrading marks are written into a flash memory, and if the firmware upgrading process is interrupted, the upgrading marks are not cleared. When the device is started next time, the system boot program detects that the upgrade flag is set, and automatically boots the minimum system to be backed up, namely, enters a safety mode to complete the automatic upgrade of the firmware, wherein the minimum system comprises an operating system, a file system and a minimum upgrade module.
The invention discloses a safety mode automatic upgrading method based on minimum system backup, which comprises the following specific steps:
as shown in fig. 1, when a user upgrades firmware by an automatic method, an environment variable url is set to store a url path. After upgrading is started, if upgrading is successful, setting an environment variable update state to be 0; when the upgrade fails, the environment variable update state is set to 1. After upgrading is finished, when the system is restarted to uboot, whether the environment variable update state is 1 or not is judged, and if not, the system is normally started. If the value is 1, the upgrade is failed, the environment variable bootmode is set to be equal to safemode, bin and rfs are read from the partition, the system is booted in the memory, and the secure mode upgrade is entered.
As shown in fig. 2, after entering the secure mode upgrade, reading a value of the bootmode from the environment variable, and if the value of the bootmode is equal to the safemode, upgrading in a url manner, that is, reading a value of the url from the environment variable, and then downloading the firmware through the url path for upgrading.
After the upgrade is successful, the minimum system automatic backup action is performed, that is, the upgraded data in the flash partition is copied to a specified other flash partition (the partition is a partition specially used for backup), and the backup contents include an operating system, a file system and a minimum upgrade module (the minimum upgrade module does not include modules of all service layers), so that the next upgrade variable brick can enter a safe mode. And if the power is cut off when the minimum system is backed up, the system can remember the corresponding state, and the uboot bootstrap program can be backed up again for the minimum system according to the state when the minimum system is powered on again next time, so that the sustainability is ensured.
As shown in fig. 2, when bootmode is not equal to safemode, other upgrading methods are used, such as tftp network recovery upgrading and USB recovery upgrading. The two upgrading modes can also recover the equipment which has failed to be upgraded (the equipment which has failed to be upgraded can enter the two upgrading modes by pressing a shortcut key for the starting time), but the two upgrading modes belong to manual recovery. When the bootmode is equal to the tftpmode, because the upgrade failure is only system damage, but the bootloader bootstrap program is not damaged, the target upgrade firmware can be downloaded in the bootloader bootstrap program in a network communication mode of tftp to perform recovery upgrade. When the bootmode is equal to the usbmode, because the upgrade failure is only system damage, but the bootloader boot program is not damaged, the target upgrade firmware can be downloaded from the U disk in the bootloader boot program in a usb communication mode for recovery upgrade.
Because the value of the environment variable bootmode is set as safemode when the upgrading fails, the value of the environment variable bootmode is always equal to safemode when the upgrading is recovered after the upgrading fails when the firmware is upgraded by adopting the method, namely, the upgrading is always in a safe mode when the upgrading is replied, and the automatic upgrading of the firmware is completed.
The key point of the invention is that the invention is upgraded by an automatic mode, when the upgrade fails, the environment variable bootmode is set to be equal to the safemode, thereby entering a safe mode for upgrading, and upgrading the firmware by a url mode. After the safe mode is started, the target firmware can be automatically upgraded again without redundant operation of a user, and user experience is optimized. In addition, the invention carries out the backup of the minimum system after the firmware is upgraded, only needs to backup the basic system and the upgrading module, and omits a large number of programs of a business layer.
The above description is only exemplary of the present invention and is not intended to limit the technical scope of the present invention, so that any minor modifications, equivalent changes and modifications made to the above exemplary embodiments according to the technical spirit of the present invention are within the technical scope of the present invention.

Claims (1)

1. A safety mode automatic upgrading method based on minimum system backup is characterized in that: the method comprises the following specific steps:
when the firmware is upgraded in an automatic mode, setting an environment variable url for storing a url path; after upgrading is started, if upgrading is successful, setting an environment variable update state to be 0; if the upgrade fails, setting an environment variable update state to be 1;
after upgrading is finished, when the system is restarted to uboot, judging whether the environment variable update state is 1, if not, normally starting the system; if the number of the nodes is 1, the upgrading is failed, an environment variable bootmode is set to be equal to safemode, bin and rfs are read from the partition to a memory to guide the system, and the safe mode upgrading is started;
after entering a safe mode for upgrading, reading a value of a bootmode from an environment variable, if the value of the bootmode is equal to a safemode, upgrading in a url mode, namely reading a value of a url from the environment variable, and then downloading firmware through a url path for upgrading;
and after the upgrade is successful, the system performs the action of automatically backing up the minimum system, wherein the action of automatically backing up the minimum system comprises copying the upgraded data in the flash partition to a specified other flash partition, the backup content comprises an operating system, a file system and a minimum upgrade module, the minimum upgrade module is a module without all service layers, if the minimum system is backed up, the system remembers a corresponding state, and when the minimum system is powered on again next time, the uboot bootstrap program backs up the minimum system again according to the state.
CN201810643037.4A 2018-06-21 2018-06-21 Safety mode automatic upgrading method based on minimum system backup implementation Active CN108958767B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810643037.4A CN108958767B (en) 2018-06-21 2018-06-21 Safety mode automatic upgrading method based on minimum system backup implementation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810643037.4A CN108958767B (en) 2018-06-21 2018-06-21 Safety mode automatic upgrading method based on minimum system backup implementation

Publications (2)

Publication Number Publication Date
CN108958767A CN108958767A (en) 2018-12-07
CN108958767B true CN108958767B (en) 2022-04-26

Family

ID=64491622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810643037.4A Active CN108958767B (en) 2018-06-21 2018-06-21 Safety mode automatic upgrading method based on minimum system backup implementation

Country Status (1)

Country Link
CN (1) CN108958767B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815053B (en) * 2019-01-04 2021-04-06 厦门亿联网络技术股份有限公司 Method for realizing IP phone multi-mode system upgrade failure recovery
CN110069928A (en) * 2019-04-17 2019-07-30 Oppo广东移动通信有限公司 Safe mode access method and Related product applied to Android system
CN110474793A (en) * 2019-07-10 2019-11-19 锐捷网络股份有限公司 A kind of upgrade method and device of the network equipment
CN111273918B (en) * 2020-01-15 2023-09-15 深圳英飞拓仁用信息有限公司 Remote upgrading method of embedded video camera
CN112269692A (en) * 2020-11-25 2021-01-26 杭州视洞科技有限公司 Remote upgrading power-off self-recovery mechanism for network camera
CN112732310A (en) * 2021-01-22 2021-04-30 深圳市信义科技有限公司 Firmware upgrading method, system, equipment and medium based on embedded boot partition

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101782858B (en) * 2010-02-22 2013-04-24 建汉科技股份有限公司 System boot method for network device
CN103533534B (en) * 2013-10-15 2017-02-01 厦门亿联网络技术股份有限公司 Firmware wireless upgrading method for DECT (Digital Enhanced Cordless Telecommunications) mobile phone
CN104915226B (en) * 2015-05-21 2018-12-14 北京星网锐捷网络技术有限公司 A kind of network device software starting method, apparatus and the network equipment
CN106325916A (en) * 2016-01-27 2017-01-11 上海华测导航技术股份有限公司 System upgrading method of GNSS (Global Navigation Satellite System) receiver

Also Published As

Publication number Publication date
CN108958767A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN108958767B (en) Safety mode automatic upgrading method based on minimum system backup implementation
CN103064715A (en) Remote upgrade method and system for automatic drive test systems
CN110083374B (en) Upgrade rollback method, system and terminal equipment
CN107493290B (en) OTA (over the air) upgrading method for Android smart television system software
CN102163167A (en) Method and device for rescuing system
CN102662798A (en) Data recovery method and terminal for Android system
CN102508686A (en) Method and system for realizing safe upgrading of system
CN103324507A (en) Method and apparatus for updating terminal preset application program
CN101639785A (en) Method and device for software updating
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN108874459B (en) Rapid starting method and device based on virtualization technology
CN104657161A (en) Method and device for updating firmware of mobile terminal
TW201621647A (en) Operating system updating method
CN102521289A (en) File synchronization method, device and system
CN104572354A (en) Backup and restoration method for operating system based on restoration service and equipment thereof
CN104951348A (en) Interruptible recovery upgrading method and device
CN103997684A (en) Method and device for updating operating system
CN103488516A (en) System repair method and electronic equipment
CN105094873A (en) Handheld terminal system switching method and device
CN113805926A (en) Software upgrading method, vehicle and computer readable storage medium
CN112433739B (en) Firmware upgrading method
CN106775874B (en) System upgrading method of terminal equipment
CN106933604B (en) System upgrading method and device
CN104765631A (en) Restoration method and device for application program of mobile terminal
CN109871334B (en) Cable modem and method of operation

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