mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
Build in required modules on buildtime
This to hopefully speed up boot, do as little as possible during boot. * New modules needs to be added to src/confd/scripts/setup.sh * Permission needs to be changed post-build for YANG files, see CONFD_PERMISSIONS in confd.mk
This commit is contained in:
committed by
Tobias Waldekranz
parent
bef44b725e
commit
3354effc53
+358
-2
@@ -11,8 +11,12 @@ CONFD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/confd
|
||||
CONFD_LICENSE = BSD-3-Clause
|
||||
CONFD_LICENSE_FILES = LICENSE
|
||||
CONFD_REDISTRIBUTE = NO
|
||||
CONFD_DEPENDENCIES = augeas jansson libite sysrepo libsrx libglib2
|
||||
CONFD_DEPENDENCIES = host-sysrepo netopeer2 augeas jansson libite sysrepo libsrx libglib2
|
||||
CONFD_AUTORECONF = YES
|
||||
|
||||
CONFD_SYSREPO_SHM_PREFIX = sr_buildroot$(subst /,_,$(CONFIG_DIR))_netopeer2
|
||||
|
||||
echo "prefix: $(CONFD_SYSREPO_SHM_PREFIX)"
|
||||
define CONFD_CONF_ENV
|
||||
CFLAGS="$(INFIX_CFLAGS)"
|
||||
endef
|
||||
@@ -23,6 +27,11 @@ else
|
||||
CONFD_CONF_OPTS += --disable-containers
|
||||
endif
|
||||
|
||||
|
||||
CONFD_MAKE_ENV = \
|
||||
SYSREPOCTL_EXECUTABLE=$(HOST_DIR)/bin/sysrepoctl \
|
||||
SYSREPO_SHM_PREFIX=$(CONFD_SYSREPO_SHM_PREFIX)
|
||||
|
||||
define CONFD_INSTALL_EXTRA
|
||||
cp $(CONFD_PKGDIR)/confd.conf $(FINIT_D)/available/
|
||||
ln -sf ../available/confd.conf $(FINIT_D)/enabled/confd.conf
|
||||
@@ -30,6 +39,353 @@ define CONFD_INSTALL_EXTRA
|
||||
mkdir -p $(TARGET_DIR)/etc/avahi/services
|
||||
cp $(CONFD_PKGDIR)/avahi.service $(TARGET_DIR)/etc/avahi/services/netconf.service
|
||||
endef
|
||||
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_EXTRA
|
||||
define CONFD_INSTALL_YANG_MODULES
|
||||
USE_CONTAINERS=$(BR2_PACKAGE_PODMAN) SYSREPO_SHM_PREFIX=$(CONFD_SYSREPO_SHM_PREFIX) SYSREPOCTL_EXECUTABLE="$(HOST_DIR)/bin/sysrepoctl" SYSREPOCFG_EXECUTABLE="$(HOST_DIR)/bin/sysrepocfg" SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/confd/" $(@D)/scripts/setup.sh
|
||||
endef
|
||||
define CONFD_PERMISSIONS
|
||||
# generated using chatGPT
|
||||
/etc/sysrepo/data/iana-ssh-mac-algs.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-nmda.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-with-defaults.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-acm.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/libnetconf2-netconf-server.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-acm.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-factory-default.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-factory-default.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-tls-cipher-suite-algs.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-client.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-keystore.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1q-types.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ethernet-interface.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-monitoring.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-common.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-server.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-system.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-nmda.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-server.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-system.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-factory-default.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-key-exchange-algs.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/libnetconf2-netconf-server.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-server.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-routing.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-datastores.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-interfaces.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-network-instance.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-server.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-client.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-routing.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-routing.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-schema-mount.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-crypto-types.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ip.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-crypto-types.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-services.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1ab-lldp.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-lldp.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-schema-mount.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-factory-default.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/notifications.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ip.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-plugind.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-hardware.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-subscribed-notifications.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-key-chain.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv6-unicast-routing.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-keystore.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-monitoring.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-lldp.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-interfaces.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-system.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-schema-mount.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1q-types.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-if-type.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-ethernet-interface.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-library.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-with-defaults.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-encryption-algs.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-interfaces.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-routing.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-truststore.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-hardware.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-crypt-hash.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1q-types.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-hardware.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-plugind.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-common.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-subscribed-notifications.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-if-type.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-if-type.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv4-unicast-routing.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-with-defaults.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1q-types.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-library.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-common.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-subscribed-notifications.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-interfaces.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv4-unicast-routing.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-monitoring.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-public-key-algs.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-plugind.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-containers.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-hardware.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-key-exchange-algs.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1ab-lldp.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ethernet-interface.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/notifications.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-routing.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-ethernet-interface.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-timezones.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-datastores.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-x509-cert-to-name.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-factory-default.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1ab-lldp.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-acm.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-factory-default.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-containers.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-tls-cipher-suite-algs.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-push.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-common.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-factory-default.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-if-type.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/nc-notifications.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-server.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/yang.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ip.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-hardware.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-push.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/notifications.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-notifications.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-public-key-algs.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/nc-notifications.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-interfaces.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-factory-default.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-tls-cipher-suite-algs.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-hardware.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-encryption-algs.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-crypt-hash.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-network-instance.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-crypto-types.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-datastores.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-hardware.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-monitoring.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-datastores.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-hardware.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ethernet-interface.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/yang.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-notifications.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-common.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-common.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ethernet-interface.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-mac-algs.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-server.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-services.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-x509-cert-to-name.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-timezones.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-datastores.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/libnetconf2-netconf-server.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-common.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-library.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-notifications.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-server.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-mac-algs.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-monitoring.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-server.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-crypto-types.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-public-key-algs.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-shell-type.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-routing.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-nmda.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-monitoring.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-truststore.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-shell-type.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-ethernet-interface.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-tls-cipher-suite-algs.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-interfaces.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-server.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv6-unicast-routing.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-lldp.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-network-instance.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ip.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/nc-notifications.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-client.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-routing.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-common.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-keystore.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1ab-lldp.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-notifications.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-client.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-origin.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-system.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-library.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-factory-default.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-timezones.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-subscribed-notifications.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-key-chain.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv4-unicast-routing.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-crypt-hash.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-encryption-algs.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-notifications.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-hardware.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-encryption-algs.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ospf.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-key-exchange-algs.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-nmda.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-timezones.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ip.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-containers.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-ethernet-interface.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-interfaces.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-origin.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/libnetconf2-netconf-server.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-push.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-nmda.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-common.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-monitoring.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ip.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-acm.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-if-type.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-common.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-dhcp-client.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-hardware.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-system.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-common.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-monitoring.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-server.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ip.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-with-defaults.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-system.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-server.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv4-unicast-routing.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ethernet-interface.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/yang.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-hardware.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-x509-cert-to-name.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-common.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-if-type.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-server.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-origin.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-key-chain.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-common.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-system.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-x509-cert-to-name.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/nc-notifications.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-keystore.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-hardware.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-common.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-containers.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-server.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-interfaces.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-server.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-key-chain.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-truststore.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-factory-default.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-if-type.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-server.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-keystore.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-routing.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-server.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-plugind.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-client.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-shell-type.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-lldp.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-mac-algs.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-interfaces.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-services.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-subscribed-notifications.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-if-type.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-factory-default.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-public-key-algs.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-if-type.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-mac-algs.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-factory-default.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-monitoring.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tls-common.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-hardware.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-dhcp-client.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-system.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-if-type.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-truststore.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-schema-mount.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-dhcp-client.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-network-instance.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-tcp-server.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ospf.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-truststore.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-crypt-hash.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-routing.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv6-unicast-routing.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/yang.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-routing.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/notifications.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ip.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/libnetconf2-netconf-server.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-schema-mount.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-factory-default.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/yang.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1ab-lldp.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-monitoring.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-key-chain.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-hardware.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ip.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-dhcp-client.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv6-unicast-routing.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-timezones.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-system.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-network-instance.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-hardware.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-ip.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv6-unicast-routing.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-services.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-origin.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-library.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ospf.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-acm.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-push.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-containers.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-encryption-algs.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-server.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-ethernet-interface.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-services.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ieee802-dot1q-types.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-origin.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-public-key-algs.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ospf.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-shell-type.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-crypt-hash.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-interfaces.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-yang-push.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/notifications.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/nc-notifications.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-server.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ospf.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-lldp.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-x509-cert-to-name.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-factory-default.factory-default f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-shell-type.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-key-exchange-algs.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-tls-cipher-suite-algs.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-system.startup f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-netconf-with-defaults.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/iana-ssh-key-exchange-algs.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-factory-default.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/infix-dhcp-client.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ipv4-unicast-routing.running.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-ssh-server.operational.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/sysrepo-plugind.candidate.perm f 660 root wheel - - - - -
|
||||
/etc/sysrepo/data/ietf-crypto-types.startup f 660 root wheel - - - - -
|
||||
endef
|
||||
|
||||
define CONFD_CLEANUP
|
||||
rm -f /dev/shm/$(NETOPEER2_SYSREPO_SHM_PREFIX)*
|
||||
endef
|
||||
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_EXTRA
|
||||
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES
|
||||
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_CLEANUP
|
||||
$(eval $(autotools-package))
|
||||
|
||||
+11
-98
@@ -148,111 +148,23 @@ if [ -n "$TESTING" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Drop all pre-initialized data from netopeer2 install, then re-create
|
||||
# with required netopeer2 models, sysrepo implicitly installs its own,
|
||||
# and then we initialize it all with our factory defaults.
|
||||
rm -rf /etc/sysrepo/* /dev/shm/sr_*
|
||||
mkdir -p /etc/sysrepo/
|
||||
if [ -f "$FACTORY_CFG" ]; then
|
||||
cp "$FACTORY_CFG" "$INIT_DATA"
|
||||
else
|
||||
cp "$FAILURE_CFG" "$INIT_DATA"
|
||||
fi
|
||||
|
||||
sysrepoctl -s $SEARCH \
|
||||
-i ietf-system@2014-08-06.yang -g wheel -p 0660 \
|
||||
-e authentication \
|
||||
-e local-users \
|
||||
-e ntp \
|
||||
-e ntp-udp-port \
|
||||
-e timezone-name \
|
||||
-i iana-timezones@2013-11-19.yang -g wheel -p 0660 \
|
||||
-i nc-notifications@2008-07-14.yang -g wheel -p 0660 \
|
||||
-i notifications@2008-07-14.yang -g wheel -p 0660 \
|
||||
-i ietf-keystore@2019-07-02.yang -g wheel -p 0660 \
|
||||
-e keystore-supported \
|
||||
-e local-definitions-supported \
|
||||
-e key-generation \
|
||||
-i ietf-truststore@2019-07-02.yang -g wheel -p 0660 \
|
||||
-e truststore-supported \
|
||||
-e x509-certificates \
|
||||
-i ietf-tcp-common@2019-07-02.yang -g wheel -p 0660 \
|
||||
-e keepalives-supported \
|
||||
-i ietf-ssh-server@2019-07-02.yang -g wheel -p 0660 \
|
||||
-e local-client-auth-supported \
|
||||
-i ietf-tls-server@2019-07-02.yang -g wheel -p 0660 \
|
||||
-e local-client-auth-supported \
|
||||
-i ietf-netconf-server@2019-07-02.yang -g wheel -p 0660 \
|
||||
-e ssh-listen \
|
||||
-e tls-listen \
|
||||
-e ssh-call-home \
|
||||
-e tls-call-home \
|
||||
-i ietf-interfaces@2018-02-20.yang -g wheel -p 0660 \
|
||||
-e if-mib \
|
||||
-i ietf-ip@2018-02-22.yang -g wheel -p 0660 \
|
||||
-e ipv6-privacy-autoconf \
|
||||
-i ietf-network-instance@2019-01-21.yang -g wheel -p 0660 \
|
||||
-i ietf-netconf-monitoring@2010-10-04.yang -g wheel -p 0660 \
|
||||
-i ietf-netconf-nmda@2019-01-07.yang -g wheel -p 0660 \
|
||||
-e origin \
|
||||
-e with-defaults \
|
||||
-i ietf-subscribed-notifications@2019-09-09.yang \
|
||||
-g wheel -p 0660 \
|
||||
-e encode-xml \
|
||||
-e replay \
|
||||
-e subtree \
|
||||
-e xpath \
|
||||
-i ietf-yang-push@2019-09-09.yang -g wheel -p 0660 \
|
||||
-e on-change \
|
||||
-i ietf-routing@2018-03-13.yang -g wheel -p 0660 \
|
||||
-i ietf-ipv6-unicast-routing@2018-03-13.yang -g wheel -p 0660 \
|
||||
-i ietf-ipv4-unicast-routing@2018-03-13.yang -g wheel -p 0660 \
|
||||
-i ietf-ospf@2022-10-19.yang -g wheel -p 0660 \
|
||||
-e bfd \
|
||||
-e explicit-router-id \
|
||||
-i iana-if-type@2023-01-26.yang -g wheel -p 0660 \
|
||||
-i iana-hardware@2018-03-13.yang -g wheel -p 0660 \
|
||||
-i ietf-hardware@2018-03-13.yang -g wheel -p 0660 \
|
||||
-e hardware-state \
|
||||
-i infix-hardware@2024-04-25.yang -g wheel -p 0660 \
|
||||
-i ieee802-dot1q-types@2022-10-29.yang -g wheel -p 0660 \
|
||||
-i infix-ip@2023-09-14.yang -g wheel -p 0660 \
|
||||
-i infix-if-type@2024-01-29.yang -g wheel -p 0660 \
|
||||
-i infix-routing@2024-03-06.yang -g wheel -p 0660 \
|
||||
-i infix-interfaces@2024-01-15.yang -g wheel -p 0660 \
|
||||
-e vlan-filtering \
|
||||
-i ieee802-dot1ab-lldp@2022-03-15.yang -g wheel -p 0660 \
|
||||
-i infix-lldp@2023-08-23.yang -g wheel -p 0660 \
|
||||
-i infix-dhcp-client@2024-04-12.yang -g wheel -p 0660 \
|
||||
-i infix-shell-type@2023-08-21.yang -g wheel -p 0660 \
|
||||
-i infix-system@2024-04-12.yang -g wheel -p 0660 \
|
||||
-i infix-services@2024-04-08.yang -g wheel -p 0660 \
|
||||
-i ieee802-ethernet-interface@2019-06-21.yang -g wheel -p 0660 \
|
||||
-i infix-ethernet-interface@2024-02-27.yang -g wheel -p 0660 \
|
||||
-I "${INIT_DATA}"
|
||||
rc=$?
|
||||
|
||||
# Unlike `sysrepoctl -i` the `-c` command requires separate invocations.
|
||||
# NOTE: we ignore any errors from these at bootstrap since sysrepo may
|
||||
# already enable some of these feature, resulting in error here.
|
||||
# Enable features required by netopeer2
|
||||
sysrepoctl -c ietf-netconf -g wheel -p 0660 \
|
||||
-e writable-running \
|
||||
-e candidate \
|
||||
-e rollback-on-error \
|
||||
-e validate \
|
||||
-e startup \
|
||||
-e url \
|
||||
-e xpath \
|
||||
-e confirmed-commit
|
||||
# Allow wheel group users (admin) to modify NACM and do factory reset
|
||||
sysrepoctl -c ietf-netconf-acm -g wheel -p 0660
|
||||
sysrepoctl -c ietf-factory-default -g wheel -p 0660
|
||||
sysrepoctl -c sysrepo-plugind -g wheel -p 0660
|
||||
sysrepoctl -z $INIT_DATA
|
||||
rc=$?
|
||||
sudo -u root -g wheel sysrepocfg -f json -I"$INIT_DATA" -d running
|
||||
rc=$?
|
||||
|
||||
# On first boot, install factory-config as startup-config. Due to a
|
||||
# limitation in sysrepo we cannot initialize ietf-netconf-acm, so we
|
||||
# cheat, see sysrepo#3079
|
||||
|
||||
#rm $INIT_DATA
|
||||
|
||||
# On first boot, install factory-config as startup-config.
|
||||
chgrp wheel /cfg
|
||||
chmod g+w /cfg
|
||||
if [ ! -f "$STARTUP_CFG" ]; then
|
||||
@@ -260,7 +172,8 @@ if [ ! -f "$STARTUP_CFG" ]; then
|
||||
fi
|
||||
|
||||
# Clear running-config so we can load startup in the next step
|
||||
echo "{}" > "$INIT_DATA"
|
||||
sysrepocfg -f json -I"$INIT_DATA" -d running
|
||||
temp=$(mktemp)
|
||||
echo "{}" > $temp
|
||||
sysrepocfg -f json -I$temp -d running
|
||||
|
||||
exit $rc
|
||||
|
||||
@@ -18,9 +18,10 @@ cat <<EOF
|
||||
"asymmetric-key": [
|
||||
{
|
||||
"name": "genkey",
|
||||
"algorithm": "rsa2048",
|
||||
"public-key-format": "ietf-crypto-types:ssh-public-key-format",
|
||||
"public-key": "$PUBKEY",
|
||||
"private-key": "$PRIVKEY",
|
||||
"private-key-format": "ietf-crypto-types:rsa-private-key-format",
|
||||
"cleartext-private-key": "$PRIVKEY",
|
||||
"certificates": {}
|
||||
}
|
||||
]
|
||||
|
||||
Executable
+183
@@ -0,0 +1,183 @@
|
||||
#!/usr/bin/env bash
|
||||
#set -x
|
||||
# env variables NP2_MODULE_DIR, NP2_MODULE_PERMS must be defined and NP2_MODULE_OWNER, NP2_MODULE_GROUP will be used if
|
||||
# defined when executing this script!
|
||||
#if [ -z "$NP2_MODULE_DIR" -o -z "$NP2_MODULE_PERMS" ]; then
|
||||
# echo "Required environment variables not defined!"
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
# optional env variable override
|
||||
if [ -n "$SYSREPOCTL_EXECUTABLE" ]; then
|
||||
SYSREPOCTL="$SYSREPOCTL_EXECUTABLE"
|
||||
# avoid problems with sudo PATH
|
||||
elif [ `id -u` -eq 0 ] && [ -n "$USER" ] && [ `command -v su` ]; then
|
||||
SYSREPOCTL=`command -v sysrepoctl -l $USER`
|
||||
else
|
||||
SYSREPOCTL=`command -v sysrepoctl`
|
||||
fi
|
||||
MODDIR=${SEARCH_PATH}
|
||||
PERMS="660"
|
||||
#OWNER=root
|
||||
#GROUP=wheel
|
||||
|
||||
# array of modules to install
|
||||
MODULES=(
|
||||
"ietf-system@2014-08-06.yang -e authentication -e local-users -e ntp -e ntp-udp-port -e timezone-name"
|
||||
"iana-timezones@2013-11-19.yang"
|
||||
"notifications@2008-07-14.yang"
|
||||
"ietf-tcp-common@2019-07-02.yang -e keepalives-supported"
|
||||
"ietf-interfaces@2018-02-20.yang -e if-mib"
|
||||
"ietf-ip@2018-02-22.yang -e ipv6-privacy-autoconf"
|
||||
"ietf-network-instance@2019-01-21.yang"
|
||||
"ietf-netconf-monitoring@2010-10-04.yang"
|
||||
"ietf-netconf-nmda@2019-01-07.yang -e origin -e with-defaults"
|
||||
"ietf-subscribed-notifications@2019-09-09.yang -e encode-xml -e replay -e subtree -e xpath"
|
||||
"ietf-yang-push@2019-09-09.yang -e on-change"
|
||||
"ietf-routing@2018-03-13.yang"
|
||||
"ietf-ipv6-unicast-routing@2018-03-13.yang"
|
||||
"ietf-ipv4-unicast-routing@2018-03-13.yang"
|
||||
"ietf-ospf@2022-10-19.yang -e bfd -e explicit-router-id"
|
||||
"iana-if-type@2023-01-26.yang"
|
||||
"iana-hardware@2018-03-13.yang"
|
||||
"ietf-hardware@2018-03-13.yang -e hardware-state"
|
||||
"infix-hardware@2024-04-25.yang"
|
||||
"ieee802-dot1q-types@2022-10-29.yang"
|
||||
"infix-ip@2023-09-14.yang"
|
||||
"infix-if-type@2024-01-29.yang"
|
||||
"infix-routing@2024-03-06.yang"
|
||||
"ieee802-dot1ab-lldp@2022-03-15.yang"
|
||||
"infix-lldp@2023-08-23.yang"
|
||||
"infix-dhcp-client@2024-04-12.yang"
|
||||
"infix-shell-type@2023-08-21.yang"
|
||||
"infix-system@2024-04-12.yang"
|
||||
"infix-services@2024-04-08.yang"
|
||||
"ieee802-ethernet-interface@2019-06-21.yang"
|
||||
"infix-ethernet-interface@2024-02-27.yang"
|
||||
"infix-factory-default@2023-06-28.yang"
|
||||
# from sysrepo
|
||||
"sysrepo-plugind@2022-08-26.yang"
|
||||
# from netopeer
|
||||
"nc-notifications@2008-07-14.yang"
|
||||
"ietf-crypto-types@2023-12-28.yang -e encrypted-private-keys"
|
||||
"ietf-netconf-server@2023-12-28.yang -e ssh-listen -e tls-listen -e ssh-call-home -e tls-call-home"
|
||||
"ietf-netconf-acm@2018-02-14.yang"
|
||||
"ietf-netconf@2013-09-29.yang -e writable-running -e candidate -e rollback-on-error -e validate -e startup -e url -e xpath -e confirmed-commit"
|
||||
"ietf-truststore@2023-12-28.yang -e central-truststore-supported -e certificates"
|
||||
"ietf-keystore@2023-12-28.yang -e central-keystore-supported -e inline-definitions-supported -e asymmetric-keys -e symmetric-keys"
|
||||
"ietf-ssh-server@2023-12-28.yang -e local-user-auth-password -e local-user-auth-publickey"
|
||||
"ietf-tls-server@2023-12-28.yang -e server-ident-raw-public-key -e server-ident-x509-cert"
|
||||
|
||||
)
|
||||
if [ -n "$USE_CONTAINERS" ]; then
|
||||
CONTAINERS=" -e containers";
|
||||
MODULES+=("infix-containers@2024-03-27.yang")
|
||||
|
||||
fi
|
||||
MODULES+=("infix-interfaces@2024-01-15.yang $CONTAINERS -e vlan-filtering")
|
||||
|
||||
CMD_INSTALL=
|
||||
|
||||
# functions
|
||||
INSTALL_MODULE_CMD() {
|
||||
if [ -z "${CMD_INSTALL}" ]; then
|
||||
CMD_INSTALL="'$SYSREPOCTL' -s $MODDIR -v2"
|
||||
fi
|
||||
CMD_INSTALL="$CMD_INSTALL -i $MODDIR/$1 -p '$PERMS'"
|
||||
if [ ! -z "${OWNER}" ]; then
|
||||
CMD_INSTALL="$CMD_INSTALL -o '$OWNER'"
|
||||
fi
|
||||
if [ ! -z "${GROUP}" ]; then
|
||||
CMD_INSTALL="$CMD_INSTALL -g '$GROUP'"
|
||||
fi
|
||||
}
|
||||
|
||||
UPDATE_MODULE() {
|
||||
CMD="'$SYSREPOCTL' -U $MODDIR/$1 -s '$MODDIR -v2"
|
||||
eval $CMD
|
||||
local rc=$?
|
||||
if [ $rc -ne 0 ]; then
|
||||
exit $rc
|
||||
fi
|
||||
}
|
||||
|
||||
CHANGE_PERMS() {
|
||||
CMD="'$SYSREPOCTL' -c $1 -p '$PERMS' -v2"
|
||||
if [ ! -z "${OWNER}" ]; then
|
||||
CMD="$CMD -o '$OWNER'"
|
||||
fi
|
||||
if [ ! -z "${GROUP}" ]; then
|
||||
CMD="$CMD -g '$GROUP'"
|
||||
fi
|
||||
eval $CMD
|
||||
local rc=$?
|
||||
if [ $rc -ne 0 ]; then
|
||||
exit $rc
|
||||
fi
|
||||
}
|
||||
|
||||
ENABLE_FEATURE() {
|
||||
"$SYSREPOCTL" -c $1 -e $2 -v2
|
||||
local rc=$?
|
||||
if [ $rc -ne 0 ]; then
|
||||
exit $rc
|
||||
fi
|
||||
}
|
||||
|
||||
# get current modules
|
||||
SCTL_MODULES=`$SYSREPOCTL -l`
|
||||
for i in "${MODULES[@]}"; do
|
||||
name=`echo "$i" | sed 's/\([^@]*\).*/\1/'`
|
||||
|
||||
SCTL_MODULE=`echo "$SCTL_MODULES" | grep "^$name \+|[^|]*| I"`
|
||||
if [ -z "$SCTL_MODULE" ]; then
|
||||
# prepare command to install module with all its features
|
||||
INSTALL_MODULE_CMD "$i"
|
||||
continue
|
||||
fi
|
||||
|
||||
sctl_revision=`echo "$SCTL_MODULE" | sed 's/[^|]*| \([^ ]*\).*/\1/'`
|
||||
revision=`echo "$i" | sed 's/[^@]*@\([^\.]*\).*/\1/'`
|
||||
if [ "$sctl_revision" \< "$revision" ]; then
|
||||
# update module without any features
|
||||
file=`echo "$i" | cut -d' ' -f 1`
|
||||
UPDATE_MODULE "$file"
|
||||
fi
|
||||
|
||||
sctl_owner=`echo "$SCTL_MODULE" | sed 's/\([^|]*|\)\{3\} \([^:]*\).*/\2/'`
|
||||
sctl_group=`echo "$SCTL_MODULE" | sed 's/\([^|]*|\)\{3\}[^:]*:\([^ ]*\).*/\2/'`
|
||||
sctl_perms=`echo "$SCTL_MODULE" | sed 's/\([^|]*|\)\{4\} \([^ ]*\).*/\2/'`
|
||||
if [ "$sctl_perms" != "$PERMS" ]; then
|
||||
# change permissions/owner
|
||||
CHANGE_PERMS "$name"
|
||||
fi
|
||||
|
||||
# parse sysrepoctl features and add extra space at the end for easier matching
|
||||
sctl_features="`echo "$SCTL_MODULE" | sed 's/\([^|]*|\)\{6\}\(.*\)/\2/'` "
|
||||
# parse features we want to enable
|
||||
features=`echo "$i" | sed 's/[^ ]* \(.*\)/\1/'`
|
||||
while [ "${features:0:3}" = "-e " ]; do
|
||||
# skip "-e "
|
||||
features=${features:3}
|
||||
# parse feature
|
||||
feature=`echo "$features" | sed 's/\([^[:space:]]*\).*/\1/'`
|
||||
|
||||
# enable feature if not already
|
||||
sctl_feature=`echo "$sctl_features" | grep " ${feature} "`
|
||||
if [ -z "$sctl_feature" ]; then
|
||||
# enable feature
|
||||
ENABLE_FEATURE $name $feature
|
||||
fi
|
||||
|
||||
# next iteration, skip this feature
|
||||
features=`echo "$features" | sed 's/[^[:space:]]* \(.*\)/\1/'`
|
||||
done
|
||||
done
|
||||
# install all the new modules
|
||||
if [ ! -z "${CMD_INSTALL}" ]; then
|
||||
eval $CMD_INSTALL
|
||||
rc=$?
|
||||
if [ $rc -ne 0 ]; then
|
||||
exit $rc
|
||||
fi
|
||||
fi
|
||||
@@ -1,34 +1,30 @@
|
||||
{
|
||||
"ietf-netconf-server:netconf-server": {
|
||||
"listen": {
|
||||
"endpoint": [
|
||||
{
|
||||
"name": "default-ssh",
|
||||
"ssh": {
|
||||
"tcp-server-parameters": {
|
||||
"local-address": "::"
|
||||
},
|
||||
"ssh-server-parameters": {
|
||||
"server-identity": {
|
||||
"host-key": [
|
||||
{
|
||||
"name": "default-key",
|
||||
"public-key": {
|
||||
"keystore-reference": "genkey"
|
||||
"endpoints": {
|
||||
"endpoint": [
|
||||
{
|
||||
"name": "default-ssh",
|
||||
"ssh": {
|
||||
"tcp-server-parameters": {
|
||||
"local-address": "::"
|
||||
},
|
||||
"ssh-server-parameters": {
|
||||
"server-identity": {
|
||||
"host-key": [
|
||||
{
|
||||
"name": "default-key",
|
||||
"public-key": {
|
||||
"central-keystore-reference": "genkey"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"client-authentication": {
|
||||
"supported-authentication-methods": {
|
||||
"publickey": [null],
|
||||
"passsword": [null]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1749,11 +1749,6 @@ err_abandon:
|
||||
int ietf_interfaces_init(struct confd *confd)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
#ifdef CONTAINERS
|
||||
sr_enable_module_feature(confd->conn, "infix-interfaces", "containers");
|
||||
#endif
|
||||
|
||||
REGISTER_CHANGE(confd->session, "ietf-interfaces", "/ietf-interfaces:interfaces//.",
|
||||
0, ifchange, confd, &confd->sub);
|
||||
REGISTER_CHANGE(confd->cand, "ietf-interfaces", "/ietf-interfaces:interfaces//.",
|
||||
|
||||
@@ -22,11 +22,6 @@
|
||||
#define ACTIVE_QUEUE "/var/lib/containers/active"
|
||||
#define LOGGER "logger -t container -p local1.notice"
|
||||
|
||||
static const struct srx_module_requirement reqs[] = {
|
||||
{ .dir = YANG_PATH_, .name = MODULE, .rev = "2024-03-27" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static int add(const char *name, struct lyd_node *cif)
|
||||
{
|
||||
const char *image = lydx_get_cattr(cif, "image");
|
||||
@@ -438,10 +433,6 @@ int infix_containers_init(struct confd *confd)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = srx_require_modules(confd->conn, reqs);
|
||||
if (rc)
|
||||
goto fail;
|
||||
|
||||
REGISTER_CHANGE(confd->session, MODULE, CFG_XPATH, 0, change, confd, &confd->sub);
|
||||
REGISTER_RPC(confd->session, CFG_XPATH "/container/start", action, NULL, &confd->sub);
|
||||
REGISTER_RPC(confd->session, CFG_XPATH "/container/stop", action, NULL, &confd->sub);
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
|
||||
#include "core.h"
|
||||
|
||||
static const struct srx_module_requirement reqs[] = {
|
||||
{ .dir = YANG_PATH_, .name = "infix-factory-default", .rev = "2023-06-28" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static int rpc(sr_session_ctx_t *session, uint32_t sub_id, const char *xpath,
|
||||
const sr_val_t *input, const size_t input_cnt, sr_event_t event,
|
||||
unsigned request_id, sr_val_t **output, size_t *output_cnt, void *priv)
|
||||
@@ -42,11 +37,6 @@ static int rpc(sr_session_ctx_t *session, uint32_t sub_id, const char *xpath,
|
||||
int infix_factory_init(struct confd *confd)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = srx_require_modules(confd->conn, reqs);
|
||||
if (rc)
|
||||
goto fail;
|
||||
|
||||
REGISTER_RPC(confd->session, "/infix-factory-default:factory-default", rpc, NULL, &confd->fsub);
|
||||
return SR_ERR_OK;
|
||||
fail:
|
||||
|
||||
@@ -43,7 +43,7 @@ struct infix_ds infix_config[] = {
|
||||
{ "running-config", "running", SR_DS_RUNNING, 1, NULL },
|
||||
{ "candidate-config", "candidate", SR_DS_CANDIDATE, 1, NULL },
|
||||
{ "operational-config", "operational", SR_DS_OPERATIONAL, 1, NULL },
|
||||
{ "factory-config", NULL, SR_DS_FACTORY_DEFAULT, 0, "/etc/factory-config.cfg" },
|
||||
{ "factory-config", "factory-default", SR_DS_FACTORY_DEFAULT, 0, NULL }
|
||||
};
|
||||
|
||||
static void cd_home(kcontext_t *ctx)
|
||||
|
||||
Reference in New Issue
Block a user