Files
makronix/docs/OFFLINE-BUILD.md
lotherk 5619071f98 docs: the media carry the signed package list
Measured 2026-11-16: make release && make iso exit 0; the DVD and CD 3 have
pkg_summary.gz.sig, and the summary extracted from the DVD verifies through
the root key -> release key chain.
2026-11-16 12:03:51 +00:00

7.4 KiB

Rebuilding Makronix without a network

What the source set is, where it lands, and what is and is not proven.

The set

make sourcesets writes one set, RELEASEDIR/source/sets/src.tgz:

set unpacks to what
src /usr/src the whole repository: src/, xsrc/, ext/, pkgsrc/ (the pinned checkout), mobile/, www/, docs/, tools/, the root files, packages.list, PINS, distfiles.lst, and distfiles/ (only the archives of the Makronix packages)

There is no second tree and no second set: xsrc/ is part of the repository, and /usr/msrc is gone. The set comes from NetBSD's makesrctars (-m, src/distrib/sets/makesrctars) and is assembled by tools/srctree-stage.sh, which copies git's file list of the root repository and of pkgsrc/ from the working tree. It carries the files a rebuild needs, not the history: no .git anywhere, no build/, and of refs/ only refs/AGENTS.md (the reference checkouts are not build inputs). tools/makronix-pins.sh check compares PINS with the repositories.

The set is one .tgz (makesrctars). It has its own DVD: make isosrc writes RELEASEDIR/images/Makronix-<version>-amd64-source.iso with source/sets/src.tgz, MD5, SHA512 and a README that names the commands (tools/cd-source.sh). The set is 5.8 GB and one ISO 9660 file cannot be that large (the size field is 32 bits); makefs truncated it at 4 GB (measured 2026-11-15: the installer's gzip saw a 1.5 GB file and stopped with "unexpected end of file"). The DVD therefore carries src.tgz.aa, .ab, ... in parts of 2 GiB; sysinst cats them and the README names the command for a running system. (UDF would hold the single file, but NetBSD's UDF rejected the makefs image with EINVAL, measured 2026-11-16.)

The install DVD and the CDs do not carry the sources. The installer asks for the source DVD when the chosen profile includes the sources (the full profile) and the disc in the drive is not it; the sources unpack to /usr/src.

Which distfiles

Only the archives of the Makronix packages: packages.list names the packages that go into the makronix set, tools/makronix-distfiles.sh list derives the closure (bmake show-depends-recursive) and writes distfiles.lst with size and SHA512 from each package's distinfo; fetch fills build/distfiles with exactly those (what the shared distfiles directory has with the right hash, the rest by bmake fetch); check verifies them. The shared directory of the development machine is not the source: it holds every package ever built there, in several versions.

The list is a superset: it is evaluated on the build host (Linux for the cross build), and it includes packages that the base system satisfies.

What to do on the installed system

# as root; the set is unpacked by sysinst or with tar -xzpf -C /
cd /usr/src
export MAKRONIX_TOP=/usr/src

tools/pkgsrc-cross.mk.conf takes its paths from MAKRONIX_TOP and uses distfiles/ when it exists. git needs safe.directory for trees owned by root:wsrc when used by another user.

What is proven, what is not

See the end of this file; the measurements are in build/logs/.

(filled in by the tests: nothing below this line is a claim until it names a log)

Measured 2026-11-16: the source DVD installs

  • make isosrc writes the source DVD as ISO 9660 with the set in parts (source/sets/src.tgz.aa, .ab, .ac: 2 GiB, 2 GiB, 1.5 GiB), and source/sets/SHA512.sig next to the hashes.
  • The signature is a chain: /etc/signify/makronix-root.pub signs /etc/signify/makronix-0.99.pub (.pub.sig), the release key signs SHA512 (tools/sign-release.sh). Measured 2026-11-16: the SHA512 extracted from the source DVD verifies through the chain, and tools/upgrade-verify.sh build/obj/releasedir/source/sets src.tgz checks the chain and the 5.8 GB file's SHA512.
  • The install DVD and the package CDs carry pkg_summary.gz.sig next to the package list (make iso signs it, tools/cd3.sh copies it). Measured 2026-11-16: make release && make iso exit 0, and the summary extracted from the DVD verifies through the chain.
  • tools/install-simple.sh -S (BIOS, the full profile): the installer asks for the source DVD, the disc is swapped in, the parts are extracted to /usr/src, the install DVD comes back for the makronix set, and the installed system passes /usr/src holds the tree, /usr/src has PINS and pkgsrc, all 1569 Makronix distfiles are in /usr/src/distfiles (build/logs/install-simple-source-2026-11-16h.log). The run exits 1 on dbus and cupsd not enabled/running, which the source set does not touch.

Measured 2026-11-15: the one source set

  • tools/srctree-stage.sh build/srctree: 462655 entries, 11 GB, 214 patch names in pkgsrc-longnames.cpio; no .git, no build/.
  • make sourcesets (32 min): distfiles.lst verified against the recipes (2010 archives, 0 missing, 0 with a wrong hash) and RELEASEDIR/source/sets/src.tgz written, 5.5 GB; size and hashes are in build/logs/sourcesets-2026-11-15.log and RELEASEDIR/source/sets/SHA512. The target removed the sets of the old layout before it wrote.
  • Not a single-layer DVD: 5.5 GB needs a dual-layer DVD (8.5 GB), and it has that medium for itself (the install media carry no sources). The old split sets were 5.6 GB together, so this is not bigger than before.
  • Not proven: an installation from this set and make release inside it (that is tasksd t0050).

Measured 2026-11-07

  • The DVD made by make isosrc installs /usr/src and /usr/msrc (with PINS, pkgsrc, and all 71 distfiles of distfiles.lst); PINS names the overlay base of the tree it was made from: build/logs/install-src-cd13-2026-11-07.log (all checks PASS). This was measured with the split sets (src, gnusrc, syssrc, sharesrc, msrc); since 2026-11-15 there is one /usr/src and no /usr/msrc (above).
  • Not proven yet: that a system installed this way rebuilds itself with no network. That is done in the build VM (see docs/BUILD-VM.md).

Measured 2026-11-07: NetBSD builds itself on Makronix

In the build VM (docs/BUILD-VM.md), installed from the DVD with sources, as the user tester (member of wsrc), from /usr/src as installed:

./build.sh -U -j 8 -m amd64 -O ~/obj -T ~/tools -x tools distribution

tools and distribution built from the sources on the disk: 2 h 02 min (Build started 08:28:57, finished 10:31:23, 8 CPUs, KVM; the pkgsrc bootstrap and the build of git-base ran in the same VM for part of that time), log in the VM, /home/tester/log/build2.log. The build then stopped in checkflist, and only there: 10825 files of ./usr/pkg missing in DESTDIR. That is the file list of the makronix set, whose packages were not in the build's DESTDIR. Not a defect of the sources, a missing step of the recipe: a self-build has to put the userland into DESTDIR first (what make release on the host gets from tools/userland.sh / tools/makronix-set.sh). Not done yet: that step for the VM, and release after it.

Things this run found in the set, now fixed in the tree: makesrctars gave every file mode 0664 (pkgsrc's bootstrap was not executable: patch 0010), two empty build directories and a Makefile.orig of ours were inside src/ and made cleandir fail for a user who may not remove them, and the user made by sysinst was not in wsrc, the owner group of the trees.