package/rauc: only install systemd service if built with dbus/service support

The systemd service will try to call rauc in service mode, so it is useless
and will fail if rauc does not have such support

Signed-off-by: Nuno Gonçalves <nunojpg@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Nuno Gonçalves 2022-02-27 19:54:14 +00:00 committed by Peter Korsgaard
parent 43c8f8b77b
commit ec532199d6

View File

@ -15,6 +15,18 @@ RAUC_DEPENDENCIES = host-pkgconf openssl libglib2
ifeq ($(BR2_PACKAGE_RAUC_DBUS),y)
RAUC_CONF_OPTS += --enable-service
RAUC_DEPENDENCIES += dbus
# systemd service uses dbus interface
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
# configure uses pkg-config --variable=systemdsystemunitdir systemd
RAUC_DEPENDENCIES += systemd
define RAUC_INSTALL_INIT_SYSTEMD
mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/rauc.service.d
printf '[Install]\nWantedBy=multi-user.target\n' \
>$(TARGET_DIR)/usr/lib/systemd/system/rauc.service.d/buildroot-enable.conf
endef
endif
else
RAUC_CONF_OPTS += --disable-service
endif
@ -33,17 +45,6 @@ else
RAUC_CONF_OPTS += --disable-json
endif
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
# configure uses pkg-config --variable=systemdsystemunitdir systemd
RAUC_DEPENDENCIES += systemd
endif
define RAUC_INSTALL_INIT_SYSTEMD
mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/rauc.service.d
printf '[Install]\nWantedBy=multi-user.target\n' \
>$(TARGET_DIR)/usr/lib/systemd/system/rauc.service.d/buildroot-enable.conf
endef
HOST_RAUC_DEPENDENCIES = \
host-pkgconf \
host-openssl \