Method and device for deploying embedded operating system based on tftp protocol under uboot

Through the TFTP protocol-based method under Uboot, self-start scripts, ramdisk file system images and Uboot scripts, the problems of vulnerability in embedded operating system deployment, and the problems of vulnerability in device deployment are solved, achieving efficient and convenient File transfer and multi-device deployment.

CN119396418APending Publication Date: 2025-02-07NARI INFORMATION & COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411243477.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The deployment methods of existing embedded operating systems have problems such as easy wear and loss of equipment, easy damage to installation media, difficult batch deployment, and cumbersome deployment steps.

Method used

Using the method based on the tftp protocol under Uboot, the deployment of the embedded operating system is completed by making self-start scripts, ramdisk file system images and uboot scripts.

Benefits of technology

It realizes the simplicity of file transfer in a network environment, avoids the loss of external memory media and the consumption of physical media, supports larger file transfer and more frequent updates, improves the efficiency of multi-device deployment and reduces production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396418A_ABST
    Figure CN119396418A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for deploying an embedded operating system based on a tftp protocol under uboot. The method comprises the steps that a self-starting script operated after a ramdisk file system is started is manufactured; making a ramdisk file system image which is started in the uboot; making a uboot script which is executed under the uboot; and setting to a tftp server side to complete the deployment of the embedded operating system. According to the invention, no external storage medium loss exists, larger files can be transmitted, and more frequent file updating is supported; a plurality of embedded devices can download files through the tftp server at the same time, so that the efficiency is improved, and the consumption of physical media and the management cost are reduced; the main steps of making the system are decoupled, the whole framework does not need to be modified, and only the corresponding modified file needs to be replaced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for deploying an embedded operating system based on a TFTP protocol under Uboot. Background Art

[0002] With the widespread application of embedded systems in industrial control, home appliances, consumer electronics, medical equipment and other fields, the demand for system updates and maintenance is also increasing. At present, the deployment of embedded operating systems is usually carried out by writing image files on external storage media such as USB drives or SD cards.

[0003] For embedded devices that need to be continuously developed and improved, it is often necessary to upgrade or redeploy the operating system during testing or use. However, these traditional methods of installation through USB drives or SD cards mostly have problems such as easy wear and loss of devices and easy damage of installation media. In addition, transferring files through USB drives or SD cards requires access to embedded devices at the physical level, which is difficult to achieve batch deployment for embedded devices that are numerous and widely distributed. In addition, each time a different version of the operating system is deployed, the USB drive or SD card needs to be re-read and written to rewrite the image file, making the deployment steps too cumbersome. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the above existing problems, the present invention is proposed. Therefore, the present invention provides a method for deploying an embedded operating system based on the TFTP protocol under uboot to solve the problem of how to provide a simple file transfer protocol suitable for file transfer in a network environment.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a method for deploying an embedded operating system based on a tftp protocol under uboot, comprising: making a self-starting script that runs after a ramdisk file system is started;

[0008] Make a ramdisk file system image that boots in uboot;

[0009] Make a uboot script to be executed under uboot;

[0010] Based on the self-starting script, ramdisk file system image and uboot script, they are set to the tftp server to complete the deployment of the embedded operating system.

[0011] As a preferred solution of the method for deploying an embedded operating system based on the TFTP protocol under uboot of the present invention, wherein: making the self-starting script includes:

[0012] Write command to set the IP address of the embedded device network port;

[0013] Write a command to monitor whether the name of the transmitted image file is the same as the name of the image file on the server, and determine whether there is an image file corresponding to the system on the server;

[0014] If there is an image file corresponding to the system, then detect whether the memory of the embedded device is working normally. If it is working normally, repartition and format the memory;

[0015] Write commands to transfer the images and files required by the embedded device from the TFTP server through the TFTP network protocol.

[0016] As a preferred solution of the method for deploying an embedded operating system based on the TFTP protocol under the uboot of the present invention, wherein: making the ramdisk file system image includes:

[0017] Create a root file system through busybox or Buildroot, put the self-starting script into the root file system, and format it into an ext2 file format image to obtain a ramdisk.ext2 file;

[0018] Use gzip-v9ramdisk.ext2 to compress the ramdisk file into ramdisk.ext2.gz in an optimal way;

[0019] The mkimage command is used to process and add a 64-byte header before the original ramdisk file system image. The 64-byte header includes a magic number and CRC check information.

[0020] As a preferred solution of the method for deploying an embedded operating system based on the tftp protocol under uboot of the present invention, wherein: making the uboot script includes:

[0021] Write the commands and environment variables to be executed in uboot into the uboot script, set the bootargs environment variable, specify the mount partition as / dev / ram0, specify the console device and the baud rate used for communication;

[0022] Use the tftpboot command in uboot to transfer the boot image file to the specified memory address;

[0023] Call the booti command to start the ramdisk file system according to the specified memory address.

[0024] As a preferred solution of the method for deploying an embedded operating system based on the tftp protocol under uboot of the present invention, wherein: making the uboot script also includes:

[0025] Use the command mkimage-A arm64-O linux-T script-C none-n "my script"-dboot.script uboot.script to create a uboot script that is executed by the source command in the uboot command line interface;

[0026] The boot image file includes a kernel file Image, a device tree file dtb and a ramdisk file system.

[0027] As a preferred solution of the method for deploying an embedded operating system based on the TFTP protocol under uboot described in the present invention, the deployment of the embedded operating system includes:

[0028] Put the self-starting script, ramdisk file system image and uboot script produced into the tftp server;

[0029] Power on the embedded device and enter the uboot command line interface. Use the tftpboot command to transfer the uboot script to the specified memory address in the embedded device, and use the source command to execute the uboot script.

[0030] As a preferred solution of the method for deploying an embedded operating system based on the TFTP protocol under the uboot of the present invention, wherein: the boot image file is transferred to a specified memory address through the TFTP network protocol, and the RAMDISK file system is started according to the set address through the booti instruction;

[0031] Through the self-starting script of the ramdisk file system, it is determined whether the required system image file exists on the tftp server, and if the image file exists, the memory in the embedded device is repartitioned and formatted;

[0032] The required applications and files are transferred to the specified partition through the TFTP network protocol according to the script settings, and the transferred files and applications are decompressed and installed respectively.

[0033] In a second aspect, the present invention provides a device for deploying an embedded operating system based on the TFTP protocol under uboot, comprising:

[0034] The self-starting script module is used to create a self-starting script that runs after the ramdisk file system is started;

[0035] The ramdisk file system image module is used to create a ramdisk file system image started in uboot;

[0036] The uboot script module is used to create uboot scripts executed under uboot;

[0037] The configuration module is used to set to the tftp server based on the self-starting script, ramdisk file system image and uboot script to complete the deployment of the embedded operating system.

[0038] In a third aspect, the present invention provides an electronic device, comprising:

[0039] Memory and processor;

[0040] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for deploying an embedded operating system based on the TFTP protocol under Uboot are implemented.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for deploying an embedded operating system based on the TFTP protocol under Uboot.

[0042] Compared with the prior art, the present invention has the following beneficial effects: the present invention has no external storage medium loss, and the transmission through the tftp server is not limited by the capacity of the USB drive or the SD card itself, so that larger files can be transmitted, and more frequent file updates are also supported; secondly, multiple embedded devices can download files through the tftp server at the same time, thereby improving efficiency. When transmitting through tftp, there is no need to prepare a large number of USB drives, thereby reducing the consumption of physical media and management costs. In particular, when large-scale deployment is required, the use of tftp can significantly reduce production costs; finally, the present invention decouples the main steps of the production system. If a file or step needs to be optimized and modified, the entire framework does not need to be modified, and only the corresponding modified file needs to be replaced. In addition, the value of the keyword in the bootargs environment variable can be set in uboot, and after the system is started, the keyword can be obtained in / proc / cmdline to specify the execution of different self-starting scripts in the ramdisk file system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0044] Figure 1 This is a schematic diagram of the overall process of a method for deploying an embedded operating system based on the TFTP protocol under uboot according to an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a specific execution flow of a method for deploying an embedded operating system based on the TFTP protocol under uboot according to an embodiment of the present invention in an application;

[0046] Figure 3 A schematic diagram of a small-scale deployment test of a method for deploying an embedded operating system based on the TFTP protocol under uboot according to an embodiment of the present invention;

[0047] Figure 4 The present invention is a flowchart of a large-scale deployment application of a method for deploying an embedded operating system based on the TFTP protocol under uboot according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0050] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0051] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0052] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0053] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0054] Example 1

[0055] Reference Figure 1-Figure 2Table 1 is an embodiment of the present invention, which provides a method for deploying an embedded operating system based on the TFTP protocol under uboot, including:

[0056] S101, create a self-starting script that runs after the ramdisk file system is started.

[0057] Preferably, making a self-starting script includes:

[0058] Write a command to set the IP address of the embedded device network port to ensure that the network can transfer files normally during TFTP transmission;

[0059] Write a command to monitor whether the name of the transmitted image file is the same as the name of the image file on the server, and determine whether there is an image file corresponding to the system on the server;

[0060] Specifically, if the image file required for deployment exists, the next step can be entered to detect whether the memory of the embedded device can work normally. If not, it will try to perform multiple tests within a fixed time. After the timeout, it will automatically exit the self-starting script and output relevant error information.

[0061] If there is an image file corresponding to the system, then detect whether the memory of the embedded device is working normally. If it is working normally, repartition and format the memory;

[0062] Specifically, if the memory is normal, the memory is repartitioned and formatted according to the steps. If the memory is detected and it is found that there is a problem with the memory device, such as no normal identification or bad blocks in the partition, the script execution will be exited and an error message will be output.

[0063] Write commands to transfer the images and files required by the embedded device from the TFTP server through the TFTP network protocol.

[0064] S102, creating a ramdisk file system image started in uboot.

[0065] Preferably, making a ramdisk file system image includes:

[0066] Use busybox or Buildroot to create a root file system, put the self-starting script into the root file system, add the steps to execute the script in the rc.local file, and format it into an ext2 file format image to obtain the ramdisk.ext2 file;

[0067] Use gzip-v9ramdisk.ext2 to compress the ramdisk file into ramdisk.ext2.gz in an optimal way;

[0068] Specifically, the gzip tool is used to compress the ramdisk file into ramdisk.ext2.gz in an optimal manner, wherein the optimal manner refers to the -9 parameter in the gzip command, and the gzip compression level ranges from 1 (lowest) to 9 (highest). The optimal compression method refers to compression level 9, which means using the maximum compression ratio to obtain a smaller file size, thereby spending less time on network transmission.

[0069] Processed by the mkimage command, a 64-byte header is added before the original ramdisk file system image. The 64-byte header includes the magic number and CRC check information.

[0070] Specifically, the mkimage command refers to mkimage -T ramdisk -C gzip-dramdisk.ext2.gzramdisk.ext2.gz.img.

[0071] S103, creating a uboot script to be executed under uboot.

[0072] Preferably, making a uboot script includes:

[0073] Write the commands and environment variables that need to be executed in uboot into the uboot script. Some of the main commands in the script are shown in Table 1. The main function of the commands in the uboot script in Table 1 is to set the bootargs environment variable, specify the mount partition as / dev / ram0, specify the console device and the baud rate used for communication;

[0074] Table 1: Commands that need to be executed in uboot

[0075]

[0076] Use the tftpboot command in uboot to transfer the boot image file to the specified memory address;

[0077] Call the booti command to start the ramdisk file system according to the specified memory address;

[0078] Use the mkimage tool to create a uboot script that can be executed through the source command in the uboot command line interface through the mkimage-A arm64-O linux-T script-C none-n "myscript"-d boot.scriptuboot.script command;

[0079] The boot image file includes the kernel file Image, the device tree file dtb and the ramdisk file system.

[0080] S104, based on the self-starting script, the ramdisk file system image and the uboot script, they are set to the tftp server to complete the deployment of the embedded operating system.

[0081] Preferably, the deployment of the embedded operating system includes:

[0082] Put the self-starting script, ramdisk file system image and uboot script into the tftp server.

[0083] Power on the embedded device and enter the uboot command line interface. Use the tftpboot command to transfer the uboot script to the specified memory address in the embedded device, and use the source command to execute the uboot script.

[0084] Transfer the boot image file to the specified memory address through the tftp network protocol, and start the ramdisk file system according to the set address through the booti instruction;

[0085] Through the self-starting script of the ramdisk file system, it is determined whether the required system image file exists on the tftp server. If the image file exists, the memory in the embedded device is repartitioned and formatted.

[0086] The required applications and files are transferred to the specified partition through the TFTP network protocol according to the script settings, and the transferred files and applications are decompressed and installed respectively.

[0087] It should be noted that the present invention is a simple file transfer protocol with the characteristics of light weight and high speed, and is suitable for file transfer in a network environment. The combination of the TFTP protocol and uboot can realize efficient and convenient embedded system deployment and update. With the improvement of network port transmission rate and the increase of the number of network ports on the server, it becomes a practical solution to transmit the set system image file through the TFTP network protocol and use RAMdisk to deploy the operating system on a large scale.

[0088] Compared with repeatedly reading and writing on an external storage medium such as a USB drive or an SD card to write a RAMdisk file system image file, the present invention does not need to worry about the loss of the external storage medium when transmitting through a network. Moreover, transmission through a TFTP server is not limited by the capacity of the USB drive or the SD card itself, and larger files can be transmitted. At the same time, it also supports more frequent file updates.

[0089] Secondly, multiple embedded devices can download files through the TFTP server at the same time, while deployment through USB drives requires manual operation of each device, which is less efficient. When transmitting through TFTP, there is no need to prepare a large number of USB drives, reducing the consumption of physical media and management costs. Especially when large-scale deployment is required, the use of TFTP can significantly reduce production costs.

[0090] Finally, the present invention decouples the main steps of the production system. If a certain file or step needs to be optimized and modified, there is no need to modify the entire framework, only the corresponding modified file needs to be replaced. In addition, the value of the keyword in the bootargs environment variable can be set in uboot. After the system is started, the keyword can be obtained in / proc / cmdline to specify the execution of different self-starting scripts in the ramdisk file system.

[0091] The above is a schematic scheme of a method for deploying an embedded operating system based on the TFTP protocol under uboot in this embodiment. It should be noted that the technical scheme of the device for deploying an embedded operating system based on the TFTP protocol under uboot and the technical scheme of the method for deploying an embedded operating system based on the TFTP protocol under uboot above belong to the same concept, and the details of the technical scheme of the device for deploying an embedded operating system based on the TFTP protocol under uboot in this embodiment that are not described in detail can all be referred to the description of the technical scheme of the method for deploying an embedded operating system based on the TFTP protocol under uboot above.

[0092] In this embodiment, the device for deploying an embedded operating system based on the tftp protocol under uboot includes:

[0093] The self-starting script module is used to create a self-starting script that runs after the ramdisk file system is started;

[0094] The ramdisk file system image module is used to create a ramdisk file system image started in uboot;

[0095] The uboot script module is used to create uboot scripts executed under uboot;

[0096] The configuration module is used to set up the TFTP server based on the self-starting script, ramdisk file system image and uboot script to complete the deployment of the embedded operating system.

[0097] This embodiment also provides an electronic device, which is suitable for deploying an embedded operating system based on the TFTP protocol under uboot, including:

[0098] A memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the method for deploying an embedded operating system based on the TFTP protocol under Uboot as proposed in the above embodiment.

[0099] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for deploying an embedded operating system based on the TFTP protocol under Uboot proposed in the above embodiment is implemented.

[0100] The storage medium proposed in this embodiment and the method for implementing the deployment of an embedded operating system based on the TFTP protocol under uboot proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0101] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (RandomAccess Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.

[0102] Example 2

[0103] Reference Figure 3-Figure 4 , which is an embodiment of the present invention, provides a method for deploying an embedded operating system based on the TFTP protocol under uboot. In order to verify its beneficial effects, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0104] In this embodiment, the embedded system is deployed by the method of the present invention, specifically for two situations: small-scale deployment testing and large-scale deployment of operating systems, and the respective deployment steps are as follows.

[0105] Reference Figure 3 , used for small-scale deployment testing, the specific implementation steps include:

[0106] 1. Set the IP address and port of the tftp server, and ensure that the tftp service runs normally. Connect the embedded device to the tftp server through network devices such as network cables, and ensure that the uboot of the embedded device can access the IP address of the tftp server.

[0107] 2. Put the ramdisk file system image and uboot script provided in the present invention and the operating system files to be deployed into the tftp server directory;

[0108] 3. Power on the motherboard, press any key to stop in the uboot command line interface, and execute the tftpbootaddress uboot.script command in uboot to transfer the prepared uboot script file to the specified memory address in the embedded device;

[0109] 4. Use the source address command to start the uboot script, follow the steps set in the script, and transfer the Image kernel image file, dtb device tree file and ramdisk file system through the tftp network protocol;

[0110] 5. After the ramdisk system is successfully started, the system will automatically execute the set self-starting script when entering the system. The main steps of the self-starting script are to set the network port IP address used to transfer files for tftp network transmission, repartition and format the memory of the embedded device, and then transfer the required applications and files to the specified partition through the tftp network protocol according to the script settings, and decompress and install the files and applications after the transfer.

[0111] Reference Figure 4 , used for large-scale deployment of operating systems, the specific implementation steps include:

[0112] 1. In the file that sets the default environment variables in the uboot source code, add keywords to determine whether to perform tftp deployment and the specific operating system version to be deployed;

[0113] 2. Set the IP address and port of the tftp server, and ensure that the tftp service runs normally. Connect the embedded device to the tftp server through network devices such as network cables, and ensure that the uboot of the embedded device can access the IP address of the tftp server.

[0114] 3. Put the ramdisk file system image and uboot script provided in the present invention and the operating system files to be deployed into the tftp server directory;

[0115] 4. When the embedded device is powered on, there is no need to enter the uboot command line interface. uboot will directly execute according to the parameters set by bootcmd. If the environment variable flag for tftp deployment of the operating system exists, the tftpboot command will be used to transfer the uboot script. If not, it will start normally. At the same time, the content of the environment variable that determines the system version can be used to determine which version of the uboot script to transfer. After the transfer is completed, the setenv command needs to be used to change the flag of the environment variable;

[0116] 5. Add source address command in bootcmd to start the steps of uboot script, execute according to the steps set in the script, and transfer Image kernel image file, dtb device tree file and ramdisk file system through tftp network protocol;

[0117] 6. After successfully starting the ramdisk system, the system will automatically execute the set self-starting script when entering the system. The main steps of the self-starting script are to set the network port IP address used to transfer files for tftp network transmission, repartition and format the memory of the embedded device, and then transfer the required applications and files to the specified partition through the tftp network protocol according to the script settings, and decompress and install the files and applications after the transfer.

[0118] It should be noted that for small-scale deployment tests, by using commands and setting environment variables in the uboot command line interface, the running links can be independently controlled and the corresponding operations can be modified according to the actual situation. This has a higher degree of freedom. For example, the version of the deployed operating system image file can be determined and modified when necessary.

[0119] For large-scale deployment of operating systems, it is more highly integrated and does not require manual operation by entering the command line interface under uboot. You only need to arrange the operating system image file to be transferred in advance.

[0120] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for deploying an embedded operating system based on the tftp protocol under uboot, characterized in that: include: Create a self-starting script that runs after the ramdisk file system is started; Make a ramdisk file system image that boots in uboot; Make a uboot script to be executed under uboot; Based on the self-starting script, ramdisk file system image and uboot script, they are set to the tftp server to complete the deployment of the embedded operating system.

2. The method for deploying an embedded operating system based on the tftp protocol under uboot as claimed in claim 1, characterized in that: Making the self-starting script includes: Write command to set the IP address of the embedded device network port; Write a command to monitor whether the name of the transmitted image file is the same as the name of the image file on the server, and determine whether there is an image file corresponding to the system on the server; If there is an image file corresponding to the system, then detect whether the memory of the embedded device is working normally. If it is working normally, repartition and format the memory; Write commands to transfer the images and files required by the embedded device from the TFTP server through the TFTP network protocol.

3. The method for deploying an embedded operating system based on the tftp protocol under uboot as described in claim 1 or 2, characterized in that: Making the ramdisk file system image includes: Create a root file system through busybox or Buildroot, put the self-starting script into the root file system, and format it into an ext2 file format image to obtain a ramdisk.ext2 file; Compress the ramdisk file to ramdisk.ext2.gz in an optimal way by gzip-v9 ramdisk.ext2; The mkimage command is used to process and add a 64-byte header before the original ramdisk file system image. The 64-byte header includes a magic number and CRC check information.

4. The method for deploying an embedded operating system based on the tftp protocol under uboot as claimed in claim 3, characterized in that: Making the uboot script includes: Write the commands and environment variables to be executed in uboot into the uboot script, set the bootargs environment variable, specify the mount partition as / dev / ram0, specify the console device and the baud rate used for communication; Use the tftpboot command in uboot to transfer the boot image file to the specified memory address; Call the booti command to start the ramdisk file system according to the specified memory address.

5. The method for deploying an embedded operating system based on the tftp protocol under uboot as claimed in claim 4, characterized in that: Making the uboot script also includes: Use the command mkimage-A arm64-O linux-T script-C none-n "my script"-d boot.scriptuboot.script to create a uboot script that is executed through the source command in the uboot command line interface; The boot image file includes a kernel file Image, a device tree file dtb and a ramdisk file system.

6. The method for deploying an embedded operating system based on the tftp protocol under uboot as claimed in claim 5, characterized in that: Deployment of embedded operating systems includes: Put the self-starting script, ramdisk file system image and uboot script produced into the tftp server; Power on the embedded device and enter the uboot command line interface. Use the tftpboot command to transfer the uboot script to the specified memory address in the embedded device, and use the source command to execute the uboot script.

7. The method for deploying an embedded operating system based on the tftp protocol under uboot as claimed in claim 6, characterized in that: The boot image file is transferred to the specified memory address through the tftp network protocol, and the ramdisk file system is started according to the set address through the booti instruction; Through the self-starting script of the ramdisk file system, it is determined whether the required system image file exists on the tftp server, and if the image file exists, the memory in the embedded device is repartitioned and formatted; The required applications and files are transferred to the specified partition through the TFTP network protocol according to the script settings, and the transferred files and applications are decompressed and installed respectively.

8. A device for deploying an embedded operating system based on the tftp protocol under uboot, characterized in that: include, The self-starting script module is used to create a self-starting script that runs after the ramdisk file system is started; The ramdisk file system image module is used to create a ramdisk file system image started in uboot; The uboot script module is used to create uboot scripts executed under uboot; The configuration module is used to set to the tftp server based on the self-starting script, ramdisk file system image and uboot script to complete the deployment of the embedded operating system.

9. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for deploying an embedded operating system based on the TFTP protocol under Uboot as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, implement the steps of the method for deploying an embedded operating system based on the TFTP protocol under Uboot as described in any one of claims 1 to 7.