[Buildroot] [PATCH 5/7] sysrepo: Use a common repository location

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Dec 8 22:03:20 UTC 2019

On Wed, 4 Dec 2019 10:37:37 +0100
Jan Kundrát <jan.kundrat at cesnet.cz> wrote:

> diff --git a/package/sysrepo/sysrepo.mk b/package/sysrepo/sysrepo.mk
> index 113ed7a929..2ef64d13e2 100644
> --- a/package/sysrepo/sysrepo.mk
> +++ b/package/sysrepo/sysrepo.mk
> @@ -58,7 +58,7 @@ HOST_SYSREPO_CONF_OPTS = \
> -	-DREPOSITORY_LOC=$(HOST_DIR)/etc/sysrepo \

I suppose you're using $(BASE_TARGET_DIR) here instead of $(TARGET_DIR)
to work around issues with per-package directory support ?

Unfortunately, using $(BASE_TARGET_DIR) is not really a good option.
Indeed, if any host-sysrepo tool gets used during the build, it will
point to $(BASE_TARGET_DIR), which is with per-package directory
support enabled, is completely empty during the build. It only gets
populated at the very end of the build, in target-finalize.

With per-package directory, we cannot have a hardcoded path to the
target, it really needs to be dynamic. Can the sysrepoctl tool use an
environment variable for example ?

> +# There's no point in keeping the logs around
> +	rm -rf $(BASE_TARGET_DIR)/etc/sysrepo/data/notifications/

Here, you can definitely use $(TARGET_DIR), because when the
target-finalize hooks are executed, TARGET_DIR is defined to

Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering

More information about the buildroot mailing list