# FreeBSD update: binary vs source



## kriscom (Jan 9, 2012)

On a freshly installed FreeBSD 8.2 system (DVD) with sources installed from the very same DVD.

`# freebsd-update fetch`
shows around 270 files that need to be patched.

`# cvsup /path/to/supfile`
shows only around 18 file that need to be patched.

How come?

Thanks in advance!


----------



## phoenix (Jan 9, 2012)

freebsd-update(8) works on the binaries installed in the system (the actual OS files on the harddrive).  The number of binary files that need to be updated depends on the version of the OS currently installed, and the version of the OS after patching.  ie, going from 8.2-RELEASE to 8.2-RELEASE-p3 will show more files than going to 8.2-RELEASE-p1.

csup(1) works on the source files under /usr/src only.  The number of files to be updated depends on the current revision of the sources on the disk, and the branch that you are updating the source tree to.

You can't compare the two.  They do two very different things.  In very different ways.


----------



## kriscom (Jan 9, 2012)

The one updates the binaries, the other the sources. My question was, if those shouldnt be the same on a freshly installed system. Seems like the sources are fresher than the compiled version.


----------



## phoenix (Jan 9, 2012)

It depends on what you have listed in your supfile, which patch version you are updating to.

Plus, a modification of a single source file could lead to multiple modified binaries once compiled.  And vice versa, it may take multiple source files to build a single binary.

You cannot compare these two things the way you are trying to.


----------



## Beastie (Jan 10, 2012)

Also, depending on your (or the default) freebsd-update.conf(5) (see *Components*), freebsd-update(8) may update *both* binaries and sources so no wonder it's updating many more files than when using a source-based upgrade tool.


----------



## kriscom (Jan 13, 2012)

Now I'm installing the new RELEASE 9.0 (before it was 8.2)

Components under /etc/freebsd-update.conf are: src world kernel
*freebsd-update fetch* said everything was just fine, up to date.

Supfile uses the cvs tag=RELENG_9_0, src-all
It was running for at least 50 minutes and now it says it has found 21 Edits, 8022 Checkouts and 20122 Deletes.

Now I'm really perplexed.


----------



## kriscom (Jan 14, 2012)

Im still curious how freebsd-update actually works. Sure, I could dig into its sources. But maybe not just now. 

Its output says something about checking systems integrity.

So I deleted all /usr/src and /var/db/freebsd-update and run *freebsd-update* again. It still says everything is fine.

I thought maybe it uses a "sources.tgz" which is being checked for presence, so I went through the packages with pkg_search looking for *sources* or *src* but haven't found anything which I would consider matching.


----------



## phoenix (Jan 14, 2012)

Time to do some reading on how freebsd-update works, me thinks.  

Start here, and read through the links and presentations on there.


----------

