# How to get source for kernel, world to match currently running kernel?



## Time2IPL (Mar 2, 2010)

Apologies in advance for this question; I have a feeling that I'm probably missing something or ??? here.

I'm currently running 8.0-RELEASE-p2, which I installed from the 8.0-RELEASE DVD, and have been keeping up to date with freebsd-update (I've been keeping my ports current w portsnap). Everything seems to be working fine.

However, it occurred to me yesterday when I went to build the kernel and "world" that I have no idea whether the sources in /usr/bin, /usr/lib, etc. match the currently running kernel, etc. - does "freebsd-update" keep those in sync? or are they the same as they were when I first installed the system?

I read through the handbook, etc., but I'm just not getting how to determine whether the sources I have are current and/or download ones that match a given release and patchlevel.

Thanks
Larry


----------



## DutchDaemon (Mar 3, 2010)

Why on earth would you build the world and kernel when you're using freebsd-update? The whole point of freebsd-update is *not* having to build the world and kernel, and just installing binary updates to world and kernel.

If you want to build everything yourself, just use csup(8) and track -RELEASE or -STABLE. Now you're just doing it twice.


----------



## adamk (Mar 3, 2010)

Also, you seem to have a funny idea of "sources".  The source code is kept in /usr/src.  /usr/bin contains binaries and /usr/lib contains libraries, both are compiled from source.

Adam


----------



## DutchDaemon (Mar 3, 2010)

And to be more concise: if you instruct freebsd-update (through freebsd-update.conf) to sync 'src', _the source tree in /usr/src will be the same source tree that built the binaries freebsd-update is installing_. Building and installing it all over again will keep your room warmer, but not add any value to the operating system.


----------



## Time2IPL (Mar 3, 2010)

I had a feeling there was a better way to ask this...



			
				DutchDaemon said:
			
		

> Why on earth would you build the world and kernel when you're using freebsd-update? ...



They're two separate machines. I'm trying to bring an old device driver up to date and before I started doing anything I wanted to make sure I was running the exact same kernel, etc., on both machines. Only with one built from sources and one not.



			
				Adam said:
			
		

> Also, you seem to have a funny idea of "sources". The source code is kept in /usr/src. /usr/bin contains binaries and /usr/lib contains libraries, both are compiled from source.



Sorry for that]
... if you instruct freebsd-update (through freebsd-update.conf) to sync 'src', the source tree in /usr/src will be the same source tree that built the binaries freebsd-update is installing.
[/QUOTE]

Ah, perfect. That's exactly what I was trying to figure out and wasn't 100% on. Thanks.

At some point in the past - I don't recall whether it was with FreeBSD or another OS - I started off a similar effort with a source tree that was close to what was being released in binary form but not close enough to spare me from a lot of wasted effort. I was trying to avoid a similar mess.

- Larry


----------

