diff mbox series

package/systemd: Set fallback hostname

Message ID 20180123231558.5840-1-chris.lesiak@licor.com
State Accepted
Commit aebabb2780da4c5f85fec00b56f4690feb646073
Headers show
Series package/systemd: Set fallback hostname | expand

Commit Message

Chris Lesiak Jan. 23, 2018, 11:15 p.m. UTC
When BR2_TARGET_GENERIC_HOSTNAME is set, use the config option
--with-fallback-hostname to specify the fallback hostname to use
if none is configured in /etc/hostname.  This is useful in a
pristine installation with an empty /etc.

Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
---
 package/systemd/systemd.mk | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Peter Korsgaard Jan. 28, 2018, 8:47 p.m. UTC | #1
>>>>> "Chris" == Chris Lesiak <chris.lesiak@licor.com> writes:

 > When BR2_TARGET_GENERIC_HOSTNAME is set, use the config option
 > --with-fallback-hostname to specify the fallback hostname to use
 > if none is configured in /etc/hostname.  This is useful in a
 > pristine installation with an empty /etc.

 > Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>

Committed, thanks.
diff mbox series

Patch

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index ef31a0f6c6..b56c6c6b26 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -317,6 +317,11 @@  else
 SYSTEMD_CONF_OPTS += -Dhibernate=false
 endif
 
+SYSTEMD_FALLBACK_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
+ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),)
+SYSTEMD_CONF_OPTS += --with-fallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
+endif
+
 define SYSTEMD_INSTALL_INIT_HOOK
 	ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
 	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt