diff --git a/docker-compose.yml b/docker-compose.yml index 89751e9..ab00e90 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,7 +87,7 @@ services: #DISABLE_OPENWRT_AUTO_UPGRADE: "true" # Enable debugging mode. - # Showing the final qemu command + # Showing the final qemu command and OpenWrt bootlog # If unset -> disabled #DEBUG: "true" diff --git a/src/cleanup_container.sh b/src/cleanup_container.sh index 2725436..d68dc4e 100644 --- a/src/cleanup_container.sh +++ b/src/cleanup_container.sh @@ -22,4 +22,14 @@ trap cleanup SIGTERM SIGINT # Wait forever to prevent that multirun will stop the complete container # This script purpose is only to catch the signal SIGTERM and SIGINT and to execute some last commands + +# Put OpenWrt bootlog into container log +if [[ $DEBUG = "true" ]]; then + # Get bootlog via TCP, remove non-printable characters + nc -l -p 4555 | sed 's/[^[:print:]]//g' | + while IFS= read -r line; do + echo $line + done +fi + sleep infinity & wait \ No newline at end of file diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index d691a04..fb2a008 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -270,7 +270,8 @@ if [[ $DEBUG = "true" ]]; then # Not working as expected grub output will delete previous log messages #DEBUG_ARGS="-serial stdio" # Show OpenWrt kernel message in container log - DEBUG_ARGS="" + # Use a TCP connection as a workaround + DEBUG_ARGS="-serial tcp:localhost:4555" else DEBUG_ARGS="" fi