CN112083944A - System upgrading device and method for Linux equipment - Google Patents

System upgrading device and method for Linux equipment Download PDF

Info

Publication number
CN112083944A
CN112083944A CN202010955198.4A CN202010955198A CN112083944A CN 112083944 A CN112083944 A CN 112083944A CN 202010955198 A CN202010955198 A CN 202010955198A CN 112083944 A CN112083944 A CN 112083944A
Authority
CN
China
Prior art keywords
file
upgrade
upgrading
kernel
linux
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
CN202010955198.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.)
Shenzhen Ex Lighting Technology Holdings Co Ltd
Original Assignee
Shenzhen Ex Lighting Technology Holdings 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 Shenzhen Ex Lighting Technology Holdings Co Ltd filed Critical Shenzhen Ex Lighting Technology Holdings Co Ltd
Priority to CN202010955198.4A priority Critical patent/CN112083944A/en
Publication of CN112083944A publication Critical patent/CN112083944A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures

Abstract

The embodiment of the invention provides a system upgrading device and method of Linux equipment, wherein the device comprises: the data receiving module is used for receiving an upgrading data packet and an upgrading instruction sent by a corresponding external device, wherein the upgrading data packet comprises an upgrading file and an upgrading tool, and the upgrading tool is a self-starting kernel file with a file system compiled in advance; the file processing module is used for decompressing the upgrading data packet according to the upgrading instruction and respectively programming the upgrading file and the upgrading tool to an opt user partition and a kernel partition of the Linux equipment; and the upgrading module is used for restarting the Linux equipment, loading the kernel partition of the Linux equipment with the self-starting kernel file to execute the file system, mounting the opt user partition of the Linux equipment, reading the upgrading file by the file system, replacing the original system file of the Linux equipment with the upgrading file, restoring the conventional starting parameters after the file replacement is finished, and restarting the Linux equipment. The method and the system can effectively upgrade the Linux equipment and reduce the burden of the root file system.

Description

System upgrading device and method for Linux equipment
Technical Field
The embodiment of the invention relates to the technical field of Linux equipment, in particular to a system upgrading device and method of the Linux equipment.
Background
Generally, as the system of the Linux device is continuously optimized, the Linux device often needs to perform system upgrade. Due to the characteristics of the Linux equipment, after the Linux equipment starts a root file system, the existing version of the root file system upgrade file cannot be directly burnt to the root file system partition on line, so the existing system online upgrade method of the Linux equipment generally comprises the steps of firstly downloading the new version of the root file system upgrade file to a local memory through a network, then burning the root file system upgrade file to a newly expanded root file system backup partition, then setting a flag bit, and guiding a kernel of the Linux equipment to be hung to the root file system of the file system backup partition after the Linux equipment is restarted, so that the Linux equipment is updated. However, in the upgrading process, since an additional root file system backup area is needed, and the space occupied by the root file system partition is generally relatively large, if the application data partition is reduced by additionally adding the root file system backup area, especially for the Linux device with a compact storage space, it is difficult to upgrade the root file system online, and finally, the upgrading fails.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a system upgrade apparatus for Linux devices, which can effectively upgrade the Linux devices and reduce the burden of a root file system.
The technical problem to be further solved in the embodiments of the present invention is to provide a method for upgrading a system of a Linux device, which can effectively upgrade the Linux device and reduce the burden of a root file system.
In order to solve the above technical problem, an embodiment of the present invention provides the following technical solutions: a system upgrading device of Linux equipment comprises:
the data receiving module is used for receiving an upgrading data packet and an upgrading instruction sent by a corresponding external device, wherein the upgrading data packet comprises an upgrading file and an upgrading tool, and the upgrading tool is a self-starting kernel file with a file system compiled in advance;
the file processing module is used for decompressing the upgrading data packet according to the upgrading instruction and respectively programming the upgrading file and the upgrading tool to an opt user partition and a kernel partition of the Linux equipment; and
and the upgrading module is used for restarting the Linux equipment, loading the self-starting kernel file into a kernel partition of the Linux equipment to execute the file system, mounting the opt user partition into the Linux equipment, reading the upgrading file by the file system, replacing an original system file of the Linux equipment with the upgrading file, restoring the conventional starting parameters after the file replacement is finished, and restarting the Linux equipment.
Further, the upgrade module includes:
the upgrading starting parameter setting unit is used for setting upgrading starting parameters and sending a restarting instruction after the setting is finished, and the upgrading starting parameters enable the Linux equipment to load the self-starting kernel file by the kernel partition in the next starting process so as to execute the file system;
the mounting unit is used for generating a mounting instruction to control the Linux equipment to mount the opt user partition so as to read the upgrade file, and the upgrade file at least comprises a new version kernel file and a new version root file;
the file upgrading unit is used for respectively programming the new version kernel file and the new version root file to a kernel partition and a rootfs partition of the Linux equipment so as to replace the old version kernel file and the old version root file; and
and the starting parameter recovery unit is used for recovering the starting parameters of the Linux equipment into the conventional starting parameters and then sending out a restarting instruction.
Further, the file processing module includes:
the file decompression unit is used for decompressing the upgrading data packet according to the upgrading instruction to obtain the upgrading file and an upgrading tool; and
and the file programming unit is used for respectively programming the upgrade file and the upgrade tool to an opt user partition and a kernel partition of the Linux equipment.
Further, the self-starting kernel file is a kernel file which is removed from the drive module and is pre-configured with the starting parameters.
Further, the data receiving module comprises:
the upgrading data packet receiving unit is used for receiving an upgrading data packet sent by an external file input device based on an FTP protocol; and an instruction receiving unit for receiving an upgrade instruction transmitted from an external instruction input device based on a TCP protocol.
On the other hand, in order to solve the above technical problem, an embodiment of the present invention provides the following technical solutions: a system upgrading method of Linux equipment comprises the following steps:
receiving an upgrade data packet and an upgrade instruction sent by a corresponding external device, wherein the upgrade data packet comprises an upgrade file and an upgrade tool, and the upgrade tool is a self-starting kernel file with a file system compiled in advance;
decompressing the upgrading data packet according to the upgrading instruction, and respectively programming the upgrading file and the upgrading tool to an opt user partition and a kernel partition of the Linux equipment; and
restarting the Linux equipment, loading the self-starting kernel file into a kernel partition of the Linux equipment to execute the file system, mounting the opt user partition into the Linux equipment, reading the upgrade file by the file system, replacing the original system file of the Linux equipment with the upgrade file, restoring the conventional starting parameters after the file replacement is finished, and restarting the Linux equipment.
Further, the restarting the Linux device and loading the self-starting kernel file into the kernel partition of the Linux device to execute the file system, mounting the opt user partition of the Linux device, reading the upgrade file by the file system and replacing the original system file of the Linux device with the upgrade file, and restoring the conventional starting parameters after the file replacement is completed, and then restarting the Linux device specifically includes:
setting an upgrade starting parameter and sending a restart instruction after the setting is finished, wherein the upgrade starting parameter enables the Linux equipment to load the self-starting kernel file by a kernel partition in the next starting process so as to execute the file system;
generating a mounting instruction to control the Linux equipment to mount the opt user partition so as to read the upgrade file, wherein the upgrade file at least comprises a new version kernel file and a new version root file;
respectively programming the new version kernel file and the new version root file to a kernel partition and a rootfs partition of the Linux equipment to replace an old version kernel file and an old version root file; and
and restoring the starting parameters of the Linux equipment into the conventional starting parameters, and then sending a restarting instruction.
Further, the decompressing the upgrade data packet according to the upgrade instruction, and respectively programming the upgrade file and the upgrade tool to the opt user partition and the kernel partition of the Linux device specifically includes:
decompressing the upgrade data packet according to the upgrade instruction to obtain the upgrade file and an upgrade tool; and
and respectively programming the upgrade file and the upgrade tool to an opt user partition and a kernel partition of the Linux equipment.
Further, the self-starting kernel file is a kernel file which is removed from the drive module and is pre-configured with the starting parameters.
Further, the receiving the upgrade data packet and the upgrade instruction sent by the corresponding external device specifically includes:
receiving an upgrading data packet sent by an external file input device based on an FTP protocol; and
and receiving an upgrading instruction sent by an external instruction input device based on the TCP protocol.
After the technical scheme is adopted, the embodiment of the invention at least has the following beneficial effects: the embodiment of the invention firstly receives an upgrading and upgrading instruction sent by a corresponding external device through a data receiving module, the upgrading data packet comprises an upgrading file and an upgrading tool, after the upgrading data packet is received, a file processing module decompresses the upgrading data packet according to the upgrading instruction, the upgrading file and the upgrading tool are respectively burnt to an opt user partition and a kernel partition of the Linux equipment, the upgrading file is not stored in the root file system partition of the Linux equipment any more, the storage burden of the root file system partition is reduced, finally, the upgrading module restarts the Linux equipment and the kernel partition of the Linux equipment loads the self-starting kernel file so as to execute the file system, the Linux equipment is hung to the opt user partition, the upgrading file is read by the file system and the original system file of the Linux equipment is replaced by the upgrading file, and after the file replacement is finished, the conventional starting parameters are restored, and the Linux equipment is restarted again, so that the Linux equipment is upgraded, and the burden of a root file system can be reduced.
Drawings
Fig. 1 is a schematic structural block diagram of an alternative embodiment of the system upgrading apparatus of the Linux device of the present invention.
Fig. 2 is a specific schematic block diagram of an upgrade module according to an alternative embodiment of the system upgrade apparatus for Linux devices of the present invention.
Fig. 3 is a schematic structural block diagram of still another alternative embodiment of the system upgrading apparatus for Linux devices of the present invention.
Fig. 4 is a specific schematic block diagram of a file processing module according to an alternative embodiment of the system upgrading apparatus for Linux devices of the present invention.
Fig. 5 is a specific schematic block diagram of a data receiving module according to an alternative embodiment of the system upgrading apparatus for Linux devices of the present invention.
FIG. 6 is a flowchart illustrating steps of an alternative embodiment of a system upgrade method for Linux devices according to the present invention.
Fig. 7 is a specific flowchart of step S3 of an alternative embodiment of the system upgrading method for Linux devices according to the present invention.
Fig. 8 is a specific flowchart of step S2 of an alternative embodiment of the system upgrading method for Linux devices according to the present invention.
Detailed Description
The present application will now be described in further detail with reference to the accompanying drawings and specific examples. It should be understood that the following illustrative embodiments and description are only intended to explain the present invention, and are not intended to limit the present invention, and features of the embodiments and examples in the present application may be combined with each other without conflict.
As shown in fig. 1, an alternative embodiment of the present invention provides a system upgrading apparatus 1 for a Linux device, including: the data receiving module 10 is configured to receive an upgrade data packet and an upgrade instruction sent by a corresponding external device 3, where the upgrade data packet includes an upgrade file and an upgrade tool, and the upgrade tool is a self-starting kernel file pre-compiled with a file system; the file processing module 12 is configured to decompress the upgrade data packet according to the upgrade instruction, and respectively write the upgrade file and the upgrade tool to the opt user partition 5 and the kernel partition 7 of the Linux device; and
and the upgrading module 14 is used for restarting the Linux equipment, loading the self-starting kernel file into the kernel partition 7 of the Linux equipment to execute the file system, mounting the opt user partition 5 on the Linux equipment, reading the upgrading file by the file system, replacing the original system file of the Linux equipment with the upgrading file, restoring the conventional starting parameters after the file replacement is finished, and restarting the Linux equipment.
In the embodiment of the invention, firstly, a data receiving module 10 receives an upgrading and upgrading instruction sent by a corresponding external device 3, the upgrading data packet comprises an upgrading file and an upgrading tool, after the upgrading data packet is received, a file processing module 12 decompresses the upgrading data packet according to the upgrading instruction, the upgrading file and the upgrading tool are respectively written into an opt user partition 5 and a kernel partition 7 of the Linux equipment, the upgrading file is not stored in a root file system partition of the Linux equipment any more, the storage burden of the root file system partition is lightened, finally, an upgrading module 14 restarts the Linux equipment and loads a self-starting kernel file into the kernel partition 7 of the Linux equipment, so as to execute the file system and mount the opt user partition 5 on the Linux equipment, the file system reads the upgrading file and replaces the original system file of the Linux equipment with the upgrading file, and after the file replacement is finished, the conventional starting parameters are restored, and the Linux equipment is restarted again, so that the Linux equipment is upgraded, and the burden of a root file system can be reduced.
In an alternative embodiment of the present invention, as shown in fig. 2 and 3, the upgrade module 14 includes:
the upgrade start parameter setting unit 141 is configured to set an upgrade start parameter and send a restart instruction after the setting is completed, where the upgrade start parameter enables the Linux device to load the self-boot kernel file from the kernel partition 7 in a next start process to execute the file system;
a mounting unit 143, configured to generate a mounting instruction to control the Linux device to mount the opt user partition 5 so as to read the upgrade file, where the upgrade file at least includes a new version kernel file and a new version root file;
the file upgrading unit 145 is configured to respectively write the new version kernel file and the new version root file to the kernel partition 7 and the rootfs partition 8 of the Linux device to replace an old version kernel file and an old version root file; and a startup parameter restoring unit 147 for restoring the startup parameter of the Linux device to a conventional startup parameter and then issuing a restart instruction.
In this embodiment, the upgrade start parameter setting unit 141 is used to set the upgrade start parameter and send a restart instruction to control the restart of the Linux device after the setting is completed, so that the Linux device loads the self-starting kernel file from the kernel partition 7 in the next start process to execute the file system, and starts a system upgrade task for the Linux device, then the mount unit 143 generates a mount instruction to control the Linux device to mount the opt user partition 5 to read the upgrade file, and obtain a new version of the upgrade image file, the file upgrade unit 145 writes the new version of the kernel file and the new version of the root file to the kernel partition 7 and the rofs root partition 8 of the Linux device respectively to replace the old version of the kernel file and the old version of the root file, performs an upgrade operation for the kernel partition 7 and the rofs partition 8, and finally the start parameter restoring unit 147 restores the start parameter of the Linux device to a normal start parameter, and the Linux equipment returns to the conventional starting mode, and a restarting instruction is sent again to enable the kernel partition 7 and the rootfs partition 8 to load the new version kernel file and the new version root file respectively after the Linux equipment is restarted, so that the whole upgrading task is completed, the upgrading of the Linux equipment can be effectively realized, and the upgrading efficiency is relatively high. It is understood that the conventional boot parameters are parameters for booting the Linux device for conventional boot.
In yet another alternative embodiment of the present invention, as shown in fig. 4, the file processing module 12 includes:
the file decompressing unit 121 is configured to decompress the upgrade data packet according to the upgrade instruction to obtain the upgrade file and an upgrade tool; and
and the file programming unit 123 is configured to respectively program the upgrade file and the upgrade tool to the opt user partition 5 and the kernel partition 7 of the Linux device.
In this embodiment, the file decompression unit 121 decompresses the upgrade data packet to obtain the upgrade file and the upgrade tool, and the file programming unit 123 respectively programs the upgrade file and the upgrade tool to the opt user partition 5 and the kernel partition 7 of the Linux device, so that the file processing efficiency is higher, and decompression and programming of file data can be effectively ensured.
In yet another optional embodiment of the present invention, the self-starting kernel file is a kernel file which is obtained by removing the driver module and is pre-configured with the starting parameters. In this embodiment, the self-starting kernel file is a kernel file which is removed from the driver module and is pre-configured with the start parameters, and when the kernel file is designed, unnecessary driver modules can be cut off first to simplify the kernel, then the start boot parameters are configured for the kernel file, the self-contained start parameters are selected, and finally the file system is compiled into the kernel file to form the self-starting kernel file, so that the upgrade tool file is smaller than the kernel partition 7, and the upgrade of the Linux device is effectively ensured.
In another alternative embodiment of the present invention, as shown in fig. 5, the data receiving module 10 includes:
an upgrade packet receiving unit 101 configured to receive an upgrade packet transmitted by the external File input device 30 based on an FTP (File Transfer Protocol); and
the instruction receiving unit 103 is configured to receive an upgrade instruction sent by the external instruction input device 32 based on a TCP (Transmission Control Protocol) Protocol.
In the embodiment, the upgrade data packet receiving unit 101 and the instruction receiving unit 103 are respectively adopted and based on the FTP protocol and the TCP protocol, so that the data and instruction transmission efficiency is high, and the upgrade data packet and the upgrade instruction are respectively received. It is understood that, when the predetermined file transfer protocol is an FTP protocol and the predetermined command transfer protocol is a TCP protocol, the external file input device 30 corresponds to an FTP server of a Linux device; the external instruction input device 32 corresponds to a remote TCP tool; in addition, the external device 3 includes an external file input device 30 and an external instruction input device 32.
On the other hand, as shown in fig. 6, an embodiment of the present invention provides a system upgrading method for Linux devices, including the following steps:
s1: receiving an upgrade data packet and an upgrade instruction sent by a corresponding external device 3, wherein the upgrade data packet comprises an upgrade file and an upgrade tool, and the upgrade tool is a self-starting kernel file with a file system compiled in advance;
s2: decompressing the upgrading data packet according to the upgrading instruction, and respectively programming the upgrading file and the upgrading tool to an opt user partition 5 and a kernel partition 7 of the Linux equipment; and
s3: restarting the Linux equipment, loading the self-starting kernel file into a kernel partition 7 of the Linux equipment to execute the file system, mounting the opt user partition 5 on the Linux equipment, reading the upgrade file by the file system, replacing an original system file of the Linux equipment with the upgrade file, restoring conventional starting parameters after the file replacement is finished, and restarting the Linux equipment.
The method of the embodiment of the invention comprises the steps of firstly receiving an upgrade instruction and an upgrade instruction sent by a corresponding external device 3, wherein the upgrade data packet comprises an upgrade file and an upgrade tool, further decompressing the upgrade data packet according to the upgrade instruction after the upgrade data packet is received, respectively programming the upgrade file and the upgrade tool to an opt user partition 5 and a kernel partition 7 of the Linux equipment, not storing the upgrade file in a root file system partition of the Linux equipment any more, reducing the storage burden of the root file system partition, finally restarting the Linux equipment and loading the self-starting kernel file in the kernel partition 7 of the Linux equipment so as to execute the file system, mounting the Linux equipment in the opt user partition 5, reading the upgrade file by the file system and replacing the original system file of the Linux equipment by the upgrade file, and after the file replacement is finished, the conventional starting parameters are restored, and the Linux equipment is restarted again, so that the Linux equipment is upgraded, and the burden of a root file system can be reduced.
In another alternative embodiment of the present invention, as shown in fig. 7, the step S3 specifically includes: s31: setting an upgrade starting parameter and sending a restart instruction after the setting is finished, wherein the upgrade starting parameter enables the Linux equipment to load the self-starting kernel file by a kernel partition 7 in the next starting process so as to execute the file system; s32: generating a mounting instruction to control the Linux equipment to mount the opt user partition 5 so as to read the upgrade file, wherein the upgrade file at least comprises a new version kernel file and a new version root file;
s33: respectively programming the new version kernel file and the new version root file to a kernel partition 7 and a rootfs partition 8 of the Linux equipment so as to replace the old version kernel file and the old version root file; and
s34: and restoring the starting parameters of the Linux equipment into the conventional starting parameters, and then sending a restarting instruction.
In this embodiment, by the above method, an upgrade start parameter is first set, and a restart instruction is issued after the setting is completed to control the Linux apparatus to restart, so that the Linux apparatus loads the self-boot kernel file from the kernel partition 7 in the next start process to execute the file system, and starts a system upgrade task for the Linux apparatus, then a mount instruction is generated to control the Linux apparatus to mount the opt user partition 5 to read the upgrade file, obtain a new version of the upgrade image file, further write the new version of the kernel file and the new version of the root file to the kernel partition 8 and the rootfs partition 9 of the Linux apparatus respectively to replace the old version of the kernel file and the old version of the root file, perform an upgrade operation on the kernel partition 7 and the rootfs partition 8, and finally restore the start parameter of the Linux apparatus to a conventional start parameter, so that the Linux apparatus returns to a conventional start mode first, and sending a restart instruction again to enable the kernel partition 7 and the rootfs partition 8 to load the new version kernel file and the new version root file respectively after the Linux equipment is restarted, so that the whole upgrading task is completed, the upgrading of the Linux equipment can be effectively realized, and the upgrading efficiency is relatively high.
In yet another alternative embodiment of the present invention, as shown in fig. 8, the step S2 specifically includes:
s21: decompressing the upgrade data packet according to the upgrade instruction to obtain the upgrade file and an upgrade tool; and
s22: and respectively programming the upgrade file and the upgrade tool to an opt user partition 5 and a kernel partition 7 of the Linux equipment.
According to the method, the upgrade data packet is firstly decompressed to obtain the upgrade file and the upgrade tool, the upgrade file and the upgrade tool are further programmed to the opt user partition 5 and the kernel partition 7 of the Linux device respectively, the file processing efficiency is higher, and decompression and programming of file data can be effectively guaranteed.
In another optional embodiment of the present invention, the self-starting kernel file is a kernel file which is obtained by removing the driver module and is pre-configured with the starting parameters. In this embodiment, the self-starting kernel file is a kernel file which is removed from the driver module and is pre-configured with the start parameters, and when the kernel file is designed, unnecessary driver modules can be cut off first to simplify the kernel, then the start boot parameters are configured for the kernel file, the self-contained start parameters are selected, and finally the file system is compiled into the kernel file to form the self-starting kernel file, so that the upgrade tool file is smaller than the kernel partition 7, and the upgrade of the Linux device is effectively ensured.
In an optional embodiment of the present invention, the step S1 specifically includes:
s11: receiving an upgrade data packet transmitted by the external file input device 30 based on the FTP protocol; and
s12: the upgrade instruction transmitted from external instruction input device 32 is received based on the TCP protocol.
In the embodiment, the transmission efficiency of data and instructions is high by respectively based on the FTP protocol and the TCP protocol, and the upgrading data packet and the upgrading instructions are respectively received. It can be understood that, when the file transfer protocol is the FTP protocol and the command transfer protocol is the TCP protocol, the external file input device 30 corresponds to an FTP server of the Linux device; the external instruction input device 32 corresponds to a remote TCP tool.
The functions described in the embodiments of the present invention may be stored in a storage medium readable by a computing device if they are implemented in the form of software functional modules or units and sold or used as independent products. Based on such understanding, part of the contribution of the embodiments of the present invention to the prior art or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device, a network device, or the like) to execute all or part of the steps of the method described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A system upgrade apparatus for a Linux device, the apparatus comprising:
the data receiving module is used for receiving an upgrading data packet and an upgrading instruction sent by a corresponding external device, wherein the upgrading data packet comprises an upgrading file and an upgrading tool, and the upgrading tool is a self-starting kernel file with a file system compiled in advance;
the file processing module is used for decompressing the upgrading data packet according to the upgrading instruction and respectively programming the upgrading file and the upgrading tool to an opt user partition and a kernel partition of the Linux equipment; and
and the upgrading module is used for restarting the Linux equipment, loading the self-starting kernel file into a kernel partition of the Linux equipment to execute the file system, mounting the opt user partition into the Linux equipment, reading the upgrading file by the file system, replacing an original system file of the Linux equipment with the upgrading file, restoring the conventional starting parameters after the file replacement is finished, and restarting the Linux equipment.
2. The system upgrade apparatus for a Linux device of claim 1, wherein the upgrade module comprises:
the upgrading starting parameter setting unit is used for setting upgrading starting parameters and sending a restarting instruction after the setting is finished, and the upgrading starting parameters enable the Linux equipment to load the self-starting kernel file by the kernel partition in the next starting process so as to execute the file system;
the mounting unit is used for generating a mounting instruction to control the Linux equipment to mount the opt user partition so as to read the upgrade file, and the upgrade file at least comprises a new version kernel file and a new version root file;
the file upgrading unit is used for respectively programming the new version kernel file and the new version root file to a kernel partition and a rootfs partition of the Linux equipment so as to replace the old version kernel file and the old version root file; and
and the starting parameter recovery unit is used for recovering the starting parameters of the Linux equipment into the conventional starting parameters and then sending out a restarting instruction.
3. The system upgrade apparatus for a Linux device according to claim 1, wherein the file processing module comprises: the file decompression unit is used for decompressing the upgrading data packet according to the upgrading instruction to obtain the upgrading file and an upgrading tool; and
and the file programming unit is used for respectively programming the upgrade file and the upgrade tool to an opt user partition and a kernel partition of the Linux equipment.
4. The system upgrade apparatus for Linux devices of claim 1, wherein the self-booting kernel file is a kernel file with a driver module removed and with booting parameters pre-configured.
5. The system upgrade apparatus for a Linux device according to claim 1, wherein the data reception module comprises: the upgrading data packet receiving unit is used for receiving an upgrading data packet sent by an external file input device based on an FTP protocol; and
and the instruction receiving unit is used for receiving the upgrading instruction sent by the external instruction input device based on the TCP protocol.
6. A system upgrading method for Linux equipment is characterized by comprising the following steps:
receiving an upgrade data packet and an upgrade instruction sent by a corresponding external device, wherein the upgrade data packet comprises an upgrade file and an upgrade tool, and the upgrade tool is a self-starting kernel file with a file system compiled in advance;
decompressing the upgrading data packet according to the upgrading instruction, and respectively programming the upgrading file and the upgrading tool to an opt user partition and a kernel partition of the Linux equipment; and
restarting the Linux equipment, loading the self-starting kernel file into a kernel partition of the Linux equipment to execute the file system, mounting the opt user partition into the Linux equipment, reading the upgrade file by the file system, replacing the original system file of the Linux equipment with the upgrade file, restoring the conventional starting parameters after the file replacement is finished, and restarting the Linux equipment.
7. The method for upgrading a system of Linux equipment according to claim 6, wherein restarting the Linux equipment and loading the kernel partition of the Linux equipment with the self-boot kernel file to execute the file system, mounting the Linux equipment with the opt user partition, reading the upgrade file by the file system and replacing an original system file of the Linux equipment with the upgrade file, and after the file replacement is completed, restoring a conventional boot parameter, and restarting the Linux equipment specifically comprises:
setting an upgrade starting parameter and sending a restart instruction after the setting is finished, wherein the upgrade starting parameter enables the Linux equipment to load the self-starting kernel file by a kernel partition in the next starting process so as to execute the file system;
generating a mounting instruction to control the Linux equipment to mount the opt user partition so as to read the upgrade file, wherein the upgrade file at least comprises a new version kernel file and a new version root file;
respectively programming the new version kernel file and the new version root file to a kernel partition and a rootfs partition of the Linux equipment to replace an old version kernel file and an old version root file; and
and the starting parameter recovery unit is used for recovering the starting parameters of the Linux equipment into the conventional starting parameters and then sending out a restarting instruction.
8. The system upgrade method for Linux devices according to claim 6, wherein said decompressing the upgrade data packet according to the upgrade instruction, and programming the upgrade file and the upgrade tool to the opt user partition and the kernel partition of the Linux device, respectively, specifically comprises:
decompressing the upgrade data packet according to the upgrade instruction to obtain the upgrade file and an upgrade tool; and
and respectively programming the upgrade file and the upgrade tool to an opt user partition and a kernel partition of the Linux equipment.
9. The system upgrade method for Linux devices of claim 6, wherein the self-booting kernel file is a kernel file with a driver module removed and with boot parameters pre-configured.
10. The system upgrade method for Linux equipment according to claim 6, wherein said receiving an upgrade data packet and an upgrade instruction sent by a corresponding external device specifically comprises:
receiving an upgrading data packet sent by an external file input device based on an FTP protocol; and
and receiving an upgrading instruction sent by an external instruction input device based on the TCP protocol.
CN202010955198.4A 2020-09-11 2020-09-11 System upgrading device and method for Linux equipment Pending CN112083944A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010955198.4A CN112083944A (en) 2020-09-11 2020-09-11 System upgrading device and method for Linux equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010955198.4A CN112083944A (en) 2020-09-11 2020-09-11 System upgrading device and method for Linux equipment

Publications (1)

Publication Number Publication Date
CN112083944A true CN112083944A (en) 2020-12-15

Family

ID=73737630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010955198.4A Pending CN112083944A (en) 2020-09-11 2020-09-11 System upgrading device and method for Linux equipment

Country Status (1)

Country Link
CN (1) CN112083944A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220147636A1 (en) * 2020-11-12 2022-05-12 Crowdstrike, Inc. Zero-touch security sensor updates

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090271780A1 (en) * 2008-04-24 2009-10-29 Moschip Semiconductor Technology Limited Automatic complete firmware upgrade
CN102298531A (en) * 2011-09-08 2011-12-28 北京傲天动联技术有限公司 Method for upgrading flash memory file system in embedded system
CN103530150A (en) * 2013-10-10 2014-01-22 上海爱数软件有限公司 Remote updating method for Linux operating system
CN103677915A (en) * 2013-12-11 2014-03-26 厦门雅迅网络股份有限公司 Automatic burning method of flash mirror image based on TF starting card
CN103677947A (en) * 2014-01-03 2014-03-26 深圳英飞拓科技股份有限公司 Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux
CN104834547A (en) * 2015-05-14 2015-08-12 烽火通信科技股份有限公司 Remote upgrade method and system of Squashfs read-only root file system
CN105760191A (en) * 2016-02-02 2016-07-13 西安诺瓦电子科技有限公司 Embedded system equipment programming mass production method
CN106598651A (en) * 2016-11-25 2017-04-26 上海斐讯数据通信技术有限公司 Embedded system and upgrade method thereof
CN106598576A (en) * 2016-11-30 2017-04-26 深圳市泛海三江科技发展有限公司 Equipment parameter updating method and device based on squashfs read-only file
CN107943414A (en) * 2017-10-16 2018-04-20 积成电子股份有限公司 The file partition of built-in Linux and data read-write method
CN109783117A (en) * 2019-01-18 2019-05-21 中国人民解放军国防科技大学 Mirror image file making and starting method of diskless system
CN111475353A (en) * 2020-03-12 2020-07-31 苏州浪潮智能科技有限公司 Method and system for detecting NVDIMM memory of production line

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090271780A1 (en) * 2008-04-24 2009-10-29 Moschip Semiconductor Technology Limited Automatic complete firmware upgrade
CN102298531A (en) * 2011-09-08 2011-12-28 北京傲天动联技术有限公司 Method for upgrading flash memory file system in embedded system
CN103530150A (en) * 2013-10-10 2014-01-22 上海爱数软件有限公司 Remote updating method for Linux operating system
CN103677915A (en) * 2013-12-11 2014-03-26 厦门雅迅网络股份有限公司 Automatic burning method of flash mirror image based on TF starting card
CN103677947A (en) * 2014-01-03 2014-03-26 深圳英飞拓科技股份有限公司 Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux
CN104834547A (en) * 2015-05-14 2015-08-12 烽火通信科技股份有限公司 Remote upgrade method and system of Squashfs read-only root file system
CN105760191A (en) * 2016-02-02 2016-07-13 西安诺瓦电子科技有限公司 Embedded system equipment programming mass production method
CN106598651A (en) * 2016-11-25 2017-04-26 上海斐讯数据通信技术有限公司 Embedded system and upgrade method thereof
CN106598576A (en) * 2016-11-30 2017-04-26 深圳市泛海三江科技发展有限公司 Equipment parameter updating method and device based on squashfs read-only file
CN107943414A (en) * 2017-10-16 2018-04-20 积成电子股份有限公司 The file partition of built-in Linux and data read-write method
CN109783117A (en) * 2019-01-18 2019-05-21 中国人民解放军国防科技大学 Mirror image file making and starting method of diskless system
CN111475353A (en) * 2020-03-12 2020-07-31 苏州浪潮智能科技有限公司 Method and system for detecting NVDIMM memory of production line

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220147636A1 (en) * 2020-11-12 2022-05-12 Crowdstrike, Inc. Zero-touch security sensor updates

Similar Documents

Publication Publication Date Title
US10649769B2 (en) Vehicle-mounted control device, program writing device, program generating device and program
CN108027753B (en) In-vehicle control device, program update system, and storage medium storing program update software
JP4944686B2 (en) Software update method and portable terminal device
CN110597542B (en) Software automatic OTA (over the air) upgrading method and device and electronic equipment
CN105824722A (en) Backup restoring system for computer cloud
CN103365696A (en) BIOS (Basic Input Output System) image file obtaining method and device
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
US7222342B2 (en) Execution on a machine, the start of an auxiliary downloader when storage of new software memory fails during execution of a first downloader
CN112083944A (en) System upgrading device and method for Linux equipment
EP1962189A1 (en) Apparatus and method for updating boot logo image in portable terminal
KR100601626B1 (en) Software upgrade method and computer-readable medium therefor
US20230132494A1 (en) Information processing apparatus, method of controlling the same, and storage medium
JPH09282169A (en) Input/output data managing system
JP5084853B2 (en) Firmware update device, communication device, electronic device, firmware update system, firmware update method, and program
CN110704091A (en) Firmware upgrading method and device
CN114661670A (en) File decompression method, system and equipment based on Fuse file system
CN110795113B (en) Redis cluster service installation method, server and medium
CN110442074B (en) Processing device for programmable logic controller program
JP4731960B2 (en) Pooling method, system and program
CN113934437A (en) Method and system for installing application in cloud mobile phone and client cloud mobile phone
CN112732276A (en) Control method of U shield and U shield equipment
CN111399940A (en) Data processing method of intelligent system, storage medium and intelligent terminal
JP2008217202A (en) Disk array device and firmware update method
CN105938417B (en) Update the method and device of configuration data
JP2023053826A (en) Software update control system

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