Files
makronix/docs/UPDATING.md
T
lotherkandClaude Sonnet 5.5 e1ac51a187 docs: what an update checks before it runs as root, and what is open (t0078)
docs/reference/update-verification.txt: no signify in the base tree, sysupgrade
and makesums verify nothing, none of 264 NetBSD packages is signed, pkg_install's
X.509/OpenPGP verification and how to sign.  UPDATING.md: the section, with the
decisions that are Konrad's named as open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:15:06 +00:00

5.8 KiB

Updating a Makronix system

Written 2026-11-07. What is set up, what is only a plan, and what is not measured. Nothing here has been run on an installed system over time.

2026-11-09: xsrc removed, X from pkgsrc

xsrc/ is gone; X11_TYPE=modular, and Xorg comes from pkgsrc. An existing build tree keeps the old X files in build/obj/destdir.<arch>; checkflist then reports 10.324 extra files under /usr/X11R7, /usr/libdata/debug/usr/X11R7, /etc/X11, /etc/fonts, /etc/drirc, /etc/rc.d/{fccache,xdm,xfs} and /var/db/obsolete/x*. Remove those from the destdir (or start from a clean build/obj) before the first release without xsrc (build/logs/make-release-2026-11-09-xsrc-gone.log:67521).

Packages

  • Where they come from. The installer writes /etc/pkg_install.conf with PKG_PATH (the NetBSD project's binary repository for the release the packages of the media come from, PKG_REPOSITORY in src/usr.sbin/sysinst/setup.c) and CHECK_OS_VERSION=no (the packages are built for NetBSD 11.0, Makronix is 11.99.9: pkg_add would warn about every one). So pkg_add firefox and pkg_add -u work as on any NetBSD.
  • Security. The installer sets fetch_pkg_vulnerabilities=YES in /etc/daily.conf. daily(8) then fetches the vulnerability list (etc/daily:267-275) and security(8) runs pkg_admin audit (etc/security:1096); the report goes to root's mail. That is NetBSD's own mechanism, nothing of ours.
  • What is ours. The makronix set (CDE, vim, flex, git and what they need) is unpacked by sysinst without a package database: pkg_add -u does not update those files, pkg_info does not list them. They change with the next release of Makronix. The extra programs (Firefox, Thunderbird, QEMU) are installed with pkg_add and are registered: those do update.
  • Not measured: pkg_add -u on an installed system, the repository URL after the quarter changes (2026Q4), and what happens when a package of the repository overwrites a file of the makronix set (the install of the extra programs did not conflict, docs/BUILD-VM.md).

The base system

  • A new release comes as new media (make release, make iso); sysinst's "Upgrade NetBSD on a hard disk" unpacks the sets over the system and the administrator runs postinstall and etcupdate as the NetBSD documentation describes (src/usr.sbin/postinstall, src/usr.sbin/etcupdate).
  • Not measured: an upgrade of a Makronix system by sysinst, with or without the makronix set, with the three CDs (the Next-CD menu is in the install path only).
  • On the build VM, make install puts a new build over a running Makronix (installworld).

An encrypted system: the gap

An encrypted installation (cgdroot.c) has a small boot partition, cgd.conf (FFS), with the kernel, cgdroot.kmod, boot.cfg and cgd.conf; the boot loader reads it before the disk is unlocked. /cgdboot in fstab is that partition (noauto). The kernel the system runs from comes from the copy on that partition, not from /netbsd of the root file system.

So a kernel update on an encrypted system is not complete until the new netbsd (and the cgdroot.kmod of the same release) are copied to the boot partition:

mount /cgdboot
cp /netbsd /cgdboot/netbsd
(cp the cgdroot.kmod of the new release to /cgdboot)
umount /cgdboot

This is the procedure by hand, not measured, and nothing does it for the user. sysinst's upgrade path does not unlock a cgd root at all. What is missing, in order of need:

  1. a script on the system that does the copy above (and keeps the old kernel as netbsd.old for the loader's menu), run after every kernel install;
  2. sysinst's upgrade for a cgd root: ask for the passphrase, bring up cgd0, mount, upgrade, and do step 1;
  3. a test: install, upgrade, boot, with the log in build/logs/.

The update source, and what is checked (2026-11-14, tasksd t0078)

The software update of System Settings (mcde_sys_update_apply, McdeSys) runs as root: sysupgrade auto URL for the base system, then pkg_add -uu for the packages. URL is the first line of /etc/makronix/update. Read in the sources (docs/reference/update-verification.txt):

  • Nothing verifies the sets. sysupgrade-1.5 fetches with ftp and unpacks with tar -xp; makesums writes MD5 and SHA512 files, no signature. signify is not in the NetBSD base tree (pkgsrc has it).
  • The NetBSD binary packages are not signed. None of the 264 downloaded from the NetBSD CDN has a +PKG_HASH or signature member, so VERIFIED_INSTALLATION=always (X.509 or OpenPGP, pkg_install.conf(5)) cannot be switched on for them as they are.
  • What is enforced now: only a directory, file:///DIR or https://HOST/DIR is used (mcde_sys_update_source_ok, ext/src/mcde/lib/McdeSys/common.c, test test_updatesource in make check). http://, ftp://, ssh:// and anything with a blank, quote, $, ? or & is refused, and the check does not even contact it. An https:// source is protected by TLS only; a file:/// source is as trusted as its medium.
  • Not decided (Konrad): who holds a signing key (never in the repository or a log); signify as a package of the makronix set, or what the base has, for the sets; and whether the packages we ship are signed with our own X.509 key (pkg_admin x509-sign-package) or the NetBSD ones stay on TLS plus the size check of tools/pkg-binaries.sh. Until then the update does not verify a signature: the check above only closes http://.

A different route, not decided

sysutils/sysupgrade (pkgsrc) upgrades a NetBSD system in place from the project's binary sets. It would not know the makronix set. Whether Makronix ships its own sysupgrade or relies on media is open.