On-line compiling and packaging method based on Buildroot
By running the Buildroot compilation environment on a virtual cloud desktop, and using scripts to automatically generate Linux system images, the problems of long local compilation time and complex dependencies are solved, achieving efficient and stable online compilation, packaging, and version management.
Patent Information
- Application Number
- CN202411505475.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies face complex dependencies and high time consumption when compiling the Buildroot system on a local computer, and also have high requirements for the performance of the compilation host machine, making it difficult to achieve efficient online compilation and packaging.
The Buildroot compilation and packaging environment is migrated to a virtual cloud desktop in a cloud data center. The browser receives request signals, and the scripts automatically execute the compilation process. Combined with the GitLab server to manage binary files and databases, a Linux system image file is generated.
It enables efficient and stable online compilation and packaging for multiple users and projects in the cloud, improving compilation efficiency and version control, reducing the risk of human error, and supporting continuous integration and delivery.
Smart Images

Figure CN119025157A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology and relates to an online compiling and packaging method based on Buildroot. Background Art
[0002] Buildroot is an open source build system that is specifically designed to generate custom root file systems, Linux kernels, bootloaders, and other toolchains for embedded Linux systems. It simplifies the complex process of building embedded Linux systems by automating scripts and configuration files. During the compilation process, the various dependency packages referenced are intricate, and the dependencies between the compiled source package versions are strongly related. The compilation takes a long time and has certain performance requirements on the host machine. Therefore, it is somewhat difficult to compile and maintain on the local computer.
[0003] Virtual Cloud Desktop, also known as Desktop as a Service (DaaS), is a cloud computing-based virtualization technology that enables users to access their desktop environment on any device via the Internet. Virtual Cloud Desktop hosts the desktop operating system, applications, and data in a cloud data center instead of on a local computer. Virtual Cloud Desktop runs on a server with much higher performance than a PC, and computing resources can be dynamically allocated and adjusted. Different roles can access it at the same time based on the assigned user permissions and levels.
[0004] How to implement an efficient Buildroot-based online compilation and packaging method based on cloud desktop remains to be solved. Summary of the invention
[0005] The present application provides an online compilation and packaging method based on Buildroot, which solves the technical problem of how to implement an efficient online compilation and packaging method based on Buildroot on a cloud desktop.
[0006] This application adopts the following technical solutions: This application provides an online compilation and packaging method based on Buildroot, including: Receive the request signal through the browser and determine the script corresponding to the target project in the Buildroot server; After obtaining the binary files, configuration files, and database of the target project corresponding to the application stored in the gitlab server, run the script; Store the corresponding application's binary files, configuration files, and database in the corresponding project Buildroot's compilation project directory for packaging and generate a Linux system image file.
[0007] Optionally, the request signal includes a project name and a number of the target project.
[0008] Optionally, store the binary files, configuration files, and database of the corresponding application in the compilation project directory of the corresponding project Buildroot for packaging to generate a Linux system image file, including: Copy the application's binary files, configuration files, and database to the corresponding project's Buildroot compilation project directory; Jump to the compilation project directory, execute the packaging command, and generate a Linux system image file.
[0009] Optionally, execute the script to copy the compiled Linux system image file to the corresponding project directory of FTP in the Buildroot server, download the Linux system image file through the local browser, and display it in the local browser.
[0010] Optionally, the Buildroot server is a cloud data center.
[0011] Optionally, the gitlab server also pre-stores binary files, configuration files, and databases of applications for multiple projects, and manages projects through different paths or through different branches of a project.
[0012] Optionally, the gitlab server creates different projects according to the division of different projects, which are used to store binary files, configuration files, databases and other files that need to be packaged into the Linux system image.
[0013] The beneficial effects of this application are: This application runs the Buildroot compilation and packaging environment on a virtual cloud desktop based on a cloud data center, runs the Linux system image content that needs to be packaged on the Buildroot server, and automatically executes it through scripts instead of manual operations, which can ensure the stability of the Buildroot project, efficient compilation, and multi-user and multi-project sharing.
[0014] This application manages the corresponding binary files, configuration files, databases and other dependency packages of different local applications through the gitlab server in advance. By managing different applications based on different project paths or different branches of the same project, it facilitates version control, code management and continuous integration / continuous delivery (CI / CD) of different projects, helping development teams collaborate and deliver software products more efficiently.
[0015] The local browser can achieve efficient interaction with the Buildroot server and gitlab server through the Web interface, which improves the compilation efficiency of the source code package and the download efficiency of the Linux system image file. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A step diagram of an online compilation and packaging method based on Buildroot provided in this application.
[0017] Figure 2 A three-party interaction diagram of a local browser, Buildroot server and gitlab server provided for this application. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0020] The present application is further described in detail below with reference to the accompanying drawings: This application provides an online compilation and packaging method based on Buildroot, including steps 101 to 103, such as Figure 1As shown, it should be noted that the technical solution of the present application includes steps 101 to 103, but is not limited to a single execution order. Figure 2 , the specific implementation method of the online compilation and packaging method of Buildroot provided by this application will be explained in detail.
[0021] Step 101: Receive a request signal through a browser to determine a script corresponding to a target project in a Buildroot server. Optionally, the request signal includes a project name and number of the target project.
[0022] In one embodiment, Buildroot is an open source build system specifically used to generate a custom root file system, Linux kernel, Bootloader, and other toolchains for embedded Linux systems. This application runs the compilation and packaging environment of Buildroot on a virtual cloud desktop. In other words, the Buildroot server is a cloud data center. The local browser can establish multiple projects. When the user runs the target project on the desktop, the local browser sends a request containing the name and number of the target project to the Buildroot server. After receiving the request, the Buildroot server finds the script that needs to be executed for the corresponding project through the CGI Webserver background. It should be noted that different projects have different operating procedures when they are built in Buildroot. These different operating procedures are written into scripts for execution. In the technical solution provided in this application, the script only executes the process steps of the underlying common part of each project to avoid human operating errors, destroy the entire compilation environment, and reduce the risk of rebuilding the compilation environment.
[0023] Step 102: After obtaining the binary files, configuration files, and database of the target project corresponding to the application stored in the gitlab server, run the script.
[0024] In one embodiment, it should be noted that the local browser has established different projects in order to accurately distinguish different projects and avoid the existence of complex dependency packages in each project, which may damage the entire compilation environment due to operational errors. To this end, all the contents of different projects that need to be packaged into the system image are pre-stored in the gitlab server for unified management according to the project name and project number, including the binary files, configuration files and database of the target project's application. When the Buildroot server executes the script of the target project, the binary files, configuration files, database and other required files of the target project's application are copied together to the compilation project directory of Buildroot, and the script continues to run after the script is compiled.
[0025] Step 103: Store the binary files, configuration files and database of the corresponding application program in the compilation project directory of the corresponding project Buildroot for packaging, and generate a Linux system image file.
[0026] Optionally, store the binary files, configuration files, and database of the corresponding application in the compilation project directory of the corresponding project Buildroot for packaging to generate a Linux system image file, including: Copy the application's binary files, configuration files, and database to the corresponding project's Buildroot compilation project directory; Jump to the compilation project directory, execute the packaging command, and generate a Linux system image file.
[0027] In one embodiment, the binary files, configuration files, databases and other contents that need to be packaged into the system image of the application corresponding to the target project are copied to the fs-overlay directory under the compilation project directory of the corresponding project Buildroot. Then jump to the compilation project directory of the corresponding project Buildroot and execute make (packaging command). The logs during the make process will be displayed in real time on the local browser. After make is completed and the Linux system image file is successfully generated, the system image file is compressed and packaged, and then copied to the ftp service directory of the corresponding project.
[0028] It should be noted that the cloud desktop has better hardware performance than the local office computer. A unified compilation interface is provided through the web to prevent everyone from making different modifications or misoperations in the Buildroot directory, which may cause abnormal or inconsistent Buildroot compilation environment.
[0029] In different projects, the same hardware solution and the same underlying Linux system may be used, but the application layer has different configurations and applications. Therefore, for different projects, different scripts can be entered on the browser to execute in the background.
[0030] Optionally, execute the script to copy the compiled Linux system image file to the corresponding project directory of FTP in the Buildroot server, download the Linux system image file through the local browser, and display it in the local browser.
[0031] In one embodiment, by executing the script, the compiled Linux system image file is automatically copied to the corresponding project directory of the FTP in the Buildroot server. When the Linux system image file is packaged, the log on the local browser will also output the compilation result synchronously. If the compilation is successful, the page will automatically jump to the download page of the corresponding project. The compressed package of the corresponding system image file can be downloaded through the download page of the browser.
[0032] Optionally, the gitlab server also pre-stores the binary files, configuration files, and databases of the applications of multiple projects, and manages the projects through different paths or through different branches of a project. Optionally, the gitlab server creates different projects according to the division of different projects, which are used to store the binary files, configuration files, databases, and other files that need to be packaged into the Linux system image.
[0033] It should be noted that the configuration files and application binary files required for different projects are managed through the gitlab server. It can be managed with different project paths or different branches of the same project, effectively implementing project planning, source code management, CI / CD, and monitoring security. In addition, the source code packages, configuration folders, Linux kernel configuration files, etc. in the Buildroot compilation environment are managed on gitlab. It can effectively record all the change points in the entire development process. The dl directory in the Buildroot project is used to store all the source code packages and other differences required for the target system image, which is implemented through the webserver. And it will be downloaded online during the first compilation. Managing the dl directory on gitlab can prevent unnecessary repeated downloads after accidentally executing make clean.
[0034] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present application can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present application should be included in the scope of protection of the claims of the present application.
Claims
1. An online compilation and packaging method based on Buildroot, characterized in that: include: Receive the request signal through the browser and determine the script corresponding to the target project in the Buildroot server; After obtaining the binary files, configuration files, and database of the target project corresponding to the application stored in the gitlab server, run the script; The binary files, configuration files and database of the corresponding application are stored in the compilation project directory of the corresponding project Buildroot for packaging to generate a Linux system image file.
2. The online compiling and packaging method based on Buildroot as claimed in claim 1, characterized in that: The request signal includes the project name and number of the target project.
3. The online compiling and packaging method based on Buildroot as claimed in claim 1, characterized in that: The binary files, configuration files and database of the corresponding application are stored in the compilation project directory of the corresponding project Buildroot for packaging to generate a Linux system image file, including: Copy the application's binary files, configuration files, and database inventory to the corresponding project's Buildroot compilation project directory; Jump to the compilation project directory, execute the packaging command, and generate a Linux system image file.
4. The online compiling and packaging method based on Buildroot as claimed in claim 1, characterized in that: Execute the script, copy the compiled Linux system image file to the corresponding project directory of FTP in the Buildroot server, download the Linux system image file through the local browser, and display it in the local browser.
5. The online compiling and packaging method based on Buildroot as claimed in claim 1, characterized in that: The Buildroot server is a cloud data center.
6. The online compiling and packaging method based on Buildroot as claimed in claim 1, characterized in that: The gitlab server also pre-stores binary files, configuration files, and databases of applications of multiple projects, and manages projects through different paths or through different branches of a project.
7. The online compiling and packaging method based on Buildroot as claimed in claim 6, characterized in that: The gitlab server creates different projects according to the division of different projects, which are used to store binary files, configuration files, databases and other files that need to be packaged into the Linux system image.
Citation Information
Patent Citations
Code packaging method, computer device, computer readable storage medium and code packaging system
CN109491662A
Continuous integration and delivery system and method, electronic equipment and storage medium
CN113434194A
Buildroot local compiling method and system based on Shenwei architecture
CN116301908A
Method, device and equipment for improving software compiling and packaging speed
CN116974615A
Storage mirror image generation method and device, computer equipment and storage medium
CN117591136A
Cited By
Control equipment operation method, control platform equipment, controller and computer equipment
CN119781339A
