A development board custom kernel loading, controlled restart and automated verification system and method
By designing a custom kernel loading, controlled reboot, and automated verification system for the development board, the problem of excessive manual intervention and low automation in existing technologies has been solved. The system automates power supply control and boot interaction, improving verification efficiency and reliability.
Patent Information
- Application Number
- CN202611644579.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-23
- Publication Date
- 2026-11-20
AI Technical Summary
The current development board custom kernel verification process involves a lot of manual intervention, is cumbersome, lacks automation, and lacks a unified power supply control and boot interaction mechanism, making it difficult to achieve rapid iterative verification. In particular, it lacks reliable recovery capabilities in the event of a development board crash or abnormality.
A system for loading, controlled rebooting, and automated verification of a custom kernel for a development board was designed. It uses a host computer to uniformly schedule power supply control, serial port and network communication, supports multiple image transmission methods, automates the boot interaction, and performs physical recovery in abnormal situations.
It improves the automation level of custom kernel verification on the development board, reduces manual operation, enhances the adaptability and reliability of the system, and improves verification efficiency and repeatability.
Smart Images

Figure CN123137679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a system and method for loading, controlled restarting, and automated verification of a custom kernel for a development board, belonging to the field of embedded system development and automated testing technology. Background Technology
[0002] With the widespread use of embedded development boards in operating system porting, driver debugging, board-level boot chain verification, and continuous integration testing, R&D personnel often need to frequently perform operations such as power-off, power-on, restart, enter the boot environment, load custom kernel images and start the target system on the development board in order to verify the running results under different kernel versions, different boot parameters, different device trees or different patch combinations.
[0003] In existing development processes, custom kernel verification still relies heavily on manual intervention. Testers need to observe the development board's boot process via a serial terminal, interrupt the automatic boot at specific moments, enter the interactive interface of bootloaders such as U-Boot, and then load the kernel image to be verified into a specified memory address via network download, serial port transmission, or other methods. Finally, they manually enter the boot command and boot parameters to complete the kernel boot. For scenarios requiring frequent kernel version switching, repeated verification of boot parameters, or execution of batch regression tests, this method is cumbersome, inefficient, lacks repeatability, and has high labor costs.
[0004] On the other hand, while existing automated testing solutions can complete serial port log collection, command issuance, and result recording to a certain extent, they typically lack the ability to remotely control the power supply status of the development board in cases of development board crashes, kernel anomalies, system unresponsiveness, or software restart failures. This makes it difficult to perform reliable physical power-off and power-on recovery operations. Once the testing process is interrupted, manual intervention is often still required.
[0005] Furthermore, existing solutions generally lack a unified interactive injection mechanism for automated processing during the boot phase. When loading a custom kernel, the development board often needs to sequentially execute operations such as interrupt-driven automatic startup, setting the load address, configuring bootargs, selecting network or serial port transmission methods, loading the image, and executing the boot command within the U-Boot environment. Current practices typically rely on manual input or only implement customized processing for a single board type, single link, or single test script, resulting in poor versatility and difficulty in meeting the needs for rapid verification of custom kernels under different hardware environments and different testing tasks.
[0006] In automated R&D and continuous integration scenarios, developers typically aim to create a complete closed loop connecting "task distribution—controlled power-on / off of the development board—automatic interaction during the boot phase—image transfer—kernel loading and startup—result judgment—anomaly recovery" to support rapid iterative verification of custom kernels. However, in existing technologies, power supply control, serial port interaction, network transmission, boot loading, and test execution are largely isolated processes, lacking a unified technical solution to coordinate these processes. This results in insufficient overall automation, and verification efficiency and stability need improvement.
[0007] Therefore, a new technical solution is urgently needed to achieve controlled switching of the power supply status of the development board by the host computer, automatically complete command interaction and injection during the boot phase, support the transmission and loading of kernel images through various methods such as TFTP and YModem, and thus realize the automatic startup verification and anomaly recovery of the custom kernel, improve testing efficiency, reduce manual intervention and enhance the reliability and repeatability of the testing process. Summary of the Invention
[0008] To address the issues of excessive manual intervention in the existing custom kernel verification process for development boards, cumbersome steps such as power-off, power-on, entering the boot environment, and loading the image, the lack of reliable physical recovery capabilities in the event of a development board crash, software restart failure, or system unresponsiveness, the insufficient automation of interactive control for boot programs such as U-Boot in existing solutions, making it difficult to form a stable one-click verification process, the relatively simple image loading method, the inability to handle different environments such as network availability and network unavailability, and the separation of power supply control, boot interaction, image loading, startup determination, and anomaly recovery in the existing test chain, making it difficult to form a unified closed loop, this invention proposes a system and method for loading, controlled restarting, and automated verification of custom kernels for development boards.
[0009] The technical solution of the present invention is as follows: A system for loading, controlled restarting, and automated verification of a custom kernel for a development board includes: a host computer, a power supply control module, a development board, a serial communication link, a network communication link, and an image service and storage unit; The host computer is connected to the power supply control module and the image service and storage unit, and is connected to the development board through serial communication link and network communication link; the power supply control module is connected to the development board. The host computer is used to receive and parse test tasks, and to uniformly schedule the power-on and power-off of the development board, execute boot interaction, control image transmission, kernel startup, and result judgment. The development board is used to run the bootloader and load and start the target kernel; The power supply control module is used to respond to commands from the host computer and perform power supply and power-off control on the development board; The serial communication link is used to transmit the development board startup log, development board output, and to send user commands from the host computer and the image to be verified to the development board. The network communication link is used to transfer the image to be verified from the host computer to the development board, and to send the status back from the development board to the host computer or to verify the network connectivity of the development board. The image service and storage unit are used to store images to be verified.
[0010] According to a preferred embodiment of the present invention, the host computer includes a task management unit, a guidance and interaction control unit, a transmission mode selection unit, a mirror transmission module, a result acquisition and judgment module, and an anomaly recovery module; The transmission mode selection unit is connected to the mirror transmission module, and the result acquisition and judgment module is connected to the anomaly recovery module. The task management unit is used to receive test tasks sent to the host computer, parse the development board identifier, target image path, startup parameters, transmission method priority, timeout threshold, retry count and judgment rules, and schedule, record status and archive results of test tasks. The boot interaction control unit is used to monitor the development board's boot information, identify keywords, automatically send interrupt commands to enter the boot program interaction environment, and inject environment variables, load commands, boot parameters and boot commands according to the task configuration; The transmission mode selection unit is used to select the target transmission mode or switch the transmission mode based on the test task configuration, network link status, current status of the development board, and transmission failure. The result acquisition and judgment module is used to acquire the development board output through serial communication link and network communication link, analyze the startup and test results, determine whether the target kernel has started successfully, and output the results. The mirror transmission module is used to start the corresponding transmission unit for mirror transmission according to the selected target transmission method; The exception recovery module is used to receive the failure judgment output by the result acquisition and judgment module, and to perform recovery and retry in the case of failure.
[0011] According to a preferred embodiment of the present invention, the power supply control module includes a control interface, an on / off execution unit, and a controlled power supply output terminal; The control interface, the on / off execution unit, and the controlled power supply output terminal are connected in sequence; The control interface is used to receive power supply control commands sent by the host computer and send them to the switching execution unit to provide feedback on the current power supply status to the host computer. The switching execution unit is used to control the controlled power supply output terminal to perform power on / off operations according to the power supply control command; The controlled power supply output terminal is connected to the development board and provides power output to the development board under the control of the interrupt execution unit, which can be remotely controlled by the host computer, so as to realize the physical-level power failure recovery and restart of the development board.
[0012] More preferably, the control interface is a USB, serial port, network interface, GPIO control interface, relay control interface or intelligent PDU control interface; The switching execution unit can be a relay, a MOSFET switch, a power management chip, a smart socket, or a controllable power module.
[0013] According to a preferred embodiment of the present invention, the development board includes a memory, a boot program, a serial port interface, and a network interface; the memory includes an image loading area and a kernel running area; The bootloader, image loading area, and kernel runtime area are connected in sequence; the serial communication link is connected to the serial port interface, and the network communication link is connected to the network interface; the serial port interface and the network interface are connected to the bootloader. The image loading area is used to store the bootloader, kernel image, and data, while the kernel runtime area is used to provide storage space for image loading and kernel execution. The bootloader is used to complete the hardware initialization, serial port and network interface initialization, environment variable configuration, image reception, image loading, and target kernel startup after the development board is powered on. The serial port interface is used to output the development board's startup information, and at the same time receive interrupt startup commands, boot interaction commands, YModem transmission unit commands and startup commands sent by the host computer; The network interface is used to receive the image to be verified sent by the image transfer module, and to perform network back-connection, remote login, status return and network connectivity verification after the kernel starts.
[0014] According to a preferred embodiment of the present invention, the mirror transmission module includes a TFTP transmission unit and a YModem transmission unit; The TFTP transfer unit is used to transfer the image to be verified from the image service and storage unit to the development board via a network communication link, and to configure relevant parameters. The YModem transmission unit is used to send the image file to be verified to the development board via a serial communication link, send a receive preparation command, handle handshake, packet transmission, verification, retransmission, and confirmation of transmission completion.
[0015] A method for loading, controlled rebooting, and automated verification of a custom kernel for a development board, implemented through the aforementioned system for loading, controlled rebooting, and automated verification of a custom kernel for a development board, includes: Step 1: The host computer receives the test task and restarts the development board according to its current status or directly enters the bootloader interactive environment. After entering the bootloader interactive environment, the corresponding transmission method is selected to transmit the image to be verified to the development board. The development board sets the boot parameters and starts the target kernel of the image to be verified. Step 2: After the development board starts the target kernel, the result acquisition and judgment module acquires the target kernel startup result and performs status analysis to judge the target kernel startup and test execution result; when startup fails, the exception recovery module performs recovery actions according to the failure type and restarts the target kernel.
[0016] According to a preferred embodiment of the present invention, the specific implementation process of step 1 includes: The host computer receives the test task and checks the current status of the development board; If the development board is in a normal and controllable state, it will directly enter the bootloader interactive environment; Otherwise, the host computer controls the power supply control module to power off and power on the development board, causing the development board to enter the boot process. The host computer's boot interaction control unit continuously monitors the boot information output by the development board through the serial communication link, and performs keyword recognition on the output boot information, including automatic boot countdown keywords, boot program prompt keywords, image transfer keywords, kernel boot keywords, system boot success keywords, failure or exception keywords. When an automatic boot countdown keyword, boot program prompt keyword, or preset keyword is recognized, an interrupt command is sent to prevent the boot process from continuing, causing the development board to enter the boot program interactive environment. If the bootloader interactive environment is not entered, the interrupt command is sent again. If the interrupt command is sent multiple times and the bootloader interactive environment is still not entered, or if the development board cannot be restored to a controllable state, the power supply control module is used to perform power off and power on again to re-enter the boot process. If the bootloader interactive environment is successfully entered, the host computer's transmission mode selection unit selects the transmission mode according to the test task configuration and the current link status, including: when the network communication link is available, the network-based TFTP mode is selected; when the network communication link is unavailable, the network-based TFTP mode fails, or the task forcibly specifies the serial port loading mode, the serial port-based YModem mode is selected; if the serial port-based YModem mode still fails, the failure judgment is passed to the exception recovery module, and the exception recovery module performs recovery actions. The host computer transmits the image to be verified from the image service and storage unit to the target address of the development board through the selected transmission method; after the transmission is completed, it injects the boot command into the boot program, sets the boot parameters, and starts the target kernel of the image to be verified. A further preferred method is the network-based TFTP method, which includes: the host computer's TFTP transfer unit injects network initialization commands, target file names, and TFTP loading commands into the development board's boot program via a network communication link, enabling the development board to download the image to be verified from the image service and storage unit to the target address using the TFTP protocol; The YModem-based serial port method includes: the host computer's YModem transmission unit sends a receive preparation command to the development board, causing the boot program to enter the YModem receiving state; subsequently, the host computer reads the image to be verified from the image service and storage unit and sends it to the development board via the serial communication link; after receiving the complete image to be verified, the development board saves it to the specified target address.
[0017] According to a preferred embodiment of the present invention, step 2 includes the following specific implementation process: The result acquisition and judgment module collects the development board's serial port logs, startup keywords, echo status, network connection results, or test script output. The serial port logs include the development board's boot log, U-Boot output, kernel boot log, driver initialization log, user-mode boot log, and exception log; the boot keywords include preset strings used to determine the boot stage or boot result; the echo status indicates the command response status returned by the development board through the serial communication link or network communication link after the host computer sends a command to the development board, including whether the command was received, whether a prompt appeared, whether a success message was returned, whether an error message was returned, and whether the expected command execution result was achieved; the network connection result indicates the result of the host computer detecting whether the development board has restored its network communication capability after the development board boots the target kernel; the test script output indicates the output results generated after the automated test script is executed on the host computer or development board, including standard output, error output, return code, PASS / FAIL flag, performance data, or functional verification results; The serial port log, command echo, and test script output are matched with preset success keywords. If they match, the target kernel is determined to have started successfully or the test has passed. The serial port log, command echo, and test script output are matched with preset failure keywords. If they match, the startup failure, transmission failure, or test failure is determined. Match the serial port logs or network connection results with the login prompts to determine whether the system has entered user mode or has interactive capabilities; Match the test script output with the test return code to confirm whether the test script passed.
[0018] When startup fails, the exception recovery module performs recovery actions based on the failure type; including: The anomaly recovery module detects development board anomalies in real time and determines the anomaly type. When the development board experiences no serial port output, serial port output stagnation, system unresponsiveness, inability to enter the bootloader interactive environment, kernel panic, system crash, watchdog reset loop, software restart failure, development board disconnection, or both serial and network communication links are unavailable, the anomaly recovery module controls the power supply control module to perform a power cut-off and power-back, causing the development board to re-enter the boot process. Subsequently, the host computer listens for boot information again, enters the boot process, and reloads the image to be verified. When the serial port log or command echo shows errors such as boot parameter configuration error, bootargs configuration error, console parameter error, root file system path error, NFS root file system parameter error, device tree address error, device tree mismatch with board, initrd address or size error, image loading address conflict, boot partition error, or kernel unable to mount root file system, the exception recovery module adjusts the boot parameters according to preset rules or task configuration, reloads the image to be verified, and then triggers the target kernel to start again. After reloading the image to be verified, determine whether the retry limit, i.e. the maximum number of power-off restarts, has been reached. If it has been reached, record the failure and end the process; otherwise, re-check for anomalies.
[0019] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described development board custom kernel loading, controlled restart, and automated verification method.
[0020] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described development board custom kernel loading, controlled restart, and automated verification method.
[0021] The beneficial effects of this invention are as follows: 1. By introducing a controlled power-on / off mechanism, reliable physical recovery can be performed when the development board crashes, the kernel malfunctions, or the software restart fails.
[0022] 2. By automatically recognizing prompts during the boot process and injecting commands, the U-Boot interaction process is automated, reducing manual operation.
[0023] 3. By simultaneously supporting mirroring transfer via TFTP and YModem, the system's adaptability to different networks and debugging environments is enhanced.
[0024] 4. By integrating power supply control, guided interaction, mirror transmission, startup parameter injection, startup judgment, and anomaly recovery into a closed-loop process, the verification efficiency and repeatability are improved.
[0025] 5. It is suitable for scenarios such as rapid iterative verification of custom kernels, driver debugging, board-level boot chain testing, and continuous integration, and has high practical value. Attached Figure Description
[0026] Figure 1 This is a system architecture diagram of the custom kernel loading, controlled restart, and automated verification system for the development board of this invention; Figure 2 This is a flowchart of the custom kernel auto-loading and startup method of the present invention; Figure 3 This is a flowchart of the interactive injection process during the guidance phase of this invention. Figure 4 This is a schematic diagram illustrating the kernel image transfer and boot process based on TFTP according to the present invention; Figure 5 This is a schematic diagram illustrating the kernel image transmission and boot process based on YModem according to the present invention; Figure 6 This is a flowchart illustrating the selection and switching of mirror transmission modes in this invention. Figure 7 This is a flowchart of the abnormal recovery process of the present invention. Detailed Implementation
[0027] The present invention will be further described below with reference to the embodiments and accompanying drawings, but is not limited thereto.
[0028] Example 1
[0029] A system for loading, controlled rebooting, and automated verification of a custom kernel for a development board, such as... Figure 1 As shown, it includes: host computer, power supply control module, development board, serial communication link, network communication link, image service and storage unit; The host computer is connected to the power supply control module and the image service and storage unit, and is connected to the development board through serial communication link and network communication link; the power supply control module is connected to the development board. The host computer is used to receive and parse test tasks, and to uniformly schedule the power-on and power-off of the development board, execute boot interaction, control image transmission, kernel startup, and result judgment. The development board is used to run the bootloader and load and start the target kernel; The power supply control module is used to respond to commands from the host computer and perform power supply and power-off control on the development board; The serial communication link is used to transmit the development board startup log, development board output, and to send user commands from the host computer and the image to be verified to the development board. The network communication link is used to transfer the image to be verified from the host computer to the development board, and to send the status back from the development board to the host computer or to verify the network connectivity of the development board. The image service and storage unit are used to store images to be verified.
[0030] Example 2
[0031] The difference between the custom kernel loading, controlled reboot, and automated verification system for development boards described in Example 1 and the system described in Example 1 is that: The host computer includes a task management unit, a guidance and interaction control unit, a transmission mode selection unit, a mirror transmission module, a result acquisition and judgment module, and an anomaly recovery module; The transmission mode selection unit is connected to the mirror transmission module, and the result acquisition and judgment module is connected to the anomaly recovery module. The task management unit is used to receive test tasks sent to the host computer, parse the development board identifier, target image path, startup parameters, transmission method priority, timeout threshold, retry count and judgment rules, and schedule, record status and archive results of test tasks. The boot interaction control unit is used to monitor the development board's boot information, identify keywords, automatically send interrupt commands to enter the boot program interaction environment, and inject environment variables, load commands, boot parameters and boot commands according to the task configuration; The transmission mode selection unit is used to select the target transmission mode or switch the transmission mode according to the test task configuration, network link status, current status of the development board and transmission failure. It can select the target transmission mode from TFTP, YModem or other preset transmission modes, and switch to backup modes such as YModem when TFTP fails, the network is unavailable or the task forces serial port transmission. The result acquisition and judgment module is used to acquire the development board output through serial communication link and network communication link, analyze the startup and test results, determine whether the target kernel has started successfully, and output the results (startup successful, startup failed, timeout, abnormal interruption or need to retry, etc.). The mirror transmission module is used to start the corresponding transmission unit for mirror transmission according to the selected target transmission method; The exception recovery module is used to receive the failure judgment output by the result acquisition and judgment module, and to perform recovery and retry in the case of failure.
[0032] The power supply control module includes a control interface, an on / off execution unit, and a controlled power supply output terminal; The control interface, the on / off execution unit, and the controlled power supply output terminal are connected in sequence; The control interface is used to receive power supply control commands sent by the host computer and send them to the switching execution unit to provide feedback on the current power supply status to the host computer. The switching execution unit is used to control the controlled power supply output terminal to perform power supply switching operations (power off, power on, delayed power on, power off restart or reset control) according to the power supply control command. The controlled power supply output terminal is connected to the development board (the power input terminal of the development board). Under the control of the switching execution unit, it provides power output to the development board that can be remotely controlled by the host computer, realizing physical-level power failure recovery and restart of the development board.
[0033] The control interface can be USB, serial port, network interface, GPIO control interface, relay control interface or intelligent PDU control interface; The switching execution unit can be a relay, a MOSFET switch, a power management chip, a smart socket, or a controllable power module.
[0034] The development board includes a memory, a bootloader, a serial port interface, and a network interface; the memory includes an image loading area and a kernel runtime area. The bootloader, image loading area, and kernel runtime area are connected in sequence; the serial communication link is connected to the serial port interface, and the network communication link is connected to the network interface; the serial port interface and the network interface are connected to the bootloader. The image loading area is used to store the bootloader, kernel image, and data, while the kernel runtime area is used to provide storage space for image loading and kernel execution. The bootloader is used to complete the hardware initialization, serial port and network interface initialization, environment variable configuration, image reception, image loading, and target kernel startup after the development board is powered on. The serial port interface is used to output the development board's boot information (such as boot log, boot prompt, command execution echo, and kernel log), and to receive interrupt boot commands, boot interaction commands, YModem transmission unit commands, and boot commands sent by the host computer. The network interface is used to receive images (kernel images, device tree files, or root file systems) to be verified sent by the image transfer module, and to perform network back-connection, remote login, status return, and network connectivity verification after the kernel starts.
[0035] The mirroring transfer module includes a TFTP transfer unit and a YModem transfer unit; The TFTP transfer unit is used to transfer the image to be verified (kernel image, device tree file, or initial root file system) in the image service and storage unit to the development board via the network communication link, and to configure relevant parameters (TFTP service parameters, target file name, server address, development board IP address, load address, and monitor download progress, file size, and download completion status). The YModem transmission unit is used to send the image file to be verified to the development board via a serial communication link (using the YModem protocol) (used when the development board's network interface is unavailable, TFTP transfer fails, or the task specifies serial port loading mode), send receive preparation commands, handle handshakes, packet transmission, verification, retransmission, and transmission completion confirmation.
[0036] Example 3
[0037] A method for loading, controlled rebooting, and automated verification of a custom kernel for a development board, implemented using the custom kernel loading, controlled rebooting, and automated verification system for a development board as described in Embodiment 1 or 2, includes: Step 1: The host computer receives the test task and restarts the development board according to its current status or directly enters the bootloader interactive environment. After entering the bootloader interactive environment, the corresponding transmission method is selected to transmit the image to be verified to the development board. The development board sets the boot parameters and starts the target kernel of the image to be verified. Step 2: After the development board starts the target kernel, the result acquisition and judgment module acquires the target kernel startup result and performs status analysis to judge the target kernel startup and test execution result; when startup fails, the exception recovery module performs recovery actions according to the failure type and restarts the target kernel.
[0038] Example 4
[0039] The method for loading, controlled rebooting, and automated verification of a custom kernel for a development board as described in Example 3 differs in that: The specific implementation process of step 1 includes: The host computer receives test tasks (test tasks sent by command-line tools, script schedulers, or continuous integration platforms) and checks the current status of the development board; If the development board is in a normal and controllable state, it will directly enter the bootloader interactive environment (U-Boot, etc.). Otherwise, the host computer controls the power supply control module to power off and power on the development board, causing it to enter the boot process. The host computer's boot interaction control unit continuously monitors the boot information output by the development board through a serial communication link, and performs keyword recognition on the output boot information, including automatic boot countdown keywords (e.g., "Hit any key to stop autoboot", "Autobooting in", "Press any key"), boot program prompt keywords (e.g., "U-Boot", "=>", "#"), image transfer keywords (e.g., "TFTP from server", "Bytes transferred", "Load address", "xyzModem", "CRC"), kernel boot keywords (e.g., "Starting kernel", "Booting Linux", "Linux version", "Freeing unused kernel memory"), system boot success keywords (e.g., "login:", "root@", "Welcome", "system ready"), and failure or exception keywords (e.g., "Kernel panic", "Bad Linux ARM64 Image magic", "Wrong Image Format", "CRC error", "TFTP error", "No ethernet"). The development board typically enters the boot process automatically in the order of BootROM, SPL, U-Boot, and default bootcmd after power-on, reset, or power-off restart. If not interrupted by the host computer, the development board will continue to execute the default boot command and attempt to boot the original system. However, some development boards are configured to remain at the U-Boot command line after power-on, waiting for user input or entering a special download mode. In response, the host computer identifies the current boot stage by outputting keywords through the serial port and decides whether to send an interrupt command, inject commands directly, or power on again based on the identification result. When the automatic boot countdown keyword, boot program prompt keyword, or preset keyword (custom keywords configured by the user in the configuration file) is identified, an interrupt command is sent to prevent the boot process from continuing and cause the development board to enter the boot program interactive environment (U-Boot, etc.). If the bootloader interactive environment cannot be entered, the interrupt command will be sent again. If multiple interrupt commands are sent (configured by task parameters; for example, a maximum of 3 interrupt cycles, with interrupt characters sent continuously at approximately 20 ms intervals within each cycle; if the U-Boot command prompt is not recognized within the preset timeout window, it is counted as one failure; after 3 failures, power off and power on again) and the bootloader interactive environment still cannot be entered, or if the development board cannot return to a controllable state (e.g., no serial port output, boot freeze, boot too fast and already entering the default system, no serial port response, no command echo, bootloader abnormality, system crash, ineffective software reset, inability to clear residual state from the previous test, etc.), the power supply control module will execute power off and power on again to re-enter the boot process (making the development board return to the new boot starting point and then listen for and interrupt the automatic boot again). If the bootloader interactive environment is successfully entered, the host computer's transmission mode selection unit selects the transmission mode (network-based TFTP mode and serial port-based YModem mode) according to the test task configuration and the current link status. This includes: when the network communication link is available (network interface initialization is successful, the target development board and the server are connected, the bootloader supports network loading, and the priority setting in the task configuration), the network-based TFTP mode is selected; when the network communication link is unavailable, the network-based TFTP mode fails, or the task forcibly specifies the serial port loading mode, the serial port-based YModem mode is selected. If the serial port-based YModem mode still fails, the failure judgment is passed to the exception recovery module, which performs recovery actions, such as powering on and off, re-entering the boot environment, or terminating the task. The host computer transmits the image to be verified from the image service and storage unit to the target address of the development board through the selected transmission method; after the transmission is completed, it injects the boot command (the boot command can be booti, bootm, bootz or other equivalent boot instructions) into the boot program, sets the boot parameters (such as kernel image load address, device tree address, initrd or ramdisk address, root file system parameters, bootargs, bootcmd, bootfile, loadaddr, serverip, ipaddr, gatewayip, netmask, console parameters, boot partition, device tree overlay parameters, image verification parameters, etc.), and starts the target kernel of the image to be verified. The network-based TFTP method includes: the host computer's TFTP transfer unit injects network initialization commands, target file names, and TFTP loading commands into the development board's boot program via a network communication link, enabling the development board to download the image to be verified from the image service and storage unit to the target address using the TFTP protocol; during the download process, the host computer reads the progress information, file size, verification results, or completion prompts from the communication link output; The YModem-based serial port method involves: the host computer's YModem transmission unit sending a receive preparation command to the development board, causing the bootloader to enter YModem receiving mode; subsequently, the host computer reads the image to be verified from the image service and storage unit and sends it to the development board via the serial communication link; after receiving the complete image to be verified, the development board saves it to a specified target address. This method is independent of the network environment and is suitable for early board debugging, isolated environment testing, and scenarios where network configuration fails. The specific implementation process of step 2 includes: The result acquisition and judgment module acquires the development board's serial port logs, startup keywords, echo status, network connection results, or test script output. The serial port logs include the development board's boot log, U-Boot output, kernel boot log, driver initialization log, user-mode boot log, and exception log. Boot keywords include preset strings used to determine the boot stage or boot result, such as "U-Boot", "Hit any key to stop autoboot", "Starting kernel", "Linux version", "login:", "Kernel panic", "CRC error", and "TFTP error". The echo status indicates the command response status returned by the development board via serial or network communication after the host computer sends a command, including whether the command was received, whether a prompt appeared, whether a success message was returned, whether an error message was returned, and whether the expected command execution result was achieved. The network connection result indicates the result of the host computer detecting whether the development board has restored its network communication capability after the development board boots the target kernel, such as whether ping is reachable, whether SSH / Telnet is connectable, whether the specified port is open, and HTTP... Whether the service responds, whether the development board actively sends back the status to the host computer or test platform, etc.; Test script output represents the output results generated after the automated test script is executed on the host computer or development board, including standard output, error output, return code, PASS / FAIL flag, performance data or functional verification results; The serial port log, command echo, and test script output are matched with preset success keywords, such as "Starting kernel", "login:", "PASS", "system ready", etc. If the match is the same, it is determined that the target kernel has started successfully or the test has passed. The serial port log, command echo, and test script output are matched with preset failure keywords, such as "Kernel panic", "CRC error", "TFTP error", "Wrong Image Format", "mount root failed", "FAIL", etc. If the match is the same, it is determined that the startup failed, the transmission failed, or the test failed. Match the serial port logs or network connection results with the login prompts. For example, if "login:", shell prompt, "root@", or SSH / Telnet login status is displayed, determine whether the system has entered user mode or has interactive capabilities. Match the test script output with the test return codes. For example, a return code of 0 indicates that the test has passed, while a non-zero return code indicates that the test has failed. Combine this with the PASS / FAIL flags in the script output to confirm whether the test script has passed.
[0040] When startup fails, the exception recovery module performs recovery actions based on the failure type; including: When transmission failure, startup failure, log error, timeout failure, or development board disconnection occurs, the error recovery module performs recovery actions according to the failure type. The anomaly recovery module detects development board anomalies in real time and determines the anomaly type. When the development board experiences no serial port output, serial port output stagnation, system unresponsiveness, inability to enter the bootloader interactive environment, kernel panic, system crash, watchdog reset loop, software restart failure, development board disconnection, or both serial and network communication links are unavailable, the anomaly recovery module controls the power supply control module to perform a power cut-off and power-back, causing the development board to re-enter the boot process. Subsequently, the host computer listens for boot information again, enters the boot process, and reloads the image to be verified. When the serial port log or command echo shows errors such as boot parameter configuration error, bootargs configuration error, console parameter error, root file system path error, NFS root file system parameter error, device tree address error, device tree mismatch with board, initrd address or size error, image loading address conflict, boot partition error, or kernel unable to mount root file system, the exception recovery module adjusts the boot parameters according to preset rules or task configuration, reloads the image to be verified, and then triggers the target kernel to start again. After reloading the image to be verified, determine whether the retry limit, i.e. the maximum number of power-off restarts, has been reached. If it has been reached, record the failure and end the process; otherwise, re-check for anomalies.
[0041] Example 5
[0042] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the development board custom kernel loading, controlled restart, and automated verification method described in Embodiment 3 or 4.
[0043] Example 6
[0044] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the development board custom kernel loading, controlled restart, and automated verification method described in Embodiment 3 or 4.
Claims
1. A system for loading, controlled restarting, and automated verification of a custom kernel for a development board, characterized in that, include: Host computer, power supply control module, development board, serial communication link, network communication link, image service and storage unit; The host computer is connected to the power supply control module and the image service and storage unit, and is connected to the development board through serial communication link and network communication link; the power supply control module is connected to the development board. The host computer is used to receive and parse test tasks, and to uniformly schedule the power-on and power-off of the development board, execute boot interaction, control image transmission, kernel startup, and result judgment. The development board is used to run the bootloader and load and start the target kernel; The power supply control module is used to respond to commands from the host computer and perform power supply and power-off control on the development board; The serial communication link is used to transmit the development board startup log, development board output, and to send user commands from the host computer and the image to be verified to the development board. The network communication link is used to transfer the image to be verified from the host computer to the development board, and to send the status back from the development board to the host computer or to verify the network connectivity of the development board. The image service and storage unit are used to store images to be verified.
2. The system for loading, controlled restarting, and automated verification of a custom kernel for a development board according to claim 1, characterized in that, The host computer includes a task management unit, a guidance and interaction control unit, a transmission mode selection unit, a mirror transmission module, a result acquisition and judgment module, and an anomaly recovery module; The transmission mode selection unit is connected to the mirror transmission module, and the result acquisition and judgment module is connected to the anomaly recovery module. The task management unit is used to receive test tasks sent to the host computer, parse the development board identifier, target image path, startup parameters, transmission method priority, timeout threshold, retry count and judgment rules, and schedule, record status and archive results of test tasks. The boot interaction control unit is used to monitor the development board's boot information, identify keywords, automatically send interrupt commands to enter the boot program interaction environment, and inject environment variables, load commands, boot parameters and boot commands according to the task configuration; The transmission mode selection unit is used to select the target transmission mode or switch the transmission mode based on the test task configuration, network link status, current status of the development board, and transmission failure. The result acquisition and judgment module is used to acquire the development board output through serial communication link and network communication link, analyze the startup and test results, determine whether the target kernel has started successfully, and output the results. The mirror transmission module is used to start the corresponding transmission unit for mirror transmission according to the selected target transmission method; The exception recovery module is used to receive the failure judgment output by the result acquisition and judgment module, and to perform recovery and retry in the case of failure.
3. The system for loading, controlled restarting, and automated verification of a custom kernel for a development board according to claim 2, characterized in that, The power supply control module includes a control interface, an on / off execution unit, and a controlled power supply output terminal; The control interface, the on / off execution unit, and the controlled power supply output terminal are connected in sequence; The control interface is used to receive power supply control commands sent by the host computer and send them to the switching execution unit to provide feedback on the current power supply status to the host computer. The switching execution unit is used to control the controlled power supply output terminal to perform power on / off operations according to the power supply control command; The controlled power supply output terminal is connected to the development board and provides power output to the development board under the control of the interruption execution unit, which can be remotely controlled by the host computer, so as to realize the physical-level power failure recovery and restart of the development board; The control interface can be USB, serial port, network interface, GPIO control interface, relay control interface or intelligent PDU control interface; The switching execution unit can be a relay, a MOSFET switch, a power management chip, a smart socket, or a controllable power module.
4. The system for loading, controlled restarting, and automated verification of a custom kernel for a development board according to claim 3, characterized in that, The development board includes a memory, a bootloader, a serial port interface, and a network interface; the memory includes an image loading area and a kernel runtime area. The bootloader, image loading area, and kernel runtime area are connected in sequence; the serial communication link is connected to the serial port interface, and the network communication link is connected to the network interface. Serial port and network interface connection bootloader; The image loading area is used to store the bootloader, kernel image, and data, while the kernel runtime area is used to provide storage space for image loading and kernel execution. The bootloader is used to complete the hardware initialization, serial port and network interface initialization, environment variable configuration, image reception, image loading, and target kernel startup after the development board is powered on. The serial port interface is used to output the development board's startup information, and at the same time receive interrupt startup commands, boot interaction commands, YModem transmission unit commands and startup commands sent by the host computer; The network interface is used to receive the image to be verified sent by the image transfer module, and to perform network back-connection, remote login, status return and network connectivity verification after the kernel starts.
5. The system for loading, controlled restarting, and automated verification of a custom kernel for a development board according to claim 4, characterized in that, The mirroring transfer module includes a TFTP transfer unit and a YModem transfer unit; The TFTP transfer unit is used to transfer the image to be verified from the image service and storage unit to the development board via a network communication link, and to configure relevant parameters. The YModem transmission unit is used to send the image file to be verified to the development board via a serial communication link, send a receive preparation command, handle handshake, packet transmission, verification, retransmission, and confirmation of transmission completion.
6. A method for loading, controlled restarting, and automated verification of a custom kernel for a development board, implemented using the system for loading, controlled restarting, and automated verification of a custom kernel for a development board as described in any one of claims 1-5, characterized in that... include: Step 1: The host computer receives the test task and restarts the development board according to its current status or directly enters the bootloader interactive environment. After entering the bootloader interactive environment, the corresponding transmission method is selected to transmit the image to be verified to the development board. The development board sets the boot parameters and starts the target kernel of the image to be verified. Step 2: After the development board starts the target kernel, the result acquisition and judgment module acquires the target kernel startup result, performs status analysis, and judges the target kernel startup and test execution results; When the startup fails, the exception recovery module performs recovery actions according to the failure type and restarts the target kernel.
7. The method for loading, controlled restarting, and automated verification of a custom kernel for a development board according to claim 6, characterized in that, The specific implementation process of step 1 includes: The host computer receives the test task and checks the current status of the development board; If the development board is in a normal and controllable state, it will directly enter the bootloader interactive environment; Otherwise, the host computer controls the power supply control module to power off and power on the development board, causing the development board to enter the boot process. The host computer's boot interaction control unit continuously monitors the boot information output by the development board through the serial communication link, and performs keyword recognition on the output boot information, including automatic boot countdown keywords, boot program prompt keywords, image transfer keywords, kernel boot keywords, system boot success keywords, failure or exception keywords. When an automatic boot countdown keyword, boot program prompt keyword, or preset keyword is recognized, an interrupt command is sent to prevent the boot process from continuing, causing the development board to enter the boot program interactive environment. If the bootloader interactive environment is not entered, the interrupt command is sent again. If the interrupt command is sent multiple times and the bootloader interactive environment is still not entered, or if the development board cannot be restored to a controllable state, the power supply control module is used to perform power off and power on again to re-enter the boot process. If the bootloader interactive environment is successfully entered, the host computer's transmission mode selection unit selects the transmission mode according to the test task configuration and the current link status, including: when the network communication link is available, the network-based TFTP mode is selected; when the network communication link is unavailable, the network-based TFTP mode fails, or the task forcibly specifies the serial port loading mode, the serial port-based YModem mode is selected; if the serial port-based YModem mode still fails, the failure judgment is passed to the exception recovery module, and the exception recovery module performs recovery actions. The host computer transmits the image to be verified from the image service and storage unit to the target address of the development board through the selected transmission method; after the transmission is completed, it injects the boot command into the boot program, sets the boot parameters, and starts the target kernel of the image to be verified. The network-based TFTP method includes: the host computer's TFTP transfer unit injects network initialization commands, target file names, and TFTP loading commands into the development board's boot program through a network communication link, enabling the development board to download the image to be verified from the image service and storage unit to the target address using the TFTP protocol; The YModem-based serial port method includes: the host computer's YModem transmission unit sends a receive preparation command to the development board, causing the boot program to enter the YModem receiving state; subsequently, the host computer reads the image to be verified from the image service and storage unit and sends it to the development board via the serial communication link; after receiving the complete image to be verified, the development board saves it to the specified target address.
8. The method for loading, controlled restarting, and automated verification of a custom kernel for a development board according to claim 6, characterized in that, The specific implementation process of step 2 includes: The result acquisition and judgment module acquires the development board's serial port logs, startup keywords, echo status, network connection results, or test script output. The serial port logs include the development board's boot log, U-Boot output, kernel boot log, driver initialization log, user-mode boot log, and exception log; the boot keywords include preset strings used to determine the boot stage or boot result; the echo status indicates the command response status returned by the development board through the serial communication link or network communication link after the host computer sends a command to the development board, including whether the command was received, whether a prompt appeared, whether a success message was returned, whether an error message was returned, and whether the expected command execution result was achieved; the network connection result indicates the result of the host computer detecting whether the development board has restored its network communication capability after the development board boots the target kernel; the test script output indicates the output results generated after the automated test script is executed on the host computer or development board, including standard output, error output, return code, PASS / FAIL flag, performance data, or functional verification results; The serial port log, command echo, and test script output are matched with preset success keywords. If they match, the target kernel is determined to have started successfully or the test has passed. The serial port log, command echo, and test script output are matched with preset failure keywords. If they match, the startup failure, transmission failure, or test failure is determined. Match the serial port logs or network connection results with the login prompts to determine whether the system has entered user mode or has interactive capabilities; Match the test script output with the test return code to confirm whether the test script passed; When startup fails, the exception recovery module performs recovery actions based on the failure type; including: The anomaly recovery module detects development board anomalies in real time and determines the anomaly type. When the development board experiences no serial port output, serial port output stagnation, system unresponsiveness, inability to enter the bootloader interactive environment, kernel panic, system crash, watchdog reset loop, software restart failure, development board disconnection, or both serial and network communication links are unavailable, the anomaly recovery module controls the power supply control module to perform a power cut-off and power-back, causing the development board to re-enter the boot process. Subsequently, the host computer listens for boot information again, enters the boot process, and reloads the image to be verified. When the serial port log or command echo shows errors such as boot parameter configuration error, bootargs configuration error, console parameter error, root file system path error, NFS root file system parameter error, device tree address error, device tree mismatch with board, initrd address or size error, image loading address conflict, boot partition error, or kernel unable to mount root file system, the exception recovery module adjusts the boot parameters according to preset rules or task configuration, reloads the image to be verified, and then triggers the target kernel to start again. After reloading the image to be verified, determine whether the retry limit, i.e. the maximum number of power-off restarts, has been reached. If it has been reached, record the failure and end the process; otherwise, re-check for anomalies.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of loading, controlled restarting, and automated verification of the custom kernel for the development board as described in any one of claims 6-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of loading, controlled restarting, and automated verification of the custom kernel for the development board as described in any one of claims 6-8.
