All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Bur <cyrilbur@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
Date: Mon,  7 Mar 2016 12:05:09 +1100	[thread overview]
Message-ID: <1457312709-6191-1-git-send-email-cyrilbur@gmail.com> (raw)

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

             reply	other threads:[~2016-03-07  1:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07  1:05 Cyril Bur [this message]
2016-03-13 20:28 ` [Buildroot] [PATCH V2] package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457312709-6191-1-git-send-email-cyrilbur@gmail.com \
    --to=cyrilbur@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.