Gentoo FreeBSD/Upgrade Guide

This guide will show you how to upgrade Gentoo/FreeBSD 10.3 from previous version.

If you want to upgrade to 11.0, please see Gentoo FreeBSD/Upgrade Guide/11.0.

Changing to the latest profile
It is necessary to change the profile to emerge packages related to FreeBSD 10.3.

Get a list of available profiles:

Set the profile to 10.3:

Updating sys-apps/portage
Please check first, what will be installed:

If you got error "masked by: EAPI", please update the portage with a manual method.

Please add --exclude sys-freebsd/* option. It will avoid the issue that sys-freebsd packages are masked by profile.

If it was updated successfully, please check the version:

The portage version 2.2 or later is needed to continue the upgrade. If it is the old version, update the portage again:

Recheck the version:

Update the portage with a manual method.
Currently, the profile requires EAPI=5. However, the very old x86 stage doesn't support it. Please update with a manual method:

Move
Currently, has been moved to. If it exists in, please move it to the location.

In addition, remove LDFLAGS from. If it is set, the upgrade may fail.

Update some of the packages to continue the upgrade
You need to update some of the packages to continue the upgrade. The required packages were picked to save your time:

Toolchain update
The latest binutils and gcc are required:

Set latest gcc:

Kernel update
First of all, you need to update your kernel. That is because some userland packages may require functions of the new kernel.

Please be sure to update the kernel first!

Failed to compile the kernel
Please get the GENERIC kernel of FreeBSD if you fail to compile the kernel. If you are using amd64-fbsd, please replace the i386 to amd64 in URL.

Reboot
Don't have a problem? Let's restart to actually use the new kernel.

After rebooting your machine, please check if the upgrade was successful.

Prepare of multilib (for amd64-fbsd users)
If you're using the old amd64-fbsd stages, some additional steps are required.

Let's check:

Please execute some additional steps when "need prepare multilib" is displayed:

Updating FreeBSD userland
First emerge the core library:

Update the userland of FreeBSD:

Please emerge the sys-freebsd packages again. Some of the packages are in need of include files of 10.3, which they couldn't use during the previous upgrade.

Clean, utmp related files:

Changing the CHOST variable and rebuilding the toolchain
Change the CHOST variable, and emerge binutils&gcc. (FYI, Changing the CHOST variable)

x86-fbsd users should issue:

amd64-fbsd users should issue:

Emerge binutils and gcc:

Check gcc's 9.x stuff:

Remove 9.x stuff:

Also check binutils:

Remove FreeBSD 9.x env data:

The target file name is in this case.

Rebuild all packages.

If one of the packages fails to compile you can issue 'emerge --resume --skipfirst' to continue emerging the remaining packages. Also, consider filing a bug report of the problem.

Cleaning
Let's remove the backup files when you have finished all the steps:

Re-select profile
Please re-select the profile if exists in.

Sample script to update automatically
You can get the sample script for easy updates.

https://gitweb.gentoo.org/proj/gentoo-bsd.git/plain/scripts/automatic_updater.sh