summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril Bur <cyrilbur@gmail.com>2016-03-07 12:05:09 +1100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-03-31 04:02:49 +0200
commite44b9c565433363dc8962654fb758192e5e069fd (patch)
tree61da1e36690a3c7476891119a3b33d60fdf0c13e
parent8706e865d8e62fd2334d0fd560b8d78c1985c1d2 (diff)
downloadbuildroot-e44b9c565433363dc8962654fb758192e5e069fd.tar.gz
buildroot-e44b9c565433363dc8962654fb758192e5e069fd.zip
package/systemd: Respect BR2_TARGET_GENERIC_GETTY_BAUDRATE
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> Reviewed-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/systemd/systemd.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 75ad961d59..8a6aa44315 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -227,6 +227,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 \
@@ -235,7 +236,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
OpenPOWER on IntegriCloud