Page MenuHomeFreeBSD

freebsd-update: Library ordering
ClosedPublic

Authored by cperciva on Sep 23 2025, 7:01 AM.
Tags
None
Referenced Files
F141839353: D52688.diff
Sun, Jan 11, 5:28 AM
Unknown Object (File)
Fri, Dec 19, 6:44 AM
Unknown Object (File)
Mon, Dec 15, 1:13 PM
Unknown Object (File)
Sat, Dec 13, 1:14 PM
Unknown Object (File)
Dec 9 2025, 2:15 AM
Unknown Object (File)
Dec 9 2025, 1:01 AM
Unknown Object (File)
Dec 6 2025, 12:57 PM
Unknown Object (File)
Dec 4 2025, 12:09 PM
Subscribers

Details

Summary

Upgrading from 14.x to 15.x with freebsd-update broke because libc
depends on the new libsys library; freebsd-update installed the new
libc before creating libsys, and every step after that failed because
all the tools (including gunzip and install) are dynamically linked
and need a working libc.

Enforce ordering when installing shared objects: First libsys, then
libc, then libthr, and then all the rest of the shared object files.

This is a candidate for an Errata Notice since is breaks upgrades.

MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Thanks.

Tested with:

  1. the VirtualBox guest snapshot that I used for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289769#c0, the standard set of base components, on UFS
  1. a fresh installation of 14.3-RELEASE, the full set, on ZFS.

Both completed without error.

usr.sbin/freebsd-update/freebsd-update.sh
3118
3123
3128
3135

BTW, did you ever run shell-check over freebsd-update?

This revision is now accepted and ready to land.Sep 23 2025, 8:54 PM
In D52688#1203807, @kib wrote:

BTW, did you ever run shell-check over freebsd-update?

Not until now. I don't think shellcheck even existed when I first wrote freebsd-update.

On first glance, lots of complaints about not quoting things but I don't see anything which actually matters.

This revision was automatically updated to reflect the committed changes.