Compilation control device and program

The compilation control device simplifies path management for device drivers on containers by using absolute and relative paths to maintain consistent path information, addressing the complexity of kernel source management across host and container environments.

JP2025108198AActive Publication Date: 2025-07-23TOSHIBA TEC KK
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024001964
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-07-23
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

The management of path information for kernel sources becomes complex when compiling device drivers on containers due to potential differences in paths between the host and the container environments.

Method used

A compilation control device that includes a container management unit, a first mount unit, a path determination unit, and a compilation unit, which uses absolute and relative paths to manage and mount kernel and driver sources on containers, ensuring equivalent path management as on the host.

Benefits of technology

This approach simplifies path information management during device driver compilation on containers, allowing the use of consistent path information across environments and reducing management load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025108198000001_ABST
    Figure 2025108198000001_ABST
Patent Text Reader

Abstract

To provide a compilation control device and a program capable of reducing a load for managing the path information on a kernel source when a device driver is compiled.SOLUTION: A compilation control device according to an embodiment includes: a container managing unit that activates a container in accordance with a command designating a set of an absolute path and a relative path; a first mount unit that mounts a kernel source on the container based on the absolute path; a path deciding unit that determines a second mount path of a driver source in the container based on the relative path and a first mount path for the kernel source in the container; a second mount unit that mounts the driver source on the container based on the second mount path; and a compilation unit that compiles the driver source using the kernel source on the container.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to a compilation control device and a program.

Background Art

[0002] As a method for compiling a device driver, there is a method of using container technology to compile a device driver mounted on a container. To compile a device driver, kernel source and path information of the kernel source are required. Therefore, when compiling a device driver on a container, the kernel source is mounted on the container.

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] However, the path of the kernel source mounted on the container may be different from the path of the kernel source on the host. Therefore, different management of the path information of the kernel source is required between the case of compiling the device driver on the host and the case of compiling the device driver on the container.

[0005] The problem to be solved by the embodiments of the present invention is to provide a compilation control device and a program capable of reducing the management load of the path information of the kernel source when compiling a device driver.

Means for Solving the Problems

[0006] In one embodiment, the compilation control device includes: a container management unit that starts a container in response to a first command specifying a set of an absolute path and a relative path; a first mounting unit that mounts a kernel source on the container based on the absolute path; a path determination unit that determines a second mounting path of a driver source in the container based on the relative path and the first mounting path of the kernel source in the container; a second mounting unit that mounts the driver source on the container based on the second mounting path; and a compilation unit that compiles the driver source using the kernel source on the container.

Brief Description of the Drawings

[0007]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

[0008] Hereinafter, a compilation control device according to an embodiment will be described with reference to the drawings. The compilation control device according to the embodiment is an information processing device having a function of compiling a device driver using a Linux kernel in a Linux (registered trademark) development environment. The device driver is, for example, a driver for an MFP (multifunction peripheral), a BCP (barcode printer), a POS (point of sale), or the like. Hereinafter, Linux will be referred to as the "host OS" or "host". The source code of the Linux kernel is referred to as the "kernel source". The source code of the device driver is referred to as the "driver source".

[0009] 1. Configuration First, the configuration of the compilation control device according to the embodiment will be described.

[0010] 1.1 Hardware Configuration FIG. 1 is a diagram showing an example of the hardware configuration of a compilation control device according to an embodiment.

[0011] As shown in FIG. 1, the compilation control device 1 includes a control circuit 11, a storage 12, a communication module 13, a user interface 14, a drive 15, and a storage medium 16.

[0012] The control circuit 11 is a circuit that overall controls each component of the compilation control device 1. The control circuit 11 includes a CPU (central processing unit), a RAM (random access memory), a ROM (read only memory), etc. The ROM of the control circuit 11 stores programs and the like used by the compilation control device 1 for various processes. The CPU of the control circuit 11 controls the whole of the compilation control device 1 according to the programs stored in the ROM of the control circuit 11. The RAM of the control circuit 11 has a working area for the CPU of the control circuit 11.

[0013] The storage 12 includes, for example, an HDD (Hard Disk Drive) or an SSD (Solid State Drive). The storage 12 stores information used in various processes in the compilation control device 1.

[0014] The communication module 13 is a circuit used for sending and receiving data between the compilation control device 1 and a network (not shown).

[0015] The user interface 14 is a device that manages communication between the compilation control device 1 and the user. The user interface 14 includes an input device and an output device. The input device includes, for example, a touch panel, a keyboard, and operation buttons, etc. The output device includes, for example, a printer, a speaker, and a display, etc.

[0016] The drive 15 is a device for reading software stored in the storage medium 16. The drive 15 includes, for example, a CD (Compact Disk) drive or a DVD (Digital Versatile Disk) drive.

[0017] The memory medium 16 is a medium that stores software by means of electrical, magnetic, optical, mechanical, or chemical actions. The memory medium 16 may store a program for executing various processes in the compilation control device 1.

[0018] 1.2 Functional Configuration FIG. 2 is a block diagram showing an example of the functional configuration of the compilation control device according to the embodiment.

[0019] As shown in FIG. 2, the CPU of the control circuit 11 expands the program stored in the ROM or the memory medium 16 of the control circuit 11 into the RAM of the control circuit 11. Then, the CPU of the control circuit 11 interprets and executes the program expanded in the RAM of the control circuit 11. Thereby, the compilation control device 1 functions as a computer including a container management unit 21, a path determination unit 22, a first mount unit 23, a second mount unit 24, and a compilation unit 25. Further, the storage 12 of the compilation control device 1 stores a kernel source 31 and a driver source 32.

[0020] The container management unit 21 functions as a platform for realizing a container-type virtual environment. The container management unit 21 manages the startup and termination of the container in response to the execution of a compilation command. Further, the container management unit 21 manages the directory structure on the container. The container management unit 21 is, for example, a Docker engine. The container is, for example, a Docker container.

[0021] FIG. 3 is a diagram showing an example of a compilation command for executing a compilation process on a container of the compilation control device according to the embodiment. Hereinafter, the compilation command for executing a compilation process on a container is referred to as a first compilation command.

[0022] As shown in FIG. 3, the first compilation command is, for example, the make command executed on a Docker container. The first compilation command can have the first path information and the second path information added as command options. Here, for either the first path information or the second path information, the absolute path information of the kernel source 31 starting from the top directory in the directory structure on the host is specified. Also, for the other of the first path information and the second path information, the relative path information of the kernel source 31 starting from the driver source 32 in the directory structure on the host is specified.

[0023] Returning again to FIG. 2, the functional configuration of the compilation control device 1 will be described.

[0024] The path determination unit 22 determines the path (mount path) when mounting the kernel source 31 and the driver source 32 on the container. Specifically, the path determination unit 22 determines the mount path of the kernel source 31 based on the absolute path information specified as a command option in the first compilation command. Also, the path determination unit 22 determines the mount path of the driver source 32 based on the relative path information specified as a command option in the first compilation command and the mount path of the kernel source 31. The path determination unit 22 transmits the determined mount path of the kernel source 31 and the mount path of the driver source 32 to the first mount unit 23 and the second mount unit 24, respectively.

[0025] The first mount unit 23 mounts the kernel source 31 on the container based on the mount path of the kernel source 31 acquired from the path determination unit 22.

[0026] The second mount unit 24 mounts the driver source 32 on the container based on the mount path of the driver source 32 acquired from the path determination unit 22.

[0027] The compilation unit 25 is a compiler. The compilation unit 25 uses the kernel source 31 mounted on the container to execute the compilation of the driver source 32 mounted on the container.

[0028] 2. Operations Next, the operations in the compilation control device according to the embodiment will be described.

[0029] 2.1 Compilation process FIG. 4 is a flowchart showing an example of the compilation process in the compilation control device according to the embodiment. The compilation process is a series of processes executed by the compilation control device 1 in response to the first compilation command.

[0030] As shown in FIG. 4, when the user inputs the first compilation command (start), the container management unit 21 starts the container (ACT11). It is assumed that the first path information and the second path information are added to the first compilation command.

[0031] The path determination unit 22 acquires the absolute path information from the command options of the first compilation command (ACT12). Details of the method for acquiring the absolute path information will be described later.

[0032] Based on the absolute path information acquired in the process of ACT12, the path determination unit 22 determines the mount path of the kernel source 31 as the first mount path (ACT13).

[0033] The container management unit 21 determines whether the mount path of the kernel source 31 determined in the process of ACT13 exists in the directory structure of the container started in the process of ACT11 (ACT14).

[0034] When the mount path of the kernel source 31 is not in the directory structure of the container (ACT14; no), the container management unit 21 generates a directory corresponding to the mount path of the kernel source 31 (ACT15).

[0035] When the mount path of the kernel source 31 is in the directory structure of the container (ACT14; yes), or after the process of ACT15, the first mount unit 23 mounts the kernel source 31 to the first mount path (ACT16).

[0036] The path determination unit 22 acquires relative path information from the command options of the first compilation command (ACT17). Details of the method for acquiring the relative path information will be described later.

[0037] Based on the relative path information acquired in the process of ACT17, the path determination unit 22 determines the mount path of the driver source 32 as the second mount path (ACT18).

[0038] The container management unit 21 determines whether the mount path of the driver source 32 determined in the process of ACT18 is in the directory structure of the container started in the process of ACT11 (ACT19).

[0039] When the mount path of the driver source 32 is not in the directory structure of the container (ACT19; no), the container management unit 21 generates a directory corresponding to the mount path of the driver source 32 (ACT20).

[0040] When the mount path of the driver source 32 is in the directory structure of the container (ACT19; yes), or after the process of ACT20, the second mount unit 24 mounts the driver source 32 to the second mount path (ACT21).

[0041] The compilation unit 25 compiles the driver source 32 mounted in the container in the process of ACT21 using the kernel source 31 mounted in the container in the process of ACT16 (ACT22).

[0042] After the process of ACT22, the container management unit 21 terminates the container started in the process of ACT11 (ACT23).

[0043] When the processing of ACT23 ends, the compilation process ends (end).

[0044] 2.2 Absolute path acquisition processing FIG. 5 is a flowchart showing an example of the absolute path acquisition processing in the compilation control apparatus according to the embodiment. The processes of ACT31 to ACT33 shown in FIG. 5 show the details of the process of ACT12 in FIG. 4.

[0045] As shown in FIG. 5, when the absolute path acquisition processing starts (start), the path determination unit 22 determines whether the first path information in the command option of the first compilation command specifies an absolute path (ACT31).

[0046] When the first path information specifies an absolute path (ACT31; yes), the path determination unit 22 acquires the first path information as an absolute path (ACT32).

[0047] When the first path information does not specify an absolute path (ACT31; no), the path determination unit 22 acquires the second path information as an absolute path (ACT33).

[0048] After the process of ACT32 or after the process of ACT33, the absolute path acquisition processing ends (end).

[0049] 2.3 Relative path acquisition processing FIG. 6 is a flowchart showing an example of the relative path acquisition processing in the compilation control apparatus according to the embodiment. The processes of ACT41 to ACT43 shown in FIG. 6 show the details of the process of ACT17 in FIG. 4.

[0050] As shown in FIG. 6, when the relative path acquisition processing starts (start), the path determination unit 22 determines whether the first path information in the command option of the first compilation command specifies a relative path (ACT41).

[0051] When the first path information specifies a relative path (ACT41; yes), the path determination unit 22 acquires the first path information as a relative path (ACT42).

[0052] When the first path information does not specify a relative path (ACT41; no), the path determination unit 22 acquires the second path information as a relative path (ACT43).

[0053] After the process of ACT42 or after the process of ACT43, the relative path acquisition process ends (ends).

[0054] 2.4 Specific Example (First Example) FIG. 7 is a diagram showing a first example of a first compilation command input to the compilation control device according to the embodiment. The first example corresponds to a case where the first compilation command specifies a relative path with the first path information and an absolute path with the second path information in the command option.

[0055] In the example of FIG. 7, the first compilation command specifies the first path information ".. / .. / linux-src" in the environment variable KERNEL_SRC. Also, the first compilation command specifies the second path information " / home / test / linux-src" in the environment variable KERNEL_ROUTE_PATH. That is, the first compilation command specifies a relative path with the first path information and an absolute path with the second path information.

[0056] Therefore, in the absolute path acquisition process, the path determination unit 22 acquires the second path information " / home / test / linux-src" as the absolute path of the kernel source 31 (ACT33). Then, the path determination unit 22 determines the acquired absolute path as the mount path of the kernel source 31 (ACT13).

[0057] Also, in the relative path acquisition process, the path determination unit 22 acquires the first path information ".. / .. / linux-src" as the relative path of the kernel source 31 starting from the driver source 32 (ACT42). Then, the path determination unit 22 determines the mount path of the driver source 32 based on the acquired relative path (ACT18). Specifically, for example, the path determination unit 22 determines that the mount path (absolute path) of the driver source 32 is " / home / test / X / Y" (X and Y are arbitrary folders).

[0058] (Second example) FIG. 8 is a diagram showing a second example of the first compilation command input to the compilation control device according to the embodiment. The second example corresponds to the case where the first compilation command specifies an absolute path with the first path information and a relative path with the second path information in the command options.

[0059] In the example of FIG. 8, the first compilation command specifies the first path information " / home / test / linux-src" in the environment variable KERNEL_SRC. Also, the first compilation command specifies the second path information ".. / .. / linux-src" in the environment variable KERNEL_RELATE_PATH. That is, the first compilation command specifies an absolute path with the first path information and a relative path with the second path information.

[0060] Therefore, in the absolute path acquisition process, the path determination unit 22 acquires the first path information " / home / test / linux-src" as the absolute path of the kernel source 31 (ACT32). Then, the path determination unit 22 determines the acquired absolute path as the mount path of the kernel source 31 (ACT13).

[0061] Also, in the relative path acquisition process, the path determination unit 22 acquires the second path information ".. / .. / linux-src" as the relative path of the kernel source 31 starting from the driver source 32 (ACT43). Then, the path determination unit 22 determines the mount path of the driver source 32 based on the acquired relative path (ACT18). Specifically, for example, the path determination unit 22 determines that the mount path (absolute path) of the driver source 32 is " / home / test / X / Y".

[0062] (Directory Structure) In any of the above-described first and second specific examples, a directory structure equivalent to the directory structure including the kernel source 31 and the driver source 32 on the host can be constructed on the container.

[0063] FIG. 9 is a diagram showing an example of path information of the kernel source and the driver source on the host of the compilation control device according to the embodiment. FIG. 10 is a diagram showing an example of path information of the kernel source and the driver source on the container of the compilation control device according to the embodiment. FIG. 10 shows the directory structure constructed on the container when the compilation process based on the first compilation command is executed on the host having the directory structure shown in FIG. 9.

[0064] As shown in FIGS. 9 and 10, the directory structure constructed on the container by executing the compilation process based on the first compilation command is equivalent to the directory structure constructed on the host. More specifically, assume that the absolute path of the kernel source 31 on the host is " / home / test / linux-src", and the relative path of the kernel source 31 starting from the driver source 32 is ".. / .. / linux-src". In this case, on the container generated by executing the compilation process based on the first compilation command, the mount path of the kernel source 31 is the absolute path " / home / test / linux-src". Also, the mount path of the driver source 32 is the path where the relative path of the kernel source 31 starting from the driver source 32 is ".. / .. / linux-src".

[0065] 3. Effects according to the embodiment According to the embodiment, the container management unit 21 starts the container according to the first compilation command that specifies a pair of an absolute path and a relative path. The first mount unit 23 mounts the kernel source 31 to the container based on the absolute path specified by the first compilation command. The path determination unit 22 determines the mount path of the driver source 32 in the container based on the relative path specified by the first compilation command and the mount path of the kernel source 31 in the container. The second mount unit 24 mounts the driver source 32 to the container based on the mount path of the driver source 32 determined by the path determination unit 22. The compilation unit 25 compiles the driver source 32 using the kernel source 31 on the container. Thereby, even when compiling the driver source 32 on the container, it is possible to use path information equivalent to the compilation command (second compilation command) used when compiling the driver source 32 on the host.

[0066] Supplementary note: In the second compilation command, as shown in FIGS. 11 and 12, an absolute path or a relative path on the host is specified.

[0067] FIG. 11 is a diagram showing a first example of a second compilation command input to the compilation control device according to the embodiment. FIG. 12 is a diagram showing a second example of a second compilation command input to the compilation control device according to the embodiment. The first example corresponds to the case where the relative path of the kernel source 31 is specified. The second example corresponds to the case where the absolute path of the kernel source 31 is specified. The first example and the second example show examples of the second compilation command when the directory structure shown in FIG. 9 is constructed on the host.

[0068] As shown in FIG. 11, when specifying the relative path of the kernel source 31, the second compilation command specifies, as a command option, the relative path ".. / .. / linux-src" of the kernel source 31 starting from the driver source 32 on the host. As shown in FIG. 12, when specifying the absolute path of the kernel source 31, the second compilation command specifies, as a command option, the absolute path " / home / test / linux-src" of the kernel source 31 starting from the top directory on the host.

[0069] On the other hand, on the container, a directory structure equivalent to the directory structure on the host may not be constructed. When the kernel source 31 and the driver source 32 are mounted on a directory structure of a container different from the directory structure on the host, the absolute path of the kernel source 31 and the relative path of the kernel source 31 starting from the driver source 32 on the container are different from the absolute path and the relative path on the host. For this reason, in the first compilation command, path information different from the path information specified in the second compilation command will be specified, which may make management complicated.

[0070] According to the embodiment, the compilation command specifies the first path information and the second path information as command options. In one of the first path information and the second path information, the absolute path of the kernel source 31 starting from the top directory on the host is specified. In the other of the first path information and the second path information, the relative path of the kernel source 31 starting from the driver source 32 on the host is specified. When the container management unit 21 does not have a directory structure corresponding to the mount path in the container, the container management unit 21 generates the directory structure in the container. Thereby, in the first compilation command, path information can be specified using the path information that may be specified in the second compilation command. Therefore, the management load of the path information used for the compilation process can be reduced.

[0071] 4. Modifications and the like Various modifications can be applied to the above-described embodiment.

[0072] In the above-described embodiment, the case where KERNEL_SRC, KERNEL_ROUTE_PATH, and KERNEL_RELATE_PATH are used as environment variables specified in the command options of the first compilation command has been described, but it is not limited thereto. For example, other string environment variables may be used as the environment variables specified in the command options of the first compilation command.

[0073] Also, in the above-described embodiment, the first mount unit 23 and the second mount unit 24 mount the kernel source 31 and the driver source 32 based on the absolute path and the relative path, respectively, but it is not limited thereto. For example, if it is an accessible path, a symbolic link or the like may be used.

[0074] Although some embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the gist of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are also included in the invention described in the claims and the equivalent scope thereof.

Explanation of Signs

[0075] 1... Compilation control device, 11... Control circuit, 12... Storage, 13... Communication module, 14... User interface, 15... Drive, 16... Storage medium, 21... Container management unit, 22... Path determination unit, 23... First mount unit, 24... Second mount unit, 25... Compilation unit, 31... Kernel source, 32... Driver source.

Claims

1. A container management unit that starts a container in response to a first command specifying a set of an absolute path and a relative path; A first mount unit that mounts a kernel source on the container based on the absolute path; A path determination unit that determines a second mount path of a driver source in the container based on the relative path and a first mount path of the kernel source in the container; A second mount unit that mounts the driver source on the container based on the second mount path; A compilation unit that compiles the driver source using the kernel source on the container; A compilation control device comprising:

2. The absolute path is an absolute path of the kernel source starting from a top directory on a host, The relative path is a relative path of the kernel source starting from the driver source on the host, The compilation control device according to Claim 1.

3. When the container management unit does not have a directory structure corresponding to the first mount path and the second mount path in the container, the container management unit generates the directory structure in the container. The compilation control device according to Claim 1.

4. The compilation unit: Compiles the driver source using the kernel source on the host in response to a second command specifying either the absolute path or the relative path. The compilation control device according to Claim 2.

5. A program for causing a computer to function as: A container management unit that starts a container in response to a first command specifying a set of an absolute path and a relative path; A first mount unit that mounts a kernel source on the container based on the absolute path; A path determination unit that determines a second mount path of a driver source in the container based on the relative path and a first mount path of the kernel source in the container; A second mount unit that mounts the driver source on the container based on the second mount path; A compilation unit that compiles the driver source using the kernel source on the container. ​

Citation Information

Patent Citations

  • Control system and control method

    JP2022091301A

  • Method and system for a customized local build environment image

    US20230021416A1

  • Control system and control method

    US20240004688A1

  • How to Implement a Container-Based Virtualization System

    JP2022540810A