runtime-rs/clh: Fix unable to boot container

In the case of Cloud Hypervisor running on arm64 architecture,
only arm AMBA UART (pl011) is supported as the TTY. Consequently,
when enabling Hypervisor debug mode, it's essential to configure
the console as "ttyAMA0" rather than "ttyS0

Fixes: #8381

Signed-off-by: briwan01 <brian.wang@arm.com>
This commit is contained in:
briwan01 2023-11-08 05:28:19 +00:00 committed by Jianyong Wu
parent 358f32e8bb
commit 231b9dfd9d

View File

@ -140,13 +140,19 @@ impl CloudHypervisorInner {
// Start by adding the default set of kernel parameters.
let mut params = KernelParams::new(enable_debug);
#[cfg(target_arch = "x86_64")]
let console_param_debug = KernelParams::from_string("console=ttyS0,115200n8");
#[cfg(target_arch = "aarch64")]
let console_param_debug = KernelParams::from_string("console=ttyAMA0,115200n8");
let mut rootfs_param = KernelParams::new_rootfs_kernel_params(rootfs_driver, rootfs_type)?;
let mut console_params = if enable_debug {
if confidential_guest {
KernelParams::from_string("console=hvc0")
} else {
KernelParams::from_string("console=ttyS0,115200n8")
console_param_debug
}
} else {
KernelParams::from_string("quiet")