package/systemd: Set fallback hostname

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>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Chris Lesiak 2018-01-23 17:15:58 -06:00 committed by Peter Korsgaard
parent 5f2dc44590
commit aebabb2780

View File

@ -317,6 +317,11 @@ else
SYSTEMD_CONF_OPTS += -Dhibernate=false SYSTEMD_CONF_OPTS += -Dhibernate=false
endif 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 define SYSTEMD_INSTALL_INIT_HOOK
ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt