Add OpenWrt bootlog in container log when debug is enabled.

This commit is contained in:
Albrecht Lohofener
2025-01-29 21:52:39 +01:00
parent 8210883143
commit 3070698e4f
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -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"
+10
View File
@@ -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
+2 -1
View File
@@ -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