Skip to content

Commit

Permalink
feat: Console mode
Browse files Browse the repository at this point in the history
* feat: Console mode

* fix: Increase timeout
  • Loading branch information
kroese authored Nov 29, 2023
1 parent 796ff4c commit a4e2adc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ cd /run

trap - ERR

if [[ "${CONSOLE}" == [Yy]* ]]; then
exec qemu-system-x86_64 -pidfile "${QEMU_PID}" ${ARGS:+ $ARGS}
exit $?
fi

set -m
(
[[ "${DEBUG}" == [Yy1]* ]] && info "$VERS" && set -x
Expand Down
1 change: 1 addition & 0 deletions src/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ trap 'error "Status $? while: ${BASH_COMMAND} (line $LINENO/$BASH_LINENO)"' ERR

: ${GPU:='N'} # Enable GPU passthrough
: ${DEBUG:='N'} # Enable debugging mode
: ${CONSOLE:='N'} # Start in console mode
: ${ALLOCATE:='Y'} # Preallocate diskspace
: ${ARGUMENTS:=''} # Extra QEMU parameters
: ${CPU_CORES:='1'} # Amount of CPU cores
Expand Down
4 changes: 2 additions & 2 deletions src/serial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ sleep 0.2
while ! nc -z -w1 127.0.0.1 2210 > /dev/null 2>&1; do
sleep 0.1
cnt=$((cnt + 1))
(( cnt > 20 )) && error "Failed to connect to qemu-host.." && exit 58
(( cnt > 50 )) && error "Failed to connect to qemu-host.." && exit 58
done

cnt=0

while ! nc -z -w1 127.0.0.1 12345 > /dev/null 2>&1; do
sleep 0.1
cnt=$((cnt + 1))
(( cnt > 20 )) && error "Failed to connect to qemu-host.." && exit 59
(( cnt > 50 )) && error "Failed to connect to qemu-host.." && exit 59
done

# Configure serial ports
Expand Down

0 comments on commit a4e2adc

Please sign in to comment.