Cross-platform compiling method and device of Linux module, computer equipment and medium
By receiving and adjusting the compiled file package, adapting to the application platform architecture, and compiling Linux module code, the problem of failed compilation of Linux modules across platforms is solved and development efficiency is improved.
Patent Information
- Application Number
- CN202510162021.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2045-02-14
AI Technical Summary
During the cross-compilation process of Linux modules, it is difficult for existing technology to achieve cross-platform compilation, resulting in compilation failure and development efficiency decline.
By receiving the compiled file package sent by the development platform, decompressing and adjusting it to adapt to the architecture of the application platform, then receiving and compiling the Linux module code, and using the adjusted compiled file package for compilation.
It realizes the establishment of a stable compilation environment on the application platform, reduces the number of compiled files managed by technicians, shortens the time for building a compilation environment, and improves the development efficiency of Linux modules.
Smart Images

Figure CN119645422A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of embedded technology, and in particular to a cross-platform compilation method, device, computer equipment and medium for a Linux module. Background Art
[0002] Linux is an open source Unix-like operating system kernel. It is often used to develop applications for embedded devices because of its stability and customizability. In the cross-compilation process of Linux modules, it is necessary to develop and apply Linux modules on platforms with different architectures, which easily leads to the problem of Linux module cross-platform compilation failure.
[0003] In the prior art, in order to avoid the problem of Linux module cross-platform compilation failure, technicians will configure the compilation environment of the Linux module on platforms of different architectures, and constantly switch the compilation environment during the development process to perform compilation verification. However, each time the technician switches the compilation environment, the compilation file needs to be regenerated, which increases the complexity of compiling file management, thereby reducing the development efficiency of the Linux module. Summary of the invention
[0004] Based on this, it is necessary to provide a cross-platform compilation method, device, computer equipment and medium for Linux modules to improve the development efficiency of Linux modules in response to the above technical problems.
[0005] In a first aspect, the present invention provides a cross-platform compilation method for a Linux module, applicable to an application platform, the method comprising: Receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; Adjust the compiled file package according to the compatibility between the compiled file package and the application platform; Receive the Linux module code sent by the development platform; Compile the Linux module code through the adjusted compilation file package.
[0006] In one of the embodiments, the compiled file package is adjusted according to the adaptation result between the compiled file package and the application platform, including: if the compiled file package is not compatible with the application platform, modifying the configuration file in the compiled file package.
[0007] In one embodiment, the Linux module code is compiled using the adjusted compilation file package, including: setting the compilation directory of the Linux module code as the target compilation directory; and compiling the Linux module code using the adjusted compilation file package under the target compilation directory.
[0008] In one of the embodiments, the compiled Linux module code is installed into the Linux kernel; the Linux module code is run, and the running status of the Linux module code is monitored; based on the running status of the Linux module code, a running log file of the Linux module code is generated; the running log file includes fault information of the Linux module code; and the running log file is sent to a development platform.
[0009] In a second aspect, the present invention provides a cross-platform compilation method for a Linux module, which is applicable to a development platform, and the method comprises: Compile the Linux kernel source code to obtain the compiled file package; Sending the compiled file package to the application platform so that the application platform decompresses the compiled file package to the target compilation directory and adjusts the compiled file package according to the compatibility between the compiled file package and the application platform; The constructed Linux module code is sent to the application platform, so that the application platform compiles the Linux module code through the adjusted compilation file package.
[0010] In one of the embodiments, compiling the Linux kernel source code includes: installing the Linux kernel compilation dependency file; and compiling the Linux kernel source code according to the Linux kernel compilation dependency file to obtain a compilation file package.
[0011] In one of the embodiments, a running log file sent by an application platform is received; and the Linux module code is corrected according to the fault information in the running log file.
[0012] In a third aspect, the present invention further provides a cross-platform compilation device for a Linux module, comprising: The first receiving module is used to receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; An adjustment module, used for adjusting the compiled file package according to the adaptation result between the compiled file package and the application platform; A second receiving module is used to receive the Linux module code sent by the development platform; The compilation module is used to compile the Linux module code through the adjusted compilation file package.
[0013] In a fourth aspect, the present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: Receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; Adjust the compiled file package according to the adaptation result between the compiled file package and the application platform; Receive the Linux module code sent by the development platform; Compile the Linux module code through the adjusted compilation file package.
[0014] In a fifth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented: Receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; Adjust the compiled file package according to the adaptation result between the compiled file package and the application platform; Receive the Linux module code sent by the development platform; Compile the Linux module code through the adjusted compilation file package.
[0015] The cross-platform compilation method, device, computer equipment and medium of the Linux module receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory, so as to facilitate the management of the compilation file package; according to the adaptation result of the compilation file package and the application platform, the compilation file package is adjusted so that the compilation file package can adapt to the architecture of the application platform, so that a stable compilation environment can be established on the application platform through the transmission of a single compilation file package, avoiding the need for technical personnel to regenerate the compilation file package every time the compilation environment is switched, and reducing the number of compilation files that technical personnel need to manage; receiving the Linux module code sent by the development platform, and then compiling the Linux module code through the adjusted compilation file package, shortening the compilation environment setup time required in the Linux module code compilation process, thereby improving the development efficiency of the Linux module. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments of the present invention or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 A schematic diagram of a cross-platform compilation method for a Linux module in one embodiment; Figure 2 A flowchart of steps related to Linux module code running feedback in one embodiment; Figure 3It is a flowchart of a cross-platform compilation method of a Linux module in another embodiment; Figure 4 A flowchart of the steps of adjusting the Linux module code in one embodiment; Figure 5 It is a structural block diagram of a cross-platform compiling device for Linux modules in one embodiment; Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0018] The technical scheme in the embodiment of the present invention is described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.
[0019] In an alternative embodiment, if Figure 1 As shown, a cross-platform compilation method for Linux modules is provided, which is applicable to application platforms. In this embodiment, the method includes the following steps: S110, receiving a compilation file package sent by the development platform, and decompressing the compilation file package into a target compilation directory.
[0020] The development platform can be understood as a platform with the configuration required for Linux module development, and the application platform can be understood as a platform with the configuration required for Linux module code operation. The data transmission method between the development platform and the application platform can include network transmission method and physical transmission method. Exemplarily, the physical transmission method can include data transmission through a data storage device (such as a USB flash drive).
[0021] Furthermore, the compiled file package can be understood as a file package that can be used to compile Linux module code, such as a Linux kernel header file package. The compiled file package may include data declaration files and configuration files, etc. The data declaration file can be understood as a file that declares constants, variables, data structures, and function prototypes, etc. The configuration file can be understood as a file used to match the platform configuration. The target compilation directory can be understood as a directory where the compiled file package is stored. Optionally, those skilled in the art can specify the target compilation directory or set the target compilation directory to an arbitrary directory based on actual needs or experience, and this is not limited here.
[0022] In an optional embodiment, the application platform may accept a Linux kernel header file package sent by a developer, and decompress the Linux kernel header file package into any directory, and then use the decompressed directory of the Linux kernel header file as the target compilation directory.
[0023] S120: Adjust the compiled file package according to the adaptation result between the compiled file package and the application platform.
[0024] It should be noted that if the compiled file package is incompatible with the application platform, it may cause compilation errors and abnormal operation of the Linux module code, so the compiled file package needs to be adjusted. The above incompatibility may include the configuration information in the compiled file package being incompatible with the architecture of the application platform.
[0025] In an optional embodiment, if the compiled file package is not compatible with the application platform, the configuration file in the compiled file package is modified.
[0026] Optionally, the configuration file may include executable files such as modpost and fixdep that are relevant to the application platform.
[0027] S130, receiving the Linux module code sent by the development platform.
[0028] Among them, Linux module can be understood as an extensible module of the Linux kernel. By installing the Linux module into the Linux kernel, the functions of the Linux kernel can be extended. The Linux module code can be understood as the program code for extending the functions of the Linux kernel. By installing the Linux module code into the Linux kernel, tasks that meet specific needs can be achieved.
[0029] S140, compile the Linux module code using the adjusted compilation file package.
[0030] Optionally, the process of compiling the Linux module code may include processing other codes or libraries on which the Linux module code depends to avoid the problem of missing Linux module code dependencies; generating a specific format file that the kernel can recognize, such as a .ko file (kernel module file), to prevent the Linux kernel from being unable to recognize the Linux module code format.
[0031] In an optional embodiment, the compilation directory of the Linux module code may be set as the target compilation directory; and the Linux module code is compiled using the adjusted compilation file package under the target compilation directory.
[0032] In this embodiment, by receiving the compilation file package sent by the development platform and unzipping the compilation file package to the target compilation directory, the management of the compilation file package is facilitated; according to the adaptation result of the compilation file package and the application platform, the compilation file package is adjusted so that the compilation file package can adapt to the architecture of the application platform, so that a stable compilation environment can be established on the application platform through the transmission of a single compilation file package, avoiding the need for technical personnel to regenerate the compilation file package every time the compilation environment is switched, and reducing the number of compilation files that technical personnel need to manage; receiving the Linux module code sent by the development platform, and then compiling the Linux module code through the adjusted compilation file package, shortening the compilation environment setup time required in the Linux module code compilation process, thereby improving the development efficiency of the Linux module.
[0033] Based on the technical solutions of the above embodiments, the present invention also provides an optional embodiment, in which a correlation step of Linux module code running feedback is added.
[0034] See also Figure 2 The Linux module code shown runs the feedback dependency steps, including: S210, installing the compiled Linux module code into the Linux kernel.
[0035] Specifically, the installation of the Linux module code may include providing the permissions required for installation, moving the compiled Linux module code to a suitable location, loading the Linux module through a load command, and determining whether the Linux module is successfully loaded through relevant commands.
[0036] S220, running the Linux module code and monitoring the running status of the Linux module code.
[0037] The running status of the Linux module code may include normal running, running failure, error running, etc.
[0038] S230, generating a Linux module code operation record file according to the operation status of the Linux module code.
[0039] Optionally, the operation log file may include failure information of the Linux module code (for example, operation failure caused by incorrect reference of the Linux module code), etc.
[0040] S240, sending the operation record file to the development platform.
[0041] In this embodiment, the compiled Linux module code is installed into the Linux kernel; the Linux module code is run, and the running status of the Linux module code is monitored; based on the running status of the Linux module code, a running log file of the Linux module code is generated, which can record relevant fault information when problems occur in the Linux module operation, and then send the running log file to the development platform, which helps technicians to modify the Linux module code, thereby eliminating faults in the rapid iteration of the Linux module and improving the functionality of the Linux module.
[0042] In another alternative embodiment, Figure 3 As shown, a cross-platform compilation method for Linux modules is provided, which is applicable to development platforms. In this embodiment, the method includes the following steps: S310, compile the Linux kernel source code to obtain a compilation file package.
[0043] It should be noted that technicians can obtain the appropriate version of Linux kernel source code according to development requirements. When compiling Linux module code, the Linux module needs to interact and connect with the Linux kernel, and the compilation file package can provide the Linux module with the internal information and interface specifications of the Linux kernel, so that the Linux module code can be correctly compiled and run according to the requirements of the Linux kernel.
[0044] In an optional embodiment, the Linux kernel source code may be compiled to obtain a Linux header file package.
[0045] Optionally, the compilation process of the Linux kernel source code may include: installing a Linux kernel compilation dependency file; and compiling the Linux kernel source code according to the Linux kernel compilation dependency file to obtain a compilation file package.
[0046] The Linux kernel compilation dependency files can be understood as files required for Linux kernel compilation. Exemplarily, the Linux kernel compilation dependency files can include compiler (such as GCC, etc.) files, Make tool files, dependency library files, and kernel configuration files.
[0047] S320, sending the compiled file package to the application platform, so that the application platform decompresses the compiled file package to the target compilation directory, and adjusts the compiled file package according to the compatibility between the compiled file package and the application platform.
[0048] S330, sending the constructed Linux module code to the application platform, so that the application platform compiles the Linux module code through the adjusted compilation file package.
[0049] The Linux module code may be constructed based on functional requirements. For example, if a hardware driver function needs to be added to the Linux kernel, a Linux module code with the hardware driver function is constructed.
[0050] In this embodiment, by compiling the Linux kernel source code, obtaining the compiled file package, and sending the compiled file package to the application platform, the application platform can be initially provided with the compilation environment required for Linux module compilation, and then after adjustment of the application platform, the application platform has a stable compilation environment, without the need to regenerate the compilation file package every time the compilation environment is switched, thereby reducing the number of compilation files that technical personnel need to manage; sending the constructed Linux module code to the application platform, and compiling the Linux module code in the compilation environment of the application platform can effectively avoid the problem of cross-platform compilation failure of the Linux module.
[0051] Based on the technical solutions of the above embodiments, the present invention further provides an optional embodiment, in which a step of adjusting the relevance of the Linux module code is added.
[0052] See also Figure 4 The steps shown to adjust the dependencies of the Linux module code include: S410, receiving a running record file sent by the application platform.
[0053] S420, modify the Linux module code according to the fault information in the operation record file.
[0054] In an optional embodiment, if the fault information in the operation log file includes an operation failure caused by an incorrect reference to the Linux module code, the Linux module code can be checked based on the fault information, and the incorrect reference statement in the Linux module code can be modified to avoid the operation failure of the Linux module code.
[0055] In this embodiment, the development platform receives the operation log file sent by the application platform, and modifies the Linux module code according to the fault information in the operation log file, so that the problems existing in the Linux module code can be quickly corrected, thereby ensuring the operation stability of the Linux module code. It should be understood that although the various steps in the flowcharts involved in the embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless clearly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0056] Based on the same inventive concept, an embodiment of the present invention further provides a cross-platform compilation device for Linux modules for implementing the cross-platform compilation method for Linux modules involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the cross-platform compilation device for one or more Linux modules provided below can refer to the limitations of the method above, and will not be repeated here.
[0057] In an exemplary embodiment, Figure 5 As shown, a cross-platform compilation device for Linux modules is provided, comprising: a first receiving module 510, an adjustment module 520, a second receiving module 530 and a compilation module 540, wherein: The first receiving module 510 is used to receive the compilation file package sent by the development platform and decompress the compilation file package to a target compilation directory.
[0058] The adjustment module 520 is used to adjust the compiled file package according to the adaptation result between the compiled file package and the application platform.
[0059] The second receiving module 530 is used to receive the Linux module code sent by the development platform.
[0060] The compiling module 540 is used to compile the Linux module code through the adjusted compiling file package.
[0061] In one embodiment, the first receiving module 510 includes: a modifying unit, configured to modify a configuration file in the compiled file package if the compiled file package is not compatible with the application platform.
[0062] In one embodiment, the compiling module 540 includes: a setting unit for setting the compiling directory of the Linux module code as the target compiling directory; a compiling unit for compiling the Linux module code through the adjusted compiling file package under the target compiling directory. Each module in the above device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0063] In an exemplary embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a cross-platform compilation method of a Linux module is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0064] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the present invention, and does not constitute a limitation on the computer device to which the present invention is applied. The specific computer device may include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0065] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented: Receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; Adjust the compiled file package according to the compatibility between the compiled file package and the application platform; Receive the Linux module code sent by the development platform; Compile the Linux module code through the adjusted compilation file package.
[0066] In one embodiment, when the processor executes the computer program, the following steps are further implemented: if the compiled file package is not compatible with the application platform, modifying the configuration file in the compiled file package.
[0067] In one embodiment, when the processor executes the computer program, the following steps are also implemented: setting the compilation directory of the Linux module code as the target compilation directory; and compiling the Linux module code through the adjusted compilation file package under the target compilation directory.
[0068] In one embodiment, when the processor executes the computer program, the following steps are also implemented: installing the compiled Linux module code into the Linux kernel; running the Linux module code and monitoring the running status of the Linux module code; generating a running log file of the Linux module code according to the running status of the Linux module code; the running log file includes fault information of the Linux module code; and sending the running log file to the development platform.
[0069] In one embodiment, when the processor executes the computer program, the following steps are also implemented: compiling the Linux kernel source code to obtain a compiled file package; sending the compiled file package to the application platform so that the application platform decompresses the compiled file package to the target compilation directory, and adjusts the compiled file package according to the compatibility of the compiled file package with the application platform; sending the constructed Linux module code to the application platform so that the application platform compiles the Linux module code through the adjusted compiled file package.
[0070] In one embodiment, when the processor executes the computer program, the following steps are also implemented: installing the Linux kernel compilation dependency file; and compiling the Linux kernel source code according to the Linux kernel compilation dependency file to obtain a compilation file package.
[0071] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: receiving a running log file sent by the application platform; and modifying the Linux module code according to the fault information in the running log file.
[0072] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; Adjust the compiled file package according to the compatibility between the compiled file package and the application platform; Receive the Linux module code sent by the development platform; The Linux module code is compiled by the adjusted compiled file package. In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the compiled file package is not compatible with the application platform, the configuration file in the compiled file package is modified.
[0073] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: setting the compilation directory of the Linux module code as the target compilation directory; and compiling the Linux module code through the adjusted compilation file package under the target compilation directory.
[0074] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: installing the compiled Linux module code into the Linux kernel; running the Linux module code and monitoring the running status of the Linux module code; generating a running log file of the Linux module code according to the running status of the Linux module code; the running log file includes fault information of the Linux module code; and sending the running log file to the development platform.
[0075] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: compiling the Linux kernel source code to obtain a compiled file package; sending the compiled file package to the application platform so that the application platform decompresses the compiled file package to the target compilation directory, and adjusts the compiled file package according to the compatibility of the compiled file package with the application platform; sending the constructed Linux module code to the application platform so that the application platform compiles the Linux module code through the adjusted compiled file package.
[0076] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: installing the Linux kernel compilation dependency file; compiling the Linux kernel source code according to the Linux kernel compilation dependency file to obtain a compilation file package.
[0077] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving a running log file sent by the application platform; and modifying the Linux module code according to the fault information in the running log file.
[0078] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps: Receive the compilation file package sent by the development platform and decompress the compilation file package to the target compilation directory; Adjust the compiled file package according to the compatibility between the compiled file package and the application platform; Receive the Linux module code sent by the development platform; Compile the Linux module code through the adjusted compilation file package.
[0079] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the compiled file package is not compatible with the application platform, modify the configuration file in the compiled file package.
[0080] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: setting the compilation directory of the Linux module code as the target compilation directory; and compiling the Linux module code through the adjusted compilation file package under the target compilation directory.
[0081] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: installing the compiled Linux module code into the Linux kernel; running the Linux module code and monitoring the running status of the Linux module code; generating a running log file of the Linux module code according to the running status of the Linux module code; the running log file includes fault information of the Linux module code; and sending the running log file to the development platform.
[0082] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: compiling the Linux kernel source code to obtain a compiled file package; sending the compiled file package to the application platform so that the application platform decompresses the compiled file package to the target compilation directory, and adjusts the compiled file package according to the compatibility of the compiled file package with the application platform; sending the constructed Linux module code to the application platform so that the application platform compiles the Linux module code through the adjusted compiled file package.
[0083] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: installing the Linux kernel compilation dependency file; compiling the Linux kernel source code according to the Linux kernel compilation dependency file to obtain a compilation file package.
[0084] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving a running log file sent by the application platform; and modifying the Linux module code according to the fault information in the running log file.
[0085] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The processor involved in each embodiment provided by the present invention can be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, an artificial intelligence (AI) processor, etc., but is not limited thereto.
[0086] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.
[0087] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A cross-platform compilation method for Linux modules, characterized in that: Applicable to the application platform, the method comprises: Receive the compilation file package sent by the development platform, and decompress the compilation file package to the target compilation directory; Adjusting the compiled file package according to the compatibility of the compiled file package with the application platform; Receiving Linux module code sent by the development platform; The Linux module code is compiled using the adjusted compilation file package.
2. The method according to claim 1, characterized in that The adjusting the compiled file package according to the adaptation of the compiled file package to the application platform includes: If the compiled file package is not compatible with the application platform, the configuration file in the compiled file package is modified.
3. The method according to claim 1, characterized in that: The step of compiling the Linux module code by using the adjusted compilation file package includes: Setting the compilation directory of the Linux module code to the target compilation directory; The Linux module code is compiled using the adjusted compilation file package under the target compilation directory.
4. The method according to claim 3, characterized in that Also includes: Install the compiled Linux module code into the Linux kernel; Running the Linux module code and monitoring the running status of the Linux module code; Generate an operation record file of the Linux module code according to the operation status of the Linux module code; the operation record file includes fault information of the Linux module code; The operation record file is sent to the development platform.
5. A cross-platform compilation method for Linux modules, characterized in that: Applicable to the development platform, the method comprises: Compile the Linux kernel source code to obtain the compiled file package; Sending the compiled file package to the application platform, so that the application platform decompresses the compiled file package to a target compilation directory, and adjusts the compiled file package according to the compatibility between the compiled file package and the application platform; The constructed Linux module code is sent to the application platform, so that the application platform compiles the Linux module code through the adjusted compilation file package.
6. The method according to claim 5, characterized in that The compiling of the Linux kernel source code includes: Install Linux kernel compilation dependency files; According to the Linux kernel compilation dependency file, the Linux kernel source code is compiled to obtain a compilation file package.
7. The method according to claim 5, characterized in that Also includes: Receive the operation record file sent by the application platform; Modify the Linux module code according to the fault information in the operation log file.
8. A cross-platform compilation device for Linux modules, characterized in that: The device comprises: A first receiving module, used for receiving a compilation file package sent by a development platform, and decompressing the compilation file package into a target compilation directory; An adjustment module, used for adjusting the compiled file package according to the adaptation result between the compiled file package and the application platform; A second receiving module is used to receive the Linux module code sent by the development platform; The compiling module is used to compile the Linux module code through the adjusted compiling file package.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and module for emergently probing system information
CN102314382A
Cross-platform system compiling and building method
CN103853589A
Multi-platform compiling detection method and device, equipment and medium
CN111061489A
Cross-platform software compiling method and system
CN114281340A
Cross-platform compiling method and device, electronic equipment and storage medium
CN116257250A
Cited By
Docker-based linux kernel compiling method and system
CN120872355A