From: Ard Biesheuvel Date: Wed, 6 May 2015 14:14:22 +0000 (+0000) Subject: xen/arm: allow console=hvc0 to be omitted for guests X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f1dddd118c555508ce383b7262f4e6440927bdf4;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git xen/arm: allow console=hvc0 to be omitted for guests From: Ard Biesheuvel This patch registers hvc0 as the preferred console if no console has been specified explicitly on the kernel command line. The purpose is to allow platform agnostic kernels and boot images (such as distro installers) to boot in a Xen/ARM domU without the need to modify the command line by hand. Signed-off-by: Ard Biesheuvel Signed-off-by: Stefano Stabellini Reviewed-by: Julien Grall --- diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 3463a9e1ff65..6c09cc440a2b 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -183,6 +184,9 @@ void __init xen_early_init(void) xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; else xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED); + + if (!console_set_on_cmdline && !xen_initial_domain()) + add_preferred_console("hvc", 0, NULL); } static int __init xen_guest_init(void)