Skip to content

Commit

Permalink
package/systemd: allow empty systemd default target
Browse files Browse the repository at this point in the history
Currently, we forcefully require that a default target be specified.
However, systemd does install a default target, but it's not
possible to just use that target.

Allow the user to blank-out the config setting to not override
whatever systemd installed and keep that.

Signed-off-by: Norbert Lange <[email protected]>
[[email protected]:
  - introduce the usual qstripped inter;ediate variable
]
Signed-off-by: Yann E. MORIN <[email protected]>
  • Loading branch information
nolange authored and yann-morin-1998 committed Jul 23, 2022
1 parent b7c65d5 commit dad510a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package/systemd/systemd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -570,17 +570,20 @@ ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),)
SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
endif

SYSTEMD_DEFAULT_TARGET = $(call qstrip,$(BR2_PACKAGE_SYSTEMD_DEFAULT_TARGET))
ifneq ($(SYSTEMD_DEFAULT_TARGET),)
define SYSTEMD_INSTALL_INIT_HOOK
ln -fs "$(call qstrip,$(BR2_PACKAGE_SYSTEMD_DEFAULT_TARGET))" \
ln -fs "$(SYSTEMD_DEFAULT_TARGET)" \
$(TARGET_DIR)/usr/lib/systemd/system/default.target
endef
SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_INSTALL_INIT_HOOK
endif

define SYSTEMD_INSTALL_MACHINEID_HOOK
touch $(TARGET_DIR)/etc/machine-id
endef

SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
SYSTEMD_INSTALL_INIT_HOOK \
SYSTEMD_INSTALL_MACHINEID_HOOK

define SYSTEMD_INSTALL_IMAGES_CMDS
Expand Down

0 comments on commit dad510a

Please sign in to comment.