FreeBSD – The Good, The Bad, and The Ugly

Background: FreeBSD and pkg

  • Baptiste Daroussin has used FreeBSD since 1998 and became a committer in 2010.
  • His involvement grew from desktop use and experimenting with large ports such as OpenOffice.
  • He began developing pkgng, which later became FreeBSD’s modern pkg package manager.
  • Initially inspired by NetBSD’s pkgin, he and Julien Laffaye created a new package manager after encountering limitations in the existing tooling.
  • Poudriere was developed alongside pkg to rapidly build packages and test the package manager.

pkg: 15 Years Later

  • Daroussin did not expect to still be working on pkg 15 years later.
  • He says many of his original ideas remain unfinished.
  • Package management has become much more complex than simply extracting files:
    • Upgrades and dependency handling require sophisticated logic.
    • pkg uses a SAT solver for dependency resolution.
    • This complexity makes it difficult for new developers to contribute.

Security Improvements

Daroussin is particularly focused on reducing the security risks of package installation scripts.

  • Traditional packages can contain scripts that execute as root.
  • Newer mechanisms include centrally reviewable triggers.
  • Lua-based package scripts can run sandboxed using Capsicum.
  • His long-term goal is to prevent package-provided scripts from executing unrestricted as root altogether.

Challenges Attracting Contributors

  • Although eight people can merge changes into pkg, relatively few actively do so.
  • The codebase is more complicated than it initially appears.
  • Another obstacle is the absence of a clearly documented long-term roadmap.
  • Contributors may hesitate to make architectural changes because they are unsure whether those changes align with Daroussin’s plans.
  • Despite this, he says pkg still attracts more contributors than some other FreeBSD subsystems.

PkgBase: A Decade-Long Project

PkgBase aims to distribute and manage parts of the FreeBSD base system using packages rather than the traditional monolithic update/install model.

  • Daroussin was already advocating PkgBase around BSDCan 2015.
  • The main obstacle was not package-manager technology but a lack of sustained effort and motivation.
  • Momentum increased more recently because:
    • OCI developers wanted small FreeBSD container images.
    • Developers including Ed Maste, Kyle Evans, Mark Johnston, Lexi, and manu@ contributed significant work.
    • Commercial requirements also provided funding and practical motivation.

Why Large FreeBSD Changes Take So Long

Daroussin sees FreeBSD’s predominantly volunteer structure as the fundamental difficulty for major system-wide projects.

  • Large changes require coordination across many parts of FreeBSD.
  • Companies have previously developed PkgBase-like systems for their own requirements, but often lacked the resources to complete full upstream integration.
  • Commercial sponsorship can provide initial momentum, but business priorities can change before the work is finished.
  • Major infrastructure projects therefore often depend on a small number of highly motivated individuals carrying them through.

Key takeaway

The evolution of pkg and PkgBase illustrates a broader FreeBSD challenge: the technical solution may exist years before enough sustained developer effort, coordination, and commercial motivation align to deploy it across the entire operating system.

,

Leave a comment

Discover more from /root

Subscribe now to keep reading and get access to the full archive.

Continue reading