All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
@ 2016-09-09 16:10 Floris Bos
  2016-09-11 20:00 ` Thomas Petazzoni
  2016-09-11 21:09 ` Yann E. MORIN
  0 siblings, 2 replies; 9+ messages in thread
From: Floris Bos @ 2016-09-09 16:10 UTC (permalink / raw)
  To: buildroot

The serial-getty unit depends on dev-%i.device which does not
seem to be created for /dev/console
Workaround this by letting normal getty unit handle things
if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
---
 package/systemd/systemd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index fb07819..975bfb6 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -357,7 +357,7 @@ ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
 # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
 define SYSTEMD_INSTALL_SERVICE_TTY
-	if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
+	if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'console|tty[0-9]*$$'; \
 	then \
 		SERVICE="getty"; \
 	else \
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-09 16:10 [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console Floris Bos
@ 2016-09-11 20:00 ` Thomas Petazzoni
  2016-09-11 21:09 ` Yann E. MORIN
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 20:00 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  9 Sep 2016 18:10:18 +0200, Floris Bos wrote:
> The serial-getty unit depends on dev-%i.device which does not
> seem to be created for /dev/console
> Workaround this by letting normal getty unit handle things
> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

Yann, Maxime, could you please review this patch?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-09 16:10 [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console Floris Bos
  2016-09-11 20:00 ` Thomas Petazzoni
@ 2016-09-11 21:09 ` Yann E. MORIN
  2016-09-21  7:01   ` Peter Korsgaard
  1 sibling, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2016-09-11 21:09 UTC (permalink / raw)
  To: buildroot

Floris, All,

On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
> The serial-getty unit depends on dev-%i.device which does not
> seem to be created for /dev/console
> Workaround this by letting normal getty unit handle things
> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

I haven't tested that, but I think this is OK just on principle.

I just wonder if that behaves correctly when console is a serial line or
anything else (e.g. a VT on HDMI, or through a debug channel...)

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/systemd/systemd.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index fb07819..975bfb6 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -357,7 +357,7 @@ ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
>  # systemd needs getty.service for VTs and serial-getty.service for serial ttys
>  # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
>  define SYSTEMD_INSTALL_SERVICE_TTY
> -	if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
> +	if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'console|tty[0-9]*$$'; \
>  	then \
>  		SERVICE="getty"; \
>  	else \
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-11 21:09 ` Yann E. MORIN
@ 2016-09-21  7:01   ` Peter Korsgaard
  2016-09-21 20:05     ` Peter Seiderer
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Korsgaard @ 2016-09-21  7:01 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Floris, All,
 > On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
 >> The serial-getty unit depends on dev-%i.device which does not
 >> seem to be created for /dev/console
 >> Workaround this by letting normal getty unit handle things
 >> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
 >> 
 >> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

 > I haven't tested that, but I think this is OK just on principle.

 > I just wonder if that behaves correctly when console is a serial line or
 > anything else (e.g. a VT on HDMI, or through a debug channel...)

Yeah, me too. Does anybody know what the difference exactly is between
getty/serial-getty, and when one should be used over the other?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-21  7:01   ` Peter Korsgaard
@ 2016-09-21 20:05     ` Peter Seiderer
  2016-09-21 21:47       ` Floris Bos
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Seiderer @ 2016-09-21 20:05 UTC (permalink / raw)
  To: buildroot

Hello *,

On Wed, 21 Sep 2016 09:01:37 +0200, Peter Korsgaard <peter@korsgaard.com> wrote:

> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> 
>  > Floris, All,
>  > On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
>  >> The serial-getty unit depends on dev-%i.device which does not
>  >> seem to be created for /dev/console
>  >> Workaround this by letting normal getty unit handle things
>  >> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
>  >> 
>  >> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> 
>  > I haven't tested that, but I think this is OK just on principle.
> 
>  > I just wonder if that behaves correctly when console is a serial line or
>  > anything else (e.g. a VT on HDMI, or through a debug channel...)
> 
> Yeah, me too. Does anybody know what the difference exactly is between
> getty/serial-getty, and when one should be used over the other?
> 

Tested for the rpi3/glibc/systemd case and failed: I get a doubled
(and unusable) ' Welcome to Buildroot/buildroot login:' on serial and
no login on hdmi...

Regards,
Peter

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-21 20:05     ` Peter Seiderer
@ 2016-09-21 21:47       ` Floris Bos
  2016-09-22 18:50         ` Peter Seiderer
  0 siblings, 1 reply; 9+ messages in thread
From: Floris Bos @ 2016-09-21 21:47 UTC (permalink / raw)
  To: buildroot

On 09/21/2016 10:05 PM, Peter Seiderer wrote:
> Hello *,
>
> On Wed, 21 Sep 2016 09:01:37 +0200, Peter Korsgaard <peter@korsgaard.com> wrote:
>
>>>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
>>   > Floris, All,
>>   > On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
>>   >> The serial-getty unit depends on dev-%i.device which does not
>>   >> seem to be created for /dev/console
>>   >> Workaround this by letting normal getty unit handle things
>>   >> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
>>   >>
>>   >> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>>
>>   > I haven't tested that, but I think this is OK just on principle.
>>
>>   > I just wonder if that behaves correctly when console is a serial line or
>>   > anything else (e.g. a VT on HDMI, or through a debug channel...)
>>
>> Yeah, me too. Does anybody know what the difference exactly is between
>> getty/serial-getty, and when one should be used over the other?
>>
> Tested for the rpi3/glibc/systemd case and failed: I get a doubled
> (and unusable) ' Welcome to Buildroot/buildroot login:' on serial and
> no login on hdmi...

Empty cmdline.txt will give hdmi.

Recall you need "console=serial0,115200 console=tty1" with tty1 last in 
cmdline.txt if you want them simultaneous.
So that tty1 becomes /dev/console and serial is handled by systemd's 
automatic getty generator.

Perhaps there is an issue if you have the order swapped, and both 
systemd's automatic stuff and the manual symlink try to display a getty 
on serial.
Not sure how to disable systemd's automatic behavior.



Yours sincerely,

Floris Bos

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-21 21:47       ` Floris Bos
@ 2016-09-22 18:50         ` Peter Seiderer
  2016-09-22 19:25           ` Floris Bos
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Seiderer @ 2016-09-22 18:50 UTC (permalink / raw)
  To: buildroot

Hello Floris,

On Wed, 21 Sep 2016 23:47:02 +0200, Floris Bos <bos@je-eigen-domein.nl> wrote:

> On 09/21/2016 10:05 PM, Peter Seiderer wrote:
> > Hello *,
> >
> > On Wed, 21 Sep 2016 09:01:37 +0200, Peter Korsgaard <peter@korsgaard.com> wrote:
> >
> >>>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> >>   > Floris, All,
> >>   > On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
> >>   >> The serial-getty unit depends on dev-%i.device which does not
> >>   >> seem to be created for /dev/console
> >>   >> Workaround this by letting normal getty unit handle things
> >>   >> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
> >>   >>
> >>   >> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> >>
> >>   > I haven't tested that, but I think this is OK just on principle.
> >>
> >>   > I just wonder if that behaves correctly when console is a serial line or
> >>   > anything else (e.g. a VT on HDMI, or through a debug channel...)
> >>
> >> Yeah, me too. Does anybody know what the difference exactly is between
> >> getty/serial-getty, and when one should be used over the other?
> >>
> > Tested for the rpi3/glibc/systemd case and failed: I get a doubled
> > (and unusable) ' Welcome to Buildroot/buildroot login:' on serial and
> > no login on hdmi...
> 
> Empty cmdline.txt will give hdmi.
> 
> Recall you need "console=serial0,115200 console=tty1" with tty1 last in 
> cmdline.txt if you want them simultaneous.

Changed cmdline.txt to:

	root=/dev/mmcblk0p2 rootwait console=ttyAMA0,115200 console=tty1

Which gives me two (functional) logins on serial and hdmi.

But I think changing package/rpi-firmware/cmdline.txt unconditional will
break the other Init systems, see commit log from last patch touching
cmdline.txt ([1):

  ...change BR2_TARGET_GENERIC_GETTY_PORT to "console", so it starts a
  getty on the last console= passed to the kernel, ttyAMA0...

Regards,
Peter


[1] https://git.buildroot.net/buildroot/commit/?id=20878a1017e2bf7eb8c5f870dc6d2641493cb0f9


> So that tty1 becomes /dev/console and serial is handled by systemd's 
> automatic getty generator.
> 
> Perhaps there is an issue if you have the order swapped, and both 
> systemd's automatic stuff and the manual symlink try to display a getty 
> on serial.
> Not sure how to disable systemd's automatic behavior.
> 
> 
> 
> Yours sincerely,
> 
> Floris Bos
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-22 18:50         ` Peter Seiderer
@ 2016-09-22 19:25           ` Floris Bos
  2016-09-25 21:44             ` Peter Seiderer
  0 siblings, 1 reply; 9+ messages in thread
From: Floris Bos @ 2016-09-22 19:25 UTC (permalink / raw)
  To: buildroot

On 09/22/2016 08:50 PM, Peter Seiderer wrote:
> Hello Floris,
>
> On Wed, 21 Sep 2016 23:47:02 +0200, Floris Bos <bos@je-eigen-domein.nl> wrote:
>
>> On 09/21/2016 10:05 PM, Peter Seiderer wrote:
>>> Hello *,
>>>
>>> On Wed, 21 Sep 2016 09:01:37 +0200, Peter Korsgaard <peter@korsgaard.com> wrote:
>>>
>>>>>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
>>>>    > Floris, All,
>>>>    > On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
>>>>    >> The serial-getty unit depends on dev-%i.device which does not
>>>>    >> seem to be created for /dev/console
>>>>    >> Workaround this by letting normal getty unit handle things
>>>>    >> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
>>>>    >>
>>>>    >> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>>>>
>>>>    > I haven't tested that, but I think this is OK just on principle.
>>>>
>>>>    > I just wonder if that behaves correctly when console is a serial line or
>>>>    > anything else (e.g. a VT on HDMI, or through a debug channel...)
>>>>
>>>> Yeah, me too. Does anybody know what the difference exactly is between
>>>> getty/serial-getty, and when one should be used over the other?
>>>>
>>> Tested for the rpi3/glibc/systemd case and failed: I get a doubled
>>> (and unusable) ' Welcome to Buildroot/buildroot login:' on serial and
>>> no login on hdmi...
>> Empty cmdline.txt will give hdmi.
>>
>> Recall you need "console=serial0,115200 console=tty1" with tty1 last in
>> cmdline.txt if you want them simultaneous.
> Changed cmdline.txt to:
>
> 	root=/dev/mmcblk0p2 rootwait console=ttyAMA0,115200 console=tty1
>
> Which gives me two (functional) logins on serial and hdmi.
>
> But I think changing package/rpi-firmware/cmdline.txt unconditional will
> break the other Init systems, see commit log from last patch touching
> cmdline.txt ([1):
>
>    ...change BR2_TARGET_GENERIC_GETTY_PORT to "console", so it starts a
>    getty on the last console= passed to the kernel, ttyAMA0...

Will withdraw my patch then, and wait for someone else to come up with a 
better solution.

I think the one-size-fits all cmdline.txt that listens to both on HDMI 
and serial console by default makes things too complicated anyway.


Yours sincerely,

Floris Bos

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console
  2016-09-22 19:25           ` Floris Bos
@ 2016-09-25 21:44             ` Peter Seiderer
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Seiderer @ 2016-09-25 21:44 UTC (permalink / raw)
  To: buildroot

Hello Floris,

On Thu, 22 Sep 2016 21:25:59 +0200, Floris Bos <bos@je-eigen-domein.nl> wrote:

> On 09/22/2016 08:50 PM, Peter Seiderer wrote:
> > Hello Floris,
> >
> > On Wed, 21 Sep 2016 23:47:02 +0200, Floris Bos <bos@je-eigen-domein.nl> wrote:
> >
> >> On 09/21/2016 10:05 PM, Peter Seiderer wrote:
> >>> Hello *,
> >>>
> >>> On Wed, 21 Sep 2016 09:01:37 +0200, Peter Korsgaard <peter@korsgaard.com> wrote:
> >>>
> >>>>>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> >>>>    > Floris, All,
> >>>>    > On 2016-09-09 18:10 +0200, Floris Bos spake thusly:
> >>>>    >> The serial-getty unit depends on dev-%i.device which does not
> >>>>    >> seem to be created for /dev/console
> >>>>    >> Workaround this by letting normal getty unit handle things
> >>>>    >> if BR2_TARGET_GENERIC_GETTY_PORT is set to 'console'
> >>>>    >>
> >>>>    >> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> >>>>
> >>>>    > I haven't tested that, but I think this is OK just on principle.
> >>>>
> >>>>    > I just wonder if that behaves correctly when console is a serial line or
> >>>>    > anything else (e.g. a VT on HDMI, or through a debug channel...)
> >>>>
> >>>> Yeah, me too. Does anybody know what the difference exactly is between
> >>>> getty/serial-getty, and when one should be used over the other?
> >>>>
> >>> Tested for the rpi3/glibc/systemd case and failed: I get a doubled
> >>> (and unusable) ' Welcome to Buildroot/buildroot login:' on serial and
> >>> no login on hdmi...
> >> Empty cmdline.txt will give hdmi.
> >>
> >> Recall you need "console=serial0,115200 console=tty1" with tty1 last in
> >> cmdline.txt if you want them simultaneous.
> > Changed cmdline.txt to:
> >
> > 	root=/dev/mmcblk0p2 rootwait console=ttyAMA0,115200 console=tty1
> >
> > Which gives me two (functional) logins on serial and hdmi.
> >
> > But I think changing package/rpi-firmware/cmdline.txt unconditional will
> > break the other Init systems, see commit log from last patch touching
> > cmdline.txt ([1):
> >
> >    ...change BR2_TARGET_GENERIC_GETTY_PORT to "console", so it starts a
> >    getty on the last console= passed to the kernel, ttyAMA0...
> 
> Will withdraw my patch then, and wait for someone else to come up with a 
> better solution.
> 

Ups, sorry, did not want to discourage you...

> I think the one-size-fits all cmdline.txt that listens to both on HDMI 
> and serial console by default makes things too complicated anyway.
> 

Maybe its feasible to list all wanted login ports in BR2_TARGET_GENERIC_GETTY_PORT
and only add the specified named systemd service links (an no generator ones)?

Regards,
Peter

>
> Yours sincerely,
> 
> Floris Bos
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-09-25 21:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 16:10 [Buildroot] [PATCH] systemd: let getty instead of serial-getty handle /dev/console Floris Bos
2016-09-11 20:00 ` Thomas Petazzoni
2016-09-11 21:09 ` Yann E. MORIN
2016-09-21  7:01   ` Peter Korsgaard
2016-09-21 20:05     ` Peter Seiderer
2016-09-21 21:47       ` Floris Bos
2016-09-22 18:50         ` Peter Seiderer
2016-09-22 19:25           ` Floris Bos
2016-09-25 21:44             ` Peter Seiderer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.