cmake: emu: qemu: pkill monitor_15_4

The IEEE 801.15.4 monitor can be started by a parameter to cmake. This
change removes a TODO to kill the monitor after qemu ends.

The change also re-assigns Ctrl-C to Ctrl-D to ensure that QEMU is not
inadvertently sending SIGINT to the surrounding ninja session (which
would leave the monitor sub-process alive).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
Florian Grandel 2024-09-02 11:06:44 +02:00 committed by Carles Cufí
commit 48e49fac56

View file

@ -257,6 +257,10 @@ elseif(QEMU_NET_STACK)
set_ifndef(NET_TOOLS ${ZEPHYR_BASE}/../net-tools) # Default if not set
list(APPEND PRE_QEMU_COMMANDS_FOR_server
COMMAND
#Disable Ctrl-C to ensure that users won't accidentally exit
#w/o killing the monitor.
stty intr ^d
COMMAND
#This command is run in the background using '&'. This prevents
#chaining other commands with '&&'. The command is enclosed in '{}'
@ -268,7 +272,11 @@ elseif(QEMU_NET_STACK)
/tmp/ip-stack-client
> /dev/null &
}
# TODO: Support cleanup of the monitor_15_4 process
)
set(POST_QEMU_COMMANDS_FOR_server
COMMAND
# Kill the monitor_15_4 sub-process
pkill -P $$$$
)
endif()
endif(QEMU_PIPE_STACK)
@ -440,6 +448,7 @@ foreach(target ${qemu_targets})
${MORE_FLAGS_FOR_${target}}
${QEMU_SMP_FLAGS}
${QEMU_KERNEL_OPTION}
${POST_QEMU_COMMANDS_FOR_${target}}
DEPENDS ${logical_target_for_zephyr_elf}
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
COMMENT "${QEMU_PIPE_COMMENT}[QEMU] CPU: ${QEMU_CPU_TYPE_${ARCH}}"