CN115220728B - Interactive compiling management method and device for embedded Linux system software - Google Patents

Interactive compiling management method and device for embedded Linux system software Download PDF

Info

Publication number
CN115220728B
CN115220728B CN202210766251.5A CN202210766251A CN115220728B CN 115220728 B CN115220728 B CN 115220728B CN 202210766251 A CN202210766251 A CN 202210766251A CN 115220728 B CN115220728 B CN 115220728B
Authority
CN
China
Prior art keywords
shell
compiling
command number
configuration
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210766251.5A
Other languages
Chinese (zh)
Other versions
CN115220728A (en
Inventor
陈腾蛟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Automobile Group Co Ltd
Original Assignee
Guangzhou Automobile Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Automobile Group Co Ltd filed Critical Guangzhou Automobile Group Co Ltd
Priority to CN202210766251.5A priority Critical patent/CN115220728B/en
Publication of CN115220728A publication Critical patent/CN115220728A/en
Application granted granted Critical
Publication of CN115220728B publication Critical patent/CN115220728B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/51Source to source

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an embedded Linux system software interactive compiling management method and device, wherein the method comprises the following steps: after a host machine of the embedded Linux system starts a compiling management software shell, the shell automatically reads a local configuration file and judges the current software use state, and one or more cross compiler use environments are initialized; the shell prints out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number; the shell carries out logic judgment according to the command number input by the user, and invokes the lower Makefile to complete compiling of the corresponding pointing source code. The invention improves the comfort level of compiling, using and developing different module software packages for users; complicated development compiling modes of command line command input are abandoned, and a large amount of unnecessary operation loss time in development is saved; after migration is carried out in embedded basic software packages of different SoC manufacturers, the adaptation development cost of a new platform can be greatly reduced; the learning cost of using configuration rules by various kinds of software at the bottom layer is saved.

Description

Interactive compiling management method and device for embedded Linux system software
Technical Field
The invention belongs to the technical field of intelligent network automobiles, and particularly relates to an interactive compiling management method and device for embedded linux system software.
Background
In a common embedded LinuxBSP software development mode, source code compiling, configuration, installation and use generally need to be completed by manually executing various compound commands, and are complicated and time-consuming.
The yopto platform configuration and compiling mechanism is perfect, but the customized configuration variables and rules are hundreds or thousands, and users can realize entrance-level use of the yopto software after familiarizing and verifying the yopto configuration rules by spending a great deal of time reference description, so that the use difficulty is high and the entrance threshold is high. If non-universal embedded software source codes are embedded in the yopto mechanism, a large number of python, shell, makefile mixed codes are written according to a complicated construction principle mechanism of yopto, more than ten process steps such as fetch, unpack, compile, deploy are realized, development and maintenance difficulties are high, and maintenance cost is high. The Yopto software customized and provided by different chip manufacturers has the problems of great difference between the organization form and script code of the basic Yopto software due to different hardware architecture and different development habits of software developers, and the Yopto software provided by the manufacturers has the advantages of poor mutual compatibility and low multiplexing degree, and a user needs to build and familiarize with different customized Yopto software environments under the multi-type chip development scenes.
The Buildroot software has the graphic configuration and compiling functions, and is simple and convenient to use. However, customization modification of private functions is difficult, the difficulty of additionally embedding and adding special software source codes (such as lk, freertos, mcal and the like) of different chips is high, only one cross compiler can be appointed to compile and manufacture an embedded linux system, and the compiling and using adaptability of the multi-type multi-core SoC platform bottom software is poor. The Buildroot defaults to not contain firmware making and private source code management functions, and a software management development environment still needs to be additionally built after a basic linux system environment is built.
Disclosure of Invention
The technical problem to be solved by the embodiment of the invention is to provide an interactive compiling management method and device for embedded Linux system software, so as to reduce the cost of software development and maintenance and improve the efficiency of software development and verification test.
In order to solve the technical problems, the invention provides an interactive compiling management method for embedded Linux system software, which comprises the following steps:
after a host machine of the embedded Linux system starts a compiling management software shell, the shell automatically reads a local configuration file and judges the current software use state, and one or more cross compiler use environments are initialized;
the shell prints out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number;
the shell carries out logic judgment according to the command number input by the user, and invokes the lower Makefile to complete compiling of the corresponding pointing source code.
Further, before the shell is started, the method further comprises:
pre-constructing shell, makefile inter-calling software environment, and custom arranging all source code catalogues needing compiling; and performing assignment operation on basic variables operated by the shell script, and introducing the configuration file into the Makefile through the include key.
Further, the shell automatically reads the local configuration file and judges the current software use state, and initializes one or more cross compiler use environments, which specifically includes:
automatically reading a local configuration file after the shell is started, judging whether the current environment software is used for the first time, if so, updating and installing a root file system and one or more cross compiler compression packages or carrying out initial configuration on source codes needing initial configuration;
if the method is not used for the first time, judging whether the current compiler and the root file system need to be updated or not automatically according to the self-defined time stamp, and if so, automatically updating and installing the compiler and the root file system; or judging whether the basic configuration of each source code needs to be updated, if so, automatically updating the corresponding source code again by taking the git library configuration as the standard; if there is no update requirement, one or more compiler use environments are directly initialized,
further, the functions of the top-level prompt menu for prompting include: compiling, clearing, configuring, synthesizing firmware and starting disc manufacturing;
the compiling menu function is used for providing one-key compiling and independent compiling operation options of each source code, and the one-key compiling operation options are used for completing compiling and installing all the source codes; the independent compiling operation option is used for providing single-module compiling and updating;
the clearing menu function is used for providing one-key clearing and independent clearing operation options of each source code, and the one-key clearing operation options are used for completing clearing of all source codes; the independent purge operation option is used for providing single module purge;
the configuration menu prompt function further comprises the steps of displaying the current configuration, restoring the default configuration, graphically configuring, starting mode selection and function selection configuration;
the firmware synthesis menu function is used for integrating the source code compiling output objects of all functions into a firmware or upgrading compression packet;
the boot disk production menu function is used to burn the integrated firmware or upgrade compressed package into a memory card used as a boot disk.
Further, the shell performs logic judgment according to a command number input by a user, calls a lower Makefile, and compiles corresponding to the pointing source code, and specifically includes: under the top-layer prompting menu, the shell receives the command number input by the user, then carries out logic judgment, judges the function command number, prints out corresponding function prompting submenu information of lower-level operable options, and the command number takes Arabic numerals or single English characters as effective operation codes.
Further, under the top-level prompt menu, the shell carries out logic judgment according to the command number input by the user, and if the command number is judged to be the compiling function command number, the shell prints out compiling prompt submenu information of lower-level operable options;
in the compiling prompt submenu function, the shell carries out logic judgment according to the command number input by a user, if the shell judges that the function command number is compiled by one key, a makeall instruction is executed to execute a top Makefile, and the Makefile sequentially enters each source code catalog for compiling according to each source code path defined by initialization; if the command number of the independent compiling function is judged, entering an independent compiling source code submenu, printing and outputting the independent compiling source code submenu information of lower-level operable options by the shell, carrying different parameters to execute a make instruction, and calling different Makefile codes to complete each source code compiling function.
Further, under the top-level prompt menu, the shell carries out logic judgment according to the command number input by the user, and if the shell judges that the command number is a clearing function command number, the shell prints out clearing prompt submenu information of lower-level operable options;
in the clearing prompt submenu function, the shell carries out logic judgment according to a command number input by a user, and if the shell judges that the function command number is cleared by one key, a make instruction is executed to call a Makefile code to carry out clearing operation on all source codes; if the shell judges that the command number of the independent clearing function is the independent clearing source code sub-menu information of the lower operable option is printed out, a make instruction is carried out with different parameters to call different Makefile codes to complete the clearing function of each source code.
Further, under the top-level prompt menu, after the shell receives an input command number from the terminal, logic judgment is carried out, and if the shell judges that the command number is a configuration function command number, the shell prints out configuration submenu information of lower-level operable options;
under the configuration prompt submenu, the shell carries out logic judgment according to the command number input by the user, if the initial configuration command number is judged to be restored, the shell calls the sub-shell or executes a make instruction to complete restoration of the original configuration file or uses default configuration operation; if the multi-core starting mode configuration command number is judged to be changed, calling the sub-function shell to automatically change the related configuration file; if the kernel menu type configuration command number is judged, executing a makementoucon fig instruction to enter a kernel graphical configuration interface; and if the current basic configuration command number is judged to be displayed, executing a make command to print the configuration variables to the terminal in sequence through a Makefile.
Further, under the top-level prompt menu, the shell performs logic judgment according to the command number input by the user, if the command number is judged to be the firmware synthesis command number, the firmware synthesis sub-function shell is executed, and the sub-firmware independently compiled by each source code is integrated to prepare complete firmware capable of being burnt and upgraded.
Further, under the top-level prompt menu, the shell performs logic judgment according to the command number input by the user, if the shell judges that the disc making command number is started, the shell performs a disc making sub-function according to the initialization definition path and the script name, invokes an fdisk or a shared tool for executing linux, and performs disc formatting and firmware burning steps on a memory card inserted into the host.
The invention also provides an embedded Linux system software interactive compiling management device, which comprises:
the initialization module is used for controlling the shell to automatically read a local configuration file and judge the current software use state after the host computer of the embedded Linux system starts the compiling management software shell, and initializing one or more cross compiler use environments;
the output module is used for controlling the shell to print out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number;
and the logic judging and calling module is used for controlling the shell to carry out logic judgment according to the command number input by the user, calling the lower Makefile and completing compiling of the corresponding pointing source code.
The implementation of the invention has the following beneficial effects: the comfort level of BSP and SDK development users in compiling, using and developing different module software packages is improved; complicated development compiling modes of command line command input are abandoned, and a large amount of unnecessary operation loss time in development is saved; after migration is carried out in embedded basic software packages of different SoC manufacturers, the adaptation development cost of a new platform can be greatly reduced; the software development user does not need to pay attention to the development environment to build the adaptation work, so that the learning cost of using configuration rules by various software at the bottom layer is saved; in addition, a standardized compiling management mechanism is provided, so that a multi-person development mode is effectively and orderly supported.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an interactive compiling management method for embedded Linux system software according to an embodiment of the invention.
Fig. 2 is a schematic diagram of an interactive compiling management method for embedded Linux system software according to an embodiment of the invention.
Fig. 3 is a specific flowchart of an interactive compiling management method for embedded Linux system software according to an embodiment of the invention.
Detailed Description
The following description of embodiments refers to the accompanying drawings, which illustrate specific embodiments in which the invention may be practiced.
The invention provides an interactive compiling management mechanism of embedded Linux system software, after a user executes a starting script in a command line of a Linux host, the script realizes the printout of a prompt menu and the input acceptance of a user command number, and realizes an upper-layer simple man-machine interaction function. The script judges the intention of the user according to the instruction number, and then invokes the lower Makefile to complete compiling of the corresponding pointing source code, and finally generates the upgradeable and running complete firmware.
Based on this, referring to fig. 1, an embodiment of the present invention provides an interactive compiling management method for embedded Linux system software, including:
after a host machine of the embedded Linux system starts a compiling management software shell, the shell automatically reads a local configuration file and judges the current software use state, and one or more cross compiler use environments are initialized;
the shell prints out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number;
the shell carries out logic judgment according to the command number input by the user, and invokes the lower Makefile to complete compiling of the corresponding pointing source code.
Specifically, as shown in fig. 2 and fig. 3, when implementing the interactive compiling management method of the embedded Linux system software of the embodiment, the types of functional modules of different embedded platform base software packages need to be confirmed in advance due to different types of available source code packages provided by different manufacturers, so that the use requirements and functional scenes of the produced software are required.
Meanwhile, a software environment which is called by shell, makefile is needed to be built in advance, all source code catalogues which need to be compiled are arranged in a self-defined mode, and a shell needs to execute a make-C specified Makeflie path according to the source code self-defined arrangement path so as to ensure that the shell accurately calls the correct Makefile code to compile, clear and install the corresponding source code.
The shell script is logically judged and processed according to a large number of variables, and assignment operation is required to be carried out on basic variables at the beginning of operation; when makefile is executed, a large number of paths and parameter configuration variables are also relied on, the configuration files are introduced through include keywords, and the variables in the configuration files play roles of path pointing and compiling parameter transmission when each source is compiled.
In order to facilitate the management of the overall software code by the git library maintenance environment, the compiler and the root file system exist in a compressed package form, and the compiling management software shell automatically performs initial installation, automatic updating and compiler use environment initialization on the development environment through local running state records and configuration files so as to ensure the normal compiling and use of the overall software.
Based on this, the shell initialization configuration at startup is as follows:
shell initialization software running environment variables specify sub-function script paths and names. The Makefile contains a basic configuration file, and contains source code PATH and version of the current software package and mode configuration information, namely, the source code PATH position, the mode configuration information and a subfunction Makefile PATH, such as a KERNEL PATH path_KERNEL and a KERNEL compiling control Makefile PATH path_KERNEL_MK are imported.
Automatically reading a local configuration file after shell starting, judging whether the current environment software is used for the first time, if so, updating and installing a root file system and one or more cross compiler compression packages, and carrying out initial configuration (defcon) on source codes (such as kernel, uboot and the like) needing initial configuration; if the use is not the first time, automatically judging whether the current compiler and root file system need to be updated according to the self-defined time stamp, if so, for example, if the local use environment is older than the git library environment, automatically updating and installing the compiler and root file system; or judging whether each source code basic configuration needs to be updated, if so, for example, the local use environment is older than the git library environment, and automatically updating the corresponding source codes again with the git library configuration as a standard (defcon default configuration operation). If the updating requirement does not exist, one or more compiler use environments are directly initialized, and the source codes of different functional software corresponding to different architecture chips can be normally compiled.
It can be understood that, in this embodiment, the current environment configuration is automatically initialized and obtained through the compiling environment, which is a basic condition for implementing the subsequent configuration, compiling and installing functions, so that the user does not need to expend time and effort to familiarize with the configuration development environment.
The shell enters a cycle after finishing necessary environment initialization configuration, prints out a top-level prompt menu covering operable option information, and blocks a digital code number waiting to be received and input by a user through a terminal. The interactive interface for constructing the option prompt menu by the shell can output information at the terminal and receive a user input command number from the terminal. Meanwhile, the embodiment also constructs the jump-in and jump-out logic relation of each level of the prompt menu.
Specifically, the top-level menu prompts the main functions: compilation, cleanup, configuration, firmware synthesis, and boot disk production (additionally supporting the active update installation functions of the compiler and root file system, providing a restore operation interface for the misoperations damaging the local compilation chain environment scenario). It can be understood that, in this embodiment, through a simple interactive prompt menu mechanism, a user can intuitively perceive which functional modules are included in the current software, and can quickly and correspondingly operate according to different usage scenarios.
(1) The compile menu function provides one-key compilation and independent compilation operation options for each source code. One-key compiling is performed to complete compiling and installing of all source codes; the independent compiling operation interface provides a single module compiling and updating channel for a software developer developed by a specific module.
(2) The clear menu function provides one-key clean and independent clean operation options for each source code. One-key clearing is performed to finish all source codes clean; the independent clean operation interface provides a single module clean channel for a software developer developing a specific module.
(3) Configuration menu prompts main functions: displaying current configuration, restoring default configuration, menu configuration (menu), starting mode selection, and function selection configuration.
(3.1) displaying the current configuration: displaying the current software matching plate type, function mode selection, starting mode selection, source code configuration version, compiler version and root file system version.
(3.2) restoring the default configuration: some source code compilations can be configured for selection of different functions, and when in use, each source code compilations has a set of customized default configurations. And when in debugging, a developer can carry out increasing and decreasing changes on the basis of some default configurations so as to complete a comparison test, and after the test is completed, the changed configurations are uniformly restored to the default configurations through the default configuration restoring function.
(3.3) Menuconfig configuration: the uboot and kernel source codes support a graphical configuration function, and the function provides an operation inlet of a graphical configuration interface for a developer.
(3.4) start mode selection: some multi-core heterogeneous SoCs contain various processing chips, support multi-heterogeneous starting modes or single-core starting modes, and have different source code configurations under different starting modes.
(3.5) the function is selected and configured: the SoC matched BSP software of some manufacturers supports the selection of xen, atf, optee functions, the SoC matched BSP software of some manufacturers supports the selection of Mcal, freertos, autosar functions, and other software compiled basic configurations are involved under the condition of selecting or not selecting different functions, and the functions can uniformly and correspondingly configure each related source code according to different function selections.
(4) Firmware synthesis function: when the BSP and SDK software are customized, the binary files compiled by the source codes are generally integrated into a firmware or an upgrade compression package for software upgrade. The function realizes the integration of source code compiling output objects of all functions.
(5) And (3) manufacturing a starting disc: some SoC hardware supports memory card (e.g., SD card) boot disk startup, which is responsible for burning the integrated overall firmware or upgrade compression package into the memory card.
The interaction menu printed by the shell informs the user of the type of the control object of the main body, and guides the user to input an operation command number. The command number takes Arabic numerals (such as 0-6) or single English characters (such as q) as effective operation codes:
0: the current operation is represented as actively updating the compiler;
1: representing the current operation as compiling and installing, and entering a compiling submenu interactive interface at the lower layer;
2: representing the current operation as clearing and entering a clearing submenu interactive interface at the lower layer;
3: representing the current operation as configuration and entering a configuration submenu interactive interface of a lower layer;
4: representing the current operation as firmware synthesis;
5: starting disc production for representing current operation as SD card;
q: representing the current operation as an exit operation.
And the user prints out a top-level prompt menu covering the operable option information according to the shell, and inputs a command number (a digital code number or a single English character) to be operated at the terminal.
Under the top-layer prompt menu, the shell receives an input command number from the terminal and then carries out logic judgment to judge what function command number (compiling, clearing, configuring, firmware synthesizing and starting disc making), and then prints out corresponding function prompt submenu information of lower-level operable options.
(1) Under the top-layer prompt menu, the shell receives the input command number from the terminal and then carries out logic judgment, and if the command number is judged to be the compiling function command number, the shell prints out compiling prompt submenu information of lower-level operable options.
In the compiling prompt submenu function, a user inputs 0 operation code, the shell receives the operation code from the terminal and then carries out logic judgment, if the operation code is judged to be a one-key compiling function command number, a makeall instruction is executed to execute a top-level Makefile, and the Makefile sequentially enters each source code catalog for compiling according to each source code path defined by initialization;
the user inputs the 1 operation code, the shell receives the 1 operation code from the terminal and then carries out logic judgment, if the shell judges that the function command number is independently compiled, the shell enters an independent compiling source code submenu, the shell prints out the independent compiling source code submenu information of lower-level operable options, the independent compiling submenu informs the user of which function source codes can be independently compiled, and the compiling and the installation of the appointed source codes can be completed by inputting corresponding option numbers again.
Under the independent compiling source code submenu, after the shell receives a command number input by a user from a terminal, executing a make instruction according to different parameters carried by the command number, and calling different Makefile codes to complete kernel, xen, freertos, mcal and other compiling functions.
The effective input symbols of each source code are Arabic numerals or single English characters when independently compiled, and the corresponding relation between the instruction codes is as follows
0): uboot compilation.
1): and (5) kernel compiling.
2): and (5) Xen compiling.
3): freertos compilation.
……
q): and exiting to return to the upper menu.
Taking KERNEL compiling as an example, after the shell receives the 1 operation code under the interactive menu, the shell executes a make KERNEL to call a top-layer Makefile function, then the top-layer Makefile executes make-C$PATH KERNEL MK according to a KERNEL target item to enter Makefile managed by KERNEL compiling of the lower layer, and the lower-layer Makefile executes make-C$PATH KERNEL according to a KERNEL PATH PATH KERNEL specified by initialization to enter a KERNEL source code catalog to compile.
Under the independent compiling source code submenu, after the shell receives a command number input by a user from a terminal, the shell judges that the command number returns to the upper menu function, and the shell exits the printing cycle of the current submenu and returns to the printing cycle of the upper compiling prompt submenu.
Under the compiling prompt submenu, after the shell receives the command number input by the user from the terminal, the shell judges that the command number returns to the upper menu function command number, and the shell exits the printing cycle of the current submenu and returns to the upper top prompt menu.
Therefore, the compiling management mechanism provided by the embodiment enables the user to break away from the development mode of tedious instruction input, and reduces the error rate and the loss time of redundant operation.
(2) Under the top-level prompt menu, the shell receives the input command number from the terminal and then carries out logic judgment, and if the shell judges that the command number is a clearing function command number, the shell prints out clearing prompt submenu information of lower-level operable options.
In the function of clearing the prompt submenu, a user inputs 0 operation code to finish all source codes clean; and inputting the 1 operation code to enter an independent clean submenu, and inputting the corresponding option number again to finish the cleaning of the designated source code.
Under the clearing prompt submenu, after the shell receives the command number input by the user from the terminal, logic judgment is carried out, if the shell judges that the function command number is cleared by one key, a make instruction is executed to call a Makefile code to carry out make clean operation on all source codes.
Under the clearing prompt submenu, after the shell receives the command number input by the user from the terminal, logic judgment is carried out, and if the command number is judged to be an independent clearing function command number, the shell prints out independent clearing source submenu information of lower-level operable options.
Under the independent clearing source code submenu, after the shell receives a command number input by a user from a terminal, executing a make instruction according to different parameters carried by the command number to call different Makefile codes to complete kernel, xen, freertos, mcal and other makeclean functions.
Under the independent clearing source submenu, after the shell receives a command number input by a user from a terminal, the shell judges that the command number returns to the upper menu function, and the shell exits the printing cycle of the current submenu and returns to the printing cycle of the upper clearing prompt submenu.
And under the condition that the prompting submenu is cleared, after the shell receives the command number input by the user from the terminal, judging that the command number returns to the upper menu function, and then the shell exits the printing cycle of the current submenu and returns to the upper top prompting menu.
(3) Under the top-layer prompt menu, after the shell receives the input command number from the terminal, logic judgment is carried out, and if the shell judges that the command number is the configuration function command number, the shell prints out the configuration submenu information of the lower-level operable options.
In the configuration prompt submenu, a user inputs 0 operation code to display the current configuration, inputs 1 operation code to restore the default configuration, inputs 2 operation code to enter the menu, inputs 3 operation code to enter the start configuration submenu, and inputs 4 operation code to perform function selection configuration submenu.
Under the configuration prompt submenu, after the shell receives the command number input by the user from the terminal, logic judgment is carried out, if the initial configuration command number is judged to be restored, the shell calls the sub-shell or executes a make instruction to complete the restoration of the original configuration file or makedefcon operation (using default configuration); if the multi-core starting mode configuration command number is judged to be changed, calling the sub-function shell to automatically change the related configuration file; if the kernel graphical configuration interface is judged to be the kernel graphical configuration interface, executing a makemenuconfig command; if the current basic configuration command number is judged to be displayed, executing a make command to print configuration variables to the terminal in sequence through a Makefile; if the upper menu function command number is judged to be returned, the shell exits the printing cycle of the current submenu and returns to the upper top prompt menu.
(4) Under the top-layer prompt menu, after the shell receives the input command number from the terminal, logic judgment is carried out, if the command number is judged to be the firmware synthesis command number, the firmware synthesis sub-function shell is executed, and the sub-firmware independently compiled by each source code is integrated to prepare a complete firmware capable of being burnt and upgraded. It will be appreciated that when the firmware synthesis function is executed, all source code is compiled and the corresponding sub-firmware is generated by normal compilation.
(5) Under the top-layer prompt menu, after the shell receives an input command number from the terminal, logic judgment is carried out, if the shell judges that the shell is a starting disc making command number, the shell of a starting disc making subfunction is executed according to an initialization definition path and a script name, an fdisk or a shared tool for executing linux is called, and disc formatting and firmware burning steps are carried out on an SD card inserted into a host.
And under the top-layer prompt menu, after the shell receives the command number input by the user from the terminal, judging that the shell is a command number with an exit function, and automatically stopping operation and exiting from the control menu interface.
It should be noted that, aiming at the problems of great difficulty in yopto learning and use and high development and maintenance cost, the invention realizes compiling management function software only through shell and Makefile, and the software under the simple architecture can realize expansion of additional function source code management by only changing a small amount of scripts and Makefile;
aiming at the problems that the buildroot can not perform the adaptive management on the product-level software package in one step and can not embed the source codes of the non-Linux system and the private function software, the invention realizes the integration, management and compilation of all the main software source codes under the flexible mutual calling mechanism of the shell and the Makefile, and supports the functions of configuration selection, firmware synthesis and the like of different modes;
aiming at the problems that the compiling configuration rules of the original BSP and SDK software packages provided by different SoC manufacturers have large difference, a great amount of time is required for developing users to refer to different instruction descriptions and construct different development environments and modes, the invention can automatically initialize the compiling environments and provide a simple and universal guiding interaction menu interface, and the users can rapidly complete configuration, compiling, installing and firmware synthesizing operations according to personal requirements and menu prompts. The software can enable a user developer to concentrate on developing the functions of the code of the bottom layer C or the upper layer C++, and the user does not need to invest time and energy to the work of familiarity, construction and use of a development environment.
Corresponding to the method for managing the interactive compiling of the embedded Linux system software in the first embodiment of the present invention, a second embodiment of the present invention further provides an apparatus for managing the interactive compiling of the embedded Linux system software, including:
the initialization module is used for controlling the shell to automatically read a local configuration file and judge the current software use state after the host computer of the embedded Linux system starts the compiling management software shell, and initializing one or more cross compiler use environments;
the output module is used for controlling the shell to print out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number;
and the logic judging and calling module is used for controlling the shell to carry out logic judgment according to the command number input by the user, calling the lower Makefile and completing compiling of the corresponding pointing source code.
Regarding the working principle and process of the present embodiment, reference is made to the foregoing description of the first embodiment of the present invention, and no further description is given here.
As can be seen from the above description, compared with the prior art, the invention has the following beneficial effects: the comfort level of BSP and SDK development users in compiling, using and developing different module software packages is improved; complicated development compiling modes of command line command input are abandoned, and a large amount of unnecessary operation loss time in development is saved; after migration is carried out in embedded basic software packages of different SoC manufacturers, the adaptation development cost of a new platform can be greatly reduced; the software development user does not need to pay attention to the development environment to build the adaptation work, so that the learning cost of using configuration rules by various software at the bottom layer is saved; in addition, a standardized compiling management mechanism is provided, so that a multi-person development mode is effectively and orderly supported.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (7)

1. An embedded Linux system software interactive compiling management method is characterized by comprising the following steps:
after a host machine of the embedded Linux system starts a compiling management software shell, the shell automatically reads a local configuration file and judges the current software use state, and one or more cross compiler use environments are initialized;
the shell prints out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number;
the shell carries out logic judgment according to the command number input by the user, and invokes the lower Makefile to complete compiling of the corresponding pointing source code;
the shell automatically reads a local configuration file and judges the current software use state, and initializes one or more cross compiler use environments, and specifically comprises the following steps:
automatically reading a local configuration file after the shell is started, judging whether the current environment software is used for the first time, if so, updating and installing a root file system and one or more cross compiler compression packages or carrying out initial configuration on source codes needing initial configuration;
if the method is not used for the first time, judging whether the current compiler and the root file system need to be updated or not automatically according to the self-defined time stamp, and if so, automatically updating and installing the compiler and the root file system; or judging whether the basic configuration of each source code needs to be updated, if so, automatically updating the corresponding source code again by taking the git library configuration as the standard; if there is no update requirement, directly initializing one or more compiler use environments;
before the shell is started, the method further comprises the following steps:
pre-constructing shell, makefile inter-calling software environment, and custom arranging all source code catalogues needing compiling; performing assignment operation on basic variables operated by the shell script, and introducing a configuration file into a Makefile through an include keyword;
the functions of the top-level prompt menu for prompting comprise: compiling, clearing, configuring, synthesizing firmware and starting disc manufacturing;
the compiling menu function is used for providing one-key compiling and independent compiling operation options of each source code, and the one-key compiling operation options are used for completing compiling and installing all the source codes; the independent compiling operation option is used for providing single-module compiling and updating;
the clearing menu function is used for providing one-key clearing and independent clearing operation options of each source code, and the one-key clearing operation options are used for completing clearing of all source codes; the independent purge operation option is used for providing single module purge;
the configuration menu prompt function further comprises the steps of displaying the current configuration, restoring the default configuration, graphically configuring, starting mode selection and function selection configuration;
the firmware synthesis menu function is used for integrating the source code compiling output objects of all functions into a firmware or upgrading compression packet;
the starting disc making menu function is used for burning the integrated firmware or the upgrade compressed package into a memory card used as a starting disc;
the shell carries out logic judgment according to a command number input by a user, calls a lower Makefile to complete compiling of corresponding pointing source codes, and specifically comprises the following steps: under the top-layer prompting menu, the shell receives the command number input by the user, then carries out logic judgment, judges the function command number, prints out corresponding function prompting submenu information of lower-level operable options, and the command number takes Arabic numerals or single English characters as effective operation codes.
2. The method of claim 1, wherein under the top-level prompt menu, the shell performs logic judgment according to the command number input by the user, and if the command number is judged to be a compiling function command number, the shell prints out compiling prompt submenu information of lower-level operable options;
in the compiling prompt submenu function, the shell carries out logic judgment according to the command number input by a user, if the shell judges that the function command number is compiled by one key, a make all instruction is executed to execute a top-level Makefile, and the Makefile sequentially enters each source code catalog for compiling according to each source code path defined by initialization; if the command number of the independent compiling function is judged, entering an independent compiling source code submenu, printing and outputting the independent compiling source code submenu information of lower-level operable options by the shell, carrying different parameters to execute a make instruction, and calling different Makefile codes to complete each source code compiling function.
3. The method of claim 1, wherein under the top-level prompt menu, the shell performs logic judgment according to the command number input by the user, and if the shell judges that the command number is a clear function command number, the shell prints out clear prompt submenu information of lower-level operable options;
in the clearing prompt submenu function, the shell carries out logic judgment according to a command number input by a user, and if the shell judges that the function command number is cleared by one key, a make instruction is executed to call a Makefile code to carry out clearing operation on all source codes; if the shell judges that the command number of the independent clearing function is the independent clearing source code sub-menu information of the lower operable option is printed out, a make instruction is carried out with different parameters to call different Makefile codes to complete the clearing function of each source code.
4. The method of claim 1, wherein under the top-level prompt menu, after the shell receives the input command number from the terminal, performing logic judgment, and if the shell judges to be the configuration function command number, printing out configuration submenu information of lower-level operable options;
under the configuration prompt submenu, the shell carries out logic judgment according to the command number input by the user, if the initial configuration command number is judged to be restored, the shell calls the sub-shell or executes a make instruction to complete restoration of the original configuration file or uses default configuration operation; if the multi-core starting mode configuration command number is judged to be changed, calling the sub-function shell to automatically change the related configuration file; if the kernel menu type configuration command number is judged, executing a make menu field instruction to enter a kernel graphical configuration interface; and if the current basic configuration command number is judged to be displayed, executing a make command to print the configuration variables to the terminal in sequence through a Makefile.
5. The method of claim 1 wherein under the top-level hint menu, the shell performs logic judgment according to the command number input by the user, and if the command number is judged to be a firmware synthesis command number, the firmware synthesis sub-function shell is executed, and the sub-firmware independently compiled by each source code is integrated to prepare the complete firmware capable of being burned and upgraded.
6. The method according to any one of claims 1 to 5, wherein under the top-level hint menu, the shell performs logic judgment according to a command number input by a user, and if the shell judges that the shell is a startup disc creation command number, the shell performs a startup disc creation sub-function according to an initialization definition path and a script name, invokes an fdisk or a shared tool that performs linux, and performs a disc formatting and firmware burning step on a memory card inserted into the host.
7. An embedded Linux system software interactive compiling management device is characterized by comprising:
the initialization module is used for controlling the shell to automatically read a local configuration file and judge the current software use state after the host computer of the embedded Linux system starts the compiling management software shell, and initializing one or more cross compiler use environments;
the output module is used for controlling the shell to print out a top-level prompt menu covering the operable option information so as to prompt a user to input a corresponding command number;
the logic judgment and calling module is used for controlling the shell to carry out logic judgment according to the command number input by the user, calling the lower Makefile and completing compiling of the corresponding pointing source code;
the initialization module is specifically configured to: automatically reading a local configuration file after the shell is started, judging whether the current environment software is used for the first time, if so, updating and installing a root file system and one or more cross compiler compression packages or carrying out initial configuration on source codes needing initial configuration; if the method is not used for the first time, judging whether the current compiler and the root file system need to be updated or not automatically according to the self-defined time stamp, and if so, automatically updating and installing the compiler and the root file system; or judging whether the basic configuration of each source code needs to be updated, if so, automatically updating the corresponding source code again by taking the git library configuration as the standard; if there is no update requirement, directly initializing one or more compiler use environments;
the initialization module is also used for pre-constructing shell, makefile inter-calling software environment before the shell is started and custom arranging all source code catalogues needing compiling; performing assignment operation on basic variables operated by the shell script, and introducing a configuration file into a Makefile through an include keyword;
the functions of the top-level prompt menu for prompting comprise: compiling, clearing, configuring, synthesizing firmware and starting disc manufacturing;
the compiling menu function is used for providing one-key compiling and independent compiling operation options of each source code, and the one-key compiling operation options are used for completing compiling and installing all the source codes; the independent compiling operation option is used for providing single-module compiling and updating;
the clearing menu function is used for providing one-key clearing and independent clearing operation options of each source code, and the one-key clearing operation options are used for completing clearing of all source codes; the independent purge operation option is used for providing single module purge;
the configuration menu prompt function further comprises the steps of displaying the current configuration, restoring the default configuration, graphically configuring, starting mode selection and function selection configuration;
the firmware synthesis menu function is used for integrating the source code compiling output objects of all functions into a firmware or upgrading compression packet;
the starting disc making menu function is used for burning the integrated firmware or the upgrade compressed package into a memory card used as a starting disc;
the shell carries out logic judgment according to a command number input by a user, calls a lower Makefile to complete compiling of corresponding pointing source codes, and specifically comprises the following steps: under the top-layer prompting menu, the shell receives the command number input by the user, then carries out logic judgment, judges the function command number, prints out corresponding function prompting submenu information of lower-level operable options, and the command number takes Arabic numerals or single English characters as effective operation codes.
CN202210766251.5A 2022-07-01 2022-07-01 Interactive compiling management method and device for embedded Linux system software Active CN115220728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210766251.5A CN115220728B (en) 2022-07-01 2022-07-01 Interactive compiling management method and device for embedded Linux system software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210766251.5A CN115220728B (en) 2022-07-01 2022-07-01 Interactive compiling management method and device for embedded Linux system software

Publications (2)

Publication Number Publication Date
CN115220728A CN115220728A (en) 2022-10-21
CN115220728B true CN115220728B (en) 2023-12-01

Family

ID=83610537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210766251.5A Active CN115220728B (en) 2022-07-01 2022-07-01 Interactive compiling management method and device for embedded Linux system software

Country Status (1)

Country Link
CN (1) CN115220728B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116931954B (en) * 2023-09-18 2023-12-19 浙江简捷物联科技有限公司 Built-in software package compiling construction method, device, equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697135A (en) * 2009-10-28 2010-04-21 北京东方网力科技有限公司 Method and device for compiling program
CN103309706A (en) * 2013-05-24 2013-09-18 中标软件有限公司 Memory file system preparation method and unit based on Linux operation system
CN103870262A (en) * 2012-12-14 2014-06-18 北汽福田汽车股份有限公司 Method and device for automatically generating variables based on SHELL script
CN104318708A (en) * 2014-09-29 2015-01-28 北京工业大学 Embedded intelligent security protection system of ARM-based Linux operating system
CN105068860A (en) * 2015-09-08 2015-11-18 中国矿业大学(北京) Linux coal cutter management host system based on ARM
CN106371813A (en) * 2015-07-23 2017-02-01 广州汽车集团股份有限公司 Simulink-based motor controller software generation method for electric vehicle
CN106873951A (en) * 2015-12-14 2017-06-20 北京谊安医疗***股份有限公司 A kind of method that Anesthesia machine upper computer software is transplanted to built-in Linux
CN112231221A (en) * 2020-10-26 2021-01-15 积成电子股份有限公司 Debugging method and system for application program of embedded Linux system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10310821B2 (en) * 2017-06-03 2019-06-04 Apple Inc. Integration of learning models into a software development system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697135A (en) * 2009-10-28 2010-04-21 北京东方网力科技有限公司 Method and device for compiling program
CN103870262A (en) * 2012-12-14 2014-06-18 北汽福田汽车股份有限公司 Method and device for automatically generating variables based on SHELL script
CN103309706A (en) * 2013-05-24 2013-09-18 中标软件有限公司 Memory file system preparation method and unit based on Linux operation system
CN104318708A (en) * 2014-09-29 2015-01-28 北京工业大学 Embedded intelligent security protection system of ARM-based Linux operating system
CN106371813A (en) * 2015-07-23 2017-02-01 广州汽车集团股份有限公司 Simulink-based motor controller software generation method for electric vehicle
CN105068860A (en) * 2015-09-08 2015-11-18 中国矿业大学(北京) Linux coal cutter management host system based on ARM
CN106873951A (en) * 2015-12-14 2017-06-20 北京谊安医疗***股份有限公司 A kind of method that Anesthesia machine upper computer software is transplanted to built-in Linux
CN112231221A (en) * 2020-10-26 2021-01-15 积成电子股份有限公司 Debugging method and system for application program of embedded Linux system

Also Published As

Publication number Publication date
CN115220728A (en) 2022-10-21

Similar Documents

Publication Publication Date Title
US8769553B2 (en) Deploy anywhere framework for heterogeneous mobile application development
CN110865971B (en) System and method for verifying SOC chip
CN101876940B (en) Automatic test method and device
CN100498704C (en) Persistent memory manipulation using EFI
US7673127B2 (en) Method and apparatus for enabling a computer system by loading and executing an updated hardware specific boot routine to modify the operating system
US6523101B1 (en) Installed-software development assistance system
CN101667134B (en) Method for constructing compiling system and compiling system constructing device
CN102880498B (en) The method of virtual SD card on the device of Android system
CN101344854B (en) Method for upgrading embedded type Linux equipment through SD card
CN101183335A (en) Method and system for realizing embedded software unconventionality testing
US6308326B1 (en) Run-time modules for dynamically adjusting computer operation
CN115220728B (en) Interactive compiling management method and device for embedded Linux system software
US7080244B2 (en) System and method for configuring hardware devices using a menu for platforms with EFI and legacy option-ROMs
CN103136002A (en) Automatic upgrade control method based on UBoot instruction and system
CN107122219A (en) The acquisition methods and device of installation file
US20120022674A1 (en) Application specific virtual real-time operating system compiler
JPH11119981A (en) Program generator
US20080127061A1 (en) Method and system for editing code
CN113138790B (en) Customized integration method and device for Android set top box and integrated development system for set top box
CN100361075C (en) Method and device for quickly developing embedded system using automatic compilation frame
CN108052326B (en) Implementation method for supporting Arduino IDE development by Xilinx FPGA
WO2004036420A1 (en) Program development support device, program execution device, compile method and debug method
CN116643761A (en) Customized mirror image manufacturing and deploying method, device, terminal and medium
CN109891385A (en) A kind of method and terminal for installing POS machine initial configuration information
US20070174699A1 (en) Automated generation of operational monitor platform for computer boards

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant