<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14375</bug_id>
          
          <creation_ts>2021-05-03 14:59:49 +0000</creation_ts>
          <short_desc>serial-getty@.service fails on gadget serial port ttyGS0</short_desc>
          <delta_ts>2026-06-03 12:53:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>3.3</version>
          <rep_platform>Other</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marc Ferland">marc.ferland</reporter>
          <assigned_to name="Marc Ferland">marc.ferland</assigned_to>
          <cc>Ahmed.Hossam</cc>
    
    <cc>ccasciato</cc>
    
    <cc>jason.wessel</cc>
    
    <cc>jon.mason</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90229</commentid>
    <comment_count>0</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2021-05-03 14:59:49 +0000</bug_when>
    <thetext>I have a system here that exposes a virtual serial device on a micro-USB port. This device appears as /dev/ttyGS0 on the embedded system.

Enabling getty on this virtual serial port using the SERIAL_CONSOLES variable in my mahcine.conf ultimately fails with:

* serial-getty@ttyGS0.service - Serial Getty on ttyGS0
     Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled; vendor&gt;
     Active: inactive (dead)
  Condition: start condition failed at Mon 2021-05-03 14:24:45 UTC; 51s ago
             `- ConditionPathExists=/dev/ttyGS0 was not met

I understand this happens because of a previous commit (	adc496081689e1d8b8bf3bbf21efec675450edb2) which changed the BindsTo to a combination of PartOf and ConditionPathExists.

Replacing the PartOf/ConditionPathExists to BindsTo on my setup fixes the issue but I understand this might break other configurations like qemuarm64.

I honestly don&apos;t know how to elegantly solve this issue. Maybe adding a &apos;dev_wait&apos; parameter to the SERIAL_CONSOLES console definition would help in generating a compatible service file? For example:

SERIAL_CONSOLES = &quot;115200;ttyGS0;dev_wait 115200;ttymxc1&quot;

This could help toggle between the two implementation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90281</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-05-06 14:51:24 +0000</bug_when>
    <thetext>This isn&apos;t so much a bug as a request for help in developing your system.
Can you ask your question on the yocto email list?

If no one answers ping this defect.
Patches would also be welcome if the issue is resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90292</commentid>
    <comment_count>2</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2021-05-06 15:17:21 +0000</bug_when>
    <thetext>Thanks for the feedback. Well, the service file generated by the systemd-serialgetty.bb recipe does not work as expected. Some service files will fail based on the type of serial device that&apos;s being used. I think this could be considered as a bug.

I will try to gather comments/ideas by asking on the mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91855</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-10-28 17:31:21 +0000</bug_when>
    <thetext>Marc, Any update on this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91860</commentid>
    <comment_count>4</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2021-10-29 13:42:41 +0000</bug_when>
    <thetext>Hi Randy, no updates. I tried asking on IRC but was unsuccessful. I have a couple of ideas on how to solve it though:

- Add a third parameter to the SERIAL_CONSOLES arguments. For example: &quot;115200;ttyGS0;dev_wait&quot; to indicate that the serial-console service _must_ wait for this device (i.e.: use BindsTo). Without this parameter, we default to the current, fast fail, poky implementation (PartOf + ConditionPathExists);

- Use the name of the tty (ttyGS0, ttyUL0, ttyFB0, ttyS0, ttyAMA0, etc.) to determine if we should use a BindsTo or a PartOf/ConditionPathExists (seems brittle);

- Use BindsTo and a _shorter_ timeout value, something like 5-10 seconds instead of the default 90 seconds;

Does that make sense?

I&apos;ll also try with the mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91864</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-10-29 16:48:47 +0000</bug_when>
    <thetext>Add Jason Wessel and Qi Chen who wrote those changes in case they have insight and can help</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91867</commentid>
    <comment_count>6</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2021-11-01 01:56:20 +0000</bug_when>
    <thetext>@Marc

IMHO, a third parameter seems reasonable.
When &apos;dev_wait&apos; is available, put a drop-in configuration (e.g. dev-wait.conf) in /etc/systemd/system/serial-getty@ttyXXX.service.d/ directory which specifies BindsTo. Could you please try if this works? I don&apos;t have environment and am not sure if this will work.

As a quick tryout, you can create /etc/systemd/system/serial-getty@ttyGS0.service.d/dev-wait.conf with the following contents and then reboot the target.
[Unit]
BindsTo=dev-%i.device

Regards,
Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91886</commentid>
    <comment_count>7</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2021-11-03 18:50:34 +0000</bug_when>
    <thetext>@Chen

Thank you for your comments. I&apos;ll try to cook something up in the next few weeks and test it on a board I have here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92987</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-04-11 21:45:51 +0000</bug_when>
    <thetext>Marc, any news? I&apos;ll move this to 3.6( soon to be 4.1) for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93006</commentid>
    <comment_count>9</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2022-04-12 15:00:55 +0000</bug_when>
    <thetext>Hi Randy, unfortunately I&apos;ve been very busy lately and I haven&apos;t been able to put much effort on this task. I&apos;m not giving up though!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93010</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-04-12 15:37:23 +0000</bug_when>
    <thetext>Thanks for the update Marc. We look forward to you making time for this work at some point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97162</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-30 15:37:33 +0000</bug_when>
    <thetext>Build move to 5.0 -- ../Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98825</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-04-25 01:13:53 +0000</bug_when>
    <thetext>Bulk move of 5.0 medium importance issues to 5.99.
Move to 5.1 if you want to actively work on an issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101812</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-05-01 14:07:07 +0000</bug_when>
    <thetext>Bulk move of all unassigned 5.2 medium importance bugs to 5.3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104744</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-03-19 15:24:58 +0000</bug_when>
    <thetext>Ross Burton did quite some work on tty management so with newer versions of systemd and that work, this may just work now.

Marc, can you retest using master or the 6.0 release when it&apos;s available in a month and let us know ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104888</commentid>
    <comment_count>15</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2026-04-01 01:41:04 +0000</bug_when>
    <thetext>(In reply to Randy MacLeod from comment #14)
&gt; Ross Burton did quite some work on tty management so with newer versions of
&gt; systemd and that work, this may just work now.
&gt; 
&gt; Marc, can you retest using master or the 6.0 release when it&apos;s available in
&gt; a month and let us know ?

Interesting, I&apos;ll have a look thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104936</commentid>
    <comment_count>16</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-04-02 15:05:52 +0000</bug_when>
    <thetext>Thanks Marc,

I&apos;ve put the bug in your name and accepted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105702</commentid>
    <comment_count>17</comment_count>
    <who name="Marc Ferland">marc.ferland</who>
    <bug_when>2026-06-03 12:53:09 +0000</bug_when>
    <thetext>Did some tests with QEMU and everything looks good. I wasn&apos;t able to reproduce the issue. I configured multiple gettys with SERIAL_CONSOLES and each one came up as expected.

Tested with wrynose (6.0).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>