diff mbox series

[meta-ti,master/kirkstone] conf: machine: k3: remove the ttyS0 definition

Message ID 20230606193353.910110-1-rs@ti.com
State Rejected
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master/kirkstone] conf: machine: k3: remove the ttyS0 definition | expand

Commit Message

Randolph Sapp June 6, 2023, 7:33 p.m. UTC
From: Randolph Sapp <rs@ti.com>

Adding serial consoles to this variable makes systemd attempt to start a
Getty instance on them. Getty has no retry limit and no retry timout.
I'm sure you can guess where this is going.

This fixes the endless start / stop Getty on ttyS0/ttyS3 messages that
will flood the log until it's full.

In the case of Jailhouse demos, the getty systemd service should be
invoked upon demo start and stopped upon end of the demo. It should not
be listed as a system serial interface since it will not be present
during normal device operation.

Before anyone asks, SERIAL_CONSOLES_CHECK only works on the sysVinit
script so it's not worth discussing as a solution here.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 meta-ti-bsp/conf/machine/include/am62xx.inc | 3 ---
 meta-ti-bsp/conf/machine/include/k3.inc     | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

Andrew Davis June 6, 2023, 9:21 p.m. UTC | #1
On 6/6/23 2:33 PM, rs@ti.com wrote:
> From: Randolph Sapp <rs@ti.com>
> 
> Adding serial consoles to this variable makes systemd attempt to start a
> Getty instance on them. Getty has no retry limit and no retry timout.
> I'm sure you can guess where this is going.
> 
> This fixes the endless start / stop Getty on ttyS0/ttyS3 messages that
> will flood the log until it's full.
> 
> In the case of Jailhouse demos, the getty systemd service should be
> invoked upon demo start and stopped upon end of the demo. It should not
> be listed as a system serial interface since it will not be present
> during normal device operation.
> 
> Before anyone asks, SERIAL_CONSOLES_CHECK only works on the sysVinit
> script so it's not worth discussing as a solution here.
> 

serial-getty-generator does work on Kirkstone, lets just go with that:

diff --git a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
index 9e49ac69..1f2513c4 100644
--- a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
+++ b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
@@ -2,7 +2,7 @@ PR:append = ".arago6"
  
  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
  
-PACKAGECONFIG:append = " networkd resolved"
+PACKAGECONFIG:append = " networkd resolved serial-getty-generator"
  USERADD_PARAM:${PN} += "--system -d / -M --shell /bin/nologin systemd-network;"
  USERADD_PARAM:${PN} += "--system -d / -M --shell /bin/nologin systemd-resolve;"
  
Andrew

> Signed-off-by: Randolph Sapp <rs@ti.com>
> ---
>   meta-ti-bsp/conf/machine/include/am62xx.inc | 3 ---
>   meta-ti-bsp/conf/machine/include/k3.inc     | 2 +-
>   2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/meta-ti-bsp/conf/machine/include/am62xx.inc b/meta-ti-bsp/conf/machine/include/am62xx.inc
> index c98da5f5..1274d3b5 100644
> --- a/meta-ti-bsp/conf/machine/include/am62xx.inc
> +++ b/meta-ti-bsp/conf/machine/include/am62xx.inc
> @@ -25,6 +25,3 @@ TFA_BOARD = "lite"
>   TFA_K3_SYSTEM_SUSPEND = "1"
>   
>   OPTEEMACHINE = "k3-am62x"
> -
> -# Normally AM62 boards use ttyS2, but our Jailhouse inmate may use ttyS3, so try both
> -SERIAL_CONSOLES = "115200;ttyS2 115200;ttyS3"
> diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc
> index c6b55239..97c6da94 100644
> --- a/meta-ti-bsp/conf/machine/include/k3.inc
> +++ b/meta-ti-bsp/conf/machine/include/k3.inc
> @@ -55,5 +55,5 @@ WKS_FILE ?= "${@bb.utils.contains("MACHINE_FEATURES", "efi", "sdimage-2part-efi.
>   do_image_wic[depends] += "virtual/bootloader:do_deploy"
>   do_image_complete[mcdepends] += "mc::k3r5:ti-sci-fw:do_deploy"
>   
> -SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS2"
> +SERIAL_CONSOLES = "115200;ttyS2"
>   SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
Randolph Sapp June 6, 2023, 9:53 p.m. UTC | #2
On 6/6/23 16:21, Andrew Davis wrote:
> On 6/6/23 2:33 PM, rs@ti.com wrote:
>> From: Randolph Sapp <rs@ti.com>
>>
>> Adding serial consoles to this variable makes systemd attempt to start a
>> Getty instance on them. Getty has no retry limit and no retry timout.
>> I'm sure you can guess where this is going.
>>
>> This fixes the endless start / stop Getty on ttyS0/ttyS3 messages that
>> will flood the log until it's full.
>>
>> In the case of Jailhouse demos, the getty systemd service should be
>> invoked upon demo start and stopped upon end of the demo. It should not
>> be listed as a system serial interface since it will not be present
>> during normal device operation.
>>
>> Before anyone asks, SERIAL_CONSOLES_CHECK only works on the sysVinit
>> script so it's not worth discussing as a solution here.
>>
> 
> serial-getty-generator does work on Kirkstone, lets just go with that:
> 
> diff --git a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend 
> b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
> index 9e49ac69..1f2513c4 100644
> --- a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
> +++ b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
> @@ -2,7 +2,7 @@ PR:append = ".arago6"
> 
>   FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
> 
> -PACKAGECONFIG:append = " networkd resolved"
> +PACKAGECONFIG:append = " networkd resolved serial-getty-generator"
>   USERADD_PARAM:${PN} += "--system -d / -M --shell /bin/nologin 
> systemd-network;"
>   USERADD_PARAM:${PN} += "--system -d / -M --shell /bin/nologin 
> systemd-resolve;"
> 
> Andrew
> 

Yeah, I've got a patch to enable it and revert all serial definitions to 
sysVinit only fields. Didn't mean to send this again, was on the wrong 
branch when I invoked git send-email.

>> Signed-off-by: Randolph Sapp <rs@ti.com>
>> ---
>>   meta-ti-bsp/conf/machine/include/am62xx.inc | 3 ---
>>   meta-ti-bsp/conf/machine/include/k3.inc     | 2 +-
>>   2 files changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/meta-ti-bsp/conf/machine/include/am62xx.inc 
>> b/meta-ti-bsp/conf/machine/include/am62xx.inc
>> index c98da5f5..1274d3b5 100644
>> --- a/meta-ti-bsp/conf/machine/include/am62xx.inc
>> +++ b/meta-ti-bsp/conf/machine/include/am62xx.inc
>> @@ -25,6 +25,3 @@ TFA_BOARD = "lite"
>>   TFA_K3_SYSTEM_SUSPEND = "1"
>>   OPTEEMACHINE = "k3-am62x"
>> -
>> -# Normally AM62 boards use ttyS2, but our Jailhouse inmate may use 
>> ttyS3, so try both
>> -SERIAL_CONSOLES = "115200;ttyS2 115200;ttyS3"
>> diff --git a/meta-ti-bsp/conf/machine/include/k3.inc 
>> b/meta-ti-bsp/conf/machine/include/k3.inc
>> index c6b55239..97c6da94 100644
>> --- a/meta-ti-bsp/conf/machine/include/k3.inc
>> +++ b/meta-ti-bsp/conf/machine/include/k3.inc
>> @@ -55,5 +55,5 @@ WKS_FILE ?= 
>> "${@bb.utils.contains("MACHINE_FEATURES", "efi", "sdimage-2part-efi.
>>   do_image_wic[depends] += "virtual/bootloader:do_deploy"
>>   do_image_complete[mcdepends] += "mc::k3r5:ti-sci-fw:do_deploy"
>> -SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS2"
>> +SERIAL_CONSOLES = "115200;ttyS2"
>>   SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
diff mbox series

Patch

diff --git a/meta-ti-bsp/conf/machine/include/am62xx.inc b/meta-ti-bsp/conf/machine/include/am62xx.inc
index c98da5f5..1274d3b5 100644
--- a/meta-ti-bsp/conf/machine/include/am62xx.inc
+++ b/meta-ti-bsp/conf/machine/include/am62xx.inc
@@ -25,6 +25,3 @@  TFA_BOARD = "lite"
 TFA_K3_SYSTEM_SUSPEND = "1"
 
 OPTEEMACHINE = "k3-am62x"
-
-# Normally AM62 boards use ttyS2, but our Jailhouse inmate may use ttyS3, so try both
-SERIAL_CONSOLES = "115200;ttyS2 115200;ttyS3"
diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc
index c6b55239..97c6da94 100644
--- a/meta-ti-bsp/conf/machine/include/k3.inc
+++ b/meta-ti-bsp/conf/machine/include/k3.inc
@@ -55,5 +55,5 @@  WKS_FILE ?= "${@bb.utils.contains("MACHINE_FEATURES", "efi", "sdimage-2part-efi.
 do_image_wic[depends] += "virtual/bootloader:do_deploy"
 do_image_complete[mcdepends] += "mc::k3r5:ti-sci-fw:do_deploy"
 
-SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS2"
+SERIAL_CONSOLES = "115200;ttyS2"
 SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"