stable/4.1: add mport package installation to DVD images - #504
Conversation
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>
Reviewer's GuideThe 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 installationsequenceDiagram
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
Flow diagram for verified DVD package stagingflowchart 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]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 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 packagesscreen 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 forMPORT_REPOSITORYandDVD_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_packagewill failvalid_bundleand 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.
| 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 |
| 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}" |
| 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 |
| 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" |
Summary
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
A complete dvd1.iso build and installer boot test were not run.
Provenance
Cherry-picked from master feature commit f692cda.
AI contribution checklist
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:
Enhancements:
Documentation: