diff --git a/docker-compose.yml b/docker-compose.yml index 011781d..42e8287 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,10 +76,9 @@ services: #OPENWRT_AFTER_BOOT_CMD: '[ -f /etc/first_boot_over ] || { touch /etc/first_boot_over; echo "Crazy first boot"; }' # Example to run a command only once # Enable debugging mode. - # Currently it show the final qemu command - # This function will be removed in further versions + # Showing the final qemu command # If unset -> disabled - #DEBUG: "y" + #DEBUG: "true" ports: # Container web page (TTY console to OpenWrt, some convenience features) port diff --git a/src/helpers.sh b/src/helpers.sh index 502fcca..d386aa1 100644 --- a/src/helpers.sh +++ b/src/helpers.sh @@ -18,4 +18,4 @@ trap 'error "Status $? while: $BASH_COMMAND (line $LINENO/$BASH_LINENO)"' ERR : "${FORWARD_LUCI:=""}" # Make LuCI OpenWrt web interface accessible via host LAN : "${OPENWRT_AFTER_BOOT_CMD:=""}" # User command or script to run after OpenWrt is booted : "${IS_U_OS_APP:=""}" # By default this container is not a u-OS app -: "${DEBUG:="n"}" # Disable debugging +: "${DEBUG:=""}" # Disable debugging diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index f8c7872..c73c26b 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -265,7 +265,15 @@ PCI_ARGS="${PCI_1_ARGS}" info "Booting image using $VERS..." # See qemu command if debug is enabled -[[ "$DEBUG" == [Yy1]* ]] && set -x +if [[ -z "${DEBUG}" ]]; then + DEBUG_ARGS="" +else + set -x # Show final qemu command + + # Not working as expected grub output will delete previous log messages + #DEBUG_ARGS="-serial stdio" # Show OpenWrt kernel message in container log + DEBUG_ARGS="" +fi #************************ FINAL BOOTING ************************ exec qemu-system-"$CPU_ARCH" \ @@ -284,4 +292,5 @@ exec qemu-system-"$CPU_ARCH" \ -qmp unix:/run/qmp-sock,server=on,wait=off \ -chardev socket,path=/run/qga.sock,server=on,wait=off,id=qga0 \ -device virtio-serial \ - -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 + -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ + $DEBUG_ARGS