CN111831314B - Method and device for patching non-writable partition - Google Patents

Method and device for patching non-writable partition Download PDF

Info

Publication number
CN111831314B
CN111831314B CN202010589871.7A CN202010589871A CN111831314B CN 111831314 B CN111831314 B CN 111831314B CN 202010589871 A CN202010589871 A CN 202010589871A CN 111831314 B CN111831314 B CN 111831314B
Authority
CN
China
Prior art keywords
patch
script
self
starting
executable file
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
CN202010589871.7A
Other languages
Chinese (zh)
Other versions
CN111831314A (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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies 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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202010589871.7A priority Critical patent/CN111831314B/en
Publication of CN111831314A publication Critical patent/CN111831314A/en
Application granted granted Critical
Publication of CN111831314B publication Critical patent/CN111831314B/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
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

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

Abstract

The invention discloses a method for patching a non-writable partition, which comprises the following steps: and planning a patch directory in the writable partition for storing various patch files, wherein the patch directory comprises: starting a script patch, a dynamic library patch needing to be replaced, a dynamic library patch mark file, an executable file patch needing to be replaced and/or an executable file patch mark file; adding a self-study software starting script in a system starting script on the non-writable partition for starting the self-study software, and presetting patch loading operation logic in the self-study software starting script to realize the replacement operation of the patch file in the patch directory. The technical scheme of the invention provides a simple and convenient file replacement method aiming at the debugging and engineering upgrading requirements of the non-writable program partitions such as the compressed mirror image. The invention also provides a corresponding device for patching the non-writable partition.

Description

Method and device for patching non-writable partition
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a method and a device for patching a non-writable partition.
Background
Generally, terminal products (such as PON terminals, intelligent gateways, wireless routers, etc.) using a Linux system will adopt a patching manner for relatively small function modifications. The patch only contains the content to be modified, and is small in size and flexible in application. Patching generally refers to replacing files of a device program partition with files in the patch, and the device can run by using new files after restarting, so that the patch replacement effect is achieved. The patch can be used for quickly replacing files in equipment during development and debugging and also can be widely applied to engineering maintenance.
In order to achieve the purpose of replacing files, an overall image upgrading mode can be used, overall image upgrading is comprehensive, but certain defects are caused: the whole mirror image file is large, the file transmission time is long during upgrading, the pressure on the server is large, the upgrading process may be unstable due to factors such as environment and the like, and the size of the upgrading file supported by the server may be limited. Therefore, the patch upgrading mode has great advantages for solving the problem of less modified files.
Along with the function of the terminal is more and more abundant, the whole mirror image file is more and more big, and the compression mirror image is gradually developed to the use for the reasons of controlling the size of the whole mirror image file and the like. However, after the compressed image is programmed on the device, the program partition cannot be written, the file cannot be modified, and the original patch replacement mode cannot be used. When a certain function of the equipment is debugged, a certain file cannot be replaced at any time, and the whole mirror image must be upgraded again, so that the development and debugging efficiency is reduced; when the project is modified aiming at a certain small function, the whole mirror image must be upgraded again.
Disclosure of Invention
In view of the above defects or improvement needs in the prior art, the present invention provides a method for patching a non-writable partition, so as to solve the problem that various program files cannot be easily and conveniently replaced for the non-writable partition. The method is mainly applied to terminal products adopting a Linux system or other similar terminal products.
To achieve the above object, according to an aspect of the present invention, there is provided a method of patching a non-writable partition, including:
and planning a patch directory in the writable partition for storing various patch files, wherein the patch directory comprises: starting a script patch, a dynamic library patch needing to be replaced, a dynamic library patch mark file, an executable file patch needing to be replaced and/or an executable file patch mark file;
adding a self-study software starting script in a system starting script on the non-writable partition for starting the self-study software, and presetting patch loading operation logic in the self-study software starting script to realize the replacement operation of the patch file in the patch directory.
In one embodiment of the present invention, during the starting process of the self-developed software boot script, a plurality of positions where a boot script patch may need to be run are planned, and the following logic is preset at each position: if the starting script patch at the corresponding position exists in the patch directory, the starting script patch is called, and if the return code of the starting script patch requires to stop the self-study software starting script, the self-study software starting script directly exits after the starting script patch is executed.
In one embodiment of the invention, a piece of logic is added at the beginning of the self-research software starting script: if a dynamic LIBRARY patch mark file exists in the patch directory, the environment variable LD _ LIBRARY _ PATH is modified through the export, and the PATH of the patch directory is added in front of the existing environment variable, so that the dynamic LIBRARY patch needing to be replaced in the patch directory can be preferentially selected to be loaded when the program is searched for the dynamic LIBRARY file during running, and the replacement running of the dynamic LIBRARY is realized.
In one embodiment of the invention, for an executable file without a specified running path, a logic is added at the beginning of the self-developed software starting script: if an executable file patch mark file is in the patch directory, the environment variable PATH is modified through the export, and the PATH of the patch directory is added to the front of the environment variable, so that a program without the specified running PATH can preferentially execute the executable file patch needing to be replaced in the patch directory during running.
In one embodiment of the invention, for an executable file started by a self-development software starting script, a piece of logic is added at the beginning of the self-development software starting script: and if the corresponding executable file patch needing to be replaced exists in the patch directory, executing the corresponding executable file patch needing to be replaced by using the full path of the executable file in the patch directory.
According to another aspect of the present invention, there is also provided an apparatus for patching a non-writable partition, including a patch catalog planning module and a self-study software start script logic presetting module, wherein:
the patch directory planning module is used for planning a patch directory in the writable partition, and storing various patch files, and includes: starting a script patch, a dynamic library patch needing to be replaced, a dynamic library patch mark file, an executable file patch needing to be replaced and/or an executable file patch mark file;
the self-study software starting script logic presetting module is used for adding a self-study software starting script in a system starting script on the non-writable partition for starting the self-study software, and presetting patch loading operation logic in the self-study software starting script so as to realize the replacement operation of the patch file in the patch directory.
In an embodiment of the present invention, the self-developed software startup script logic presetting module plans a plurality of positions where startup script patches may need to be run in the startup process of the self-developed software startup script, and presets the following logic at each position: if the starting script patch at the corresponding position exists in the patch directory, the starting script patch is called, and if the return code of the starting script patch requires to stop the self-study software starting script, the self-study software starting script directly exits after the starting script patch is executed.
In an embodiment of the present invention, the self-developed software startup script logic presetting module adds a logic at the beginning of the self-developed software startup script: if a dynamic LIBRARY patch mark file exists in the patch directory, the environment variable LD _ LIBRARY _ PATH is modified through the export, and the PATH of the patch directory is added in front of the existing environment variable, so that the dynamic LIBRARY patch needing to be replaced in the patch directory can be preferentially selected to be loaded when the program is searched for the dynamic LIBRARY file during running, and the replacement running of the dynamic LIBRARY is realized.
In an embodiment of the present invention, for an executable file with no specified running path, the self-development software startup script logic presetting module adds a piece of logic at the beginning of the self-development software startup script: if an executable file patch mark file is in the patch directory, the environment variable PATH is modified through the export, and the PATH of the patch directory is added to the front of the environment variable, so that a program without the specified running PATH can preferentially execute the executable file patch needing to be replaced in the patch directory during running.
In an embodiment of the present invention, for an executable file started by a self-development software start script, the self-development software start script logic presetting module adds a piece of logic at the beginning of the self-development software start script: and if the corresponding executable file patch needing to be replaced exists in the patch directory, executing the corresponding executable file patch needing to be replaced by using the full path of the executable file in the patch directory.
In general, compared with the prior art, the technical scheme conceived by the invention has the following beneficial effects:
(1) The technical scheme of the invention provides a simple and convenient file replacement method aiming at the debugging and engineering upgrading requirements of the non-writable program partitions such as the compressed mirror image and the like;
(2) In the technical scheme of the invention, during debugging, the debugging efficiency of research and development test is improved, for example, the required executable file or dynamic library file can be quickly modified and replaced, or information output at a specific stage is carried out, so that the requirement of frequent change during debugging is met, and the debugging is not required to be carried out after the whole mirror image is reproduced and upgraded every time;
(3) In the technical scheme of the invention, in the use of engineering, a small amount of modification can be carried out, and the version can be upgraded in a patching mode, so that the method is flexible and convenient. .
Drawings
FIG. 1 illustrates a schematic diagram of a self-developed software startup script logic preset-startup script patch logic preset method;
FIG. 2 illustrates a schematic diagram of a self-developed software startup script logic provisioning-dynamic library patch and executable file patch logic provisioning method;
fig. 3 is a schematic structural diagram of an apparatus for patching a non-writable partition according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1
The invention mainly solves the problem that the non-writable partition in the Linux system can not be patched (files are replaced), and the files to be replaced mainly comprise the following components according to the function requirement: startup script custom modification replacement, executable file (executable binary or script) replacement, dynamic library replacement, etc.
In order to solve the above technical problem, the present invention provides a method for patching a non-writable partition, including:
1 Patch directory planning
A directory is planned in a writable partition such as a configuration data area, and various patch files are specially stored: a boot script patch, a dynamic library patch requiring replacement, a dynamic library patch flag file, an executable file patch (executable binary or script) requiring replacement, and/or an executable file patch flag file, etc.
2 self-study software start script logic Preset
Adding a self-study software starting script in a system starting script on the non-writable partition for starting the self-study software, and presetting patch loading operation logic in the self-study software starting script to realize the replacement operation of the patch file in the patch directory.
1) Startup script patch logic preset
In the starting process of the self-developed software starting script, a plurality of positions where the starting script patch possibly needs to be operated are planned, and the following logic is preset in each position: if the starting script patch at the corresponding position exists in the patch directory, the starting script patch is called, and if the return code of the starting script patch requires to stop the self-developed software starting script, the self-developed software starting script directly exits after the starting script patch is executed.
Therefore, the boot script patch stored in the patch catalog can add special processing to the corresponding position of the original boot script or directly replace the original boot script to run.
2) Dynamic library patch logic provisioning
Adding a piece of logic at the beginning of the bootstrap script (after the import of the environment variable): if a dynamic LIBRARY patch mark file exists in the patch directory, the environment variable LD _ LIBRARY _ PATH is modified through the export, and the PATH of the patch directory is added in front of the existing environment variable, so that when a program is run, a dynamic LIBRARY file is searched, and a dynamic LIBRARY patch needing to be replaced in the patch directory is preferentially selected to be loaded, so that the replacement running of the dynamic LIBRARY is realized. .
3) Executable file patch logic provisioning
The method comprises the following steps: for an executable file without a specified running path, adding a logic at the beginning of the self-developed software starting script (after the introduction of the environment variable): if the patch directory has an executable file patch mark file, the environment variable PATH is modified through the export, and the PATH of the patch directory is added to the front of the environment variable, so that a program without the specified operation PATH can preferentially execute the executable file patch needing to be replaced under the patch directory during operation.
The method 2 comprises the following steps: for an executable file started by a self-development software starting script, a piece of logic is added at the beginning of the self-development software starting script: and if the corresponding executable file patch needing to be replaced exists in the patch directory, executing the corresponding executable file patch needing to be replaced by using the full path of the executable file in the patch directory.
Example 2
The implementation process of the technical scheme of the invention comprises the following steps:
1. patch directory planning
In a writable partition, such as a configuration data area, a directory patch is created in which all patch files are stored. Assume the directory path is/flash/patch/.
The patch file includes:
(1) Boot script patch
Planning the positions which are possibly required to be operated and modified in the self-developed software starting script, and setting the patch script of the corresponding position as follows:
the start script plan location 1 corresponds to the patch script name start _1_patch.
The startup script planning position 2 corresponds to the patch script name start _2_ _ patch.
…,
The startup script planning position x corresponds to the patch script name start _ x _ patch.
(2) Dynamic library patch markup files
One or more dynamic library files need to be replaced, i.e., the flag file needs to be set.
Setting its name to so _ patch _ flag, the file content may be empty.
(3) Executable file patch flag file
An executable file running on one or more unspecified paths needs to be replaced, i.e. the flag file needs to be set.
Setting its name as bin _ patch _ flag, the file content may be empty.
(4) Dynamic library patch
All dynamic library files that need replacement.
The name of the dynamic library patch file is the same as the corresponding dynamic library file of the non-writable program partition in the original image of the device.
(5) Executable file patch
All executables that need replacement.
The name of the executable patch file is the same as the corresponding executable file of the non-writable program partition in the original image of the device itself.
2. Self-study software start script logic preset
As shown in figure 1: starting script patch logic presetting method
1) The preset positions of the startup script patch logic are determined according to the positions of the startup scripts which are planned in advance and possibly need to be modified, each position corresponds to a patch script, and the name of the patch script is consistent with the name of the patch script in the startup process in the patch catalog planning.
2) At each planned position of the logical preset, the following logical preset is added (starting positions 1, x are illustrated in the figure, and other starting positions are logically similar):
and if the patch script under the patch directory corresponding to the current position exists, calling the patch script. For example, the position 1 corresponds to the determination call start _1_ patch.sh, the position 2 corresponds to the determination call start _2_ patch.sh, \8230, and the position x corresponds to the determination call start _ x _ patch.sh.
And confirming whether the current startup script directly returns or continues to execute according to the return value of the patch script.
As shown in the attached figure 2: logic presetting method for dynamic library patch and executable file patch
1) Adding dynamic library patch logic preset at the beginning of the self-developed software boot script (after the introduction of the environment variable):
if the patch directory has a dynamic LIBRARY patch flag file, adding a patch directory PATH at the top of the environment variable LD _ LIBRARY _ PATH.
For example: the original environment variable LD _ LIBRARY _ PATH =/lib:/usr/lib, and if the patch directory PATH planned by the current device is/flash/patch/, the imported environment variable is: export LD _ LIBRARY _ PATH =/flash/patch:/lib:/usr/lib.
2) Adding an unspecified path to run executable file patch logic preset at the beginning of the self-study software starting script (after the environment variable is imported):
if the patch directory has the executable file patch flag file, adding a patch directory PATH at the top of the environment variable PATH.
For example, if the original environment variable PATH = usr/bin:/usr/sbin:/sbin, and the patch directory PATH of the current device plan is/flash/patch/, then the import environment variable is: export PATH =/flash/patch usr/bin:/usr/sbin:/bin:/sbin.
3) Adding logic preset at the starting operation position of an executable file executed in the self-study software starting script:
and if the patch directory has the corresponding executable file, directly running the executable file under the path of the patch directory according to the absolute path, or running the executable file of the original program partition according to the original logic.
For example, the original binary/usr/bin/abc is called, the patch directory path of the current device plan is/flash/patch/, and if/flash/patch/abc exists in the directory, then execute/flash/patch/abc is called. Otherwise, calling/usr/bin/abc according to the original logic.
4) If the executable file is an executable file such as abc running in an unspecified PATH, the system finds a corresponding binary abc running according to the environment variable PATH.
For example, when the executable file patch logic preset processing is executed in an unspecified PATH, if the export PATH =/flash/patch: user/bin:/sbin already exists, if the original startup script executes abc, it will give priority to whether the/flash/patch/abc file exists, and if so, the executable file of the PATH will be automatically executed. If not, then find the operation in the original path usr/bin:/usr/sbin:/bin:/sbin.
5) If the binary file runs and links the dynamic LIBRARY, the system searches a corresponding dynamic LIBRARY link according to the environment variable LD _ LIBRARY _ PATH.
For example, when the dynamic LIBRARY patch logic is preset, the port LD _ LIBRARY _ PATH =/flash/patch:/lib:/usr/lib already exists, if the running binary file needs to link the dynamic LIBRARY libabc. If not, then find and link in the original path/lib:/usr/lib.
3. Making and loading patches
Description of patch preparation:
1) Starting a script patch: according to the planned and preset boot script patch positions, for example, 2 positions currently need to be manufactured, corresponding to the boot process patch 1: start _1_patch.sh, patch 2. Then the contents of these 2 patches are edited in advance according to the functional requirements to generate a patch file: start _1_patch.sh and start _2_patch.sh.
2) Dynamic library patching: if the name of the planned dynamic library patch flag file is so _ patch _ flag, a certain so dynamic library libabc is required to be replaced, and a patch file is generated: so _ patch _ flag, libabc.
3) The unspecified path runs executable file patches: if the name of the planned executable file patch flag file is bin _ patch _ flag, an executable file abc which is run by a path which is not specified and is to be replaced generates a patch file, namely bin _ patch _ flag and abc to be replaced.
4) Starting an executable file patch running in the script: if one wants to run instead of the executable file abc running in the startup script, a patch file is generated: abc to be replaced.
The patches can be arranged singly or simultaneously according to the actual use requirement. All patch files are prepared according to the method, and basic production of the patch is completed.
The loading mode is to copy all patch files to the writable patch directory path planned ahead on the device, such as/flash/patch/. The specific mode is not limited, as long as the purpose that the corresponding patch files are all copied to the writable partition patch directory on the device is achieved.
4. Clear patch
And removing the patch only needs to delete all patch files under the patch catalogue of the writable partition of the equipment.
Such as: rm-rf/flash/patch/. Star
Example 3
As shown in fig. 3, an embodiment of the present invention provides an apparatus for patching a non-writable partition, including a patch catalog planning module and a self-developed software startup script logic presetting module, where:
the patch directory planning module is used for planning a patch directory in the writable partition, and storing various patch files, and includes: starting a script patch, a dynamic library patch needing to be replaced, a dynamic library patch mark file, an executable file patch needing to be replaced and/or an executable file patch mark file;
the self-study software starting script logic presetting module is used for adding a self-study software starting script in a system starting script on the non-writable partition for starting the self-study software, and presetting patch loading operation logic in the self-study software starting script so as to realize the replacement operation of the patch file in the patch directory.
Further, the self-study software startup script logic presetting module plans a plurality of positions where startup script patches may need to be run in the startup process of the self-study software startup script, and presets the following logic at each position: if the starting script patch at the corresponding position exists in the patch directory, the starting script patch is called, and if the return code of the starting script patch requires to stop the self-study software starting script, the self-study software starting script directly exits after the starting script patch is executed.
Further, the self-development software startup script logic presetting module adds a logic segment at the beginning of the self-development software startup script: if a dynamic LIBRARY patch mark file exists in the patch directory, the environment variable LD _ LIBRARY _ PATH is modified through the export, and the PATH of the patch directory is added in front of the existing environment variable, so that when a program is run, a dynamic LIBRARY file is searched, and a dynamic LIBRARY patch needing to be replaced in the patch directory is preferentially selected to be loaded, so that the replacement running of the dynamic LIBRARY is realized.
Further, for an executable file of which the running path is not specified, the self-development software startup script logic presetting module adds a piece of logic at the beginning of the self-development software startup script: if an executable file patch mark file is in the patch directory, the environment variable PATH is modified through the export, and the PATH of the patch directory is added to the front of the environment variable, so that a program without the specified running PATH can preferentially execute the executable file patch needing to be replaced in the patch directory during running.
Further, for an executable file started by a self-development software starting script, the self-development software starting script logic presetting module adds a logic segment at the beginning of the self-development software starting script: and if the corresponding executable file patch needing to be replaced exists in the patch directory, executing the corresponding executable file patch needing to be replaced by using the full path of the executable file in the patch directory.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (4)

1. A method of patching a non-writable partition, comprising:
and planning a patch directory in the writable partition for storing various patch files, wherein the patch directory comprises: starting a script patch, a dynamic library patch needing to be replaced, a dynamic library patch mark file, an executable file patch needing to be replaced and/or an executable file patch mark file;
adding a self-developed software starting script in a system starting script on the non-writable partition for starting the self-developed software, and presetting patch loading operation logic in the self-developed software starting script to realize the replacement operation of the patch file in the patch directory; in the starting process of the self-research software starting script, a plurality of positions which may need to run a starting script patch are planned, and the following logic is preset in each position: if the starting script patch at the corresponding position exists in the patch directory, calling the starting script patch, and if the return code of the starting script patch requires to stop the self-developed software starting script, directly exiting the self-developed software starting script after the execution of the starting script patch is finished; and pre-provisioning dynamic library patch and executable patch logic, comprising: adding dynamic library patch logic presetting at the beginning of a self-study software starting script; adding an unspecified path running executable file patch logic preset at the beginning of a self-developed software starting script; adding logic preset at the starting operation position of an executable file executed in a self-developed software starting script; if the executable file is the executable file which is not run by the appointed PATH, the system searches the corresponding binary system to run according to the environment variable PATH; if the binary file runs and links the dynamic LIBRARY, the system can find the corresponding dynamic LIBRARY link according to the environment variable LD _ LIBRARY _ PATH.
2. A method of patching non-writable partitions, according to claim 1, where for an executable file started by a self-booted script, a piece of logic is added at the beginning of the self-booted script: and if the corresponding executable file patch needing to be replaced exists in the patch directory, executing the corresponding executable file patch needing to be replaced by using the full path of the executable file in the patch directory.
3. An apparatus for patching a non-writable partition, comprising a patch catalog planning module and a self-developed software startup script logic presetting module, wherein:
the patch directory planning module is configured to plan a patch directory in the writable partition, and is configured to store various patch files, where the patch directory planning module includes: starting a script patch, a dynamic library patch needing to be replaced, a dynamic library patch mark file, an executable file patch needing to be replaced and/or an executable file patch mark file;
the self-developed software starting script logic presetting module is used for adding a self-developed software starting script to a system starting script on the non-writable partition for starting the self-developed software and presetting patch loading operation logic in the self-developed software starting script so as to realize the replacement operation of the patch file in the patch directory; the self-developed software startup script logic presetting module plans a plurality of positions where startup script patches possibly need to be operated in the startup process of the self-developed software startup script, and the following logic is preset in each position: if the start script patch at the corresponding position exists in the patch directory, the start script patch is called, and if the return code of the start script patch requires to stop the self-study software start script, the self-study software start script directly exits after the start script patch is executed; and pre-setting dynamic library patch and executable file patch logic, comprising: adding dynamic library patch logic presetting at the beginning of a self-study software starting script; adding logic presetting of an executable file patch running in an unspecified path at the beginning of a self-study software starting script; adding logic preset at the starting operation position of an executable file executed in the self-study software starting script; if the executable file is the executable file which is not run by the appointed PATH, the system searches the corresponding binary system to run according to the environment variable PATH; if the binary file runs and links the dynamic LIBRARY, the system searches a corresponding dynamic LIBRARY link according to the environment variable LD _ LIBRARY _ PATH.
4. An apparatus for patching non-writable partitions according to claim 3, wherein for an executable file started by a bootstrap script, the bootstrap script logic preset module adds a piece of logic at the beginning of the bootstrap script: and if the corresponding executable file patch needing to be replaced exists in the patch directory, executing the corresponding executable file patch needing to be replaced by using the full path of the executable file in the patch directory.
CN202010589871.7A 2020-06-24 2020-06-24 Method and device for patching non-writable partition Active CN111831314B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010589871.7A CN111831314B (en) 2020-06-24 2020-06-24 Method and device for patching non-writable partition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010589871.7A CN111831314B (en) 2020-06-24 2020-06-24 Method and device for patching non-writable partition

Publications (2)

Publication Number Publication Date
CN111831314A CN111831314A (en) 2020-10-27
CN111831314B true CN111831314B (en) 2022-11-22

Family

ID=72898126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010589871.7A Active CN111831314B (en) 2020-06-24 2020-06-24 Method and device for patching non-writable partition

Country Status (1)

Country Link
CN (1) CN111831314B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821272B (en) * 2021-09-23 2023-09-12 武汉深之度科技有限公司 Application program running method, computing device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677909A (en) * 2013-12-05 2014-03-26 北京大唐智能卡技术有限公司 Method and device for achieving mask card patch mechanism
CN105589706A (en) * 2014-10-29 2016-05-18 Tcl集团股份有限公司 Upgrade package generation method and device
CN109325012A (en) * 2018-08-08 2019-02-12 国云科技股份有限公司 A method of modification virtual machine image subregion
CN110865837A (en) * 2019-11-14 2020-03-06 青岛海信移动通信技术股份有限公司 Method and terminal for upgrading system
CN108027741B (en) * 2016-04-27 2020-06-09 华为技术有限公司 File processing method, device, terminal and storage medium based on patch upgrade

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7735078B1 (en) * 2003-10-30 2010-06-08 Oracle America, Inc. System and method for software patching for cross-platform products
CN106681749B (en) * 2015-11-11 2021-01-05 腾讯科技(深圳)有限公司 Local code patch updating method and device based on android platform
US20190155598A1 (en) * 2017-11-17 2019-05-23 Apple Inc. Techniques for updating a file using a multi-version patch file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677909A (en) * 2013-12-05 2014-03-26 北京大唐智能卡技术有限公司 Method and device for achieving mask card patch mechanism
CN105589706A (en) * 2014-10-29 2016-05-18 Tcl集团股份有限公司 Upgrade package generation method and device
CN108027741B (en) * 2016-04-27 2020-06-09 华为技术有限公司 File processing method, device, terminal and storage medium based on patch upgrade
CN109325012A (en) * 2018-08-08 2019-02-12 国云科技股份有限公司 A method of modification virtual machine image subregion
CN110865837A (en) * 2019-11-14 2020-03-06 青岛海信移动通信技术股份有限公司 Method and terminal for upgrading system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Ubuntu16.04安装NVIDIA驱动+CU DA9.0+cuDNN7.0;grllery;《https://blog.csdn.net/grllery/article/details/80092364》;20180426;第1-7页 *

Also Published As

Publication number Publication date
CN111831314A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
US6948164B2 (en) Method and system for modifying executable code to add additional functionality
CN108897547B (en) Software automation deployment method and device
CN102880498B (en) The method of virtual SD card on the device of Android system
CN102053831B (en) Linux operating system customizing method and system
US10684846B2 (en) Using semantic annotations to control compatibility behaviors
CN106293756A (en) A kind of for quick-replaceable self-defined linux kernel system
CN105335173A (en) Method, apparatus and system for initializing intelligent terminal device
CN102147743A (en) Method for accelerating startup of embedded system application program
CN110442371B (en) Method, device and medium for releasing codes and computer equipment
CN106909480B (en) Cross debugging method and device for embedded system
CN111831314B (en) Method and device for patching non-writable partition
CN112748959A (en) Embedded system starting method, flash memory burning method and system updating method
CN111078265B (en) Web project update patch generation method based on jenkins
CN110716721A (en) TMS320C6748 program loading method compatible with network port and serial port
KR100729525B1 (en) Method and system for updating firmware
CN107544813B (en) Switching method and system for static library configuration
CN116028084A (en) Cross-version hot upgrading method, system and terminal based on OpenStack cloud platform
CN114356395A (en) Optimization scheme for modifying python source code to take effect without restarting docker mirror image
CN114697313A (en) File downloading method based on mirror image
CN103530151A (en) Customization method of Linux operating system capable of switching service software systems
CN113849181A (en) Cross compiling tool chain construction method and device, electronic equipment and storage medium
US11513792B2 (en) Tracking history of firmware program updates
CN114995962B (en) Method for loading emergency patches by initializing container
CN116136770B (en) Singlechip program upgrading method based on module
JPS59201150A (en) Debug 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