libink: a message bus is not a peer

libink was written against the only bus it had, its own, where the
peer on the other end is the client.  A broker is not: it routes for
senders it names itself, expects a DESTINATION on anything addressed
through it, and answers on its own schedule rather than next.

Runlevels go on the wire as S and N rather than the digits Finit
keeps internally, since that is what a caller outside Finit means by
one.

The library stays a convenience library, linked into finit and
initctl and installed nowhere: the ABI promise waits until libink is
its own project.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-08-13 09:28:26 +02:00
1 parent 6310d9e760
commit b55dada80b
16 files changed
+340 -250

No files matched your search

+4 -35
View File
@@ -2,41 +2,17 @@
set -eu
echo "=== Finit Test Sysroot Setup ==="
echo "Date: $(date)"
echo "SYSROOT: $SYSROOT"
echo "top_builddir: $top_builddir"
echo "srcdir: $srcdir"
echo "================================"
echo
# shellcheck disable=SC2154
make -C "$top_builddir" DESTDIR="$SYSROOT" install
mkdir -p "$SYSROOT/sbin/"
cp "$top_builddir/test/src/serv" "$SYSROOT/sbin/"
# Prefer the real ELF in .libs/ over the libtool wrapper script --
# since the test client links libink.la, libtool wraps the top-level
# dbus-auth-client as a shell script that re-execs the real binary
# via its own RPATH, which falls apart inside the test namespace.
if [ -x "$top_builddir/test/src/.libs/dbus-auth-client" ]; then
cp "$top_builddir/test/src/.libs/dbus-auth-client" "$SYSROOT/sbin/"
elif [ -x "$top_builddir/test/src/dbus-auth-client" ]; then
cp "$top_builddir/test/src/dbus-auth-client" "$SYSROOT/sbin/"
if [ -x "$top_builddir/test/src/dbus-auth-client" ]; then
cp "$top_builddir/test/src/dbus-auth-client" "$SYSROOT/sbin/"
fi
# shellcheck disable=SC2154
# Prefer the real ELF in .libs/ over the libtool wrapper script at
# $top_builddir/src/finit. Libtool generates a shell wrapper when
# the binary depends on an in-tree convenience library (e.g. libink),
# and `ldd <wrapper>` returns "not a dynamic executable", which
# silently makes sysroot.mk copy zero host libs into the sysroot.
if [ -f "$top_builddir/src/.libs/finit" ]; then
finitbin_for_ldd="$(pwd)/$top_builddir/src/.libs/finit"
else
finitbin_for_ldd="$(pwd)/$top_builddir/src/finit"
fi
FINITBIN="$finitbin_for_ldd" DEST="$SYSROOT" make -f "$srcdir/lib/sysroot.mk"
FINITBIN="$(pwd)/$top_builddir/src/finit" DEST="$SYSROOT" make -f "$srcdir/lib/sysroot.mk"
# Drop plugins we don't need in test, only causes confusing FAIL in logs.
for plugin in tty.so urandom.so rtc.so modprobe.so; do
@@ -50,11 +26,4 @@ for conf in 10-hotplug.conf; do
done
# Update dynamic linker cache for /usr/local/lib libraries
echo "Running ldconfig in sysroot: $SYSROOT"
echo "Contents of $SYSROOT/etc/ld.so.conf:"
cat "$SYSROOT/etc/ld.so.conf" || echo "Warning: ld.so.conf not found"
echo "Libraries in $SYSROOT/usr/local/lib:"
ls -la "$SYSROOT/usr/local/lib/" 2>/dev/null || echo "Warning: /usr/local/lib not found in sysroot"
ldconfig -v -r "$SYSROOT" || echo "Warning: ldconfig failed with exit code $?"
echo "Verifying ldconfig cache was created:"
ls -la "$SYSROOT/etc/ld.so.cache" || echo "Warning: ld.so.cache not created"
ldconfig -r "$SYSROOT" || echo "Warning: ldconfig failed with exit code $?"