Movatterモバイル変換


[0]ホーム

URL:


CN117369865A - GNU linux universal application program packaging method and graphical application packer - Google Patents

GNU linux universal application program packaging method and graphical application packer
Download PDF

Info

Publication number
CN117369865A
CN117369865ACN202311669092.8ACN202311669092ACN117369865ACN 117369865 ACN117369865 ACN 117369865ACN 202311669092 ACN202311669092 ACN 202311669092ACN 117369865 ACN117369865 ACN 117369865A
Authority
CN
China
Prior art keywords
application
file
packaging
packaged
dependent
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.)
Granted
Application number
CN202311669092.8A
Other languages
Chinese (zh)
Other versions
CN117369865B (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.)
Kirin Software Co Ltd
Original Assignee
Kirin Software 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 Kirin Software Co LtdfiledCriticalKirin Software Co Ltd
Priority to CN202311669092.8ApriorityCriticalpatent/CN117369865B/en
Publication of CN117369865ApublicationCriticalpatent/CN117369865A/en
Application grantedgrantedCritical
Publication of CN117369865BpublicationCriticalpatent/CN117369865B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention provides a GNU linux universal application program packaging method and a graphical application packer, which comprise the following steps: s1, carrying out static dependency analysis on an application program to be packaged based on an ELF file; s2, performing running state dependency analysis on the application program to be packaged by establishing a communication sub-node in the process space; s3, completing the rapth path assignment of the application dependent file through the graphical interactive interface; s4, constructing an interface layer for the squarhfs file, realizing real-time display of the packing progress on the graphical interactive interface and terminating the packing function; s5, completing information filling in the graphical interaction interface and starting packaging until completion or termination. The invention can solve the problem of application program dependence analysis, can specify a dependence library path, can display the whole packing process, and can graphically operate.

Description

Translated fromChinese
一种GNU linux通用的应用程序打包方法及图形化应用打包器A GNU linux universal application packaging method and graphical application creationpackage container

技术领域Technical field

本发明属于计算机技术领域,特别是涉及到一种GNU linux通用的应用程序打包方法及图形化应用打包器。The invention belongs to the field of computer technology, and in particular relates to a GNU linux universal application packaging method and a graphical application packager.

背景技术Background technique

GNU linux的发布行版本众多,各版本的应用打包方式不尽相同,同一个应用程序要运行在不同的发行版上,需要根据各个发行版的要求打包方能安装使用,而且应用程序的打包基本是通过终端命令行来完成的,没有图形化操作性,这不利于应用在GNU linux不同发布行版本的推广使用,不方便新手用户进行应用程序的打包操作。There are many GNU linux release versions, and the application packaging methods of each version are different. To run the same application on different releases, it needs to be packaged according to the requirements of each release before it can be installed and used. Moreover, the packaging of applications is basically It is done through the terminal command line and has no graphical operability. This is not conducive to the promotion and use of the application in different GNU Linux release versions, and it is inconvenient for novice users to package the application.

目前能在不同GNU linux的发布行版本上运行应用打包方式是AppImage,该打包方式需要通过终端命令行来操作,无图形化操作界面,不方便新手用户使用;不提供应用程序依赖分析收集功能,需要用户通过其他工具来进行应用依赖分析方能完成应用打包;不显示应用程度打包的进度,由于AppImage格式的软件包一般比较大,打包时间比较长,如不显示进度,给用户带来系统卡住的错觉;不提供rpath的修改,当打包的应用程序不依赖系统的基础库需要依赖打包的库文件时,需要进行依赖路径的指定,不然会导致应用程序在不同的发行版上无法运行。Currently, the application packaging method that can be run on different GNU Linux release versions is AppImage. This packaging method needs to be operated through the terminal command line. It has no graphical operation interface and is inconvenient for novice users. It does not provide application dependency analysis and collection functions. Users need to use other tools to analyze application dependencies to complete application packaging; the progress of application-level packaging is not displayed. Since software packages in the AppImage format are generally relatively large, the packaging time is relatively long. If the progress is not displayed, system lags will be brought to the user. It does not provide rpath modification. When the packaged application does not depend on the system's basic library and needs to rely on the packaged library file, the dependency path needs to be specified, otherwise the application will not run on different distributions.

发明内容Contents of the invention

本发明的目的在于提出一种GNU linux通用的应用程序打包方法及图形化应用打包器,能解决应用程序依赖分析的问题,可指定依赖库路径,可以显示打包全过程,可图形化操作。The purpose of the present invention is to propose a universal application packaging method and graphical application packager for GNU Linux, which can solve the problem of application dependency analysis, can specify the dependency library path, can display the entire packaging process, and can operate graphically.

为了实现上述目的,本发明的技术方案是这样实现的:In order to achieve the above objects, the technical solution of the present invention is implemented as follows:

一种GNU linux通用的应用程序打包方法,包括:A universal application packaging method for GNU Linux, including:

S1、基于ELF文件,对于待打包应用程序进行静态依赖分析,通过图形化交互界面显示静态依赖关系并提供导出接口导出到待打包应用程序所在目录;S1. Based on the ELF file, perform static dependency analysis on the application to be packaged, display static dependencies through a graphical interactive interface and provide an export interface to export to the directory where the application to be packaged is located;

S2、通过在进程空间建立通信子节点,对于待打包应用程序进行运行态依赖分析,通过图形化交互界面显示运行态依赖关系并提供导出接口导出到待打包应用程序所在目录;S2. By establishing communication sub-nodes in the process space, perform a running dependency analysis on the application to be packaged, display the running dependencies through a graphical interactive interface and provide an export interface to export to the directory where the application to be packaged is located;

S3、通过图形化交互界面完成应用程序依赖文件的rapth路径指定;S3. Complete the rapth path specification of application dependent files through the graphical interactive interface;

S4、对于squashfs文件构建接口层,使用上下文封装内部,通过查看生成的ELF文件的符号表来判断封装的完整性,实现打包进度在图形化交互界面的实时显示以及终止打包功能;S4. For the squashfs file to build the interface layer, use the context to encapsulate the interior and judge the integrity of the package by viewing the symbol table of the generated ELF file to realize the real-time display of the packaging progress on the graphical interactive interface and the termination of packaging function;

S5、通过在图形化交互界面完成信息填写并开始打包至完成或终止。S5. Complete the information filling in the graphical interactive interface and start packaging until completion or termination.

进一步的,步骤S1中所述静态依赖分析的过程包括:Further, the static dependency analysis process described in step S1 includes:

S101、读取待打包应用程序的ELF文件,抓取ELF文件的needed信息,获取直接依赖的依赖库文件名称;S101. Read the ELF file of the application to be packaged, grab the needed information of the ELF file, and obtain the name of the directly dependent dependent library file;

S102、基于依赖库文件名称通过查询自定义路径或者系统默认ld.so.cache,获取依赖库文件的全路径;S102. Based on the name of the dependent library file, obtain the full path of the dependent library file by querying the custom path or the system default ld.so.cache;

S103、通过广度遍历算法递归获取待打包应用程序目录中的所有ELF文件的所有依赖库的信息,合并库文件采用集合进行去重,获取到所有依赖库目录,得到待打包应用程序的全部静态依赖。S103. Recursively obtain the information of all dependent libraries of all ELF files in the application directory to be packaged through the breadth traversal algorithm, merge the library files using sets to remove duplication, obtain all dependent library directories, and obtain all static dependencies of the application to be packaged. .

进一步的,步骤S2中所述运行态依赖分析的过程包括:Further, the process of running state dependency analysis described in step S2 includes:

S201、对内核procfs进行扩展,在进程节点内建立一个与核外通信的子节点;S201. Expand the kernel procfs and establish a sub-node in the process node that communicates with outside the core;

S202、核外加载器在加载进程需要的依赖库文件时,写入依赖库文件原始与真实文件信息对到所述子节点内;S202. When loading the dependent library file required by the process, the external loader writes the original and real file information pair of the dependent library file into the child node;

S203、基于写入子节点的依赖库文件原始与真实文件信息建立运行时的依赖文件树关系。S203. Establish a runtime dependency file tree relationship based on the original dependency library file written to the child node and the real file information.

进一步的,步骤S4具体包括:Further, step S4 specifically includes:

S401、图形化交互界面程序中,对于squashfs文件构建一层接口层,定义一套用于可视进度、可中断取消打包的状态机,包括:创建上下文、创建squashfs文件、获取打包处理进度、中断取消打包、销毁上下文;S401. In the graphical interactive interface program, build an interface layer for the squashfs file and define a set of state machines for visual progress and interruptible cancellation of packaging, including: creating context, creating squashfs file, obtaining packaging processing progress, and interrupting cancellation. Pack and destroy context;

S402、基于上下文对内部状态的封装,再通过查看ELF文件里的符号表中GLOBAL类型的变量来做封装完整的判断,实现宿主程序多线程时的可重入使用,从而实现打包进度的实时显示。S402. Encapsulate the internal state based on the context, and then check the GLOBAL type variables in the symbol table in the ELF file to make a complete judgment of the encapsulation, so as to realize the reentrant use of the host program when it is multi-threaded, so as to realize the real-time display of the packaging progress. .

本发明另一方面还提出了一种GNU linux通用的图形化应用打包器,包括:图形化交互界面以及与图形化交互界面关联的静态分析模块、运行时分析模块、rapth设置模块、应用打包模块;On the other hand, the present invention also proposes a GNU linux universal graphical application packager, including: a graphical interactive interface and a static analysis module, a runtime analysis module, a rapth setting module, and an application packaging module associated with the graphical interactive interface. ;

静态分析模块:基于ELF文件,对于待打包应用程序进行静态依赖分析,通过图形化交互界面显示静态依赖关系并提供导出接口导出到待打包应用程序所在目录;Static analysis module: Based on the ELF file, perform static dependency analysis on the application to be packaged, display static dependencies through a graphical interactive interface and provide an export interface to export to the directory where the application to be packaged is located;

运行时分析模块:通过在进程空间建立通信子节点,对于待打包应用程序进行运行态依赖分析,通过图形化交互界面显示运行态依赖关系并提供导出接口导出到待打包应用程序所在目录;Runtime analysis module: By establishing communication sub-nodes in the process space, it performs runtime dependency analysis on the application to be packaged, displays the runtime dependencies through a graphical interactive interface, and provides an export interface to export to the directory where the application to be packaged is located;

rapth设置模块:通过图形化交互界面完成应用程序依赖文件的rapth路径指定;Rapth setting module: completes the rapth path specification of application dependent files through a graphical interactive interface;

应用打包模块:对于squashfs文件构建接口层,使用上下文封装内部,通过查看生成的ELF文件的符号表来判断封装的完整性,实现打包进度在图形化交互界面的实时显示以及终止打包功能;Application packaging module: To build the interface layer for squashfs files, use the context to encapsulate the interior, and judge the integrity of the package by viewing the symbol table of the generated ELF file, so as to realize the real-time display of the packaging progress on the graphical interactive interface and the function of terminating the packaging;

图形化交互界面:通过在图形化交互界面完成信息填写并开始打包至完成或终止。Graphical interactive interface: Complete information filling in the graphical interactive interface and start packaging to completion or termination.

进一步的,静态分析模块包括:Further, the static analysis module includes:

读取单元:读取待打包应用程序的ELF文件,抓取ELF文件的needed信息,获取直接依赖的依赖库文件名称;Reading unit: reads the ELF file of the application to be packaged, grabs the needed information of the ELF file, and obtains the name of the directly dependent dependent library file;

查询单元:基于依赖库文件名称通过查询自定义路径或者系统默认ld.so.cache,获取依赖库文件的全路径;Query unit: Based on the name of the dependent library file, obtain the full path of the dependent library file by querying the custom path or the system default ld.so.cache;

遍历去重单元:通过广度遍历算法递归获取待打包应用程序目录中的所有ELF文件的所有依赖库的信息,合并库文件采用集合进行去重,获取到所有依赖库目录,得到待打包应用程序的全部静态依赖。Traversal deduplication unit: Recursively obtain the information of all dependent libraries of all ELF files in the application directory to be packaged through the breadth traversal algorithm, merge the library files using a collection to remove duplication, obtain all dependent library directories, and obtain the information of the application to be packaged. All static dependencies.

进一步的,运行时分析模块包括:Further, the runtime analysis module includes:

子节点建立单元:对内核procfs进行扩展,在进程节点内建立一个与核外通信的子节点;Sub-node establishment unit: Expand the kernel procfs and establish a sub-node in the process node that communicates with outside the core;

核外加载单元:核外加载器在加载进程需要的依赖库文件时,写入依赖库文件原始与真实文件信息对到所述子节点内;Out-of-core loading unit: When loading the dependent library files required by the process, the out-of-core loader writes the original and real file information pairs of the dependent library files into the child nodes;

关系建立单元:基于写入子节点的依赖库文件原始与真实文件信息建立运行时的依赖文件树关系。Relationship establishment unit: Establish a dependency file tree relationship at runtime based on the original and real file information of the dependent library file written to the child node.

进一步的,应用打包模块包括:Further, the application packaging module includes:

接口层单元:对于squashfs文件构建一层接口层,定义一套用于可视进度、可中断取消打包的状态机,包括:创建上下文、创建squashfs文件、获取打包处理进度、中断取消打包、销毁上下文;Interface layer unit: Build an interface layer for squashfs files, and define a set of state machines for visual progress and interruptible unpacking, including: creating context, creating squashfs files, obtaining packaging processing progress, interrupting unpacking, and destroying contexts;

可重入使用单元:基于上下文对内部状态的封装,再通过查看ELF文件里的符号表中GLOBAL类型的变量来做封装完整的判断,实现宿主程序多线程时的可重入使用,从而实现打包进度的实时显示。Reentrant usage unit: Encapsulates the internal state based on the context, and then checks the GLOBAL type variable in the symbol table in the ELF file to make a complete judgment of the encapsulation, realizing reentrant use when the host program is multi-threaded, thereby realizing packaging Real-time display of progress.

本发明还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述的GNU linux通用的应用程序打包方法。The present invention also provides a computer-readable storage medium, the storage medium stores a computer program, and the computer program is used to execute the above GNU Linux universal application packaging method.

与现有技术相比,本发明具有如下的有益效果:Compared with the prior art, the present invention has the following beneficial effects:

1、本发明可以使应用程序打包的全过程通过图形化交互的方式完成;1. This invention can complete the entire process of application packaging through graphical interaction;

2、本发明能够提供依赖分析收集功能,无需其他工具,直接进行应用程序的静态和运行态的依赖分析,并可通过图形化交互界面显示依赖关系并且选择依赖信息进行导出,完成应用打包;2. The present invention can provide a dependency analysis and collection function, without the need for other tools, to directly analyze the static and running dependencies of applications, and can display dependencies through a graphical interactive interface and select dependency information for export to complete application packaging;

3、本发明提供rpath设置功能,确保打包好的应用程序在目标操作系统上安装后能找到正确的依赖文件,应用程序能正常运行;3. The present invention provides rpath setting function to ensure that the packaged application can find the correct dependent files after being installed on the target operating system, and the application can run normally;

4、本发明解决squashfs工具mksquashfs无法实现安全被宿主程序调用的问题,可实时显示squashfs文件的打包进程、以及打包中途可终止应用程序打包并回退的功能。4. The present invention solves the problem that the squashfs tool mksquashfs cannot be safely called by the host program. It can display the packaging process of the squashfs file in real time, and can terminate the application packaging and roll back during packaging.

附图说明Description of the drawings

图1是本发明实施例一的应用打包器图形交互界面的静态分析界面图;Figure 1 is a static analysis interface diagram of the application packager graphical interactive interface according to Embodiment 1 of the present invention;

图2是本发明实施例一的应用打包器图形交互界面的运行时分析界面图;Figure 2 is a runtime analysis interface diagram of the application packager graphical interactive interface according to Embodiment 1 of the present invention;

图3是本发明实施例一的应用打包器图形交互界面的应用打包过程实时显示图。Figure 3 is a real-time display diagram of the application packaging process of the graphical interactive interface of the application packager in Embodiment 1 of the present invention.

具体实施方式Detailed ways

需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。It should be noted that, as long as there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

本发明的设计思想在于通过图形化的方式,将应用程序的依赖信息展现出来,导出到待打包应用的目录中,通过交互界面填写rpath路径及作者、联系方式、应用介绍、安装路径、应用图标等相关应用信息,实时显示打包全过程,并集成桌面快捷方式、开始菜单显示、应用卸载等功能,实现一种能分析应用程序依赖、可指定依赖库路径、显示打包进度、可图形化操作的GNU linux通用的打包器。The design idea of the present invention is to display the dependency information of the application program in a graphical manner, export it to the directory of the application to be packaged, and fill in the rpath path and author, contact information, application introduction, installation path, and application icon through the interactive interface and other related application information, display the entire packaging process in real time, and integrate desktop shortcuts, start menu display, application uninstallation and other functions to realize a system that can analyze application dependencies, specify dependency library paths, display packaging progress, and perform graphical operations GNU linux universal packager.

实施例一:Example 1:

在实施例一中提供了图形化应用打包器的设计方案及其打包方法。In Embodiment 1, a design solution of a graphical application packager and its packaging method are provided.

图形化应用打包器包括图形化交互界面以及与图形化交互界面关联的静态分析模块、运行时分析模块、rapth设置模块、应用打包模块。The graphical application packager includes a graphical interactive interface and a static analysis module, a runtime analysis module, a rapth setting module, and an application packaging module associated with the graphical interactive interface.

1、依赖分析:1. Dependency analysis:

待打包应用程序可以是运行态或静止态,因此如图1、2所示是生成待打包应用程序依赖信息的静态分析模块、运行时分析模块的界面图;The application to be packaged can be in a running state or a static state, so Figures 1 and 2 show the interface diagrams of the static analysis module and runtime analysis module that generate dependency information of the application to be packaged;

静态分析模块中,对于静止态待打包应用程序,通过读取其ELF文件,抓取被分析ELF文件的needed信息,获取文件直接依赖的库文件名称;基于所述库文件名称通过查询自定义路径或者系统默认ld.so.cache,获取依赖库文件的全路径;通过广度遍历算法递归获取所有依赖库的信息,合并库文件采用集合进行去重,获取到所有文件依赖库目录,得到待打包应用程序的全部静态依赖;其中广度遍历算法的分析过程是通过A文件获取到依赖库B.so,再获取B.so的依赖库C.so,一直到没有依赖;通过上述步骤获取的是静态待打包程序目录内的ELF文件依赖库的所有目录;并图形化显示全部依赖信息,每个依赖信息均可以通过导出功能按钮进行导出。In the static analysis module, for the static application to be packaged, by reading its ELF file, grabbing the needed information of the analyzed ELF file, and obtaining the name of the library file that the file directly depends on; querying the custom path based on the name of the library file Or the system defaults to ld.so.cache to obtain the full path of dependent library files; recursively obtain the information of all dependent libraries through the breadth traversal algorithm, merge the library files using collections to remove duplication, obtain all file dependent library directories, and obtain the application to be packaged All static dependencies of the program; the analysis process of the breadth traversal algorithm is to obtain the dependent library B.so through the A file, and then obtain the dependent library C.so of B.so until there are no dependencies; what is obtained through the above steps is the static dependency The ELF files in the packager directory depend on all directories of the library; all dependency information is graphically displayed, and each dependency information can be exported through the export function button.

对于运行态的待打包应用程序,需要通过读取进程空间来获得进程的依赖文件。然而,由于进程空间加载依赖文件时,是通过open、mmap做调用实现的,对依赖文件的文件名信息,只维护了最终打开的真实文件名,而非进程对应的ELF文件中动态段内的“文件名”,即如果后者是个软链接名等情况时,进程空间里依赖文件的“真实文件名”与其是无法对应起来的,由于这种无法对应的存在,一般无法准确的获取进程依赖文件之间的树关系。本发明在运行时分析模块中,通过对内核procfs进行一个扩展,在进程节点内建立一个与核外可通信的子节点,由扩展了对应功能的核外加载器,在加载进程需要的依赖库文件时,写入依赖库文件原始与真实文件信息对到前述的子节点内,从而实现了将依赖文件的对应关系维护在对应进程的运行期进程空间里,以建立运行时的依赖文件树关系。通过此方案,一方面保持了与其他无此功能内核、核外加载器的向后兼容(全部的通信,都基于扩展子节点);另一方面,扩展子节点的生命周期,受进程生命周期的约束,这个重要性在于,以确定的边界来降低管理的复杂度,保证每个进程的创建、工作、消亡等全生命周期状态均与以往无异,从而最终保证整个系统的正常。根据待打包应用程序进程ID信息,生成进程字典表,再将字典表转化为进程树,并分析出进程的上下级关系,在依赖分析界面图形化展示该进程,每个进程图形化显示其全部依赖信息,每个进程依赖信息栏均有导出功能按钮。For running applications to be packaged, you need to obtain the process's dependency files by reading the process space. However, since the process space loads dependent files through open and mmap calls, only the real file name that is finally opened is maintained for the file name information of the dependent file, not the dynamic segment in the ELF file corresponding to the process. "File name", that is, if the latter is a soft link name, the "real file name" of the dependent file in the process space cannot correspond to it. Due to this incompatibility, it is generally impossible to accurately obtain process dependencies. Tree relationships between files. In the runtime analysis module, the present invention establishes a sub-node in the process node that can communicate with the outside core by extending the kernel procfs. The extra-core loader that extends the corresponding function loads the dependency library required by the process. When writing a file, the original and real file information of the dependent library file is paired into the aforementioned child node, thereby maintaining the corresponding relationship of the dependent file in the runtime process space of the corresponding process to establish a runtime dependent file tree relationship. . Through this solution, on the one hand, backward compatibility with other kernels and extra-core loaders without this function is maintained (all communications are based on extended child nodes); on the other hand, the life cycle of extended child nodes is subject to the process life cycle The importance of constraints lies in defining the boundaries to reduce the complexity of management and ensure that the creation, work, and death of each process are the same as before, thus ultimately ensuring the normality of the entire system. Based on the process ID information of the application to be packaged, a process dictionary table is generated, and then the dictionary table is converted into a process tree, and the superior-subordinate relationship of the process is analyzed. The process is graphically displayed on the dependency analysis interface, and each process is graphically displayed. Dependency information, each process dependency information bar has an export function button.

无论静态分析模块还是运行时分析模块,用户可以根据应用目标运行的操作系统情况来选择需要包含的依赖信息,导出到待打包应用程序所在目录。Regardless of the static analysis module or the runtime analysis module, users can select the dependency information that needs to be included based on the operating system in which the application target is running, and export it to the directory where the application to be packaged is located.

2、指定rpath路径:2. Specify rpath path:

rapth设置模块是根据应用程序运行所需依赖的依赖库等信息,通过图形化交互界面完成应用程序依赖文件的rapth路径指定,以确保打包好的应用程序在目标操作系统上安装后能找到正确的依赖文件,应用程序能正常运行。The rapth setting module completes the rapth path specification of the application's dependency files through a graphical interactive interface based on information such as the dependent libraries that the application depends on to run, to ensure that the packaged application can find the correct path after it is installed on the target operating system. Depending on the file, the application can run normally.

3、应用程序打包并提供实时进度信息:3. The application is packaged and provides real-time progress information:

完成信息填写,开始打包。对于squashfs文件,squashfs工具mksquashfs相关的代码,是无法实现安全(指多线程)可重入的被宿主程序调用的,这些问题的根源是在于mksquashfs的原始设计,因而导致应用程序无法调用来实时显示打包的进度。为了实现实时显示squashfs文件的打包进程,本发明在应用打包模块中构建一层新的接口层,定义了一套用于可视进度、可中断取消打包的状态机,包括:创建上下文、创建squashfs文件、获取打包处理进度、中断取消打包、销毁上下文等,基于上下文对内部状态的封装,再通过查看ELF文件里的符号表中GLOBAL类型的变量来做封装完整的判断,来实现宿主程序多线程时的可重入使用,以满足多线程的要求,从而实现打包进度的实时显示,封装桌面快捷方式、开始菜单显示及应用卸载等功能,直至打包完成,并且打包中途可终止应用程序打包并回退。如图3所示是本发明的应用打包模块的实时显示的界面图。Complete the information and start packaging. For squashfs files, the code related to the squashfs tool mksquashfs cannot be called by the host program in a safe (referring to multi-threading) reentrancy. The root cause of these problems lies in the original design of mksquashfs, which results in the application being unable to call it for real-time display. Packaging progress. In order to realize the real-time display of the squashfs file packaging process, the present invention builds a new interface layer in the application packaging module and defines a set of state machines for visual progress and interruptible cancellation of packaging, including: creating context and creating squashfs files. , obtain packaging processing progress, interrupt and cancel packaging, destroy context, etc., encapsulate the internal state based on the context, and then make a complete judgment of the encapsulation by looking at the GLOBAL type variables in the symbol table in the ELF file to achieve multi-threading of the host program. It can be reentrant to meet the requirements of multi-threading, thereby realizing real-time display of packaging progress, encapsulating functions such as desktop shortcuts, start menu display, and application uninstallation, until the packaging is completed, and the application packaging can be terminated and rolled back during the packaging process. . Figure 3 shows an interface diagram of the real-time display of the application packaging module of the present invention.

实施例二:Example 2:

本发明实施例二还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如上述实施例一中提供的打包方法。Embodiment 2 of the present invention also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute the packaging method provided in the above-mentioned Embodiment 1.

本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium in this embodiment of the present invention may be any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage media include: an electrical connection having one or more wires, portable computer disk, hard drive, random access memory (RAM), read only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. As used herein, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present invention may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language - such as "C" or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In situations involving remote computers, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as an Internet service provider through Internet connection).

上述实施例仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above embodiments are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of the present invention. within the scope of protection.

Claims (9)

Translated fromChinese
1.一种GNU linux通用的应用程序打包方法,其特征在于,包括:1. A universal application packaging method for GNU Linux, which is characterized by including:S1、基于ELF文件,对于待打包应用程序进行静态依赖分析,通过图形化交互界面显示静态依赖关系并提供导出接口导出到待打包应用程序所在目录;S1. Based on the ELF file, perform static dependency analysis on the application to be packaged, display static dependencies through a graphical interactive interface and provide an export interface to export to the directory where the application to be packaged is located;S2、通过在进程空间建立通信子节点,对于待打包应用程序进行运行态依赖分析,通过图形化交互界面显示运行态依赖关系并提供导出接口导出到待打包应用程序所在目录;S2. By establishing communication sub-nodes in the process space, perform a running dependency analysis on the application to be packaged, display the running dependencies through a graphical interactive interface and provide an export interface to export to the directory where the application to be packaged is located;S3、通过图形化交互界面完成应用程序依赖文件的rapth路径指定;S3. Complete the rapth path specification of application dependent files through the graphical interactive interface;S4、对于squashfs文件构建接口层,使用上下文封装内部,通过查看生成的ELF文件的符号表来判断封装的完整性,实现打包进度在图形化交互界面的实时显示以及终止打包功能;S4. For the squashfs file to build the interface layer, use the context to encapsulate the interior and judge the integrity of the package by viewing the symbol table of the generated ELF file to realize the real-time display of the packaging progress on the graphical interactive interface and the termination of packaging function;S5、通过在图形化交互界面完成信息填写并开始打包至完成或终止。S5. Complete the information filling in the graphical interactive interface and start packaging until completion or termination.2.根据权利要求1所述的一种GNU linux通用的应用程序打包方法,其特征在于,步骤S1中所述静态依赖分析的过程包括:2. A GNU linux universal application packaging method according to claim 1, characterized in that the static dependency analysis process in step S1 includes:S101、读取待打包应用程序的ELF文件,抓取ELF文件的needed信息,获取直接依赖的依赖库文件名称;S101. Read the ELF file of the application to be packaged, grab the needed information of the ELF file, and obtain the name of the directly dependent dependent library file;S102、基于依赖库文件名称通过查询自定义路径或者系统默认ld.so.cache,获取依赖库文件的全路径;S102. Based on the name of the dependent library file, obtain the full path of the dependent library file by querying the custom path or the system default ld.so.cache;S103、通过广度遍历算法递归获取待打包应用程序目录中的所有ELF文件的所有依赖库的信息,合并库文件采用集合进行去重,获取到所有依赖库目录,得到待打包应用程序的全部静态依赖。S103. Recursively obtain the information of all dependent libraries of all ELF files in the application directory to be packaged through the breadth traversal algorithm, merge the library files using sets to remove duplication, obtain all dependent library directories, and obtain all static dependencies of the application to be packaged. .3.根据权利要求1所述的一种GNU linux通用的应用程序打包方法,其特征在于,步骤S2中所述运行态依赖分析的过程包括:3. A GNU linux universal application packaging method according to claim 1, characterized in that the process of running state dependency analysis in step S2 includes:S201、对内核procfs进行扩展,在进程节点内建立一个与核外通信的子节点;S201. Expand the kernel procfs and establish a sub-node in the process node that communicates with outside the core;S202、核外加载器在加载进程需要的依赖库文件时,写入依赖库文件原始与真实文件信息对到所述子节点内;S202. When loading the dependent library file required by the process, the external loader writes the original and real file information pair of the dependent library file into the child node;S203、基于写入子节点的依赖库文件原始与真实文件信息建立运行时的依赖文件树关系。S203. Establish a runtime dependency file tree relationship based on the original dependency library file written to the child node and the real file information.4.根据权利要求1所述的一种GNU linux通用的应用程序打包方法,其特征在于,步骤S4具体包括:4. A GNU linux universal application packaging method according to claim 1, characterized in that step S4 specifically includes:S401、图形化交互界面程序中,对于squashfs文件构建一层接口层,定义一套用于可视进度、可中断取消打包的状态机,包括:创建上下文、创建squashfs文件、获取打包处理进度、中断取消打包、销毁上下文;S401. In the graphical interactive interface program, build an interface layer for the squashfs file and define a set of state machines for visual progress and interruptible cancellation of packaging, including: creating context, creating squashfs file, obtaining packaging processing progress, and interrupting cancellation. Pack and destroy context;S402、基于上下文对内部状态的封装,再通过查看ELF文件里的符号表中GLOBAL类型的变量来做封装完整的判断,实现宿主程序多线程时的可重入使用,从而实现打包进度的实时显示。S402. Encapsulate the internal state based on the context, and then check the GLOBAL type variables in the symbol table in the ELF file to make a complete judgment of the encapsulation, so as to realize the reentrant use of the host program when it is multi-threaded, so as to realize the real-time display of the packaging progress. .5.一种GNU linux通用的图形化应用打包器,其特征在于,包括:图形化交互界面以及与图形化交互界面关联的静态分析模块、运行时分析模块、rapth设置模块、应用打包模块;5. A GNU linux universal graphical application packager, which is characterized in that it includes: a graphical interactive interface and a static analysis module, a runtime analysis module, a rapth setting module, and an application packaging module associated with the graphical interactive interface;静态分析模块:基于ELF文件,对于待打包应用程序进行静态依赖分析,通过图形化交互界面显示静态依赖关系并提供导出接口导出到待打包应用程序所在目录;Static analysis module: Based on the ELF file, perform static dependency analysis on the application to be packaged, display static dependencies through a graphical interactive interface and provide an export interface to export to the directory where the application to be packaged is located;运行时分析模块:通过在进程空间建立通信子节点,对于待打包应用程序进行运行态依赖分析,通过图形化交互界面显示运行态依赖关系并提供导出接口导出到待打包应用程序所在目录;Runtime analysis module: By establishing communication sub-nodes in the process space, it performs runtime dependency analysis on the application to be packaged, displays the runtime dependencies through a graphical interactive interface, and provides an export interface to export to the directory where the application to be packaged is located;rapth设置模块:通过图形化交互界面完成应用程序依赖文件的rapth路径指定;Rapth setting module: completes the rapth path specification of application dependent files through a graphical interactive interface;应用打包模块:对于squashfs文件构建接口层,使用上下文封装内部,通过查看生成的ELF文件的符号表来判断封装的完整性,实现打包进度在图形化交互界面的实时显示以及终止打包功能;Application packaging module: To build the interface layer for squashfs files, use the context to encapsulate the interior, and judge the integrity of the package by viewing the symbol table of the generated ELF file, so as to realize the real-time display of the packaging progress on the graphical interactive interface and the function of terminating the packaging;图形化交互界面:通过在图形化交互界面完成信息填写并开始打包至完成或终止。Graphical interactive interface: Complete information filling in the graphical interactive interface and start packaging to completion or termination.6.根据权利要求5所述的一种GNU linux通用的图形化应用打包器,其特征在于,静态分析模块包括:6. A GNU linux universal graphical application packager according to claim 5, characterized in that the static analysis module includes:读取单元:读取待打包应用程序的ELF文件,抓取ELF文件的needed信息,获取直接依赖的依赖库文件名称;Reading unit: reads the ELF file of the application to be packaged, grabs the needed information of the ELF file, and obtains the name of the directly dependent dependent library file;查询单元:基于依赖库文件名称通过查询自定义路径或者系统默认ld.so.cache,获取依赖库文件的全路径;Query unit: Based on the name of the dependent library file, obtain the full path of the dependent library file by querying the custom path or the system default ld.so.cache;遍历去重单元:通过广度遍历算法递归获取待打包应用程序目录中的所有ELF文件的所有依赖库的信息,合并库文件采用集合进行去重,获取到所有依赖库目录,得到待打包应用程序的全部静态依赖。Traversal deduplication unit: Recursively obtain the information of all dependent libraries of all ELF files in the application directory to be packaged through the breadth traversal algorithm, merge the library files using a collection to remove duplication, obtain all dependent library directories, and obtain the information of the application to be packaged. All static dependencies.7.根据权利要求5所述的一种GNU linux通用的图形化应用打包器,其特征在于,运行时分析模块包括:7. A GNU linux universal graphical application packager according to claim 5, characterized in that the runtime analysis module includes:子节点建立单元:对内核procfs进行扩展,在进程节点内建立一个与核外通信的子节点;Sub-node establishment unit: Expand the kernel procfs and establish a sub-node in the process node that communicates with outside the core;核外加载单元:核外加载器在加载进程需要的依赖库文件时,写入依赖库文件原始与真实文件信息对到所述子节点内;Out-of-core loading unit: When loading the dependent library files required by the process, the out-of-core loader writes the original and real file information pairs of the dependent library files into the child nodes;关系建立单元:基于写入子节点的依赖库文件原始与真实文件信息建立运行时的依赖文件树关系。Relationship establishment unit: Establish a dependency file tree relationship at runtime based on the original and real file information of the dependent library file written to the child node.8.根据权利要求5所述的一种GNU linux通用的图形化应用打包器,其特征在于,应用打包模块包括:8. A GNU linux universal graphical application packager according to claim 5, characterized in that the application packaging module includes:接口层单元:对于squashfs文件构建一层接口层,定义一套用于可视进度、可中断取消打包的状态机,包括:创建上下文、创建squashfs文件、获取打包处理进度、中断取消打包、销毁上下文;Interface layer unit: Build an interface layer for squashfs files, and define a set of state machines for visual progress and interruptible unpacking, including: creating context, creating squashfs files, obtaining packaging processing progress, interrupting unpacking, and destroying contexts;可重入使用单元:基于上下文对内部状态的封装,再通过查看ELF文件里的符号表中GLOBAL类型的变量来做封装完整的判断,实现宿主程序多线程时的可重入使用,从而实现打包进度的实时显示。Reentrant usage unit: Encapsulates the internal state based on the context, and then checks the GLOBAL type variable in the symbol table in the ELF file to make a complete judgment of the encapsulation, realizing reentrant use when the host program is multi-threaded, thereby realizing packaging Real-time display of progress.9.一种计算机可读存储介质,其特征在于,所述存储介质存储有计算机程序,所述计算机程序用于执行权利要求1-4任一项所述的GNU linux通用的应用程序打包方法。9. A computer-readable storage medium, characterized in that the storage medium stores a computer program, and the computer program is used to execute the GNU linux universal application packaging method described in any one of claims 1-4.
CN202311669092.8A2023-12-072023-12-07GNU linux universal application program packaging method and graphical application packerActiveCN117369865B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202311669092.8ACN117369865B (en)2023-12-072023-12-07GNU linux universal application program packaging method and graphical application packer

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202311669092.8ACN117369865B (en)2023-12-072023-12-07GNU linux universal application program packaging method and graphical application packer

Publications (2)

Publication NumberPublication Date
CN117369865Atrue CN117369865A (en)2024-01-09
CN117369865B CN117369865B (en)2024-04-05

Family

ID=89394800

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202311669092.8AActiveCN117369865B (en)2023-12-072023-12-07GNU linux universal application program packaging method and graphical application packer

Country Status (1)

CountryLink
CN (1)CN117369865B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104462352A (en)*2014-12-042015-03-25北京国双科技有限公司Data packing method and device
KR101513662B1 (en)*2014-10-072015-04-20충남대학교산학협력단Search system and method of executable GUI
CN107391528A (en)*2016-03-302017-11-24阿里巴巴集团控股有限公司Front end assemblies Dependency Specification searching method and equipment
WO2019153829A1 (en)*2018-02-122019-08-15人和未来生物科技(长沙)有限公司Method and system for rapid generation of container dockerfile and container mirror image
CN110347398A (en)*2018-04-082019-10-18阿里巴巴集团控股有限公司A kind of packaging method and device of application program
CN110865888A (en)*2019-11-282020-03-06米哈游科技(上海)有限公司Resource loading method and device, server and storage medium
CN111162953A (en)*2019-12-312020-05-15四川省公安科研中心Data processing method, system upgrading method and server
CN111949312A (en)*2020-08-142020-11-17曙光信息产业(北京)有限公司Data module packaging method and device, computer equipment and storage medium
CN113885935A (en)*2021-09-292022-01-04厦门雅基软件有限公司Resource packaging method and device, electronic equipment and computer readable storage medium
CN113986395A (en)*2021-11-082022-01-28麒麟软件有限公司Packaging method for applying dependent self-contained technology under linux system
CN115268991A (en)*2022-08-052022-11-01中国平安财产保险股份有限公司Dependency analysis optimization method, dependency analysis optimization device, dependency analysis equipment and storage medium
CN115543269A (en)*2022-09-302022-12-30中电信数智科技有限公司System and method for solving micro-service external dependency complexity through arrangement mode
CN115543294A (en)*2022-12-062022-12-30麒麟软件有限公司 A method for generating a visual dependency tree of a dynamic link library on a Linux system

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
KR101513662B1 (en)*2014-10-072015-04-20충남대학교산학협력단Search system and method of executable GUI
CN104462352A (en)*2014-12-042015-03-25北京国双科技有限公司Data packing method and device
CN107391528A (en)*2016-03-302017-11-24阿里巴巴集团控股有限公司Front end assemblies Dependency Specification searching method and equipment
WO2019153829A1 (en)*2018-02-122019-08-15人和未来生物科技(长沙)有限公司Method and system for rapid generation of container dockerfile and container mirror image
CN110347398A (en)*2018-04-082019-10-18阿里巴巴集团控股有限公司A kind of packaging method and device of application program
CN110865888A (en)*2019-11-282020-03-06米哈游科技(上海)有限公司Resource loading method and device, server and storage medium
CN111162953A (en)*2019-12-312020-05-15四川省公安科研中心Data processing method, system upgrading method and server
CN111949312A (en)*2020-08-142020-11-17曙光信息产业(北京)有限公司Data module packaging method and device, computer equipment and storage medium
CN113885935A (en)*2021-09-292022-01-04厦门雅基软件有限公司Resource packaging method and device, electronic equipment and computer readable storage medium
CN113986395A (en)*2021-11-082022-01-28麒麟软件有限公司Packaging method for applying dependent self-contained technology under linux system
CN115268991A (en)*2022-08-052022-11-01中国平安财产保险股份有限公司Dependency analysis optimization method, dependency analysis optimization device, dependency analysis equipment and storage medium
CN115543269A (en)*2022-09-302022-12-30中电信数智科技有限公司System and method for solving micro-service external dependency complexity through arrangement mode
CN115543294A (en)*2022-12-062022-12-30麒麟软件有限公司 A method for generating a visual dependency tree of a dynamic link library on a Linux system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
TRUPTI M HAKE: "Process of Building up an Application Packaging", 《INTERNATIONAL JOURNAL OF COMPUTER AND INFORMATION TECHNOLOGY》, vol. 2, no. 3*
我爱PYTHON数据挖掘: "可视化 Python 打包 exe,这个神器绝了!", Retrieved from the Internet <URL:《https://blog.csdn.net/weixin_38037405/article/details/120992428》>*

Also Published As

Publication numberPublication date
CN117369865B (en)2024-04-05

Similar Documents

PublicationPublication DateTitle
CN110716715B (en)Application program development method, device, equipment and medium
CN103530137B (en)A kind of Java web applications dispositions method and device
TWI536263B (en)Projecting native application programming interfaces of an operating system into other programming languages
CN111740948A (en)Data packet issuing method, dynamic updating method, device, equipment and medium
WO2024045382A1 (en)Implementation of reflective mechanism in blockchain
WO2024045379A1 (en)Compiling method, compiler, and wasm virtual machine
CN112463123A (en)Task compiling method, device, network node, system and storage medium
CN114625473A (en)Upgrading method and device, electronic equipment and medium
CN108037949B (en) Installation package multi-channel packaging method, device, computer equipment and storage medium
CN109032936A (en)A kind of desktop automatic test development approach and system
CN115373731A (en) A public code resource sharing method, device, equipment, and storage medium
CN117369865A (en)GNU linux universal application program packaging method and graphical application packer
US11775471B2 (en)System and method for caching converted files and compiling computer code from the cache
CN118034766A (en)Script file packaging method, system, storage medium and computer equipment
CN115495421A (en)Data formatting method, device, electronic equipment and medium
CN113961234A (en)Construction method and related device of Linux distribution version
CN114816358A (en) A service platform development method and device
US8751480B1 (en)Virtual arrays in an array-based language
CN118245154A (en)Interface rendering method and device, electronic equipment and storage medium
US20240427648A1 (en)Eye-catcher injection into library transformation
CN115658023B (en)Building cockpit system generation method, device, equipment, medium and product
CN111562940B (en)Project data construction method and device
CN114428687A (en) A method for canceling encryption and decryption tasks under the iOS platform and related equipment
CN115390804A (en)Virtual environment integration method, computing device and storage medium
CN118733199A (en) Kvisor configuration method, device and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp