mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-15 00:01:23 +00:00
Add OpenWrt bootlog in container log when debug is enabled.
This commit is contained in:
+1
-1
@@ -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"
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user