mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-07 17:07:58 +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
|
fi
|
||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && info "$VERS" && set -x
|
[[ "$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
|
{ set +x; } 2>/dev/null
|
||||||
|
|
||||||
if [[ "$dev" != "char"* || "$dev" != *"redirected to"* || "$dev" != *")" ]]; then
|
if [[ "$msg" != "char"* || "$msg" != *"serial0)" ]]; then
|
||||||
error "$dev"
|
echo "$msg"
|
||||||
finish 33
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dev="${dev#*/dev/}"
|
dev="${msg#*/dev/p}"
|
||||||
dev="/dev/${dev%% *}"
|
dev="/dev/p${dev%% *}"
|
||||||
|
|
||||||
if [ ! -c "$dev" ]; then
|
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
|
finish 34
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user