bird3: add protocol-specific build variants and Config.in#1173
bird3: add protocol-specific build variants and Config.in#1173PolynomialDivision wants to merge 1 commit intoopenwrt:masterfrom
Conversation
|
Cool idea! Got any numbers on how much space this actually saves for the different variants compared to the full package? :) |
|
The idea originates from @pktpls from freifunk berlin repository: There are also size comparisons. |
|
I don't think it's a good practice for the upstream repository (OpenWrt in this case) to simply rely on a link to a downstream commit for more context, such as package size differences. All relevant information should be included directly in the commit message you are trying to merge here. Furthermore, the linked downstream commit doesn't even seem to contain the size breakdown for the individual packages anyway as you did. While splitting the packages sounds like a good idea in theory, it seems we would be the only GNU/Linux distribution doing it this way. Because of that, I wonder if saving a few kilobytes is actually worth it. It will likely cause confusion for users, so I am strongly in favor of making this configurable via Config.in. |
Bird's binary size is dominated by compiled-in routing protocols.
This adds size-optimized package variants built with --with-protocols
so users on flash-constrained devices can install only what they need
without recompiling.
New packages:
- bird3-bgp: BGP, RPKI, BFD + infrastructure (mrt, pipe, static)
- bird3-ospf: OSPF, BFD + infrastructure
- bird3-babel: Babel + infrastructure
- bird3-mesh: Babel, BGP + infrastructure, for mesh networks using
BGP-based overlay services (e.g. hostname distribution
via bgpdisco)
All variants PROVIDE:=bird3 so existing DEPENDS:=+bird3 continue to
work. They conflict with each other since all install /usr/sbin/bird.
For users building from source, Config.in adds per-protocol checkboxes
under the bird3 menu in menuconfig. Protocols default to enabled to
preserve existing behaviour, builders on tight flash budgets can
uncheck what they do not need. PKG_CONFIG_DEPENDS ensures bird3 is
rebuilt when the selection changes.
Signed-off-by: Nick Hainke <vincent@systemli.org>
26bc96c to
a40e07d
Compare
|
OpenWrt is not a general purpose GNU/Linux distro. It is designed specifically for embedded routers with as little as 8 to 32 MB of flash, where saving around 200 KB in a binary can still matter, even if the final squashfs image reduction is much smaller. The BUILD_VARIANT mechanism exists in OpenWrt specifically for this kind of use case and is already widely used across both the core packages and the various feeds. I will measure the size differences and include them in the commit message. |
Bird's binary size is dominated by compiled-in routing protocols. This adds size-optimized package variants built with --with-protocols so users on flash-constrained devices can install only what they need without recompiling.
New packages:
networks using BGP-based overlay services (e.g. hostname
distribution via bgpdisco)
All variants PROVIDE:=bird3 so existing DEPENDS:=+bird3 continue to work. They conflict with each other since all install /usr/sbin/bird.
For users building from source, Config.in adds per-protocol checkboxes under the bird3 menu in menuconfig. Protocols default to enabled to preserve existing behaviour, builders on tight flash budgets can uncheck what they do not need. PKG_CONFIG_DEPENDS ensures bird3 is rebuilt when the selection changes.
Maintainer: me, @tohojo
Compile tested: tbd
Run tested: tbd