Code compiling method and device for system upgrade
By identifying and compiling components of the Linux embedded operating system, and using the baseline image package to generate a new system image upgrade package, the problem of long compilation time for components during system upgrades is solved, thus improving development efficiency.
Patent Information
- Application Number
- CN202111488285.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-12-08
AI Technical Summary
In existing technologies, the system upgrade process of Linux embedded operating systems involves recompiling all components, which takes a long time and affects project development efficiency.
By detecting new code being added to the repository, the corresponding first component is identified, and based on the baseline image package saved by the system, the first component and its dependent second component are compiled to generate a software deb package. When a packaging instruction is received from the user, the deb package is updated to the baseline image package, and the system image upgrade bin package is repackaged.
A time-sharing compilation component was implemented, which solved the problem of long compilation time in centralized compilation, ensured project development efficiency, and made the time for deb package replacement and image package creation fixed and controllable.
Smart Images

Figure CN114327540B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer communication technology, and more particularly to a code compilation method and apparatus for system upgrades. Background Technology
[0002] Currently, most Linux embedded operating systems adopt a component-based development approach (i.e., each module has an independent software package, .deb). The system's functionality is composed of many components, each of which can consist of applications, dynamic libraries, drivers, etc. Different products select different component combinations and package them together to form a complete system image upgrade package, .bin, which contains the complete system functionality of a product. End users can use this .bin package to upgrade their devices.
[0003] Because this bin package contains a large number of functions, which means that a large number of components need to be compiled, it takes several hours to compile all of them in sequence each time, and finally package them into a system image upgrade package. The excessive compilation time greatly affects project development and efficiency. Summary of the Invention
[0004] This invention provides a method and apparatus for compiling code for system upgrades, which solves the problem of long recompilation time for all components in system upgrades in the prior art.
[0005] According to an embodiment of the present invention, a code compilation method for system upgrade is provided, the method comprising:
[0006] When new code is detected entering the library, the first component corresponding to the code is identified;
[0007] Based on the baseline image package saved by the system, the first component and the second component that depends on the first component are compiled to obtain a software deb package; the baseline image package includes the compilation information required for component compilation;
[0008] Upon receiving a packaging instruction from the user, the deb package is updated to the baseline image package, and a new system image upgrade bin package is obtained based on the updated baseline image package.
[0009] Optionally, the method further includes:
[0010] After compiling and packaging all components of the original system, the initial baseline image package of the system is obtained.
[0011] Optionally, the step of compiling the first component and a second component that depends on the first component based on the baseline image package saved by the system to obtain a software deb package specifically includes:
[0012] Based on the baseline image package saved by the system, the first component is compiled to obtain the first component deb package;
[0013] Update the first component deb package to the baseline image package; and
[0014] Based on the preset dependency relationships, determine the second component that depends on the first component;
[0015] Based on the updated baseline image package, the second component is compiled to obtain the second component deb package.
[0016] Optionally, determining the second component that depends on the first component based on a preset dependency relationship specifically includes:
[0017] Obtain the process and the corresponding library file in the first component's deb package;
[0018] Use the LDD command to find the dependent libraries corresponding to the library file;
[0019] Based on the file list information of the dependency libraries and deb packages, the corresponding component name is determined, and the component corresponding to the component name is the second component; wherein, the file list information includes the correspondence between dependency libraries and component names.
[0020] Optionally, updating the deb package to the baseline image package and packaging a new system image upgrade bin package based on the updated baseline image package specifically includes:
[0021] Replace the old deb package in the baseline image package with the new deb package, and update the component version information in the baseline image package to obtain the updated baseline image package;
[0022] Based on the updated baseline image package, a new system image upgrade bin package is regenerated.
[0023] According to an embodiment of the present invention, a code compilation apparatus for system upgrades is also provided, the apparatus comprising: an identification unit, a compilation unit, and a packaging unit; wherein,
[0024] The identification unit is used to identify the first component corresponding to the code when a new code is detected entering the library;
[0025] The compilation unit is used to compile the first component and the second component that depends on the first component based on the baseline image package saved by the system, so as to obtain a software deb package; the baseline image package includes the compilation information required for component compilation;
[0026] The packaging unit is used to update the deb package to the baseline image package when it receives a packaging instruction input by the user, and to package a new system image upgrade bin package based on the updated baseline image package.
[0027] Optionally, the compilation unit is also used to compile all components of the original system to obtain compilation products;
[0028] The packaging unit is also used to package the compiled products to obtain the baseline image package initially saved by the system.
[0029] Optionally, the compilation unit is used to compile the first component and a second component that depends on the first component based on the baseline image package saved by the system, to obtain a software deb package, specifically for:
[0030] Based on the baseline image package saved by the system, the first component is compiled to obtain the first component deb package;
[0031] Update the first component deb package to the baseline image package; and
[0032] Based on the preset dependency relationships, determine the second component that depends on the first component;
[0033] Based on the updated baseline image package, the second component is compiled to obtain the second component deb package.
[0034] Optionally, the compilation unit is configured to determine a second component that depends on the first component based on a preset dependency relationship, specifically configured to:
[0035] Obtain the process and the corresponding library file in the first component's deb package;
[0036] Use the LDD command to find the dependent libraries corresponding to the library file;
[0037] Based on the file list information of the dependency libraries and deb packages, the corresponding component name is determined, and the component corresponding to the component name is the second component; wherein, the file list information includes the correspondence between dependency libraries and component names.
[0038] Optionally, the packaging unit is used to update the deb package to the baseline image package, and to package a new system image upgrade bin package based on the updated baseline image package, specifically for:
[0039] Replace the old deb package in the baseline image package with the new deb package, and update the component version information in the baseline image package to obtain the updated baseline image package;
[0040] Based on the updated baseline image package, a new system image upgrade bin package is regenerated.
[0041] According to an embodiment of the present invention, an electronic device is also provided, the electronic device including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0042] Memory, used to store computer programs;
[0043] When a processor executes a program stored in memory, it implements the above method steps.
[0044] According to an embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements the above-described method steps.
[0045] The beneficial effects of this invention are as follows:
[0046] The system upgrade code compilation method and apparatus provided in this embodiment of the invention detects new code entering the library and identifies the first component corresponding to the code; based on the baseline image package saved by the system, the first component and a second component that depends on the first component are compiled to obtain a software deb package; the baseline image package includes compilation information required for component compilation; when a packaging instruction is received from the user, the deb package is updated to the baseline image package, and a new system image upgrade bin package is obtained based on the updated baseline image package. When new code is detected in the library, this invention can automatically identify the component corresponding to the code and automatically trigger the compilation of the component. At the same time, all other components that depend on the component corresponding to the new code are also automatically triggered for compilation. After the component is compiled, a deb package is generated. After receiving the user's input packaging command, all the deb packages generated after the component compilation was triggered that day are overwritten into the baseline image package saved by the system, and a new system image upgrade package is repackaged and output. This realizes time-sharing compilation of components and solves the problem of long centralized compilation time. This invention performs component compilation in real time while the code is updated, and performs deb package replacement and image package creation after receiving the packaging command. The time for deb package replacement and image package creation is fixed and controllable, avoiding the problem of long recompilation time for all components and ensuring the development efficiency of the project. Attached Figure Description
[0047] Figure 1 This is a flowchart of the code compilation method for system upgrade in this embodiment of the invention;
[0048] Figure 2 This is a schematic diagram of the code compilation device for system upgrade in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the structure of an electronic device shown in this application. Detailed Implementation
[0050] To address the issue of lengthy recompilation times for all components during system upgrades in existing technologies, this invention provides a system upgrade code compilation method that achieves rapid generation of a system image upgrade package by performing real-time time-sharing compilation of components and replacing and packaging them based on a baseline image package. The process of this invention is as follows: Figure 1 As shown, the execution steps are as follows:
[0051] Step 101: When new code is detected entering the library, identify the first component corresponding to the code;
[0052] When new code is submitted, approved, and added to the repository, the code change will be detected. Based on the correspondence between code and components, the component corresponding to the code will be identified. For ease of description, this component will be referred to as the first component.
[0053] Step 102: Based on the baseline image package saved by the system, compile the first component and the second component that depends on the first component to obtain a software deb package; the baseline image package includes the compilation information required for component compilation;
[0054] Here, when the system is undergoing its first system upgrade, the baseline image package saved by the system is the initial baseline image package obtained by compiling and packaging all components of the original system; when the system is not undergoing its first upgrade, the baseline image package saved by the system is the updated baseline image package after the last system upgrade.
[0055] The baseline image package is an Images.tar file, which is a complete set containing all compilation artifacts, such as header files, .so dynamic libraries generated by the cross-toolchain, ELF files, .a static libraries, executable files, drivers, and other compilation information, and can be used to compile components locally.
[0056] Step 103: Upon receiving the user's input packaging instruction, update the deb package to the baseline image package, and package a new system image upgrade bin package based on the updated baseline image package.
[0057] Specifically, upon receiving the packaging instruction, all the newly generated deb packages are replaced in the baseline image package, and the executable files in the updated baseline image package are compiled into a system image upgrade package (bin).
[0058] Preferably, the method further includes:
[0059] After compiling and packaging all components of the original system, the initial baseline image package of the system is obtained.
[0060] Preferably, the step of compiling the first component and a second component that depends on the first component based on the baseline image package saved by the system to obtain a software deb package specifically includes:
[0061] Based on the baseline image package saved by the system, the first component is compiled to obtain the first component deb package;
[0062] Update the first component deb package to the baseline image package; and
[0063] Based on the preset dependency relationships, determine the second component that depends on the first component;
[0064] Based on the updated baseline image package, the second component is compiled to obtain the second component deb package.
[0065] Optionally, determining the second component that depends on the first component based on a preset dependency relationship specifically includes:
[0066] Obtain the process and the corresponding library file in the first component's deb package;
[0067] Use the LDD command to find the dependent libraries corresponding to the library file;
[0068] Based on the file list information of the dependency libraries and deb packages, the corresponding component name is determined, and the component corresponding to the component name is the second component; wherein, the file list information includes the correspondence between dependency libraries and component names.
[0069] Preferably, the step of updating the deb package to the baseline image package and packaging a new system image upgrade bin package based on the updated baseline image package specifically includes:
[0070] The old deb package in the baseline image package is replaced with the new deb package, and the component version information in the baseline image package is updated to obtain the updated baseline image package. Specifically, when compiling the component, the SVN version number of the code is recorded in the deb package. The deb package includes three files: control.tar.gz, data.tar.gz, and debian-binary. The version number is recorded in the control configuration file in control.tar.gz.
[0071] When updating or replacing a deb file, the version number is written to the / etc / version file in image.tar. This version file contains version number information for all components.
[0072] Based on the updated baseline image package, a new system image upgrade bin package is regenerated.
[0073] Based on the same inventive concept, embodiments of the present invention provide a code compilation device for system upgrades, the structure of which is as follows: Figure 2 As shown, it includes: an identification unit 21, a compilation unit 22, and a packaging unit 23; wherein,
[0074] The identification unit 21 is used to identify the first component corresponding to the code when a new code is detected entering the library; when a new code is submitted and enters the library after passing the review, the code change will be identified, and the component corresponding to the code will be identified according to the correspondence between the code and the component. For ease of description, this component is referred to as the first component.
[0075] The compilation unit 22 is used to compile the first component and the second component that depends on the first component based on the baseline image package saved by the system, to obtain a software deb package; the baseline image package includes the compilation information required for component compilation; here, when the system is undergoing its first system upgrade, the baseline image package saved by the system is the initial baseline image package saved by the system after compiling and packaging all components of the original system; when the system is not undergoing its first upgrade, the baseline image package saved by the system is the updated baseline image package after the last system upgrade.
[0076] The baseline image package is an Images.tar file, which is a complete set containing all compilation artifacts, such as header files, .so dynamic libraries generated by the cross-toolchain, ELF files, .a static libraries, executable files, drivers, and other compilation information, and can be used to compile components locally.
[0077] The packaging unit 23 is used to update the deb package to the baseline image package when it receives a packaging instruction input by the user, and to package a new system image upgrade bin package based on the updated baseline image package; specifically, when the packaging instruction is received, all the new deb packages generated this time are replaced in the baseline image package, and the executable files in the updated baseline image package are made into a system image upgrade bin package.
[0078] Preferably, the compilation unit 22 is further configured to compile all components of the original system to obtain compilation products;
[0079] The packaging unit 23 is also used to package the compiled products to obtain the baseline image package initially saved by the system.
[0080] Preferably, the compilation unit 22 is used to compile the first component and a second component that depends on the first component based on the baseline image package saved by the system, to obtain a software deb package, specifically for:
[0081] Based on the baseline image package saved by the system, the first component is compiled to obtain the first component deb package;
[0082] Update the first component deb package to the baseline image package; and
[0083] Based on the preset dependency relationships, determine the second component that depends on the first component;
[0084] Based on the updated baseline image package, the second component is compiled to obtain the second component deb package.
[0085] Preferably, the compilation unit 23 is used to determine a second component that depends on the first component according to a preset dependency relationship, specifically for:
[0086] Obtain the process and the corresponding library file in the first component's deb package;
[0087] Use the LDD command to find the dependent libraries corresponding to the library file;
[0088] Based on the file list information of the dependency libraries and deb packages, the corresponding component name is determined, and the component corresponding to the component name is the second component; wherein, the file list information includes the correspondence between dependency libraries and component names.
[0089] Preferably, the packaging unit 23 is used to update the deb package to the baseline image package, and to package a new system image upgrade bin package based on the updated baseline image package, specifically for:
[0090] Replace the old deb package in the baseline image package with the new deb package, and update the component version information in the baseline image package to obtain the updated baseline image package;
[0091] Based on the updated baseline image package, a new system image upgrade bin package is regenerated.
[0092] It should be understood that the implementation principle and process of the system upgrade code compilation device provided in the embodiments of the present invention are the same as those described above. Figure 1 Similar to the embodiments shown, they will not be described again here.
[0093] The system upgrade code compilation method and apparatus provided in this embodiment of the invention detects new code entering the library and identifies the first component corresponding to the code; based on the baseline image package saved by the system, the first component and a second component that depends on the first component are compiled to obtain a software deb package; the baseline image package includes compilation information required for component compilation; when a packaging instruction is received from the user, the deb package is updated to the baseline image package, and a new system image upgrade bin package is obtained based on the updated baseline image package. When new code is detected in the library, this invention can automatically identify the component corresponding to the code and automatically trigger the compilation of the component. At the same time, all other components that depend on the component corresponding to the new code are also automatically triggered for compilation. After the component is compiled, a deb package is generated. After receiving the user's input packaging command, all the deb packages generated after the component compilation was triggered that day are overwritten into the baseline image package saved by the system, and a new system image upgrade package is repackaged and output. This realizes time-sharing compilation of components and solves the problem of long centralized compilation time. This invention performs component compilation in real time while the code is updated, and performs deb package replacement and image package creation after receiving the packaging command. The time for deb package replacement and image package creation is fixed and controllable, avoiding the problem of long recompilation time for all components and ensuring the development efficiency of the project.
[0094] This application also provides an electronic device; please refer to [link to relevant documentation]. Figure 3 As shown, it includes a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540.
[0095] Memory 530 is used to store computer programs;
[0096] When the processor 510 executes the program stored in the memory 530, it implements the code compilation method for system upgrade as described in any of the above embodiments.
[0097] Communication interface 520 is used for communication between the above-mentioned electronic device and other devices.
[0098] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0099] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0100] In this solution, when new code is detected being added to the library, the corresponding component is automatically identified and its compilation is automatically triggered. Simultaneously, all other components that depend on the new code are also automatically compiled. After compilation, a deb package is generated. Upon receiving a user-input packaging command, all deb packages generated from components that were compiled that day are overwritten into the system's saved baseline image package, and a new system image upgrade package is repackaged and output. This achieves time-sharing component compilation, solving the problem of long compilation times associated with centralized compilation. This embodiment of the invention performs component compilation in real time while code is being updated, and upon receiving a packaging command, deb package replacement and image package creation are performed. The time for deb package replacement and image package creation is fixed and controllable, avoiding the time-consuming problem of recompiling all components and ensuring project development efficiency.
[0101] Accordingly, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform any of the system upgrade code compilation methods described in the above embodiments.
[0102] In this solution, when new code is detected being added to the library, the corresponding component is automatically identified and its compilation is automatically triggered. Simultaneously, all other components that depend on the new code are also automatically compiled. After compilation, a deb package is generated. Upon receiving a user-input packaging command, all deb packages generated from components that were compiled that day are overwritten into the system's saved baseline image package, and a new system image upgrade package is repackaged and output. This achieves time-sharing component compilation, solving the problem of long compilation times associated with centralized compilation. This embodiment of the invention performs component compilation in real time while code is being updated, and upon receiving a packaging command, deb package replacement and image package creation are performed. The time for deb package replacement and image package creation is fixed and controllable, avoiding the time-consuming problem of recompiling all components and ensuring project development efficiency.
[0103] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.
[0104] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
[0105] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for apparatus or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The apparatus and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0106] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 201, 202, 203, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0108] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0109] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0110] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0111] Although alternative embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make further changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the alternative embodiments as well as all changes and modifications falling within the scope of the invention.
[0112] Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if these modifications and variations to the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention also intends to include these modifications and variations.
Claims
1. A code compilation method for system upgrades, characterized in that, The method includes: When new code is detected entering the library, the first component corresponding to the code is identified; based on the baseline image package saved by the system, the first component and the second component that depends on the first component are compiled to obtain the first component deb package and the second component deb package; the baseline image package is used to compile the component; the file list information of the first component deb package includes the component name of the second component; When a user inputs a packaging instruction, the first component deb package and the second component deb package are updated to the baseline image package, and a new system image upgrade bin package is obtained based on the updated baseline image package; Specifically, the process of compiling the first component and a second component that depends on the first component based on the baseline image package stored in the system to obtain a first component deb package and a second component deb package includes: Based on the baseline image package saved by the system, the first component is compiled to obtain the first component deb package; Update the first component deb package to the baseline image package; and Based on the preset dependency relationships, determine the second component that depends on the first component; Based on the updated baseline image package, the second component is compiled to obtain the second component deb package; The step of determining the second component that depends on the first component based on a preset dependency relationship specifically includes: Obtain the process and the corresponding library file in the first component's deb package; Use the LDD command to find the dependent libraries corresponding to the library file; Based on the file list information of the dependency libraries and deb packages, the corresponding component name is determined, and the component corresponding to the component name is the second component; wherein, the file list information includes the correspondence between dependency libraries and component names.
2. The method according to claim 1, characterized in that, The method further includes: After compiling and packaging all components of the original system, the initial baseline image package of the system is obtained.
3. The method according to claim 1, characterized in that, The step of updating the first component deb package and the second component deb package to the baseline image package, and packaging a new system image upgrade bin package based on the updated baseline image package, specifically includes: Replace the old deb package in the baseline image package with the first component deb package and the second component deb package, and update the component version information in the baseline image package to obtain the updated baseline image package; Based on the updated baseline image package, a new system image upgrade bin package is regenerated.
4. A code compilation device for system upgrades, characterized in that, The device includes: an identification unit, a compilation unit, and a packaging unit; wherein, The identification unit is used to identify the first component corresponding to the code when a new code is detected entering the library; The compilation unit is used to compile the first component and the second component that depends on the first component based on the baseline image package saved by the system, to obtain a first component deb package and a second component deb package; the baseline image package is used to compile the component; the file list information of the first component deb package includes the component name of the second component; The packaging unit is used to update the first component deb package and the second component deb package to the baseline image package when it receives the packaging instruction input by the user, and to package a new system image upgrade bin package based on the updated baseline image package; The compilation unit is configured to compile the first component and a second component that depends on the first component based on a baseline image package stored in the system, to obtain a first component deb package and a second component deb package, specifically for: Based on the baseline image package saved by the system, the first component is compiled to obtain the first component deb package; Update the first component deb package to the baseline image package; and Based on the preset dependency relationships, determine the second component that depends on the first component; Based on the updated baseline image package, the second component is compiled to obtain the second component deb package; The compilation unit is used to determine a second component that depends on the first component based on a preset dependency relationship, specifically for: Obtain the process and the corresponding library file in the first component's deb package; Use the LDD command to find the dependent libraries corresponding to the library file; Based on the file list information of the dependency libraries and deb packages, the corresponding component name is determined, and the component corresponding to the component name is the second component; wherein, the file list information includes the correspondence between dependency libraries and component names.
5. The apparatus according to claim 4, characterized in that, The compilation unit is also used to compile all components of the original system to obtain compilation products; The packaging unit is also used to package the compiled products to obtain the baseline image package initially saved by the system.
6. The apparatus according to claim 4, characterized in that, The packaging unit is used to update the first component deb package and the second component deb package to the baseline image package, and to package a new system image upgrade bin package based on the updated baseline image package, specifically for: Replace the old deb package in the baseline image package with the first component deb package and the second component deb package, and update the component version information in the baseline image package to obtain the updated baseline image package; Based on the updated baseline image package, a new system image upgrade bin package is regenerated.
7. An electronic device, characterized in that, The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method according to any one of claims 1-3.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-3.
Citation Information
Patent Citations
Method, apparatus, computer device and storage medium for generating upgrade package
CN109144519A
Application mirror image construction method and device, electronic equipment and storage medium
CN112256282A
Construction and compiling method and device of operating system, electronic equipment and storage medium
CN113504914A
Continuous integration method and device, computer equipment and storage medium
CN113703730A