Skip to content

Commit 5998119

Browse files
bird3: add new bird3 package
This commit introduces the `bird3` package to OpenWrt's routing feed. The package is primarily based on the existing `bird2` package, with minor modifications to accommodate the updates and changes in BIRD 3.0.0. I have also added myself as the maintainer for this package. BIRD 3.0.0 is a major release that brings multithreading support, enabling better performance for protocols like BGP, BMP, RPKI, and others. The internal rework has introduced significant changes to the table and channel implementations, while protocol-level functionality remains largely consistent with BIRD 2.16. Although there are minor breaking changes in configuration and CLI, most existing setups should be reusable. Memory usage has increased in this version, with improvements planned for subsequent releases. Migration documentation is available in `doc/migration-bird3.md` from the official BIRD repository. For more details, see the official announcement: https://trubka.network.cz/pipermail/bird-users/2024-December/017973.html Signed-off-by: Nick Hainke <[email protected]>
1 parent 478626b commit 5998119

File tree

3 files changed

+151
-0
lines changed

3 files changed

+151
-0
lines changed

bird3/Makefile

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
3+
include $(TOPDIR)/rules.mk
4+
5+
PKG_NAME:=bird3
6+
PKG_VERSION:=3.0.0
7+
PKG_RELEASE:=1
8+
9+
PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz
10+
PKG_SOURCE_URL:=https://bird.network.cz/download/
11+
PKG_HASH:=8130440a2e273ba6456df2fb3acb43da7cb4d566f94a294a3a52a1b118f2512a
12+
13+
PKG_MAINTAINER:=Toke Høiland-Jørgensen <[email protected]>, Nick Hainke <[email protected]>
14+
PKG_LICENSE:=GPL-2.0-or-later
15+
16+
PKG_BUILD_DEPENDS:=ncurses readline
17+
PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION)
18+
19+
include $(INCLUDE_DIR)/package.mk
20+
21+
define Package/bird3/Default/description
22+
BIRD is an internet routing daemon which manages TCP/IP routing tables
23+
with support of modern routing protocols, easy to use configuration
24+
interface and powerful route filtering language. It is lightweight and
25+
efficient and therefore appropriate for small embedded routers.
26+
27+
endef
28+
29+
define Package/bird3
30+
TITLE:=The BIRD Internet Routing Daemon (v3)
31+
URL:=http://bird.network.cz/
32+
SECTION:=net
33+
CATEGORY:=Network
34+
SUBMENU:=Routing and Redirection
35+
DEPENDS:=+libpthread +libatomic
36+
CONFLICTS:=bird2
37+
endef
38+
39+
define Package/bird3c
40+
TITLE:=The BIRD command-line client (v3)
41+
URL:=http://bird.network.cz/
42+
SECTION:=net
43+
CATEGORY:=Network
44+
SUBMENU:=Routing and Redirection
45+
DEPENDS:=+bird3 +libreadline +libncurses
46+
CONFLICTS:=bird2
47+
endef
48+
49+
define Package/bird3cl
50+
TITLE:=The BIRD lightweight command-line client (v2)
51+
URL:=http://bird.network.cz/
52+
SECTION:=net
53+
CATEGORY:=Network
54+
SUBMENU:=Routing and Redirection
55+
DEPENDS:=+bird3
56+
CONFLICTS:=bird2
57+
endef
58+
59+
define Package/bird3/description
60+
$(call Package/bird3/Default/description)
61+
62+
BIRD supports OSPFv2, RIPv2, Babel and BGP protocols for IPv4 and
63+
OSPFv3, RIPng, Babel and BGP protocols for IPv6.
64+
65+
In BGP, BIRD supports communities, multiprotocol extensions, MD5
66+
authentication, 32bit AS numbers and could act as a route server or a
67+
route reflector. BIRD also supports multiple RIBs, multiple kernel
68+
routing tables and redistribution between the protocols with a powerful
69+
configuration syntax.
70+
71+
This is the 3.0 branch of Bird which is a multithreaded rewrite.
72+
endef
73+
74+
define Package/bird3c/description
75+
$(call Package/bird3/Default/description)
76+
77+
This is a BIRD command-line client. It is used to send commands to BIRD,
78+
commands can perform simple actions such as enabling/disabling of
79+
protocols, telling BIRD to show various information, telling it to show
80+
a routing table filtered by a filter, or asking BIRD to reconfigure.
81+
82+
Unless you can't afford dependency on ncurses and readline, you
83+
should install BIRD command-line client together with BIRD.
84+
endef
85+
86+
define Package/bird3cl/description
87+
$(call Package/bird3/Default/description)
88+
89+
This is a BIRD lightweight command-line client. It is used to send commands
90+
to BIRD, commands can perform simple actions such as enabling/disabling of
91+
protocols, telling BIRD to show various information, telling it to show
92+
a routing table filtered by a filter, or asking BIRD to reconfigure.
93+
endef
94+
95+
CONFIGURE_ARGS += --disable-libssh
96+
TARGET_LDFLAGS += -latomic
97+
98+
define Package/bird3/conffiles
99+
/etc/bird.conf
100+
/etc/bird4.conf
101+
/etc/bird6.conf
102+
endef
103+
104+
define Package/bird3/install
105+
$(INSTALL_DIR) $(1)/usr/sbin
106+
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bird $(1)/usr/sbin/
107+
$(INSTALL_DIR) $(1)/etc
108+
$(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/bird.conf.example $(1)/etc/bird.conf
109+
$(INSTALL_DIR) $(1)/etc/init.d
110+
$(INSTALL_BIN) ./files/bird.init $(1)/etc/init.d/bird
111+
endef
112+
113+
define Package/bird3c/install
114+
$(INSTALL_DIR) $(1)/usr/sbin
115+
$(INSTALL_BIN) $(PKG_BUILD_DIR)/birdc $(1)/usr/sbin/
116+
endef
117+
118+
define Package/bird3cl/install
119+
$(INSTALL_DIR) $(1)/usr/sbin
120+
$(INSTALL_BIN) $(PKG_BUILD_DIR)/birdcl $(1)/usr/sbin/
121+
endef
122+
123+
$(eval $(call BuildPackage,bird3))
124+
$(eval $(call BuildPackage,bird3c))
125+
$(eval $(call BuildPackage,bird3cl))

bird3/files/bird.init

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh /etc/rc.common
2+
# Copyright (C) 2010-2017 OpenWrt.org
3+
4+
USE_PROCD=1
5+
START=70
6+
STOP=10
7+
8+
BIRD_BIN="/usr/sbin/bird"
9+
BIRD_CONF="/etc/bird.conf"
10+
BIRD_PID_FILE="/var/run/bird.pid"
11+
12+
start_service() {
13+
mkdir -p /var/run
14+
procd_open_instance
15+
procd_set_param command $BIRD_BIN -f -c $BIRD_CONF -P $BIRD_PID_FILE
16+
procd_set_param file "$BIRD_CONF"
17+
procd_set_param stdout 1
18+
procd_set_param stderr 1
19+
procd_set_param respawn
20+
procd_close_instance
21+
}
22+
23+
reload_service() {
24+
procd_send_signal bird
25+
}

bird3/test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bird --version 2>&1 | grep "$PKG_VERSION"

0 commit comments

Comments
 (0)