Skip to main content

Raymii.org Raymii.org Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed

FreeBSD 10, Converting from RELEASE to STABLE

Published: 17-04-2014 | Author: Remy van Elst | Text only version of this article


❗ This post is over nine years old. It may no longer be up to date. Opinions may have changed.

Table of Contents


Because of a bug in mpd which is fixed in 10-STABLE I wanted to move one of my FreeBSD machines from 10.0-RELEASE to 10.0-STABLE. The process to do so is fairly simple. Basically, you check out the new source code, build the world, build the kernel, install the kernel, install the world, merge some stuff and reboot.

Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:

I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days.

Make sure you have a backup of important stuff on the system.

Stable?

The name "-STABLE" is frequently misunderstood. It does not mean solid or steady. -STABLE means that while code can change, the ABI (Application Binary Interface) will remain stable and not change. Programs compiled to run on FreeBSD 9.0-RELEASE, or 9.1-RELEASE, or 9.2-RELEASE will continue to work on FreeBSD 9-STABLE. Effectively, -STABLE is the latest version of FreeBSD you can get without breaking installed software. [source]

Procedure

Move the current source code to a backup folder to be sure to get only -STABLE code:

mv /usr/src /usr/src-RELEASE

Do the same thing for the ports tree:

mv /usr/ports /usr/ports-RELEASE

When I did not moved the /usr/src folder and continued this article, everytime I would be back in 10.0-RELEASE...

Check out the STABLE source code:

svn checkout https://svn0.us-west.freebsd.org/base/stable/10 /usr/src

Also for the ports tree:

svn checkout https://svn0.us-west.freebsd.org/ports/head /usr/ports

Then cd in to the correct folder

cd /usr/src

Build the world:

make buildworld -j4

The -j 4 part means that it should run 4 jobs at once. I have a quad core CPU so all the cores will be used.

Build the kernel:

make buildkernel KERNCONF=VPN
make installkernel KERNCONF=VPN

I have a different kernel file for the VPN setup.

Now reboot in to the new kernel:

shutdown -r now

Next, it was time to install the world. However, make installworld complained:

make installworld
ERROR: Required unbound user is missing, see /usr/src/UPDATING.
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src

/usr/src/UPDATING to the rescue:

20130916:
        With the addition of unbound(8), a new unbound user is now
        required during installworld.  "mergemaster -p" can be used to
        add the user prior to installworld, as documented in the handbook.

However, mergemaster -p did not create the user:

mergemaster -p

*** Creating the temporary root environment in /var/tmp/temproot
 *** /var/tmp/temproot ready for use
 *** Creating and populating directory structure in /var/tmp/temproot



*** Beginning comparison

 *** Temp ./etc/group and installed have the same Id, deleting
 *** Temp ./etc/master.passwd and installed have the same Id, deleting

*** Comparison complete

*** /var/tmp/temproot is empty, deleting

I already am on FreeBSD 10, but this box is updated from 8 to 9 to 10, so maybe that didn't work out quite well. Installing unbound via pkg did work:

pkg install unbound

It seemed that it was half done:

Proceed with installing packages [y/N]: y
ldns-1.6.17.txz 
unbound-1.4.22.txz
Checking integrity... done
[1/2] Installing ldns-1.6.17... done
[2/2] Installing unbound-1.4.22...===> Creating users and/or groups.
Using existing group 'unbound'.
Creating user 'unbound' with uid '59'.
 done

Oh wel... Now the make installworld continues;

make installworld

After that finished we can do another mergemaster:

mergemaster -Ui 

Only /etc/motd changed, so, no big things.

Time to reboot:

shutdown -r now

Remove old files and libraries:

cd /usr/src
make check-old
>>> Checking for old files
>>> Checking for old libraries
>>> Checking for old directories
To remove old files and directories run 'make delete-old'.
To remove old libraries run 'make delete-old-libs'.

make delete-old
>>> Removing old files (only deletes safe to delete libs)
remove /usr/include/clang/3.3/__wmmintrin_aes.h? y
remove /usr/include/clang/3.3/__wmmintrin_pclmul.h? y
remove /usr/include/clang/3.3/altivec.h? y
remove /usr/include/clang/3.3/ammintrin.h? y
[...]
>>> Old files removed
>>> Removing old directories
>>> Old directories removed
To remove old libraries run 'make delete-old-libs'.



make delete-old-libs
>>> Removing old libraries
Please be sure no application still uses those libraries, else you
can not start such an application. Consult UPDATING for more
information regarding how to cope with the removal/revision bump
of a specific library.
>>> Old libraries removed

Note that freebsd-update does not work with the STABLE branch. Therefore this process is required.

That's it. Run freebsd-version to see that you are now on stable:

freebsd-version
10.0-STABLE

Sources

http://www.wonkity.com/~wblock/docs/html/buildworld.html
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
https://forums.freebsd.org/viewtopic.php?&t=42776

Tags: blog , bsd , freebsd , make , pkg , ports , release , stable , upgrade , version