Add a console option to the kernel command line
diff mbox series

Message ID 20190315063834.3788-2-akihiro27.suzuki@toshiba.co.jp
State New
Headers show
Series
  • Add a console option to the kernel command line
Related show

Commit Message

Akihiro Suzuki March 15, 2019, 6:38 a.m. UTC
This option is required when starting qemu-amd64 with nographic.

Signed-off-by: Akihiro Suzuki <akihiro27.suzuki@toshiba.co.jp>
---
 start-qemu.sh | 1 +
 1 file changed, 1 insertion(+)

Comments

Jan Kiszka March 15, 2019, 9:17 a.m. UTC | #1
On 15.03.19 07:38, Akihiro Suzuki wrote:
> This option is required when starting qemu-amd64 with nographic.
> 
> Signed-off-by: Akihiro Suzuki <akihiro27.suzuki@toshiba.co.jp>
> ---
>   start-qemu.sh | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/start-qemu.sh b/start-qemu.sh
> index b71ba32..52498fa 100755
> --- a/start-qemu.sh
> +++ b/start-qemu.sh
> @@ -79,6 +79,7 @@ INITRD_FILE=$(ls ${IMAGE_PREFIX}.initrd.img* | tail -1)
>   
>   if [ -z "${DISPLAY}" ]; then
>   	QEMU_EXTRA_ARGS="${QEMU_EXTRA_ARGS} -nographic"
> +	KERNEL_CMDLINE="${KERNEL_CMDLINE} console=ttyS0"
>   fi
>   
>   shift 1
> 

Valid point. But I think this should rather go to the original, per-target 
definition of KERNEL_CMDLINE. And we can make it unconditional, ie. provide a 
uart console independent of DISPLAY settings. That's how it is on ARM[64] already.

Jan
Akihiro Suzuki March 18, 2019, 5:55 a.m. UTC | #2
Hi Jan,

I agree with your opinion.
We have to be able to use a uart console even if DISPLAY has a value.

But I couldn't understand the statement of "That's how it is on ARM[64] already".
Could you explain it in more detail?
Do you mean that, on ARM[64], we don't have to add console option to KERNEL_CMDLINE
on current start-qemu.sh?

Best regards,
Suzuki


> -----Original Message-----
> From: Jan Kiszka [mailto:jan.kiszka@siemens.com]
> Sent: Friday, March 15, 2019 6:17 PM
> To: suzuki akihiro(鈴木 章浩 ○SWC□OST)
> <akihiro27.suzuki@toshiba.co.jp>; cip-dev@lists.cip-project.org
> Subject: Re: [cip-dev] [PATCH] Add a console option to the kernel command
> line
> 
> On 15.03.19 07:38, Akihiro Suzuki wrote:
> > This option is required when starting qemu-amd64 with nographic.
> >
> > Signed-off-by: Akihiro Suzuki <akihiro27.suzuki@toshiba.co.jp>
> > ---
> >   start-qemu.sh | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/start-qemu.sh b/start-qemu.sh
> > index b71ba32..52498fa 100755
> > --- a/start-qemu.sh
> > +++ b/start-qemu.sh
> > @@ -79,6 +79,7 @@ INITRD_FILE=$(ls ${IMAGE_PREFIX}.initrd.img* | tail
> -1)
> >
> >   if [ -z "${DISPLAY}" ]; then
> >   	QEMU_EXTRA_ARGS="${QEMU_EXTRA_ARGS} -nographic"
> > +	KERNEL_CMDLINE="${KERNEL_CMDLINE} console=ttyS0"
> >   fi
> >
> >   shift 1
> >
> 
> Valid point. But I think this should rather go to the original, per-target
> definition of KERNEL_CMDLINE. And we can make it unconditional, ie.
> provide a
> uart console independent of DISPLAY settings. That's how it is on ARM[64]
> already.
> 
> Jan
> 
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> Corporate Competence Center Embedded Linux
Jan Kiszka March 18, 2019, 6:22 a.m. UTC | #3
On 18.03.19 06:55, akihiro27.suzuki@toshiba.co.jp wrote:
> Hi Jan,
> 
> I agree with your opinion.
> We have to be able to use a uart console even if DISPLAY has a value.
> 
> But I couldn't understand the statement of "That's how it is on ARM[64] already".
> Could you explain it in more detail?
> Do you mean that, on ARM[64], we don't have to add console option to KERNEL_CMDLINE
> on current start-qemu.sh?

On ARM, QEMU ensures that the guest uses the UART by injecting this as console 
into its device tree. This mechanism is not available on the x86 boot, therefore 
we need to set this on the command line.

Jan
Akihiro Suzuki April 3, 2019, 8:33 a.m. UTC | #4
Hi Jan,

Sorry for my late reply.

I have created a new patch.
After applying the patch, "console=ttyS0" is added to KERNEL_CMDLINE
only when you use qemu-system-x86_64 with "-nographic" option.

Best regards,
Suzuki

Patch
diff mbox series

diff --git a/start-qemu.sh b/start-qemu.sh
index b71ba32..52498fa 100755
--- a/start-qemu.sh
+++ b/start-qemu.sh
@@ -79,6 +79,7 @@  INITRD_FILE=$(ls ${IMAGE_PREFIX}.initrd.img* | tail -1)
 
 if [ -z "${DISPLAY}" ]; then
 	QEMU_EXTRA_ARGS="${QEMU_EXTRA_ARGS} -nographic"
+	KERNEL_CMDLINE="${KERNEL_CMDLINE} console=ttyS0"
 fi
 
 shift 1