* [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
@ 2016-03-07 1:05 Cyril Bur
2016-03-13 20:28 ` Maxime Hadjinlian
2016-03-31 2:15 ` Thomas Petazzoni
0 siblings, 2 replies; 6+ messages in thread
From: Cyril Bur @ 2016-03-07 1:05 UTC (permalink / raw)
To: buildroot
Currently systemd getty services ignore baudrates set in buildroot in
favour of a hardcoded 115200. This patch SEDs out that hardcoded value with
what is selected.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---
V2: Address comments from Martin Bark and Maxime Hadjinlian
- Don't change the symlink
- Use qstrip (for consistency) around
$(BR2_TARGET_GENERIC_GETTY_BAUDRATE) in shell test statement
---
package/systemd/systemd.mk | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 05121cf..0d52481 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -169,6 +169,7 @@ endef
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]*$$'; \
then \
@@ -177,7 +178,11 @@ define SYSTEMD_INSTALL_SERVICE_TTY
SERVICE="serial-getty"; \
fi; \
ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
- $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
+ $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
+ if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
+ then \
+ $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
+ fi
endef
endif
--
2.7.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
2016-03-07 1:05 [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE Cyril Bur
@ 2016-03-13 20:28 ` Maxime Hadjinlian
2016-03-20 22:38 ` Thomas Petazzoni
2016-03-31 2:15 ` Thomas Petazzoni
1 sibling, 1 reply; 6+ messages in thread
From: Maxime Hadjinlian @ 2016-03-13 20:28 UTC (permalink / raw)
To: buildroot
Hi Cyril, all,
Thanks for your patch.
On Mon, Mar 7, 2016 at 2:05 AM, Cyril Bur <cyrilbur@gmail.com> wrote:
> Currently systemd getty services ignore baudrates set in buildroot in
> favour of a hardcoded 115200. This patch SEDs out that hardcoded value with
> what is selected.
>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> ---
> V2: Address comments from Martin Bark and Maxime Hadjinlian
> - Don't change the symlink
> - Use qstrip (for consistency) around
> $(BR2_TARGET_GENERIC_GETTY_BAUDRATE) in shell test statement
>
> ---
> package/systemd/systemd.mk | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 05121cf..0d52481 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -169,6 +169,7 @@ endef
>
> 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]*$$'; \
> then \
> @@ -177,7 +178,11 @@ define SYSTEMD_INSTALL_SERVICE_TTY
> SERVICE="serial-getty"; \
> fi; \
> ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
> - $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
> + $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
> + if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
> + then \
> + $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
> + fi
> endef
> endif
>
> --
> 2.7.2
>
I don't think it's a problem for getty, but still worth noting
somewhere, this will replace '115200' (without the quotes) by say
"9600" (with the quotes) because the quotes are present in
system/Config.in (maybe they could be removed ? There's no type for
that sort of things in Kconfig as far as I know (which is not much) ?
Other than that, it's fine by me.
Reviewed-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
2016-03-13 20:28 ` Maxime Hadjinlian
@ 2016-03-20 22:38 ` Thomas Petazzoni
2016-03-20 22:51 ` Cyril Bur
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-03-20 22:38 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 13 Mar 2016 21:28:05 +0100, Maxime Hadjinlian wrote:
> > ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
> > - $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
> > + $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
> > + if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
> > + then \
> > + $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
> > + fi
> > endef
> > endif
> >
> > --
> > 2.7.2
> >
>
> I don't think it's a problem for getty, but still worth noting
> somewhere, this will replace '115200' (without the quotes) by say
> "9600" (with the quotes) because the quotes are present in
> system/Config.in (maybe they could be removed ? There's no type for
> that sort of things in Kconfig as far as I know (which is not much) ?
I'm not sure to understand what you meant. Did you mean that he should
be calling qstrip on the variable?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread* [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
2016-03-20 22:38 ` Thomas Petazzoni
@ 2016-03-20 22:51 ` Cyril Bur
2016-03-21 10:05 ` Maxime Hadjinlian
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Bur @ 2016-03-20 22:51 UTC (permalink / raw)
To: buildroot
On Sun, 20 Mar 2016 23:38:23 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Sun, 13 Mar 2016 21:28:05 +0100, Maxime Hadjinlian wrote:
>
> > > ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
> > > - $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
> > > + $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
> > > + if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
> > > + then \
> > > + $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
> > > + fi
> > > endef
> > > endif
> > >
> > > --
> > > 2.7.2
> > >
> >
> > I don't think it's a problem for getty, but still worth noting
> > somewhere, this will replace '115200' (without the quotes) by say
> > "9600" (with the quotes) because the quotes are present in
> > system/Config.in (maybe they could be removed ? There's no type for
> > that sort of things in Kconfig as far as I know (which is not much) ?
>
> I'm not sure to understand what you meant. Did you mean that he should
> be calling qstrip on the variable?
>
I think Maxime was just pointing out what my patch will 'add' quotes. I could
have called qstrip but (I think this was mentioned in V1) AFAIK systemd is
perfectly happy to accept quotes in service files.
If you or someone else would be more comfortable with a qstrip, I can add that.
Cyril
> Thanks,
>
> Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread* [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
2016-03-20 22:51 ` Cyril Bur
@ 2016-03-21 10:05 ` Maxime Hadjinlian
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Hadjinlian @ 2016-03-21 10:05 UTC (permalink / raw)
To: buildroot
On Sun, Mar 20, 2016 at 11:51 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> On Sun, 20 Mar 2016 23:38:23 +0100
> Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
>
>> Hello,
>>
>> On Sun, 13 Mar 2016 21:28:05 +0100, Maxime Hadjinlian wrote:
>>
>> > > ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
>> > > - $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
>> > > + $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
>> > > + if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
>> > > + then \
>> > > + $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
>> > > + fi
>> > > endef
>> > > endif
>> > >
>> > > --
>> > > 2.7.2
>> > >
>> >
>> > I don't think it's a problem for getty, but still worth noting
>> > somewhere, this will replace '115200' (without the quotes) by say
>> > "9600" (with the quotes) because the quotes are present in
>> > system/Config.in (maybe they could be removed ? There's no type for
>> > that sort of things in Kconfig as far as I know (which is not much) ?
>>
>> I'm not sure to understand what you meant. Did you mean that he should
>> be calling qstrip on the variable?
>>
>
> I think Maxime was just pointing out what my patch will 'add' quotes. I could
> have called qstrip but (I think this was mentioned in V1) AFAIK systemd is
> perfectly happy to accept quotes in service files.
That's exactly what I was pointing out. I really don't care about it,
it should not pose any problems, just thought it was worth
mentionning.
>
> If you or someone else would be more comfortable with a qstrip, I can add that.
>
> Cyril
>
>> Thanks,
>>
>> Thomas
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
2016-03-07 1:05 [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE Cyril Bur
2016-03-13 20:28 ` Maxime Hadjinlian
@ 2016-03-31 2:15 ` Thomas Petazzoni
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-03-31 2:15 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 7 Mar 2016 12:05:09 +1100, Cyril Bur wrote:
> Currently systemd getty services ignore baudrates set in buildroot in
> favour of a hardcoded 115200. This patch SEDs out that hardcoded value with
> what is selected.
>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> ---
> V2: Address comments from Martin Bark and Maxime Hadjinlian
> - Don't change the symlink
> - Use qstrip (for consistency) around
> $(BR2_TARGET_GENERIC_GETTY_BAUDRATE) in shell test statement
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-31 2:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 1:05 [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE Cyril Bur
2016-03-13 20:28 ` Maxime Hadjinlian
2016-03-20 22:38 ` Thomas Petazzoni
2016-03-20 22:51 ` Cyril Bur
2016-03-21 10:05 ` Maxime Hadjinlian
2016-03-31 2:15 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox