mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 05:20:02 +08:00
fix: Device detection
* fix: Device detection
This commit is contained in:
parent
69e785e6ee
commit
9db12cd25f
21
src/entry.sh
21
src/entry.sh
@ -24,19 +24,26 @@ if [[ "$CONSOLE" == [Yy]* ]]; then
|
||||
fi
|
||||
|
||||
[[ "$DEBUG" == [Yy1]* ]] && info "$VERS" && set -x
|
||||
dev=$(qemu-system-x86_64 -daemonize -pidfile "$QEMU_PID" ${ARGS:+ $ARGS})
|
||||
msg=$(qemu-system-x86_64 -daemonize -pidfile "$QEMU_PID" ${ARGS:+ $ARGS})
|
||||
{ set +x; } 2>/dev/null
|
||||
|
||||
if [[ "$dev" != "char"* || "$dev" != *"redirected to"* || "$dev" != *")" ]]; then
|
||||
error "$dev"
|
||||
finish 33
|
||||
if [[ "$msg" != "char"* || "$msg" != *"serial0)" ]]; then
|
||||
echo "$msg"
|
||||
fi
|
||||
|
||||
dev="${dev#*/dev/}"
|
||||
dev="/dev/${dev%% *}"
|
||||
dev="${msg#*/dev/p}"
|
||||
dev="/dev/p${dev%% *}"
|
||||
|
||||
if [ ! -c "$dev" ]; then
|
||||
error "Device $dev not found!"
|
||||
dev=$(echo 'info chardev' | nc -q 1 -w 1 localhost "$QEMU_PORT" | tr -d '\000')
|
||||
dev="${dev#*charserial0}"
|
||||
dev="${dev#*pty:}"
|
||||
dev="${dev%%$'\n'*}"
|
||||
dev="${dev%%$'\r'*}"
|
||||
fi
|
||||
|
||||
if [ ! -c "$dev" ]; then
|
||||
error "Device `$dev` not found!"
|
||||
finish 34
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user