Skip to content

Commit 2d18446

Browse files
committed
release: Rework VM package selection using sets
Filtering the list of packages broke with the introduction of package sets, since we excluded FreeBSD-src.* but still included FreeBSD-set-src, which transitively included the FreeBSD-src and FreeBSD-src-sys packages. This could be fixed by excluding package sets, but that would be fragile, potentially breaking upgrades if new packages are introduced. Instead, start with an explicit set of package sets: base, base-dbg lib32, lib32-dbg kernels, kernels-dbg tests and filter the package sets; the EC2 "small" and "builder" AMIs filter out everything except "base" and "kernels". Note that using FreeBSD-set-kernels may pose a problem in the future if we start shipping packages for multiple differently-configured kernels. That will be addressed if and when that problem arises. Reviewed by: ivy MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D52922
1 parent 2b6c5f0 commit 2d18446

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

release/tools/ec2-builder.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ vm_extra_filter_base_packages() {
1616
grep -v \
1717
-e '.*-dbg$' \
1818
-e '.*-lib32$' \
19-
-e '^FreeBSD-tests.*'
19+
-e '^FreeBSD-set-tests'
2020
}
2121

2222
# Packages to install into the image we're creating. In addition to packages

release/tools/ec2-small.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ vm_extra_filter_base_packages() {
1919
grep -v \
2020
-e '.*-dbg$' \
2121
-e '.*-lib32$' \
22-
-e '^FreeBSD-tests.*'
22+
-e '^FreeBSD-set-tests'
2323
}
2424

2525
# Packages to install into the image we're creating. In addition to packages

release/tools/vmimage.subr

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ vm_copy_base() {
7070
return 0
7171
}
7272

73-
vm_filter_base_packages() {
74-
# Reads a list of all base system packages from stdin.
75-
# Writes a list of base system packages to install to stdout.
76-
grep -v -e '^FreeBSD-src.*' -e '^FreeBSD-kernel.*'
77-
# There are several kernel variants available in separate packages.
78-
# For VMs it is sufficient to install only the generic kernel.
79-
echo "FreeBSD-kernel-man"
80-
echo "FreeBSD-kernel-generic"
81-
echo "FreeBSD-kernel-generic-dbg"
73+
vm_base_packages_list() {
74+
# Output a list of package sets equivalent to what we get from
75+
# "installworld installkernel distribution", aka. the full base
76+
# system.
77+
for S in base lib32 kernels; do
78+
echo FreeBSD-set-$S
79+
echo FreeBSD-set-$S-dbg
80+
done
81+
echo FreeBSD-set-tests
8282
}
8383

8484
vm_extra_filter_base_packages() {
@@ -99,8 +99,7 @@ vm_install_base() {
9999
pkg_cmd="$pkg_cmd -o METALOG=METALOG"
100100
fi
101101
$pkg_cmd update
102-
selected=$($pkg_cmd rquery -U -r FreeBSD-base %n | \
103-
vm_filter_base_packages | vm_extra_filter_base_packages)
102+
selected=$(vm_base_packages_list | vm_extra_filter_base_packages)
104103
$pkg_cmd install -U -r FreeBSD-base $selected
105104
else
106105
cd ${WORLDDIR} && \

0 commit comments

Comments
 (0)