Skip to content

A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.

feat(hostbridge): build and install podroid-hostd into the rootfs

ExTvaff061caed75
diff --git a/build-rootfs/Dockerfile.rootfs b/build-rootfs/Dockerfile.rootfs
index 6f7fa00..107e7c2 100644
--- a/build-rootfs/Dockerfile.rootfs
+++ b/build-rootfs/Dockerfile.rootfs
@@ -7,6 +7,8 @@ RUN apk add --no-cache musl-dev gcc make linux-headers
WORKDIR /work
COPY vsock-agent /work/vsock-agent
RUN cd /work/vsock-agent && make CC=gcc
+COPY host-bridge /work/host-bridge
+RUN cd /work/host-bridge && make CC=gcc
# ── Stage 2: build the Alpine rootfs squashfs ───────────────────────────────
FROM alpine:3.23 AS builder
@@ -25,6 +27,7 @@ RUN curl -L -o minirootfs.tar.gz \
# Pull in the vsock-agent binary built in stage 1.
COPY --from=vsock-builder /work/vsock-agent/podroid-vsock-agent /work/rootfs/usr/local/bin/podroid-vsock-agent
+COPY --from=vsock-builder /work/host-bridge/podroid-hostd /work/rootfs/usr/local/bin/podroid-hostd
ENV ALPINE_VERSION=${ALPINE_RELEASE}
COPY files /work/files
diff --git a/build-rootfs/build-rootfs.sh b/build-rootfs/build-rootfs.sh
index 3db542d..a8b772a 100755
--- a/build-rootfs/build-rootfs.sh
+++ b/build-rootfs/build-rootfs.sh
@@ -103,6 +103,7 @@ cp /work/files/etc/init.d/podroid-resize "$ROOTFS/etc/init.d/"
cp /work/files/etc/init.d/podroid-ready "$ROOTFS/etc/init.d/"
cp /work/files/etc/init.d/podroid-x11 "$ROOTFS/etc/init.d/"
cp /work/files/etc/init.d/podroid-vsock "$ROOTFS/etc/init.d/"
+cp /work/files/etc/init.d/podroid-hostd "$ROOTFS/etc/init.d/"
chmod +x "$ROOTFS/etc/init.d/podroid-"*
# Copy /usr/local/bin scripts (resize daemon + login wrapper + getty selector)
@@ -114,6 +115,11 @@ cp /work/files/usr/local/bin/podroid-getty "$ROOTFS/usr/local/bin/"
# sure it's executable (cross-arch COPY can lose the mode bit on some buildkit
# versions).
chmod +x "$ROOTFS/usr/local/bin/podroid-vsock-agent" 2>/dev/null || true
+# podroid-hostd is also COPY'd from the vsock-builder stage; same mode-bit guard.
+# The CLIs are argv[0]-dispatch symlinks onto the one multi-call binary.
+chmod +x "$ROOTFS/usr/local/bin/podroid-hostd" 2>/dev/null || true
+ln -sf podroid-hostd "$ROOTFS/usr/local/bin/podroid-notify"
+ln -sf podroid-hostd "$ROOTFS/usr/local/bin/podroid-forward"
chmod +x "$ROOTFS/usr/local/bin/podroid-"*
mkdir -p "$ROOTFS/etc/conf.d"
cp /work/files/etc/conf.d/podroid "$ROOTFS/etc/conf.d/"
@@ -165,7 +171,7 @@ mkdir -p "$ROOTFS/etc/runlevels/default" "$ROOTFS/etc/runlevels/boot"
# Guard each link: a dangling symlink (e.g. dnsmasq.lxcbr0, which lxc-bridge
# may ship only as dnsmasq config and not an init script) makes OpenRC log
# an error every boot and stalls podroid-ready's `after *` on a phantom.
-for svc in podroid-bootstrap podroid-network podroid-resize dropbear docker lxc dnsmasq.lxcbr0 podroid-x11 podroid-vsock podroid-ready; do
+for svc in podroid-bootstrap podroid-network podroid-resize dropbear docker lxc dnsmasq.lxcbr0 podroid-x11 podroid-vsock podroid-hostd podroid-ready; do
if [ -e "$ROOTFS/etc/init.d/$svc" ]; then
ln -sf "/etc/init.d/$svc" "$ROOTFS/etc/runlevels/default/$svc"
else