Skip to content

Build a minimal Debian image with mmdebstrap instead of live-build - #10

Merged
dodolia907 merged 18 commits into
mainfrom
debian-minimal
Nov 28, 2026
Merged

dodolia907 merged 18 commits into
mainfrom
debian-minimal

Conversation

@dodolia907

@dodolia907 dodolia907 commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Replace the live-build system with a minimal Debian (trixie) image built with mmdebstrap. A rebuild with no changes now takes about 6 minutes; live-build took about 30.

What changes

  • Build
    • make build runs in a builder container (build/Containerfile). The host needs only podman or docker, make and git.
    • Each application is rebuilt only when its source changes.
    • The apt, cargo, Go and npm caches are kept in cache/.
  • Images
    • out/utone-linux.img is a GPT disk image: systemd-boot, a read-only ext4 root and a 1 GiB utone-data partition for settings. A .bmap file is written next to it.
    • out/utone-linux.iso is a hybrid UEFI ISO: a squashfs root with a RAM overlay.
  • System
    • At boot, utone-init overlays /etc, /home and /var/lib onto utone-data.
    • The hostname is utone- plus the last 6 hex digits of the MAC address.
    • There is no default password; SSH accepts the empty password.
    • The NDI runtime is bundled.
  • Applications
    • The submodules move to apps/.
    • booth-display is updated to 1.1.2 and dmxctl to the latest main.
  • CI
    • .github/workflows/builder-image.yml publishes the builder image to GHCR, tagged with the hash of the Containerfile.
    • make pulls that image and builds it locally if the pull fails.
  • Releases (port of ci: build the ISO and the qcow2 image, and publish them on a tag #7 to the new build)
    • make release puts the release files in out/release: utone-linux.img.xz, .img.bmap, .iso, .qcow2 and SHA256SUMS.
    • The disk image is compressed with xz because 2.56 GB is over GitHub's limit of 2 GiB per file; compressed, it is 490 MB.
    • .github/workflows/build-image.yml: a v* tag runs make build, make test and make release, then publishes to TechnoTUT/utone-linux-releases (secret RELEASES_TOKEN). Pull requests that change the build, and manual runs, build and test only.
  • Removed: live-build (work/) and the devcontainer.
  • Docs: the README files (English and Japanese) are rewritten.

Fixes found while testing on KVM

  • chown -R cleared the setuid bit of sudo, so sudo did not work.
  • ping did not work for the user. Fixed with ping_group_range.
  • After hostnamectl set-hostname, sudo warned that it could not resolve the hostname. Fixed with libnss-myhostname.
  • The ISO did not boot:
    • The initramfs had no busybox, so it could not mount the squashfs.
    • The boot script used seq, which the initramfs does not have.
    • The fstab entry for / made systemd-remount-fs fail on the ISO.
  • dmxctl was marked as failed when it was stopped (it exits with 130).
  • The NDI discovery server address was out of date. It is now 10.12.230.254, as documented in TechnoTUT/Infra.

Test plan

Run on KVM (QEMU q35 with OVMF):

  • make test
    • img: login prompt after 9.0 s, including the UEFI firmware.
    • iso: login prompt after 12.4 s.
    • Both show the hostname utone-123456 and no failed units.
  • img over SSH (empty password)
    • systemctl is-system-running reports running.
    • sudo works and ping works.
    • / is read-only ext4, /data is ext4, and the overlays are mounted.
    • libndi.so.6 is found by the dynamic linker.
    • Boot takes 5.7 s (systemd-analyze).
  • Services
    • moip-web (:8000) and booth (:8080) answer HTTP 200, and moip-web loads the NDI runtime 6.4.
    • dmxctl and moip-rx each start on KMS/DRM (bochs).
    • moip-tx exits because the VM has no capture device, which is expected.
  • Persistence: the hostname, a file in the home directory and an enabled service are kept across a reboot. rm -rf /data/overlay brings back the initial state.
  • ISO over SSH: the root is an overlay, /data is a tmpfs, sudo works and moip-web answers.
  • NDI between two VMs on a private LAN
    • VM A sent the built-in color bars (moip tx -d -1, 1280x720 at 30 fps).
    • VM B found UTONE-990001 (TX) with moip discover and showed it with moip-rx on KMS/DRM.
    • The discovery server was disabled for this test (no server on that LAN), so the sources were found with mDNS.
    • A multicast route to the LAN was needed because each VM also has a management NIC that holds the default route. A machine with one NIC does not need it.
  • make release: all files are under 2 GiB. bmaptool copy of the .img.xz with the .bmap gives a disk identical to the .img.
  • The workflows have not run yet. Actions jobs on this repository are not starting because of the account's billing or spending limit.
  • Real hardware: display output, NDI send and receive, capture devices, DMX.

After merging

🤖 Generated with Claude Code

dodolia907 and others added 18 commits November 28, 2026 00:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build/Containerfile has the toolchains (Rust, Go, Node.js) and the image
tools. build-apps.sh builds moip-toolkit, booth-display and dmxctl into
out/apps and fetches the NDI runtime; an application is rebuilt only when
its source changed, and the cargo, Go and npm caches are kept in cache/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces live-build. The root file system is made from the minbase variant
with only the run-time packages, and assembled into:

- out/utone-linux.img: EFI partition with systemd-boot (no menu), read-only
  root and the utone-data partition, mounted by utone-init on /data with
  overlays on /etc, /home and /var/lib
- out/utone-linux.iso: the same root as squashfs with a RAM overlay, booted
  by an initramfs-tools script (boot=utone)

The utone user has no password, the hostname comes from the MAC address,
the services are system units configured in /etc/default, and SSH host
keys are created on the first boot. Debian packages are cached in cache/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checks that the image reaches the login prompt with the MAC-derived
hostname and that no unit failed, and prints the time it took.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make pulls ghcr.io/technotut/utone-linux-builder tagged with the hash of
build/Containerfile and builds it locally only when that tag is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The live-build configuration, its hooks and the Dev Container are replaced
by build/, rootfs/ and initramfs/. The README describes the disk image,
the ISO, the services and the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chown -R on /etc and /usr cleared the setuid bit of sudo, su and passwd and
the shadow group of /etc/shadow, so sudo did not work. Copy the repository
files without their ownership instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ping has no file capability in the image, so allow unprivileged ICMP sockets
with net.ipv4.ping_group_range. With libnss-myhostname the hostname resolves
after it is changed with hostnamectl, so sudo no longer warns that it cannot
resolve it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dmxctl exits with 130 on stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The initramfs had only the klibc tools, whose mount cannot loop-mount the
  squashfs: install busybox, which initramfs-tools then uses, and load loop.
- The boot script used seq, which the initramfs does not have.
- Remove the / entry from fstab: the kernel already mounts the root read-only,
  and the ext4 entry made systemd-remount-fs fail on the ISO's overlay root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The discovery server of the TechnoTUT network is 10.12.230.254
(ndi.svc.technotut.net), as documented in TechnoTUT/Infra; the image still had
10.11.230.254. Document the address, and how to use mDNS on other networks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There is no desktop session in the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The disk image is compressed with xz: at 2.56 GB it is over GitHub's limit of
2 GiB per release file (xz -6: 490 MB). balenaEtcher, Rufus and bmaptool write
the .img.xz as it is. Also the bmap, the ISO, the qcow2 and SHA256SUMS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of #7 to the new build: a v* tag runs make build, make test (QEMU/KVM)
and make release, and attaches the files to a release of the private
TechnoTUT/utone-linux-releases (secret RELEASES_TOKEN). Pull requests that
change the build and manual runs build and test without publishing. The
builder image is pulled from GHCR with the workflow's token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dodolia907
dodolia907 merged commit c277566 into main Nov 28, 2026
1 of 2 checks passed
@dodolia907
dodolia907 deleted the debian-minimal branch November 30, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant