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> 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't know how to elegantly solve this issue. Maybe adding a 'dev_wait' parameter to the SERIAL_CONSOLES console definition would help in generating a compatible service file? For example: SERIAL_CONSOLES = "115200;ttyGS0;dev_wait 115200;ttymxc1" This could help toggle between the two implementation.
This isn'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.
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'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.
Marc, Any update on this issue?
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: "115200;ttyGS0;dev_wait" 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'll also try with the mailing list.
Add Jason Wessel and Qi Chen who wrote those changes in case they have insight and can help
@Marc IMHO, a third parameter seems reasonable. When 'dev_wait' 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'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
@Chen Thank you for your comments. I'll try to cook something up in the next few weeks and test it on a board I have here.
Marc, any news? I'll move this to 3.6( soon to be 4.1) for now.
Hi Randy, unfortunately I've been very busy lately and I haven't been able to put much effort on this task. I'm not giving up though!
Thanks for the update Marc. We look forward to you making time for this work at some point.
Build move to 5.0 -- ../Randy
Bulk move of 5.0 medium importance issues to 5.99. Move to 5.1 if you want to actively work on an issue.
Bulk move of all unassigned 5.2 medium importance bugs to 5.3.
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's available in a month and let us know ?
(In reply to Randy MacLeod from comment #14) > 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's available in > a month and let us know ? Interesting, I'll have a look thanks!
Thanks Marc, I've put the bug in your name and accepted.
Did some tests with QEMU and everything looks good. I wasn'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).