Docker: override stty size in container (#1420)

With some docker CLI version, `stty size` in the container will return `0 0`,
which causes `dialog` to fail. This commit fixes that by setting the actual
terminal size.

For more infor, see:

  https://github.com/docker/for-linux/issues/314
This commit is contained in:
Firefly Team 2019-06-23 11:32:59 +08:00 committed by lanefu
parent 2e3a338d48
commit 2f8ce01852
2 changed files with 6 additions and 0 deletions

View File

@ -77,6 +77,8 @@ DOCKER_FLAGS+=(-v=$SRC/:/root/armbian/)
# mount 2 named volumes - for cacheable data and compiler cache
DOCKER_FLAGS+=(-v=armbian-cache:/root/armbian/cache -v=armbian-ccache:/root/.ccache)
DOCKER_FLAGS+=(-e COLUMNS="`tput cols`" -e LINES="`tput lines`")
# pass other command line arguments like KERNEL_ONLY=yes, KERNEL_CONFIGURE=yes, etc.
# pass "docker-guest" as an additional config name that will be sourced in the container if exists
display_alert "Running the container" "" "info"

View File

@ -26,6 +26,10 @@ umask 002
# destination
DEST=$SRC/output
# override stty size
[[ -n $COLUMNS ]] && stty cols $COLUMNS
[[ -n $LINES ]] && stty rows $LINES
TTY_X=$(($(stty size | awk '{print $2}')-6)) # determine terminal width
TTY_Y=$(($(stty size | awk '{print $1}')-6)) # determine terminal height