Mirror image construction method, system and device based on embedded system and storage medium

By building embedded operating system images in the docker environment, using docker basic image files and automatic construction frameworks, the problems of multi-platform and custom software construction in the existing technology are solved, and rapid and repeatable image construction and development environment restoration are achieved.

CN120066528APending Publication Date: 2025-05-30RESIDE (SHANGHAI) INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411958010.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing embedded operating system image construction methods are difficult to support multi-platform and custom software construction, and they rely more on the development host environment, resulting in confusion in system image construction management.

Method used

By building images in the docker environment, using docker basic image files and automatic construction frameworks, downloading and installing dependency packages, configuring and compiling source code, and outputting the image files described in the configuration file.

Benefits of technology

It realizes rapid restoration of the development environment in the docker environment, and can be rebuilt in one configuration, avoids software version errors caused by improper time or archive, and reduces errors caused by different environment dependencies and package versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066528A_ABST
    Figure CN120066528A_ABST
Patent Text Reader

Abstract

According to the mirror image construction method based on the embedded system, a docker container is adopted through a unified development environment, a development dependency package is installed in the container environment, and dependence on the development host environment is avoided; constructing and describing a mirror image by adopting a configuration file, and describing a warehouse, a version, the configuration file and steps which need to be constructed in the configuration file; a script language is adopted to compile an automatic construction framework, construction of a container environment is mainly completed, configuration files are read to complete construction of software in the container environment, and combined construction of multiple kinds of software is supported; by constructing the consistent system mirror image in the docker environment, software version errors caused by factors such as time or improper archiving are avoided, and meanwhile, the error problem caused by constructing the same mirror image by multiple persons due to environmental problems is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to virtualization technology of embedded operating systems, and specifically to a method for constructing an image based on an embedded system. Background Art

[0002] In the current embedded field, the frameworks that support automatic construction mainly include BuildRoot and Yocto, but they only support the Linux platform, do not support the construction of other user-defined software or systems, and rely more on the development host environment.

[0003] In the actual development process, there are deliveries and integrations of multiple systems, which are likely to cause chaos in the management of system image construction and it is difficult to guarantee the development environment of later projects.

[0004] This solution combines existing tools and technologies to form a new automatic construction method. It can quickly restore the development environment by relying on only a small amount of software, and can be repeatedly constructed with one configuration. Summary of the Invention

[0005] To solve the above technical problems, the present invention provides a method, a system, a device and a storage medium for constructing an image based on an embedded system.

[0006] The present invention is achieved through the following technical solutions.

[0007] The method for constructing an image based on an embedded system provided by the present invention includes the following steps:

[0008] Install a running environment in the host, and prepare a docker software package and a version management software in the host;

[0009] Pull a docker base image file from the server, execute the docker base image file and enter the docker container, and download and install dependent software packages in the docker environment;

[0010] After the installation is completed, export the docker container as a docker image file;

[0011] Create a configuration folder for storing configuration files of software construction information;

[0012] Configure the docker image file and the configuration file into an automatic construction framework. The automatic construction framework uses the docker image file and the configuration file to download the source code in the docker environment, and configure and compile the source code to output the image file described in the configuration file.

[0013] Furthermore, the configuration file includes basic configuration information of the application program, software configuration files, and patch files;

[0014] Among them, the basic configuration information includes the name, repository, and build process of the application, and the basic configuration information is stored in the same directory as the software configuration file and the patch file.

[0015] Furthermore, the automatic build framework supports configuring the build of embedded operating system software, where the embedded operating system software includes Linux and RT-Thread.

[0016] Furthermore, download the source code in the docker environment, configure and compile the source code, and the output mirror files described in the configuration file include:

[0017] The automatic build framework determines the docker environment based on the configured docker mirror file;

[0018] The automatic build framework sequentially downloads the corresponding source code for configuration and compilation according to the storage order of the configuration files.

[0019] The present invention also provides an image building system based on an embedded system, including a docker image module, an automatic build architecture, and a configuration folder. Among them, the docker image module and the configuration folder respectively input the produced docker image file and configuration file into the automatic build architecture, and the automatic build architecture outputs a new image file;

[0020] The docker image module includes a docker base image file and a docker container. After the docker base image file is executed in the docker container, it is output as a docker image file;

[0021] The configuration folder includes several folders.

[0022] The present invention also provides an image building device based on an embedded system, including a module for executing the method described in any one of the above, including a processor and an interface circuit. The interface circuit is used to receive signals from other devices outside the device that executes the kernel state command and transmit them to the processor, or send signals from the processor to other devices outside the device that executes the kernel state command. The processor uses logic circuits or executes code instructions to implement the method described in any one of the above.

[0023] The present invention also provides a computer-readable storage medium, on which a computer program is stored. The computer program is characterized in that when the computer program is executed by a processor, it implements the method described in any one of the above.

[0024] The beneficial effects of the present invention are as follows: By building a consistent system image in the docker environment, it avoids software version errors caused by factors such as time or improper archiving, and at the same time reduces the error problems that occur when multiple people build the same image due to environmental issues, such as environmental dependencies and different package versions; and through the creation of an automatic build framework once, it realizes multiple repeated automatic builds, getting rid of the consumption of build time. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a schematic flowchart of the method of the present invention;

[0026] Figure 2 is a schematic diagram of the connection relationship between modules of the present invention;

[0027] Figure 3 is a diagram of the application program configuration information of the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] The technical solution of the present invention will be further described below, but the scope of protection is not limited thereto.

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be described in detail below with reference to the drawings and specific embodiments.

[0030] Embodiment 1

[0031] The goal of this embodiment is to perform automatic build under the Uboot, Linux and RT-Thread embedded operating system software. Therefore, the present invention is implemented according to the following steps:

[0032] Step 1: Prepare the development environment, and prepare the docker software package and version management software on the host for building the docker environment;

[0033] Step 2: Prepare the docker image, download the docker base image file from the server to the host, execute the docker container, and install the dependent software packages required during the build in the docker environment, including cmake, make, gcc-multilib, cpio, python, python3, curl, tar, scons, ninja-build, libaio-dev, device-tree-compiler, u-boot-tools, gcc-aarch64-linux-gnu, etc. The dependent software packages are related to the specific system software to be built. After installation, export the docker container to the docker image file docker V0.1;

[0034] Step 3: Create configuration folders, and create dedicated folders for the embedded system software of this embodiment target. The folders are Uboot V0.1.0 folder, Linux V0.1.0 folder, Linux V0.2.0 folder, and RT-Thread V0.1.0 folder respectively. Taking the Linux V0.1.0 folder as an example, the Linux V0.1.0 folder includes LinuxV0.1.0 configuration file, software configuration file, and patch file. The Linux V0.1.0 configuration file records basic configuration information, including software name, repository name, version number, software configuration file information, and build steps. Among them, the software configuration file and patch file are placed in the same directory as the Linux V0.1.0 configuration file; The description information of the Linux V0.1.0 configuration file is illustrated as Figure 3 shown below, and the description of each parameter is as follows:

[0035] name: Describe the name of the current system software; version: Describe the version used; arch: Describe the system software architecture; tool: Describe the name of the compilation tool used; tool_path: Describe the path of the compilation tool used; branch_name: Describe the branch name of the source code used; source: Describe the method and download link for downloading the source code; prepare: Describe operations such as patching the source code; config: Describe the configuration operation on the source code; build: Describe the build operation on the source code; install: Describe the operation on the generated image after the source code is built.

[0036] Step 4: Configure the docker image file name docker V0.1 with the embedded system software names UbootV0.1.0, Linux V0.1.0, Linux V0.2.0, and RT-Thread V0.1.0 into the automatic build framework respectively. The automatic build framework virtualizes the corresponding docker V0.1 build item and embedded system software build item. The automatic build framework builds the docker environment according to docker V0.1, starts building in the docker environment, and sequentially builds an image file set according to the embedded system software build item. Finally, the image files of Uboot V0.1.0, Linux V0.1.0, Linux V0.2.0, and RT-Thread V0.1.0 are output respectively. In this embodiment, the user can build the automatic build framework according to the actually used embedded operating system software and embedded software. At the same time, the image file can be built according to the automatic build framework, configuration file, and docker environment, getting rid of the requirements for the host environment.

[0037] The above embodiments are the preferred solutions for the implementation of the present invention. It should be noted that, without departing from the concept of the present invention, any obvious substitutions and minor changes are within the protection scope of the present invention.

Claims

1. A mirror image construction method based on an embedded system, characterized in that The following methods are included: Install the operating environment in the host, and prepare the Docker software package and version management software in the host; Pull the Docker base image file from the server, execute the Docker base image file and enter the Docker container, download and install dependent software packages in the Docker environment; After the installation is complete, export the docker container as a docker image file; Create a configuration folder to store configuration files for software build information; Configure the docker image file and configuration file into the automatic build framework. The automatic build framework uses the docker image file and configuration file to download the source code in the docker environment, configure and compile the source code, and output the image file described in the configuration file.

2. The mirror image construction method according to claim 1, characterized in that: The configuration file includes the basic configuration information of the application, software configuration files, and patch files; The basic configuration information includes the application name, repository, and build process, and the basic configuration information is stored in the same directory as the software configuration file and patch file.

3. The mirror image construction method according to claim 1, wherein: The automatic build framework supports the configuration of embedded operating system software builds, including Linux and RT-Thread.

4. The mirror image construction method according to claim 1, wherein: Download the source code in the Docker environment, configure and compile the source code, and output the image files described in the configuration file, including: The automatic build framework determines the Docker environment based on the configured Docker image file; The automatic construction framework downloads the corresponding source code for configuration and compilation according to the order in which the configuration files are stored.

5. Image building system based on embedded system, characterized by: It includes docker image module, automatic build architecture and configuration folder. The docker image module and configuration folder input the generated docker image file and configuration file into the automatic build architecture respectively, and the automatic build architecture outputs the new image file. The docker image module includes the docker basic image file and the docker container. The docker basic image file is output as a docker image file after being executed in the docker container. The configuration folder contains several folders.

6. An image building device based on an embedded system, comprising a module for executing the method according to any one of claims 1 to 4, characterized in that: It includes a processor and an interface circuit, wherein the interface circuit is used to receive signals from other devices other than the device for executing kernel mode commands and transmit them to the processor or send signals from the processor to other devices other than the device for executing kernel mode commands, and the processor is used to implement the method as described in any one of claims 1 to 4 through logic circuits or execution code instructions.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.