# Kernel compilation



## dtto86 (Nov 14, 2011)

I installed FreeBSD 9.0-RC1 2 days back from FreeBSD-9.0-RC1-amd64-dvd1.iso and after I started installing xorg, xfce-4.8 from ports. Everything runs flawlessly, but when I started compiling x11/nvidia-driver it gives me error saying 
	
	



```
can't find kernel source tree.***Error code 1"
```

So after some googling, I downloaded the source code for kernel using cvsup. Code for cvsup I used was:
[cmd=]cvsup -g -L 2 cvsup-snapfile[/cmd]

In cvsup-snapfile, I only uncomment "src-sys" while all options for src-,ports- and doc- are commented. Mirror I used was cvsup.FreeBSD.org. The cvsup downloaded the "sys" directory under /usr/src. But when I went through /usr/src/sys/ I came to know that all files which were downloaded had suffix ",v". Is it normal to have ",v" suffix because I never compile kernel before. If it's not then how to remove that ",v" suffix from each file. Bash script which I wrote to remove ",v" suffix removes ",v" successfully, but for that I have to "cd" into each directory and run that script.

My script is:

```
#!/bin/sh
for i in $(ls | grep ,v)
do
  mv $i $(sed 's/\{2\}$//')
done
```

Forgive me if my bash script which I have posted was correct because I am posting this post from other pc but it was running correctly. 
If renaming is required please suggest me a script which goes through each folder and execute the above script without manually going through each directory. By the way, this is my first post.

Hi everyone and thanks in advance.


----------



## dtto86 (Nov 14, 2011)

Script should be:


```
#!/bin/sh
for i in $(ls | grep ,v)
do
  mv $i $(echo "$i" | sed 's/\{2\}$//')
done
```


----------



## SirDice (Nov 14, 2011)

dtto86 said:
			
		

> But ,when I went through /usr/src/sys/ I came to know that all files which was downloaded had suffix ",v".Is it normal to have ",v" suffix because I never compile kernel before.


That's because you downloaded the entire CVS tree, not just the tree you needed.

Take a look at the tag you used. It should be something like RELENG_9.

NB No need for cvsup, csup(1) has been part of the base OS since 6.x.


----------



## dtto86 (Nov 14, 2011)

Thanks SirDice. I'll try csup.


----------

