All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Kundrát" <jan.kundrat@cesnet.cz>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 5/7] sysrepo: Use a common repository location
Date: Wed, 4 Dec 2019 10:37:37 +0100	[thread overview]
Message-ID: <b19aded0e3b221e21a629a3eba7deb8d7f54dfae.1575456104.git.jan.kundrat@cesnet.cz> (raw)
In-Reply-To: <cover.1575456104.git.jan.kundrat@cesnet.cz>

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@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 = \
 	-DCALL_TARGET_BINS_DIRECTLY=OFF \
 	-DBUILD_EXAMPLES=OFF \
 	-DBUILD_CPP_EXAMPLES=OFF \
-	-DREPOSITORY_LOC=$(HOST_DIR)/etc/sysrepo \
+	-DREPOSITORY_LOC=$(BASE_TARGET_DIR)/etc/sysrepo \
 	-DSUBSCRIPTIONS_SOCKET_DIR=$(HOST_DIR)/var/run/sysrepo-subscriptions
 
 ifdef BR2_PACKAGE_SYSREPO_CPP
@@ -68,5 +68,12 @@ ifdef BR2_PACKAGE_SYSREPO_CPP
 	HOST_SYSREPO_CONF_OPTS += -DGEN_LANGUAGE_BINDINGS=ON -DGEN_CPP_BINDINGS=ON -DGEN_PYTHON_BINDINGS=OFF -DGEN_JAVA_BINDINGS=OFF
 endif
 
+# There's no point in keeping the logs around
+define SYSREPO_REMOVE_NOTIFICATION_LOG
+	rm -rf $(BASE_TARGET_DIR)/etc/sysrepo/data/notifications/
+endef
+
+SYSREPO_TARGET_FINALIZE_HOOKS += SYSREPO_REMOVE_NOTIFICATION_LOG
+
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))
-- 
2.21.0

  parent reply	other threads:[~2019-12-04  9:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 10:41 [Buildroot] [PATCH 0/7] Improve sysrepo support Jan Kundrát
2019-12-04  9:05 ` [Buildroot] [PATCH 2/7] sysrepo: fix a typo when installing with systemd Jan Kundrát
2019-12-04 13:15   ` Heiko Thiery
2019-12-08 21:51   ` Thomas Petazzoni
2019-12-22 20:28   ` Peter Korsgaard
2019-12-04  9:35 ` [Buildroot] [PATCH 3/7] sysrepo: libnetconf2 is not needed Jan Kundrát
2019-12-04 13:07   ` Heiko Thiery
2019-12-08 21:57   ` Thomas Petazzoni
2019-12-22 20:29   ` Peter Korsgaard
2019-12-04  9:37 ` [Buildroot] [PATCH 4/7] sysrepo: Optional support for C++ bindings Jan Kundrát
2019-12-08 21:59   ` Thomas Petazzoni
2019-12-04  9:37 ` Jan Kundrát [this message]
2019-12-04 12:29   ` [Buildroot] [PATCH 5/7] sysrepo: Use a common repository location Heiko Thiery
2019-12-08 22:03   ` Thomas Petazzoni
2019-12-04 10:17 ` [Buildroot] [PATCH 7/7] Add me as a maintainer for the NETCONF stack Jan Kundrát
2019-12-08 22:04   ` Thomas Petazzoni
2019-12-22 20:29   ` Peter Korsgaard
2019-12-04 10:47 ` [Buildroot] [PATCH 1/7] libyang: Optional C++ bindings Jan Kundrát
2019-12-04 13:23   ` Heiko Thiery
2019-12-04 15:16   ` Thomas Petazzoni
2019-12-04 10:47 ` [Buildroot] [PATCH 6/7] libnetconf2: adjust dependencies Jan Kundrát
2019-12-04 12:53   ` Heiko Thiery
2019-12-04 13:00     ` Jan Kundrát
2019-12-04 13:11       ` Heiko Thiery
2019-12-04 15:14   ` Thomas Petazzoni
2019-12-08 22:05 ` [Buildroot] [PATCH 0/7] Improve sysrepo support Thomas Petazzoni
2019-12-08 22:11   ` Jan Kundrát

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b19aded0e3b221e21a629a3eba7deb8d7f54dfae.1575456104.git.jan.kundrat@cesnet.cz \
    --to=jan.kundrat@cesnet.cz \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.