# Switching from /usr/src to freebsd-update



## Mage (Feb 21, 2016)

I have been compiling the OS and the ports for years. I like watching the compile log on the screen. However, I spent too much time on it already.

Yesterday I tried `freebsd-update` on a new machine and it was great. The question is whether it is safe and clean to run `freebsd-update` on machines that were updated by `make buildkernel && make buildworld` in the past. Will it remove the obsolete files? What about updating /etc? As far as I understood I don’t have to run `mergemaster` anymore.

Is it okay just to switch?


----------



## SirDice (Feb 22, 2016)

Note that you can only use freebsd-update(8) on -RELEASE versions. What do you have now?


----------



## xtaz (Feb 22, 2016)

I did exactly this and switched from 10.3-PRERELEASE to 10.3-BETA1 (and BETA2) via freebsd-update. I first downloaded the kernel.txz from the ftp site, ran `strings` on it to find out the specific revision that it was compiled with and then built that version from source after checking it out from svn. That gave me the same 10.3-BETA1 release. I then ran `freebsd-update IDS` which listed all the files on the system which differed. I then used the base.txz, kernel.txz, and source.txz files to extract any files which didn't match until `freebsd-update IDS` told me that all files on the system were as expected. Then I succesfully used it to update to BETA2 without any issues at all.

I suspect that `freebsd-update` is probably intelligent enough to deal with files that don't quite match anyway, but I wanted to be 100% sure so did it this way. FYI those files came from ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.3-BETA2/


----------



## SirDice (Feb 22, 2016)

xtaz said:


> I first downloaded the kernel.txz from the ftp site, ran `strings` on it to find out the specific revision that it was compiled with and then built that version from source after checking it out from svn. That gave me the same 10.3-BETA1 release.


No need to look that up, it's /base/releng/10.3 for 10.3-RELEASE, /base/releng/10.2 for 10.2-RELEASE and /base/releng/10.1 for 10.1-RELEASE.

The /base/releng/10.3 doesn't exist yet as it's not "released" yet. It should be there when the release candidates are created.


----------



## Mage (Mar 3, 2016)

Thank you for the replies, I was a bit AFK.

One of my servers is built from: svn://svn0.us-west.freebsd.org/base/releng/10.2
Another is built from https://github.com/freebsd/freebsd.git

I prefer the git repository for the performance, however, its `make buildworld` doesn’t seem to add the version numbers to the config files.

First server:

```
$ cat /etc/amd.map

# $FreeBSD: releng/10.2/etc/amd.map 164015 2006-11-06 01:42:11Z obrien $

#

/defaults       type:=host;fs:=${autodir}/${rhost}/host;rhost:=${key}

*               opts:=rw,grpid,resvport,vers=3,proto=tcp,nosuid,nodev
```

Second server:

```
$ cat /etc/amd.map

# $FreeBSD$

#

/defaults       type:=host;fs:=${autodir}/${rhost}/host;rhost:=${key}

*               opts:=rw,grpid,resvport,vers=3,proto=tcp,nosuid,nodev
```

I usually run `mergemaster -ad` and `mergemaster -F`. This is less efficient on the server that has its world built from the git repository. I have no clue whether this has an effect on `freebsd-update`.

The `uname -a` outputs are the same (except the date and revision parts):

```
$uname -a

FreeBSD sharon 10.2-RELEASE-p8 FreeBSD 10.2-RELEASE-p8 #0
```


----------

