# Difficulty upgrading /usr/src



## Jimmy (Mar 14, 2014)

Can't seem to update my source to 10.0-RELEASE. Can anyone advise what I'm doing wrong?

```
> uname -a
FreeBSD diesel.steppingstones 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #14: Mon Jun 24 23:17:13 BST 2013     jim@diesel.steppingstones:/usr/obj/usr/src/sys/DIESEL  i386
```
Procedure followed is:

```
> svn checkout svn://svn0.eu.freebsd.org/base/releng/10.0 /usr/src
Checked out revision 263161.

> svn update /usr/src
Updating '/usr/src':
At revision 263161.
```
Then if I `more /usr/src/UPDATING` the first entry at the top of the file is:

20121205:
        9.1-RELEASE.

I attempted to follow the guide here which by the way seems to only offer advice on how to upgrade to STABLE and not RELEASE which I thought was a bit odd: 

https://www.freebsd.org/doc/handbook/svn.html

Can somebody point me in the right direction? Thank you.


----------



## SirDice (Mar 14, 2014)

Was the directory /usr/src/ empty when you did the first checkout?


----------



## acheron (Mar 14, 2014)

What does `svn info /usr/src` returns?


----------



## Jimmy (Mar 14, 2014)

/usr/src was not empty to begin with, output of the requested command is as follows, thanks for assistance so far:


```
> svn info /usr/src
Path: /usr/src
Working Copy Root Path: /usr/src
URL: svn://svn0.eu.freebsd.org/base/releng/10.0
Repository Root: svn://svn0.eu.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 263161
Node Kind: directory
Schedule: normal
Last Changed Author: gjb
Last Changed Rev: 260787
Last Changed Date: 2014-01-16 18:33:10 +0000 (Thu, 16 Jan 2014)
```


----------



## Jimmy (Mar 14, 2014)

I think it's the version of subversion I'm using:

subversion-1.7.9    Version control system

Maybe.


----------



## kpa (Mar 14, 2014)

Remove everything from /usr/src and do a new checkout of the source.

`rm -rf /usr/src`
`svn checkout [url=svn://svn0.eu.freebsd.org/base/releng/10.0]svn://svn0.eu.freebsd.org/base/releng/10.0[/url] /usr/src`


----------



## Jimmy (Mar 14, 2014)

Yep that fixed it. 

After I upgraded subversion still no joy, I got messages regarding 'tree conflicts' on all of the TLDs and TLFs during the svn update /usr/src.  Wasn't sure how to fix so toasted /usr/src and it then began working as expected.


----------



## Jimmy (Mar 14, 2014)

Oh dear, I'm now hitting this issue: viewtopic.php?&t=37283


----------



## tingo (Mar 14, 2014)

Jimmy said:
			
		

> Oh dear, I'm now hitting this issue: viewtopic.php?&t=37283


How is that even possible? That thread talks about cvsup, and you are using svn.


----------



## trh411 (Mar 14, 2014)

Jimmy said:
			
		

> Oh dear, I'm now hitting this issue: viewtopic.php?&t=37283


Did you run a `make buildworld` before running `make buildkernel?`


----------



## Jimmy (Mar 14, 2014)

No I did not because I have already performed a:


```
freebsd-update -r 10.0-RELEASE upgrade
```

But looks like I would have to boot GENERIC and dynamically load custom drivers from loader.conf.  I had thought that once I had updated the binaries with the above I could simply rebuild the kernel and reboot.


----------



## Jimmy (Mar 14, 2014)

Hilariously though:


```
> nextboot -k GENERIC
Error: /boot/GENERIC doesn't exist. Use -f to override.
```


----------



## trh411 (Mar 14, 2014)

Jimmy said:
			
		

> No I did not because I have already performed a:
> 
> freebsd-update -r 10.0-RELEASE upgrade
> 
> But looks like I would have to boot GENERIC and dynamically load custom drivers from loader.conf.  I had thought that once I had updated the binaries with the above I could simply rebuild the kernel and reboot.


Kernels are not built from binaries, but rather from the source code in /usr/src. The `make buildkernel` process relies on certain kernel tools built during the `make buuildworld` step. Now that I understand you only wish to build a new custom kernel, you should be able to get away with running the much shorter `make kernel-toolchain`. This should build all the tools you need to run a successful `make buildkernel` for your custom kernel. Once you've got a custom kernel, `make installkernel` will install it. Then you can reboot your new custom kernel.


----------



## Jimmy (Mar 14, 2014)

That's good to hear because it looks like I'm hitting another bug with freebsd-update when I tried to pull down the GENERIC kernel again, I'll try your suggestion and report back, thank you, but this is what I see at present:


```
> freebsd-update -r 10.0-RELEASE upgrade
The following components of FreeBSD seem to be installed:
kernel/generic src/src world/base world/doc world/games

The following components of FreeBSD do not seem to be installed:

Does this look reasonable (y/n)? y

Fetching metadata signature for 10.0-RELEASE from update4.freebsd.org... done.
Fetching metadata index... done.

The update metadata is correctly signed, but
failed an integrity check.
Cowardly refusing to proceed any further.

[screen is terminating]
```

I understand that kernels are not built _from_ binaries, but they are certainly built _with_ them. So it was my impression that once the binary tools were fetched and installed into the base system with freebsd-update and the relevant source obtained that -- sparing the possibility any essential software was preloaded into memory -- the new system kernel could then be built?


----------



## trh411 (Mar 14, 2014)

I'm not a user of freebsd-update(8), but my understanding is that you need to bring your current system to the latest patch level before you attempt an upgrade (-r FreeBSD-10.0-RELEASE upgrade). Have you done this? Have you reviewed the section in the FreeBSD handbook that deals with the freebsd-update(8) process? See 23.2 FreeBSD Update


----------



## trh411 (Mar 14, 2014)

Jimmy said:
			
		

> I understand that kernels are not built _from_ binaries, but they are certainly built _with_ them. So it was my impression that once the binary tools were fetched and installed into the base system with freebsd-update and the relevant source obtained that -- sparing the possibility any essential software was preloaded into memory -- the new system kernel could then be built?


Have you read 9.5 Building and Installing a Custom Kernel?


----------

