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

Jan Kundrát jan.kundrat at cesnet.cz
Wed Dec 4 09:37:37 UTC 2019

Because the executables contain a hardcoded location to the on-disk
repository path, we take care to use a stable, shared location between
the host-sysrepo and sysrepo builds so that the host-side tools can
install YANG modules and have them available once the system boots on
the target.

This means that other packages, such as the upcoming netopeer2-keystored
or the netopeer2-server, or really anything else which installs YANG
modules into sysrepo, can just call `sysrepoctl` from `host-sysrepo`,
and the resulting *target* image will have that module also available.

Also make sure that we prune the notification directory. "Notifications"
in this context refer to a persistent state of NETCONF-level
notifications which are created either by `sysrepoctl` for events such
as module (de)installations, and by third-party code. There is no value
in leaking these events from the build env into the target, and killing
these causes in one fewer things to care about.

Signed-off-by: Jan Kundrát <jan.kundrat at cesnet.cz>
 package/sysrepo/sysrepo.mk | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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 \
@@ -68,5 +68,12 @@ ifdef BR2_PACKAGE_SYSREPO_CPP
+# There's no point in keeping the logs around
+	rm -rf $(BASE_TARGET_DIR)/etc/sysrepo/data/notifications/
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))

More information about the buildroot mailing list