# Problems Upgrading



## douglasfim (Sep 7, 2010)

where can I download the source code of the kernel? I want to compile the latest kernel

I'm currently having a problem compilation, this showing the following error


```
===> linux (all)
cc -Os -march=native -pipe -ftree-vectorize -ftracer -march="native" -DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 -fno-strict-aliasing -Werror -D_KERNEL 
-DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /usr/src/sys/amd64/compile/MYKERNEL/opt_global.h -I. -I@ -I@/contrib/altq -
finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -fno-omit-frame-pointer -
I/usr/src/sys/amd64/compile/MYKERNEL -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float 
-fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -
Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c 
/usr/src/sys/modules/linux/../../compat/linux/linux_futex.c
cc1: warnings being treated as errors
/usr/src/sys/modules/linux/../../compat/linux/linux_futex.c: In function 'release_futexes':
/usr/src/sys/modules/linux/../../compat/linux/linux_futex.c:783: warning: 'next_entry' may be used uninitialized in this function
*** Error code 1

Stop in /usr/src/sys/modules/linux.
*** Error code 1

Stop in /usr/src/sys/modules.
*** Error code 1

Stop in /usr/src/sys/amd64/compile/MYKERNEL.
```

Where do I find a new kernel? the only way and using CVS?


----------



## SirDice (Sep 7, 2010)

douglasfim said:
			
		

> where can I download the source code of the kernel? I want to compile the latest kernel


First, this is not linux. The kernel is not a single entity with FreeBSD. 

Second: Handbook: Chapter 24 Updating and Upgrading FreeBSD


----------



## douglasfim (Sep 7, 2010)

and if I accidentally delete a file from the directory /usr/src/sys/modules

I have to do to regain the directory or file?


----------



## da1 (Sep 7, 2010)

if you use cvsup for instance, no.

but do read the manual


----------



## douglasfim (Sep 7, 2010)

then, in this case I have to delete the directory /usr/src and download everything again? not have any way of getting the files separately? any way to download via ftp

I'm reading the manual =)


----------



## Beastie (Sep 7, 2010)

The source (for 8.1-RELEASE) is available on disc1 as well as here.
These are the same files and both can be installed using the included shell script: `# ./install all` or any other option.


----------



## douglasfim (Sep 7, 2010)

thanks man

I am already downloading

I'm downloading the entire directory, in this case got so using the "wget"

`$ wget -r [url]ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/src/[/url]`

how to do this with the "fetch"?


----------



## Beastie (Sep 7, 2010)

douglasfim said:
			
		

> how to do this with the "fetch"?


You do not, since fetch(1) does not support "recursive downloading".

However, you can always make a quick and dirty shell script to do just that.

```
#!/bin/sh

base=ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/src
dest=./files

fetch $base/CHECKSUM.MD5

mkdir $dest
cd $dest

while read checksum
do
	fetch $base/`echo $checksum | awk '{ print $2 }' | sed 's/(//g;s/)//g'`
done < ../CHECKSUM.MD5
```
Feel free to modify/optimize.


----------



## douglasfim (Sep 14, 2011)

solved, thanks


----------

