package/confd: support for customer factory startup-config.cfg

When researching the systemd tmpfiles.d implementation I discovered the
effort to standarize on /usr/share/factory as a generic factory defaults
for Linux systems.  This patch adds a small example factory.cfg file
that is installed as /usr/share/factory/cfg/startup-config.cfg.  The
tmpfiles.d backend will then install it as /cfg/startup-config.cfg if
that file is missing at boot.  Confd does the rest to bootstrap our
(by default) empty sysrepo db with this startup-config.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-04-03 06:00:54 +02:00
parent f9a7c256ca
commit 36ff60f99c
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -15,6 +15,8 @@ define CONFD_INSTALL_EXTRA
cp $(CONFD_PKGDIR)/sysrepo.conf $(FINIT_D)/available/
ln -sf ../available/sysrepo.conf $(FINIT_D)/enabled/sysrepo.conf
cp $(CONFD_PKGDIR)/tmpfiles.conf $(TARGET_DIR)/etc/tmpfiles.d/confd.conf
mkdir -p $(TARGET_DIR)/usr/share/factory/cfg
cp $(CONFD_PKGDIR)/factory.cfg $(TARGET_DIR)/usr/share/factory/cfg/startup-config.cfg
mkdir -p $(TARGET_DIR)/lib/infix
cp $(CONFD_PKGDIR)/prep-db $(TARGET_DIR)/lib/infix/
cp $(CONFD_PKGDIR)/clean-etc $(TARGET_DIR)/lib/infix/
+5
View File
@@ -0,0 +1,5 @@
{
"ietf-system:system": {
"hostname": "default"
}
}
+1
View File
@@ -1 +1,2 @@
d /run/resolvconf/interfaces - - -
C /cfg/startup-config.cfg - - -