Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions board/common/busybox_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,9 @@ CONFIG_SV_DEFAULT_SERVICE_DIR=""
CONFIG_SH_IS_ASH=y
# CONFIG_SH_IS_HUSH is not set
# CONFIG_SH_IS_NONE is not set
# CONFIG_BASH_IS_ASH is not set
CONFIG_BASH_IS_ASH=y
# CONFIG_BASH_IS_HUSH is not set
CONFIG_BASH_IS_NONE=y
# CONFIG_BASH_IS_NONE is not set
CONFIG_SHELL_ASH=y
CONFIG_ASH=y
# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
Expand Down
2 changes: 0 additions & 2 deletions board/common/rootfs/etc/finit.d/available/netd.conf

This file was deleted.

1 change: 0 additions & 1 deletion board/common/rootfs/etc/finit.d/enabled/netd.conf

This file was deleted.

15 changes: 12 additions & 3 deletions board/common/rootfs/usr/bin/askline
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
#!/bin/bash
#!/bin/sh
# Prompt for a single-line value, prefilled with the current one.
#
# askline LABEL FILE
#
# FILE holds the current value on entry and the new value on exit.
# Editing the value in place needs bash, on builds where bash is ash
# the current value is shown as the default, and Enter keeps it.

LABEL=$1
FILE=$2

current=$(cat "$FILE" 2>/dev/null)
read -er -p "$LABEL> " -i "$current" value || exit 1

umask 0177

if [ -n "$(bash -c 'echo "$BASH_VERSION"' 2>/dev/null)" ]; then
exec bash -c 'read -er -p "$1> " -i "$2" value || exit 1
printf "%s" "$value" > "$3"' askline "$LABEL" "$current" "$FILE"
fi

printf '%s [%s]> ' "$LABEL" "$current"
read -r value || exit 1
[ -n "$value" ] || value=$current
printf '%s' "$value" > "$FILE"
4 changes: 1 addition & 3 deletions configs/aarch64_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/linux_defconfig"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_STRESS_NG=y
BR2_PACKAGE_JQ=y
Expand Down Expand Up @@ -63,7 +64,6 @@ BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
BR2_PACKAGE_CHRONY=y
BR2_PACKAGE_DNSMASQ=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_FRR=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
Expand All @@ -81,8 +81,6 @@ BR2_PACKAGE_SOCAT=y
BR2_PACKAGE_TCPDUMP=y
BR2_PACKAGE_WHOIS=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_BASH_COMPLETION=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_GETENT=y
BR2_PACKAGE_KMOD_TOOLS=y
Expand Down
4 changes: 1 addition & 3 deletions configs/arm_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/arm/linux_
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_STRESS_NG=y
BR2_PACKAGE_JQ=y
Expand Down Expand Up @@ -65,7 +66,6 @@ BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
BR2_PACKAGE_CHRONY=y
BR2_PACKAGE_DNSMASQ=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_FRR=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
Expand All @@ -83,8 +83,6 @@ BR2_PACKAGE_SOCAT=y
BR2_PACKAGE_TCPDUMP=y
BR2_PACKAGE_WHOIS=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_BASH_COMPLETION=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_GETENT=y
BR2_PACKAGE_KMOD_TOOLS=y
Expand Down
4 changes: 1 addition & 3 deletions configs/x86_64_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/lin
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_STRESS_NG=y
BR2_PACKAGE_JQ=y
Expand Down Expand Up @@ -62,7 +63,6 @@ BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
BR2_PACKAGE_CHRONY=y
BR2_PACKAGE_DNSMASQ=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_FRR=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
Expand All @@ -80,8 +80,6 @@ BR2_PACKAGE_SOCAT=y
BR2_PACKAGE_TCPDUMP=y
BR2_PACKAGE_WHOIS=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_BASH_COMPLETION=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_GETENT=y
BR2_PACKAGE_KMOD_TOOLS=y
Expand Down
2 changes: 2 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All notable changes to the project are documented in this file.
- Add IPv6 dynamic routing: RIPng and OSPFv3. Both reuse the existing
ietf-rip and ietf-ospf models, selected per control-plane-protocol by the
`ripng`/`ospfv3` type and the IPv6 address-family
- Support building without Frr, which also drops bash. The minimal
defconfigs are now built this way, with static routing only, issue #1670
Comment thread
troglobit marked this conversation as resolved.

[v26.09.0][] - 2026-09-30
-------------------------
Expand Down
5 changes: 5 additions & 0 deletions doc/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,11 @@ client, and IPv4 link-local (IPv4) routes, are injected into Frr to let
it weigh all routes before installing them into the kernel routing table
(sometimes referred to as FIB).

Some builds have static routing only. OSPF, RIP, and BFD are then not
Comment thread
troglobit marked this conversation as resolved.
available, and the routing YANG model does not list its `ospf`, `rip`,
and `bfd` features. Route preference still selects between routes to
the same destination, and a route with preference 255 is never used.

Routes have different weights made up from a *distance* and a *metric*.
The kernel routing table only talks about *metric*, which unfortunately
is **not the same** -- this is one of the reasons why the term *route
Expand Down
20 changes: 20 additions & 0 deletions package/confd/confd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ else
CONFD_CONF_OPTS += --disable-containers
endif

ifeq ($(BR2_PACKAGE_FRR),y)
CONFD_CONF_OPTS += --enable-frr
else
CONFD_CONF_OPTS += --disable-frr
endif

ifeq ($(BR2_PACKAGE_FEATURE_WIFI),y)
CONFD_CONF_OPTS += --enable-wifi
else
Expand Down Expand Up @@ -124,6 +130,18 @@ define CONFD_INSTALL_YANG_MODULES_CONTAINERS
$(BR2_EXTERNAL_INFIX_PATH)/utils/srload $(@D)/yang/containers.inc
endef
endif
ifeq ($(BR2_PACKAGE_PODMAN),y)
define CONFD_INSTALL_CONTAINERS
$(INSTALL) -D -m 0755 $(CONFD_PKGDIR)/container $(TARGET_DIR)/usr/sbin/container
$(INSTALL) -D -m 0644 $(CONFD_PKGDIR)/container@.conf $(FINIT_D)/available/container@.conf
endef
endif
ifeq ($(BR2_PACKAGE_FRR),y)
define CONFD_INSTALL_YANG_MODULES_FRR
$(COMMON_SYSREPO_ENV) \
$(BR2_EXTERNAL_INFIX_PATH)/utils/srload $(@D)/yang/frr.inc
endef
endif
ifeq ($(BR2_PACKAGE_FEATURE_WIFI),y)
define CONFD_INSTALL_YANG_MODULES_WIFI
$(COMMON_SYSREPO_ENV) \
Expand Down Expand Up @@ -179,6 +197,8 @@ CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_NETCONF_SERVER
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_NETCONF_SERVER
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_CONTAINERS
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_CONTAINERS
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_FRR
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_WIFI
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_GPS
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_WEBUI
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions package/netd/netd.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#set DEBUG=1
service <pid/confd> name:netd log \
[2345] netd -p /run/netd.pid -- Network route daemon
service [2345] <pid/confd> name:netd netd -- Network route daemon
10 changes: 10 additions & 0 deletions package/netd/netd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ else
NETD_CONF_OPTS += --without-frr
endif

# With an FRR backend netd feeds staticd, so it must not start before it
ifeq ($(BR2_PACKAGE_NETD_LINUX),y)
NETD_CONDITION = <pid/confd>
else
NETD_CONDITION = <pid/confd,pid/staticd>
endif

define NETD_INSTALL_EXTRA
cp $(NETD_PKGDIR)/tmpfiles.conf $(TARGET_DIR)/etc/tmpfiles.d/netd.conf
cp $(NETD_PKGDIR)/netd.conf $(FINIT_D)/available/netd.conf
$(SED) 's|<pid/confd>|$(NETD_CONDITION)|' $(FINIT_D)/available/netd.conf
ln -sf ../available/netd.conf $(FINIT_D)/enabled/netd.conf
endef

NETD_TARGET_FINALIZE_HOOKS += NETD_INSTALL_EXTRA
Expand Down
14 changes: 13 additions & 1 deletion package/skeleton-init-finit/skeleton-init-finit.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ endef
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_SET_DROPBEAR
endif

SKELETON_INIT_FINIT_FRR_DAEMONS = \
babeld bfdd bgpd mgmtd eigrpd isisd ldpd ospfd ospf6d pathd \
ripd ripngd staticd vrrpd zebra

ifeq ($(BR2_PACKAGE_FRR),y)
ifeq ($(BR2_PACKAGE_NETD_FRR_CONF),y)
define SKELETON_INIT_FINIT_SET_FRR
Expand All @@ -92,7 +96,7 @@ define SKELETON_INIT_FINIT_SET_FRR
endef
else
define SKELETON_INIT_FINIT_SET_FRR
for svc in babeld bfdd bgpd mgmtd eigrpd isisd ldpd ospfd ospf6d pathd ripd ripngd staticd vrrpd zebra; do \
for svc in $(SKELETON_INIT_FINIT_FRR_DAEMONS); do \
cp $(SKELETON_INIT_FINIT_AVAILABLE)/frr/$$svc.conf $(FINIT_D)/available/$$svc.conf; \
done
ln -sf ../available/zebra.conf $(FINIT_D)/enabled/zebra.conf
Expand All @@ -114,6 +118,14 @@ endef
endif
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_SET_FRR_MGMTD_GRPC

else # !BR2_PACKAGE_FRR
# The skeleton is copied wholesale, drop the FRR bits from a build without it
define SKELETON_INIT_FINIT_UNSET_FRR
rm -rf $(TARGET_DIR)/etc/frr $(FINIT_D)/available/frr
rm -f $(addprefix $(TARGET_DIR)/etc/default/,$(SKELETON_INIT_FINIT_FRR_DAEMONS))
rm -f $(TARGET_DIR)/usr/lib/tmpfiles.d/frr.conf
endef
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_UNSET_FRR
endif # BR2_PACKAGE_FRR

ifeq ($(BR2_PACKAGE_INADYN),y)
Expand Down
6 changes: 6 additions & 0 deletions package/statd/statd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ else
STATD_CONF_OPTS += --disable-containers
endif

ifeq ($(BR2_PACKAGE_FRR),y)
STATD_CONF_OPTS += --enable-frr
else
STATD_CONF_OPTS += --disable-frr
endif

define STATD_BUILD_PYTHON
cd $(STATD_SITE)/python && \
$(PKG_PYTHON_PEP517_ENV) $(HOST_DIR)/bin/python3 $(PKG_PYTHON_PEP517_BUILD_CMD) -o $(@D)/python/dist
Expand Down
34 changes: 23 additions & 11 deletions src/bin/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,21 @@ static void sysrepo_print_error(sr_session_ctx_t *sess)
warnx("%s (%d)", msg, erri->err->err_code);
}

/*
* The NACM subscription has a listener thread that refers to the
* session and connection, so it must go first, before NACM itself.
*/
static void sysrepo_exit(sr_subscription_ctx_t *sub, sr_session_ctx_t *sess)
{
sr_conn_ctx_t *conn = sr_session_get_connection(sess);

if (sub)
sr_unsubscribe(sub);
sr_nacm_destroy();
sr_session_stop(sess);
sr_disconnect(conn);
}

/* Connect to sysrepo and create NACM-aware session on running datastore */
static int sysrepo_init(sr_conn_ctx_t **conn, sr_session_ctx_t **sess,
sr_subscription_ctx_t **sub)
Expand Down Expand Up @@ -352,8 +367,12 @@ static int sysrepo_init(sr_conn_ctx_t **conn, sr_session_ctx_t **sess,
return SR_ERR_OK;
fail:
sysrepo_print_error(*sess);
sr_session_stop(*sess);
sr_disconnect(*conn);
if (*sess)
sysrepo_exit(*sub, *sess);
else
sr_disconnect(*conn);
*sess = NULL;
*sub = NULL;

return err;
}
Expand All @@ -369,9 +388,7 @@ static sr_session_ctx_t *sysrepo_session(const struct infix_ds *ds)
if (!sess)
return NULL;

conn = sr_session_get_connection(sess);
sr_session_stop(sess);
sr_disconnect(conn);
sysrepo_exit(sub, sess);
sess = NULL;
sub = NULL;
return NULL;
Expand Down Expand Up @@ -1037,12 +1054,7 @@ static int rpc_exec(const char *rpc_xpath, int argc, char *argv[])
cleanup:
sr_free_values(input, icnt);
sr_free_values(output, ocnt);
if (sub)
sr_nacm_destroy();
if (sess)
sr_session_stop(sess);
if (conn)
sr_disconnect(conn);
sysrepo_exit(sub, sess);

return rc;
}
Expand Down
8 changes: 8 additions & 0 deletions src/confd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ AC_ARG_ENABLE(containers,
AS_HELP_STRING([--enable-containers], [Enable support for containers]),,[
enable_containers=no])

AC_ARG_ENABLE(frr,
AS_HELP_STRING([--enable-frr], [Enable dynamic routing (OSPF, RIP, BFD) with FRR]),,[
enable_frr=no])

AC_ARG_ENABLE(wifi,
AS_HELP_STRING([--enable-wifi], [Enable support for Wi-Fi]),,[
enable_wifi=no])
Expand Down Expand Up @@ -84,6 +88,9 @@ AC_ARG_WITH(crypt,
AS_IF([test "x$enable_containers" = "xyes"], [
AC_DEFINE(CONTAINERS, 1, [Built with container support])])

AS_IF([test "x$enable_frr" = "xyes"], [
AC_DEFINE(HAVE_FRR, 1, [Built with FRR dynamic routing support])])

AS_IF([test "x$enable_wifi" = "xyes"], [
AC_DEFINE(HAVE_WIFI, 1, [Built with Wi-Fi support])])

Expand Down Expand Up @@ -190,6 +197,7 @@ cat <<EOF

Optional features:
Container support ....: $enable_containers
FRR routing support ..: $enable_frr
Wi-Fi support ........: $enable_wifi
GPS support ..........: $enable_gps
SNMP support .........: $enable_snmp
Expand Down
Loading
Loading