Files
firmware/docker
Oleksandr ShyshatskyiandClaude Opus 5 dcd037c250 The build host has no reason to imitate a package manager
pkgs/ipk-install is POSIX sh because the PRINTER has no opkg and no ar --
measured, and its header says so. Neither is true in the build container, and
the imitation is missing exactly the parts that decide what a payload should
contain: it resolves no Depends, enforces no Conflicts, reads no Provides and
handles no conffiles. Assembling a payload with it means arguing that the
result matches what opkg would have done.

pkg_buildopkg builds an x86-64 opkg from the same pinned tarball the mipsel
one is built from, cached at work/.opkg-host, shaped as pkg_buildpython's twin
so that "build a host tool from the pinned source" means one thing here.
ipk-install keeps its job -- repairing a printer by hand -- and comes off the
build path.

Two things this build gets wrong if written the obvious way, both now checked
rather than commented:

  --prefix must be $MODDIR. opkg bakes its state directory in at compile time
  (libopkg/Makefile.am: -DVARDIR="@localstatedir@"), so a host opkg built
  --prefix=/usr/local keeps its database somewhere the printer never reads and
  says nothing about it. The prefix is a literal string in the binary, so the
  question is put to the file.

  --disable-shared is not a size decision. The prefix is baked into the
  LIBRARY too, so a shared build produces a bin/opkg looking for libopkg.so.1
  at a path that exists on the printer and not here.

libarchive-dev is Debian's, deliberately: opkg's configure.ac requires
libarchive, and this opkg is a build tool that never leaves the container. The
same call is already made for the gcc that builds the build-python.

Measured against the built feed: installs into an --offline-root with the
database at $MODDIR/var/lib/opkg, and refuses the two chamber configs together
(exit 255) on the Conflicts field ipk-install cannot read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 21:13:26 +03:00
..