Page MenuHomeFreeBSD

D56632.1796047281.diff
No OneTemporary

Authored By
Unknown
Size
12 KB
Referenced Files
None
Subscribers
None

D56632.1796047281.diff

diff --git a/documentation/content/en/books/handbook/cutting-edge/_index.adoc b/documentation/content/en/books/handbook/cutting-edge/_index.adoc
--- a/documentation/content/en/books/handbook/cutting-edge/_index.adoc
+++ b/documentation/content/en/books/handbook/cutting-edge/_index.adoc
@@ -1090,13 +1090,15 @@
[[pkgbase]]
== Updating FreeBSD with packages
-Starting from 14.0-RELEASE, the FreeBSD project has published a set of packages of the base system, using man:pkg[8].
+Starting from 15.0-RELEASE, the FreeBSD project has published a set of packages of the base system, using man:pkg[8].
+
The convenience of pkg is no longer limited to the FreeBSD ports collection.
man:pkg[8] can be used for FreeBSD itself.
+
Base packages, and usage thereof, were traditionally referred to as _pkgbase_.
Publication of official packages began in link:https://lists.freebsd.org/archives/freebsd-pkgbase/2023-October/000221.html[October 2023].
-Their use with FreeBSD 14 is currently experimental.
+Their use with releases prior to FreeBSD 15 is unsupported.
Starting from 15.0-RELEASE, man:freebsd-base[7] will be supported as a tech preview for:
@@ -1144,37 +1146,54 @@
* Updates passwd and capabilities databases
* Restarts sshd immediately
+For more Information please take a look at the link:https://github.com/FreeBSDFoundation/pkgbasify[README.md] of the project.
+
=== Upgrading a Host using freebsd-base
[WARNING]
====
-This is still in development, so please be careful especially when converting an existing system to use freebsd-base.
+This is still in development, so please be careful especially when converting an existing system to use base system packages.
====
-Create a folder for custom pkg repository config files, if there is none present already.
+Starting with FreeBSD 15 the FreeBSD-base repository is included in `/etc/pkg/FreeBSD.conf`.
-[source,shell]
+When installing the traditional way, this is disabled by default.
+
+If the installation was done utilizing base packages, it will be enabled in `/usr/local/etc/pkg/repos/FreeBSD.conf`.
+
+If the system was converted with the pkgbasify tool, it will be enabled in `/usr/local/etc/pkg/repos/FreeBSD-base.conf`.
+
+To make adjustments, it is recommended to use configuration files located in `/usr/local/etc/pkg/repos/`.
+
+If this directory does not exist yet, create it.
+
+To enable the FreeBSD-base repository, create or edit the pkg repository configuration file `/usr/local/etc/pkg/repos/FreeBSD.conf`:
+
+[[pgk-base-repo-configuration]]
+[.programlisting]
....
-# mkdir -p /usr/local/etc/pkg/repos/
+FreeBSD-base: {
+ enabled: yes
+}
....
-For using the freebsd-base repository, create a pkg repository configuration file called `FreeBSD-base.conf`:
+To overwrite the defaults set in `/etc/pkg/FreeBSD.conf`, additional content like the url can be set.
+
+Preferably a new repository with a different name should be created.
+
+For example:
-[[pgk-base-repo-configuration]]
[.programlisting]
....
-FreeBSD-base {
- url = "pkg+https://pkg.freebsd.org/${ABI}/base_release_${VERSION_MINOR}";
- mirror_type = "srv";
- signature_type = "fingerprints";
- fingerprints = "/usr/share/keys/pkg";
- enabled = yes;
+FreeBSD-base: {
+ url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}",
+ enabled: yes
}
....
for more information on specific configuration options see man:pkg.conf[5].
-There are different branches to choose from (by changing the url accordingly):
+There are different branches to choose from (by changing the url accordingly, or overwriting the environment variables ABI and VERSION_MINOR):
[[table-of-packagebase-branches]]
.Base system package Branches
@@ -1204,6 +1223,10 @@
| twice daily – 12:00 and 00:00 UTC
| `pkg+https://pkg.freebsd.org/${ABI}/base_release_3`
+| releng/14.4
+| twice daily – 12:00 and 00:00 UTC
+| `pkg+https://pkg.freebsd.org/${ABI}/base_release_4`
+
| releng/15.0
| twice daily – 12:00 and 00:00 UTC
| `pkg+https://pkg.freebsd.org/${ABI}/base_release_0`
@@ -1217,11 +1240,10 @@
| `pkg+https://pkg.freebsd.org/${ABI}/base_weekly`
|===
-To upgrade the system, change the configuration file according to the desired release, and run:
+To upgrade the system run:
[source,shell]
....
-# pkg update -r FreeBSD-base
# pkg upgrade -r FreeBSD-base
....
@@ -1234,45 +1256,45 @@
# shutdown -r now
....
-[[pkgbase-major-upgrade]]
-==== Major Upgrades
-With ZFS, boot environments allow an upgrade to be performed without interrupting running software.
-If the system does not use root-on-ZFS: backup before upgrading.
+[[pkgbase-minor-upgrade]]
+==== Minor Upgrades
+When running on ZFS, using boot environments is a great way to recover from any failures.
-===== Preparations
-Change `/usr/local/etc/pkg/repos/FreeBSD-base.conf` to target the correct major release like `base_release_0` for 15.0-RELEASE, to look like this:
+Take a look at crossref:cutting-edge[pkgbase-major-upgrade,Major Upgrades] on how to utilize boot environments for upgrading.
-[WARNING]
-====
-This file might change to be included in RELEASE with a different path.
-====
+Set the environment variable VERSION_MINOR to upgrade to another minor version.
-[.programlisting]
+For example to upgrade from 15.0-RELEASE to 15.1-RELEASE, run
+
+[source,shell]
....
-FreeBSD-base {
- url = "pkg+https://pkg.freebsd.org/${ABI}/base_release_0";
- mirror_type = "srv";
- signature_type = "fingerprints";
- fingerprints = "/usr/share/keys/pkg";
- enabled = yes;
-}
+# env VERSION_MINOR=1 pkg upgrade -r FreeBSD-base
....
-[WARNING]
-====
-As pkgbase with FreeBSD 14 is experimental, so is a pkgbase major upgrade to 15.
-At the time of this writing in some edge-cases the major upgrade removes pkg and therefore segfaults.
-This is considered a (link:https://github.com/freebsd/pkg/issues/2475[known issue]) for 15.0-RELEASE.
-To work around this issue, lock pkg before upgrading.
+check, if the listed packages are correct and accept the changes.
+
+Reboot the OS executing the following command:
[source,shell]
....
-# pkg -c /mnt/upgrade lock pkg
+# shutdown -r now
....
-An experimental major upgrade from FreeBSD 14, to 15 (or 16.0-CURRENT), should be followed by installation of meta package `FreeBSD-set-minimal`.
+[[pkgbase-major-upgrade]]
+==== Major Upgrades
+With ZFS, boot environments allow an upgrade to be performed without interrupting running software.
+If the system does not use root-on-ZFS: backup before upgrading.
+
+===== Preparations
+Use the environment variables for ABI and VERSION_MINOR according to the target version.
+For example to target 15.0 use ABI=FreeBSD:15:amd64 (or whatever architecture is running) and VERSION_MINOR=0 to get the correct url.
+
+[WARNING]
====
+As pkgbase with FreeBSD 14 is experimental, so is a pkgbase major upgrade to 15.
+To upgrade from FreeBSD 14 to 15 you need to have `compat14x` installed, else pkg might get removed while upgrading.
+====
Save a list of the non-base packages in case they are needed later:
@@ -1281,8 +1303,13 @@
pkg prime-origins | sort -u > /var/tmp/pkg-prime-origins.txt
....
+Always take a look at the link:https://www.freebsd.org/releases/15.0R/relnotes/#upgrade-rc[release notes], because some parts still might change.
+
+Switching between release and development branches might require changing the signing keys.
+Because releng has its own signing keys, 15.0-RELEASE has different signing keys than 15-STABLE or 16-CURRENT.
+
[[pkgbase-major-zfs]]
-===== major upgrade with zfs
+===== major upgrade with ZFS
Create a boot environment using man:bectl[8] and name it according to the version upgrading to
[source,shell]
....
@@ -1305,11 +1332,11 @@
====
Set the environment variable ABI to upgrade the major version (replace amd64 with the architecture and 15 with the targeted version).
-Set the pkg-static chroot directory to the boot environment mountpoint.
+Set the pkg-static rootdir directory to the boot environment mountpoint.
[source,shell]
....
-# env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
+# env ABI=FreeBSD:15:amd64 VERSION_MINOR=0 pkg-static -r /mnt/upgrade upgrade -r FreeBSD-base
....
There will be a prompt asking about ignoring the version mismatch looking like this:
@@ -1325,7 +1352,16 @@
Check and confirm that.
-To check if that was successful, chroot into the mountpoint of the boot environment and run `freebsd-version -ku`.
+An experimental major upgrade from FreeBSD 14 to 15 should be followed by installation of package sets (see man:freebsd-base[7]), like `FreeBSD-set-minimal` at least, which is a meta package which includes some base packages required for running a multi-user FreeBSD system.
+
+[source,shell]
+....
+# env ABI=FreeBSD:15:amd64 pkg-static -r /mnt/upgrade install -r FreeBSD-base FreeBSD-set-minimal
+....
+
+To check if the upgrade was successful, chroot into the mountpoint of the boot environment and run `freebsd-version -ku`.
+
+The output should show the new version.
[source,shell]
....
@@ -1352,12 +1388,12 @@
....
[[pkgbase-major-non-zfs]]
-===== major upgrade without zfs
+===== major upgrade without ZFS
Set the environment variable ABI to upgrade the major version (replace amd64 with the architecture and 15 with the targeted version).
[source,shell]
....
-# env ABI=FreeBSD:15:amd64 pkg-static upgrade -r FreeBSD-base
+# env ABI=FreeBSD:15:amd64 VERSION_MINOR=1501000 pkg-static upgrade -r FreeBSD-base
....
There will be a prompt to ask about ignoring the version mismatch looking like this:
@@ -1378,12 +1414,6 @@
Then reboot.
===== Post-upgrade tasks
-If pkg was locked during the update as a workaround remove the lock like this:
-[source,shell]
-....
-# pkg unlock pkg
-....
-
After upgrading to a new major version, updates and upgrades of installed packages to match the ABI version may be necessary.
[source,shell]
@@ -1394,9 +1424,9 @@
Consider getting help from link:https://www.freebsd.org/support/[FreeBSD Support] when experiencing issues.
[[build-pkgbase-packages-locally]]
-=== Manually building pkgbase and publishing it to the local network
+=== Manually building base packages and publishing it to the local network
-When building custom pkgbase packages clone the FreeBSD source tree:
+When building custom base packages clone the FreeBSD source tree:
[source,shell]
....
@@ -1408,7 +1438,7 @@
[source,shell]
....
-# git checkout releng/14.3
+# git checkout releng/15.0
....
Start the building process, depending on the resources available this could take some while.
@@ -1418,19 +1448,23 @@
[source,shell]
....
-# make -j8 buildworld && make -j8 buildkernel && make -j8 packages
+# make -j8 buildkernel && make -j8 buildworld && make -j8 update-packages
....
+The update-packages make target is copying unchanged packages from the previous build (the first build always builds every package).
+
+This keeps the version number in the packages so only changed packages get upgraded on the hosts.
+
When building frequently, consider using package:devel/ccache[] to speed up subsequent builds from the cache.
-After building, the packages will get saved into `/usr/obj/usr/src/repo/FreeBSD:14:amd64/14.3p2` or something like that, depending on the version build.
+After building, the packages will get saved into `/usr/obj/usr/src/repo/FreeBSD:15:amd64/15.0p6`, depending on the version build.
-To publish these packages to the network set up a nginx service and use this location in the http server configuration:
+To publish these packages to the network set up a web server like nginx and use this location in the http server configuration (usually located in `/usr/local/etc/nginx/nginx.conf`):
[.programlisting]
....
- location /FreeBSD:14:amd64 {
- alias /usr/obj/usr/src/repo/FreeBSD:14:amd64/;
+ location / {
+ alias /usr/obj/usr/src/repo/;
autoindex on;
}
....
@@ -1441,13 +1475,27 @@
[.programlisting]
....
-upgrade: {
- url = http://ip.of.the.server/FreeBSD:14:amd64/14.3p2
+base: {
+ url = http://ip.of.the.server/FreeBSD:15:amd64/15.0p6
enabled = yes
}
....
-and use it as written above (but use -r upgrade instead of FreeBSD-base).
+and use it as written above (but use `-r base` instead of `-r FreeBSD-base`).
+
+Disable the FreeBSD-base repository, when using a custom repository for base system packages.
+
+Optionally create a configuration to use the local repository on the host where the packages are built, if publishing to the network is not needed or to just upgrade the local host.
+
+[.programlisting]
+....
+upgrade {
+ url: "file:///usr/obj/usr/src/repo/FreeBSD:15:amd64/latest/";
+ enabled: yes
+}
+....
+
+Here `latest` is a symlink to the version built last.
[[small-lan]]
== Tracking for Multiple Machines

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 30, 2:01 PM (19 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42106805
Default Alt Text
D56632.1796047281.diff (12 KB)

Event Timeline