Upstream has done this, but in a different way. Instead of including an ancient and patched copy of libbb, opkg now links against libarchive.
The rest of this page is kept only for reference and historical purposes.
opkg includes and is statically linked with a copy of libbb, BusyBox's helper library. Of course, BusyBox is also linked against its own copy of libbb. This is a bad idea in general, since duplicated code makes maintenance more difficult and is often subject to bit rot (resulting in long-standing bugs and security problems). It's an even larger problem (no pun intended) in embedded systems, where saving space is important.
The Good News
libbb can be built as a shared library by setting the CONFIG_BUILD_LIBBUSYBOX
option to y
in BusyBox's configuration. So, we can make libbusybox.N
and
libbusybox.N-dev
binary packages that provide this shared library and its
header files, modify opkg to dynamically link against this library (instead of
statically linking against its own copy), and add dependency information to the
opkg
source package and its binary packages.
The Bad News
The copy of libbb in opkg hasn't been updated from its upstream source since at least 2008, when opkg development began from the old ipkg sources. Three months later, an attempt was made by Koen Kooi to update the copy of libbb, but it was determined that BusyBox had changed significantly since the code was added to ipkg. Things have most likely gotten much worse in the more than three years since then.
To make matters slightly worse, many of the libbb files have been patched in opkg. Any files in /trunk/libbb newer than revision 3 have opkg modifications.
The Plan
- Build a shared libbusybox library and set of binary packages.
- Port opkg to work with more recent versions of BusyBox's shared library.
- Modify opkg to dynamically link against libbusybox.
- Add
Build-Depends
andDepends
fields to theopkg
source package. - Investigate API and ABI stability of libbusybox. This may require coordination with BusyBox developers.
- Look at each patch in opkg against libbb. If it's still useful in newer
versions, then refresh it, apply it to the
busybox
source package, and forward it upstream to BusyBox.