Skip to content

stable/4.1: add mport package installation to DVD images - #504

Merged
laffer1 merged 1 commit into
stable/4.1from
stable41-bsdinstall-mport-packages
Sep 5, 2026
Merged

stable/4.1: add mport package installation to DVD images#504
laffer1 merged 1 commit into
stable/4.1from
stable41-bsdinstall-mport-packages

Conversation

@laffer1

@laffer1 laffer1 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • stage a verified dependency closure from a blessed mport repository on dvd1.iso while retaining the full repository index
  • add a bsdinstall package menu for curated DVD packages and full-catalog network searches
  • install selections with mport, seed /var/db/mport/index.db, and mount installation media at /packages
  • use the canonical /usr/mports path throughout the affected release tooling
  • document release configuration and keep future system package support out of the application-package path

This is a clean cherry-pick of the package-media commit from #503. The kmod.mk correction included in that master PR is already present on stable/4.1 through merged PR #502, so it is not duplicated here.

Validation

  • sh -n on all modified shell scripts
  • git diff --check
  • bmake -C release -V MPORT_REPOSITORY -V DVD_PACKAGE_ROOTS
  • bmake -C usr.sbin/bsdinstall/scripts
  • synthetic blessed-index test covering dependency cycles, missing dependencies, empty descriptions, package subset staging, and system-package exclusion
  • mandoc -Tlint usr.sbin/bsdinstall/bsdinstall.8 reports only existing diagnostics outside the new text

A complete dvd1.iso build and installer boot test were not run.

Provenance

Cherry-picked from master feature commit f692cda.

AI contribution checklist

  • Human maintainer has manually reviewed every AI-assisted change
  • No proprietary or copyleft code was introduced
  • Final maintainer style review completed

AI-Assisted-by: OpenAI Codex (GPT-5)

Summary by Sourcery

Stage verified application packages on DVD installation media and integrate mport-based package selection into bsdinstall.

New Features:

  • Add mport package staging to DVD images with the complete blessed repository index and the verified dependency closure for curated application packages.
  • Add a bsdinstall package menu for installing curated DVD packages and searching the full catalog for network-available applications.

Enhancements:

  • Use mport for package installation and seed the target system's mport index while keeping system-package installation separate from the application package workflow.
  • Standardize release tooling on /usr/mports and expose configurable package repository and DVD package selections.

Documentation:

  • Document blessed repository requirements, DVD package staging, installer behavior, configuration, and the scope of future system-package support.

Stage a verified package dependency closure and the full blessed mport index on DVD images. Add a bsdinstall package menu that installs curated or searched packages into the target with mport and seeds its repository index.

AI-Assisted-by: OpenAI Codex (GPT-5)
Signed-off-by: Lucas Holt <luke@foolishgames.com>
Copilot AI lite review requested due to automatic review settings September 5, 2026 16:18
@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR adds a verified, size-bounded mport package subset to dvd1.iso while retaining the full repository catalog, then connects that media to a new bsdinstall package workflow supporting curated offline installs and searchable network packages. Release configuration and tooling are updated for blessed repositories, dependency closure validation, /packages mounting, and the canonical /usr/mports path.

Sequence diagram for bsdinstall package installation

sequenceDiagram
    actor User
    participant Installer as bsdinstall packages
    participant Media as DVD /packages
    participant Target as Target system
    participant Mport as mport
    participant Network as Repository mirrors

    User->>Installer: Select curated or searched package
    Installer->>Media: Read index.db and package catalog
    Installer->>Target: Copy index.db to /var/db/mport/index.db
    Installer->>Mport: mport -U -c BSDINSTALL_CHROOT install -y package-name
    Mport->>Media: Locate bundled package and dependencies
    alt Bundle is not on DVD
        Mport->>Network: Download package
    end
    Mport-->>Target: Install package and automatic dependencies
Loading

Flow diagram for verified DVD package staging

flowchart LR
    Repo[Blessed mport repository] --> Index[index.db]
    Roots[DVD_PACKAGE_ROOTS] --> Closure[Dependency closure]
    Index --> Closure
    Closure --> Verify[Verify bundles and SHA-256 hashes]
    Verify --> Media[dvd1.iso /packages]
    Index --> Media
    Media --> Catalog[installer.tsv and catalog.tsv]
Loading

File-Level Changes

Change Details Files
Replace legacy pkg-based DVD staging with verified, dependency-aware mport media staging.
  • Add configurable blessed repository and curated package-root settings.
  • Resolve recursive dependency closures from SQLite index data, including cycle handling and deduplication.
  • Validate package names, types, uniqueness, bundle paths, file presence, and SHA-256 hashes before copying.
  • Preserve the complete repository index and generate installer/catalog metadata while copying only selected bundles.
  • Restrict package payload staging to dvd1.iso and honor NOPKG behavior.
release/Makefile
release/packages.md
release/release.conf.sample
release/scripts/pkg-stage.sh
Integrate the staged package repository into bsdinstall for offline and network-assisted application installation.
  • Add a packages menu with curated DVD selections and searchable application catalog results.
  • Mount installation media at /packages and unmount it during cleanup.
  • Seed /var/db/mport/index.db when needed and invoke mport install with the target chroot and media repository available.
  • Distinguish DVD-present packages from network-only packages and report failed network installations without aborting base installation.
  • Keep system-package entries excluded from the application workflow.
usr.sbin/bsdinstall/bsdinstall.8
usr.sbin/bsdinstall/scripts/Makefile
usr.sbin/bsdinstall/scripts/auto
usr.sbin/bsdinstall/scripts/mount
usr.sbin/bsdinstall/scripts/packages
usr.sbin/bsdinstall/scripts/umount
Standardize release tooling on the canonical /usr/mports tree and mport command path.
  • Update chroot synchronization, package fallback installation, embedded package builds, and GCE fetch logic.
  • Rename temporary mports build paths and revise related comments.
release/release.sh
release/tools/gce.conf

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It contains correctness issues in release tooling/media staging (e.g., GCE still expecting ports.txz and pkg-stage not enforcing application-only deps) that can break intended DVD/GCE behaviors.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds support for installing selected third-party mport application packages during installation when building dvd1.iso, by staging a curated subset of a blessed mport repository on the DVD (while retaining the full index) and integrating a new bsdinstall packages workflow. It also standardizes release tooling on the canonical /usr/mports path and documents the release configuration and intended separation from future system-package support.

Changes:

  • Add a new bsdinstall packages screen that installs curated/DVD-available packages and supports full-catalog searching with network fallback.
  • Stage a verified dependency closure from a blessed mport repository onto DVD media under /packages, including index seeding into the target.
  • Update release tooling and documentation to use /usr/mports, and add release.conf knobs for MPORT_REPOSITORY and DVD_PACKAGE_ROOTS.
File summaries
File Description
usr.sbin/bsdinstall/scripts/umount Unmount and clean up the target /packages mountpoint.
usr.sbin/bsdinstall/scripts/packages New installer workflow for curated/package-catalog selection and installation via mport.
usr.sbin/bsdinstall/scripts/mount Mount DVD /packages into the target chroot at the mport media path.
usr.sbin/bsdinstall/scripts/Makefile Install the new packages script as part of bsdinstall.
usr.sbin/bsdinstall/scripts/auto Invoke the packages workflow when media package metadata is present; add Final Configuration menu entry.
usr.sbin/bsdinstall/bsdinstall.8 Document the new bsdinstall packages subcommand.
release/tools/gce.conf Adjust GCE image source-fetch path to /usr/mports.
release/scripts/pkg-stage.sh Replace pkg(8) staging with blessed-index + SHA256-verified mport bundle staging under /packages.
release/release.sh Add MPORT_REPOSITORY / DVD_PACKAGE_ROOTS wiring and switch chroot mports usage.
release/release.conf.sample Document new release knobs and /usr/mports chroot layout.
release/packages.md New documentation for the DVD package staging and installer behavior.
release/Makefile Add MPORT_REPOSITORY / DVD_PACKAGE_ROOTS variables and run pkg staging for dvd1 via pkg-stage target.
Review details

Suppressed comments (1)

usr.sbin/bsdinstall/scripts/packages:174

  • In the search flow, if the selected package cannot be mapped back to a bundle (e.g., truncated results file, malformed TSV), install_package will fail valid_bundle and exit silently. This should show a dialog error and return to the menu.
	[ "$result" -eq 0 ] || return 0
	bundle=$(awk -F "$TAB" -v name="$choice" '$1 == name { print $4; exit }' "$results")
	install_package "$choice" "$bundle"
  • Files reviewed: 12/12 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread release/tools/gce.conf
Comment on lines 103 to +107
tar fxJ ${DESTDIR}/../ftp/ports.txz -C ${DESTDIR}
_INSTALLED_PACKAGES=$(chroot ${DESTDIR} pkg info -o -q -a)
for PACKAGE in ${_INSTALLED_PACKAGES}; do
chroot ${DESTDIR} \
make -C /usr/ports/${PACKAGE} fetch
make -C /usr/mports/${PACKAGE} fetch
Comment thread release/release.sh
WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \
WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}"
if [ -n "${MPORT_REPOSITORY}" ]; then
RELEASE_RMAKEFLAGS="${RELEASE_RMAKEFLAGS} MPORT_REPOSITORY=${MPORT_REPOSITORY}"
Comment on lines +96 to +105
count=$(sqlite3 -readonly "$INDEX" \
"SELECT count(*) FROM packages WHERE pkg='$pkg' AND version='$version';")
[ "$count" -eq 1 ] ||
fail "dependency '$pkg-$version' has $count matching index entries"

row=$(sqlite3 -readonly -noheader -tabs "$INDEX" \
"SELECT bundlefile, hash FROM packages WHERE pkg='$pkg' AND version='$version';")
bundle=${row%%"$TAB"*}
hash=${row#*"$TAB"}
case "$bundle" in
Comment on lines +122 to +125
while IFS= read -r pkg; do
bundle=$(awk -F "$TAB" -v name="$pkg" '$1 == name { print $4; exit }' "$CATALOG")
install_package "$pkg" "$bundle"
done < "$selection"

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@laffer1
laffer1 merged commit 85f6a86 into stable/4.1 Sep 5, 2026
6 of 7 checks passed
@laffer1
laffer1 deleted the stable41-bsdinstall-mport-packages branch September 5, 2026 23:55
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.

2 participants