Support `make run_kernel CONSOLE=ttyS0`
This commit is contained in:
parent
3c959bf0a0
commit
22dd288b07
5
Makefile
5
Makefile
|
|
@ -23,9 +23,10 @@ NO_DEFAULT_FEATURES ?= 0
|
|||
COVERAGE ?= 0
|
||||
# Specify whether to build regression tests under `test/initramfs/src/apps`.
|
||||
ENABLE_BASIC_TEST ?= false
|
||||
# Specify the primary system console (supported: hvc0, tty0).
|
||||
# - hvc0: The virtio-console terminal.
|
||||
# Specify the primary system console (supported: tty0, ttyS0, hvc0).
|
||||
# - tty0: The active virtual terminal (VT).
|
||||
# - ttyS0: The serial (UART) terminal.
|
||||
# - hvc0: The virtio-console terminal.
|
||||
# Asterinas will automatically fall back to tty0 if hvc0 is not available.
|
||||
# Note that currently the virtual terminal (tty0) can only work with
|
||||
# linux-efi-handover64 and linux-efi-pe64 boot protocol.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
# - NETDEV: "user" or "tap";
|
||||
# - VHOST: "off" or "on";
|
||||
# - VSOCK: "off" or "on";
|
||||
# - CONSOLE: "hvc0" to enable virtio console;
|
||||
# - SMP: number of CPUs;
|
||||
# - MEM: amount of memory, e.g. "8G";
|
||||
# - VNC_PORT: VNC port, default is "42".
|
||||
|
|
@ -19,6 +20,7 @@ OVMF=${OVMF:-"on"}
|
|||
VHOST=${VHOST:-"off"}
|
||||
VSOCK=${VSOCK:-"off"}
|
||||
NETDEV=${NETDEV:-"user"}
|
||||
CONSOLE=${CONSOLE:-"hvc0"}
|
||||
|
||||
SSH_RAND_PORT=${SSH_PORT:-$(shuf -i 1024-65535 -n 1)}
|
||||
NGINX_RAND_PORT=${NGINX_PORT:-$(shuf -i 1024-65535 -n 1)}
|
||||
|
|
@ -46,6 +48,10 @@ else
|
|||
NETDEV_ARGS="-nic none"
|
||||
fi
|
||||
|
||||
if [ "$CONSOLE" = "hvc0" ]; then
|
||||
CONSOLE_ARGS="-device virtconsole,chardev=mux"
|
||||
fi
|
||||
|
||||
if [ "$1" = "tdx" ]; then
|
||||
TDX_OBJECT='{ "qom-type": "tdx-guest", "id": "tdx0", "sept-ve-disable": true, "quote-generation-socket": { "type": "vsock", "cid": "2", "port": "4050" } }'
|
||||
|
||||
|
|
@ -66,7 +72,7 @@ if [ "$1" = "tdx" ]; then
|
|||
$QEMU_OPT_ARG_DUMP_PACKETS \
|
||||
-chardev stdio,id=mux,mux=on,logfile=qemu.log \
|
||||
-device virtio-serial,romfile= \
|
||||
-device virtconsole,chardev=mux \
|
||||
$CONSOLE_ARGS \
|
||||
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
|
||||
-monitor chardev:mux \
|
||||
-serial chardev:mux \
|
||||
|
|
@ -113,7 +119,7 @@ QEMU_ARGS="\
|
|||
-device virtio-blk-pci,bus=pcie.0,addr=0x7,drive=x1,serial=vexfat,disable-legacy=on,disable-modern=off,queue-size=64,num-queues=1,request-merging=off,backend_defaults=off,discard=off,write-zeroes=off,event_idx=off,indirect_desc=off,queue_reset=off$IOMMU_DEV_EXTRA \
|
||||
-device virtio-net-pci,netdev=net01,disable-legacy=on,disable-modern=off$VIRTIO_NET_FEATURES$IOMMU_DEV_EXTRA \
|
||||
-device virtio-serial-pci,disable-legacy=on,disable-modern=off$IOMMU_DEV_EXTRA \
|
||||
-device virtconsole,chardev=mux \
|
||||
$CONSOLE_ARGS \
|
||||
$IOMMU_EXTRA_ARGS \
|
||||
"
|
||||
|
||||
|
|
@ -127,7 +133,7 @@ MICROVM_QEMU_ARGS="\
|
|||
-device virtio-keyboard-device \
|
||||
-device virtio-net-device,netdev=net01 \
|
||||
-device virtio-serial-device \
|
||||
-device virtconsole,chardev=mux \
|
||||
$CONSOLE_ARGS \
|
||||
"
|
||||
|
||||
if [ "$VSOCK" = "on" ]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue