# [PC-BSD] Fetch correct kernel sources



## Peter2121 (Sep 21, 2014)

Hello,
I am on PCBSD 10 and I would like to fetch kernel sources. Unfortunately, I don't know exactly what branch should I use.
Is there any way to know it on my running system? What is the exact command I should use to fetch kernel sources for my system?

```
[peter@pcbsd-peter ~]$ uname -a
FreeBSD pcbsd-peter 10.0-RELEASE-p17 FreeBSD 10.0-RELEASE-p17 #0: Tue Sep 16 14:33:46 UTC 2014     root@amd64-builder.pcbsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## kpa (Sep 21, 2014)

*Re: Fetch correct kernel sources*

On a vanilla FreeBSD 10.0-RELEASE the correct branch would be releng/10.0 but since you're on PCBSD you have to use PCBSD's own SVN repositories. Ask on the PCBSD forums for more assistance. This is how it would be done on FreeBSD:



```
svnlite co https://svn0.eu.freebsd.org/base/releng/10.0 /usr/src
```


----------



## Peter2121 (Sep 21, 2014)

*Re: Fetch correct kernel sources*


```
[root@pcbsd-peter] /usr/src# svnlite co https://svn0.eu.freebsd.org/base/releng/10.0 /usr/src
svn: E000049: Unable to connect to a repository at URL 'https://svn0.eu.freebsd.org/base/releng/10.0'
svn: E000049: Error running context: Can't assign requested address
```
Internet connection - OK :

```
[root@pcbsd-peter] /usr/src# ping svn0.eu.freebsd.org
PING svnmir.bme.freebsd.org (213.138.116.72): 56 data bytes
64 bytes from 213.138.116.72: icmp_seq=0 ttl=54 time=50.816 ms
64 bytes from 213.138.116.72: icmp_seq=1 ttl=54 time=50.353 ms
```


```
[root@pcbsd-peter] /usr/src# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
	ether 5c:26:0a:83:d2:f1
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect
	status: no carrier
iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 08:11:96:80:44:c8
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 08:11:96:80:44:c8
	inet 192.168.211.14 netmask 0xffffff00 broadcast 192.168.211.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
	status: associated
	ssid ppp-rrr channel 11 (2462 MHz 11g) bssid 00:18:39:21:49:c6
	country US authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit
	TKIP 3:128-bit txpower 11 bmiss 10 scanvalid 60 bgscan bgscanintvl 300
	bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
```
What I missed??


----------



## kpa (Sep 21, 2014)

*Re: Fetch correct kernel sources*

Works fine here so I have no idea why it's failing for you. You can't use those sources anyway as I said because you're on PCBSD and not on plain FreeBSD, PCBSD uses its own customized sources for building the world and kernel. Ask on the PCBSD forums.


----------



## junovitch@ (Sep 22, 2014)

*Re: Fetch correct kernel sources*

PCBSD uses Git.  The sys/conf/newvers.sh on the releng/10.0 branch on Github reflects 10.0-RELEASE-p17 so this should get you what you are looking for.
`git clone [url=https://github.com/pcbsd/freebsd]https://github.com/pcbsd/freebsd[/url] -b releng/10.0 /usr/src`


----------



## Peter2121 (Sep 22, 2014)

*Re: Fetch correct kernel sources*

Thanks, @junovitch, this is the information I was searching for.
Anyway, I cannot compile it on my PC. 

```
/usr/src/sys/dev/advansys/adwcam.c:104:1: error: unused function 'adwccbstatus'
      [-Werror,-Wunused-function]
adwccbstatus(union ccb* ccb)
^
1 error generated.
*** Error code 1
```
Probably, some old build configuration is still here as it compiles without problem on the fresh install.


----------



## SirDice (Sep 22, 2014)

*Re: Fetch correct kernel sources*

Issues with PC-BSD should be asked on their forums.

PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives


----------



## Peter2121 (Sep 22, 2014)

@SirDice,
Sorry.
http://forums.pcbsd.org/showthread.php?t=23058


----------



## junovitch@ (Sep 22, 2014)

The function you referenced appears to have been removed in r259825 @ http://svnweb.freebsd.org/base?view=revision&revision=259825 and later on in r259825 for 10.0-STABLE.  If it breaks the build using the default options, it seems like it would have been fixed for the release.  It probably would be worth taking a look around your local environment about would could be causing the error and asking for more help on the PCBSD side about what you find in your environment.


----------

