Commit graph

519 commits

Author SHA1 Message Date
Colin Percival
d2b670b27f pkgbase-stage: Use unique PKG_DBDIR
Prior to this commit, pkgbase-stage.lua used a hard-coded PKG_DBDIR
"./pkgdb"; unfortunately this creates a race condition if we start
building disc1.iso and dvd1.iso at the same time

  pkg: sqlite error while executing CREATE TABLE licenses [...]
  in file pkgdb.c:2330: table licenses already exists

since pkg checks to see if the pkgdb is initialized and initializes
it if not.

Use separate pkgdb-disc1 and pkgdb-dvd directories.

MFC after:	1 minute
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D52755

(cherry picked from commit 523fece9d11e5d084c1d20d10d05971f5354d343)
2025-09-26 21:09:37 -07:00
Lexi Winter
b1187b5a12 release: Improve kernel package handling
Although support for PowerPC kernels (GENERIC64 and GENERIC64LE) was
added to pkgbase-stage.lua, the equivalent support was missing from
bsdinstall, so the installer would fail at runtime since it wouldn't
find a kernel package.

Improve the pkgbase-stage logic to have a specific list of kernels
we want to support (which avoids breaking if multiple kernels are
available), and use the same logic in both bsdinstall and pkgbase-stage.

MFC after:	1 day
Reviewed by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D52638

(cherry picked from commit 3f5385beeacf49d0edb563ccc712841bcfd6b158)
2025-09-25 02:00:41 +01:00
Lexi Winter
3608d730ad pkgbase-stage.lua: Add pkg package to the offline repo
We need a pkg package on the media so we can install it for offline
installations; copy this package from the staging repository to the
pkgbase offline repository on the media.

MFC after:	1 day
Reviewed by:	ifreund_freebsdfoundation.org, cperciva
Differential Revision:	https://reviews.freebsd.org/D52636

(cherry picked from commit 5bb96dab061af5f44e6090831f1b2724196828b8)
2025-09-25 02:00:41 +01:00
Lexi Winter
46a4ee6e6e Makefile.inc1: Fix package-pkg with a non-default LOCALBASE
package-pkg (via make-pkg-package.sh) passes CONFIGURE_ARGS to make when
building ports-mgmt/pkg, which overrides the port's default configure
args that are supposed to set --prefix.  This means that pkg is always
built with the default prefix of /usr/local, which then fails when ports
tries to package it from LOCALBASE.

Work around this by explicitly adding --prefix to CONFIGURE_ARGS.

MFC after:	1 day
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D52634

(cherry picked from commit f259daa708f507d3ff450d2eb8c05065674339ec)
2025-09-25 02:00:41 +01:00
Colin Percival
9183529955 release: More fixes for building pkg package
* Ignore "wrong major" errors when obtaining WRKDIR.
* Put distfiles in /tmp in case /usr/ports is read-only.

MFC after:	6 hours
Sponsored by:	https://www.patreon.com/cperciva

(cherry picked from commit 088e21000507510a2c3b1ec22684fe9665f6c8a7)
2025-09-20 06:50:56 -07:00
Colin Percival
9c56bf2d1f release: Allow pkg build on "wrong" major
While we usually build FreeBSD releases on the same major version, we
do need to be able to e.g. build 15 on 16.  Tell the ports tree that
we know what we're doing.  (We don't, not really, but we can at least
pretend...)

MFC after:	6 hours
Sponsored by:	https://www.patreon.com/cperciva

(cherry picked from commit 5918b4866a9689b50180da42aad6d742466b0d1b)
2025-09-20 06:50:56 -07:00
Colin Percival
33f8c98c92 Include a pkg package in the pkgbase repo
It is essential that users be able to install the FreeBSD base system
from release media and have all the bits needed to update the FreeBSD
base system without touching the ports tree or pkg.freebsd.org.  To
that end, resurrect (and heavily rewrite) the make-pkg-package.sh
script and hook it into the create-packages target; if /usr/ports
exists when building pkgbase packages, we'll also (cross)build pkg
and include it in the repository.

Scripting for actually installing this package as part of the FreeBSD
installation process to come later, but I wanted this in the tree in
time to test it in this week's snapshots.

MFC after:	1 day
Sponsored by:	https://www.patreon.com/cperciva
2025-09-20 06:50:55 -07:00
Dave Cottlehuber
48578fbefa release: Add images for almost all packages, with & without toolchain
Contains almost everything of use in a container except:

- *lib32
- *dev
- *dbg
- *src
- anything expecting hardware such as device config tools

Differential Revision:	https://reviews.freebsd.org/D51471

Reviewed by:	dfr, emaste
Approved by:	cperciva
MFC after:	1 day
Sponsored by:	SkunkWerks, GmbH

(cherry picked from commit 7295620108834090187cb9b429dbd664a7ab953d)
2025-09-19 11:47:10 +00:00
Isaac Freund
2bf7d850c5 release: use sets to select base packages
The introduction of package sets allows us to replace the current
fragile string matching with this simpler and more robust alternative.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 seconds
Reviewed by:	emaste, ivy
Differential Revision:	https://reviews.freebsd.org/D52592

(cherry picked from commit 6cdca18d79b9e247d8a34e266fe2215e4bfa1b05)
2025-09-19 02:18:42 +01:00
Colin Percival
da62a299de release: Pass ABI to pkgbase-stage.lua
We then pass ABI from pkgbase-stage.lua to pkg(8); without this,
cross-building releases with PKGBASE enabled fails with

pkg: wrong architecture: ...
pkg: repository FreeBSD-base contains packages with wrong ABI: ...

MFC after:	1 minute
Discussed with:	emaste, jrtc27
Sponsored by:	https://www.patreon.com/c/cperciva

(cherry picked from commit 340e68fd7c0d62cac1f0876b6475a89df5065db5)
2025-09-13 19:05:21 -07:00
Isaac Freund
6fa24b29d8 release, bsdinstall: include FreeBSD-kernel-man package
This package has been newly split off during man page reorganization and
should be considered part of the "base" component rather than being
ignored. Update pkgbase release and bsdinstall scripts for this change.

Reviewed by:	ivy
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51519
2025-07-30 18:57:17 -04:00
Doug Rabson
2e2903faa6 release: Generalise the OCI image build's pkg config
Allow building OCI images if the source tree is not /usr/src. This also
removes the copy of /etc/pkg/FreeBSD.conf which is not needed for the
OCI image build.

MFC after:	3 days
2025-07-21 13:43:21 +01:00
Bojan Novković
ceab09e3db release: Add a helper script for common tools
Add a helper script that populates variables used to invoke several tools.
This is also the first step towards cleaning up several inconsistencies
related to tool invocation in various release scripts (e.g. ${MAKEFS} vs makefs).

Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51038
Reviewed by:	emaste, des
2025-07-16 17:03:49 +02:00
Ed Maste
611c1457ff release: Add set -e to abort upon failure
We don't want to blindly continue and produce broken VM images if
something goes wrong.

Reviewed by:	cperciva
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50711
2025-06-17 13:40:33 -04:00
Isaac Freund
62d18f8c4c release: Add -DPKGBASE option to include pkgbase packages
If this option is set, an offline repo of pkgbase packages corresponding
to base.txz and kernel.txz will be included in the disc1 release media
rather than the base.txz and kernel.txz tarballs.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50346
2025-05-20 16:30:12 -04:00
Ed Maste
9a354a41be release: Use "debug info" in dist set descriptions
"Kernel (Debugging)" could suggest that this is a debugging kernel --
an alternative to a "Kernel (Standard)".  These dist sets contain the
standalone debug info files for the kernel, base system, and other
components.  Change the MANIFEST descriptions (used by bsdinstall's
dist selection menu) to use "debug info".

Reviewed by:	brooks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50254
2025-05-13 12:59:21 -04:00
Colin Percival
94e44a074e release: Don't put drm-kmod package onto DVD
The X.Y-RELEASE DVDs use a quarterly package set which was built on
X.(Y-1)-RELEASE, and those kernel modules are never going to be
useful.

MFC after:	30 seconds
Sponsored by:	Amazon
2025-05-11 15:19:33 -07:00
Ed Maste
b064317fa8 release/pkg-stage: Support non-release artifact builds
Add -N flag to invoke pkg commands with INSTALL_AS_USER mode, and
add package repo contents to METALOG.

Reviewed by:	bapt, brooks
PR:		283387
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50173
2025-05-08 12:46:24 -04:00
Ed Maste
16d0fe1f72 release/pkg-stage: Put each package on a separate line
The list of packages included in dvd1.iso is maintained in pkg-stage.sh
itself, and sees regular additions and deletions.  Rearrange the
beginning and end of the variable so that each package is alone on a
line, to make it easier to track changes.

Reviewed by:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50221
2025-05-06 17:51:50 -04:00
Ed Maste
a2aabd2493 release/pkg-stage: Stop creating pkg.txz symlink
Contemporary pkg never uses any file other than pkg.pkg now.

Reviewed by: Isaac Freund <ifreund@freebsdfoundation.org>
Fixes: 0cd9513a5b ("pkg: retire backwards compatibility bootstrap support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50171
2025-05-06 08:04:42 -04:00
Brooks Davis
64b9e40dc5 release: style: prefer -n over ! -z
This is (nearly) universally the style of other shell scripts.

Reviewed by:	cperciva, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D50056
2025-04-29 18:18:33 +01:00
Doug Rabson
3a79ca6553 release: avoid sparse-file handling for container image layers
This improves compatiblity with Podman. See
https://github.com/containers/podman/issues/25270 for details.

Differential Revision:  https://reviews.freebsd.org/D49821
2025-04-15 22:01:45 +00:00
Dave Cottlehuber
0ce9a414ad release: add cloudware oracle targets to package and upload .oci files
- requires base tar & flua, qemu-tools & curl from ports
- set ORACLE_PAR_URL to upload to local file:/// dir or cloud buckets

Reviewed by:	emaste
Approved by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D48382
Sponsored by:	SkunkWerks, GmbH
2025-03-04 23:56:00 +00:00
Doug Rabson
e8a5b9fd73 release: build OCI images with shell scripts
This avoids the need for buildah and skopeo for building releases.

Reviewed by:		cpersiva
MFC after:		1 day
Differential Revision:	https://reviews.freebsd.org/D48574
2025-03-02 15:17:13 +00:00
Dave Cottlehuber
457d745d90 release: ensure default sudo flavor is selected
pkg behaviour selects the non-default flavour, this trims
0,5GiB per cloudware image, by being explicit.

Approved by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D48599
Sponsored by:	SkunkWerks, GmbH
PR:		284278
MFC after:	10 days
2025-02-28 22:33:46 +00:00
Colin Percival
0d7b98c06c pkg-stage.sh: kde5 -> kde
The "kde5" package no longer exists; KDE goes to 6.

Note: Depending on the size of 13.5-BETA3 DVD images, KDE might end
up being removed from this list in the near future.

With hat:	re@
MFC after:	30 seconds
Sponsored by:	Amazon
2025-02-19 11:24:06 -08:00
Emmanuel Vadot
11f3da5655 pkgbase: Remove /boot/firmware from bootloader package
For now we don't ship anything in /boot/firmware, but some up coming commit
will ship wifi drivers in it and we want them to be in their own package.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-12-16 10:44:45 +01:00
Doug Rabson
e2fc29e539 release: fix architecture for OCI images
PR:			283260
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D48051
2024-12-13 16:47:05 +00:00
Bjoern A. Zeeb
2483a2d368 release: add wifi-firmware-kmod@release to ship as package
Rather than adding the rtw88 package add the flavored port for all the
supported wireless drivers we recently added support for.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Pointed out by:	cperciva (as part of the set of changes)
Reviewed by:	cperciva (#releng)
Differential Revision: https://reviews.freebsd.org/D47406
2024-11-10 19:00:55 +00:00
Doug Rabson
d03c82c28d release: add optional OCI images
This adds three OCI archive format files to the release containing
FreeBSD base images suitable for static linked, dynamic linked and shell
workloads. The shell image also contains pkg-bootstrap and can be easily
extended by installing packages (including pkgbase packages).

Reviewed by: dch, cpersiva, jlduran, zlei
Differential Revision: https://reviews.freebsd.org/D46759
MFC after: 2 days
2024-11-08 13:23:08 +00:00
Ed Maste
2d6094615a release: Remove mergemaster mm-mtree.sh script
It is unused after 8ee478dfd4 ("release: stop generating mergemaster
databases").

Sponsored by:	The FreeBSD Foundation
2024-06-17 14:37:46 -04:00
Colin Percival
f81c0904f7 Add rtw88 firmware to DVD package set
Add net/wifi-firmware-rtw88-kmod since it is no longer included in
the base system on 15.x.  (It is present in 14.x, so this change will
not be MFCed.)
2024-05-23 17:02:40 -07:00
Colin Percival
d31ed58b9f Modernize DVD package set in preparation for 14.1
Remove archivers/unzip (now in base) and emulators/linux_base-c7 (old
and unlikely to be useful without other linux packages being installed),
ports-mgmt/portmaster (now largely obsolete and discouraged in favour
of using pkg and binary packages) and x11-drivers/xf86-video-vmware
(questionably useful).

Replace devel/git with devel/git@lite (sufficient for most purposes),
and adjust the "ensure the ports exist to sanitize the list" code to
ignore the @lite part when checking that /usr/ports/devel/git exists.

Add sysutils/seatd and x11-wm/sway for wayland support.

MFC after:	1 minute
Differential Revision:	https://reviews.freebsd.org/D45278
2024-05-23 17:01:59 -07:00
Colin Percival
0b1c5628c7 release: Rework vm_extra_pre_umount
The vm_extra_pre_umount function in vmimage.subr served two purposes:
It removed /etc/resolv.conf and /qemu (if cross-building), and it
provided a function for cloudware to override in order to make cloud
specific changes to the filesystem before constructing a disk image.

This resulted in a number of bugs:
1. When cross-building, the emulator binary was left as /qemu in the
Azure, GCE, Openstack and Vagrant images.
2. The build host's resolv.conf was left as /etc/resolv.conf in the
basic-ci and basic-cloudinit images.
3. When building GCE images, a Google-specific resolv.conf file was
constructed, and then deleted before the disk image was created.

Move the bits needed for running code inside a VM staging directory
from vm_install_base into a new vm_emulation_setup routine, and move
the corresponding cleanup bits from vm_extra_pre_umount to a new
vm_emulation_cleanup routine.

Remove the /qemu and /etc/resolv.conf cleanups from the cloudware
configuration files (where they exist) since we will now be running
vm_emulation_cleanup to remove those even when vm_extra_pre_umount
has been overridden.

Override vm_emulation_cleanup in gce.conf since in that one case (and
*only* that one case) we don't want to clean up resolv.conf (since it
was constructed for the VM image rather than copied from the host).

releng/14.1 candidate.

MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
2024-05-06 13:40:47 -07:00
John Baldwin
ea2663040d release: Use the ABI of the target release to fetch packages
- Point --rootdir at the installed destdir in the dvd tree.  This
  causes pkg to determine the ABI from the installed destdir instead
  of the host's binaries.  Previously the result was that packages
  for the host's ABI were always downloaded breaking cross-releases
  (e.g. arm64 releases built on an amd64 host included amd64
  packages on the DVD ISO image rather than arm64 packages).  This
  also handles version mismatches, and I tested this by cross-building
  a 15.x arm64 release on a 14.x amd64 host.

- As a result, pkg now does a chdir(3) to the rootdir before running,
  so the -o argument to fetch needs to be updated to be relative to
  rootdir instead of the CWD as make runs.

- Add a new ROOTDIR variable to limit references to "dvd" to one
  place.  Ideally ROOTDIR would be an argument to this script so
  that it didn't really know about the dvd layout at all.

- While here, simplify creation of symlinks by just using a longer
  path to the link name instead of using 'cd' in the shell before
  invoking ln(1).  Also use ln -sf to create the pkg.pkg symlink
  rather than rm + ln.

PR:		278273
Reported by:	gatekeeper <tiago.gasiba@gmail.com>
Reviewed by:	imp, delphij
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44749
2024-04-14 16:45:40 -07:00
Emmanuel Vadot
b6e9a7a2e2 Reapply "pkgbase: Create a FreeBSD-dtb package"
This reverts commit 9bbe06b004.

Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Fix mtree-to-plist.awk to only generate a dtb.plist when we create
the kernel one (because dtb are installed during make installkernel).

Sponsored by:   Beckhoff Automation GmbH & Co. KG
2024-02-03 09:49:12 +01:00
Graham Perrin
5ff76402da pkg-stage.sh: add x11/sddm
MFC After: 2 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/996
2024-02-02 18:34:59 -07:00
Emmanuel Vadot
9bbe06b004 Revert "pkgbase: Create a FreeBSD-dtb package"
Somehow this doesn't work iwth make packages due to some kind of a race.
The package is first created correctly but later in the process it is
overwritten by a badly created empty package.
Revert in the mean time so we can have working pkgbase on arm/arm64

This reverts commit a5afd7920d.
2024-02-02 11:39:51 +01:00
Emmanuel Vadot
a5afd7920d pkgbase: Create a FreeBSD-dtb package
Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Differential Revision:	https://reviews.freebsd.org/D43632
Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-01-29 19:24:25 +01:00
Baptiste Daroussin
5faaa602ce pkgbase: propagate SRCRELDATE to the packages correctly
MFC After:		3 days
Reviewed by:		manu
Differential Revision:	https://reviews.freebsd.org/D42892
2023-12-04 22:27:57 +01:00
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Li-Wen Hsu
fea4a44c19
release/DVD_PACKAGES: Update the names of drm-kmod ports
Reviewed by:	x11 (manu), re (gjb)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40770
2023-07-05 04:24:52 +08:00
Ed Maste
4654ba28fb release: Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2023-04-17 10:56:59 -04:00
Glen Barber
e4e139b828 pkg-stage.sh: update port trailing version information
Reported by:	Ian Smith, Graham Perrin
MFC after:	1 week
X-MFC-13.2:	NO

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-03-20 10:36:51 -04:00
Mark Johnston
89585511cc release: Add support for creating ZFS-based VM images
The change extends vmimage.subr to handle a new parameter, VMFS, which
should be equal to either "ufs" or "zfs".  When it is set to ZFS, we use
makefs to create a bootable pool populated using the same dataset layout
as bsdinstall and "poudriere image" use.  The pool can be grown using
the growfs rc.d script, just as in UFS images.

This will make it easy to provide VM and cloud images with ZFS as the
root filesystem.  So far I did not do extensive testing of cloud images;
I merely verified that creation of ZFS-based AWS AMIs works and allows
me to create amd64 and arm64 EC2 instances with ZFS as the root
filesystem.

Reviewed by:	emaste, gjb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34426
2022-10-28 17:00:24 -04:00
Alan Somers
55c8093f73 Replace subversion with git in the installation DVD
I assume the original reason for Subversion's inclusion was to checkout
the base system.  But now we use git for that.

Reviewed by:	gjb
Sponsored by:	Axcient
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D35329
2022-05-27 09:10:19 -06:00
Glen Barber
68b0a79b7c release: fix on-disc pkg binary symbolic links
PR:		263574
Reported by:	loader
MFC after:	immediately
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-26 15:52:40 -04:00
Brad Davis
81c6dfbf56 release: Move the vagrant.vmx config out to its own file to match vbox
Silly to have all these echos and makes this easier to use in other tooling.

Reviewed by:	gjb (re)
2021-03-12 09:44:42 -07:00
Nathan Whitehorn
1ca8842f3a Use makefs(8) in release VM-image generation instead of md(4) and newfs.
Using makefs instead reduces the privileges needed to build VM images,
simplifies the script (no need to copy files to a fresh image at the end),
and improves portability by allowing generation of cross-endian images.
As a result of the last, this patch also adds support for generation of
powerpc64 and powerpc64le VM images.

No other changes to the output. Tested and working for both amd64 and
powerpc64 targets.

Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D28912
2021-02-24 21:16:56 -05:00
Mitchell Horne
1d76e25a67 arm64: convert virtual machine images to GPT
These images were switched to MBR in r281876 as a way to cope with a
hard-coded partition GUID in QEMU's default EFI firmware. Enough time
has passed that this is no longer a problem; QEMU versions >= 4.0
include a copy of edk2 EFI firmware that can detect the root filesystem
properly. Alternatively, sysutils/u-boot-qemu-arm64 can be used.

Switch back to building these images with a GPT partition table, and
re-enable the swap partition.

Reviewed by:	gjb, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26986
2020-10-30 18:20:52 +00:00