# Copying the source code tree



## Phishfry (Nov 25, 2017)

I need a certain source tree on my RPi3 as the FreeBSD aarch64 image has no source tree included.
Unfortunately all that available is FreeBSD 12.
The problem I have is when I fetch the /base/head source code it has already advanced in revision beyond my very recent RPi3 download.
Not much differences I am sure, but I want to compile kernel only, not the entire world.
I also understand that I need to keep kernel and world in sync.
I could probably recompile the kernel with the slightly newer source, but I really don't want to take the chance.

So how to get a certain revision of source code. r326056 in particular.
My path went like this. Download the same revision amd64 memstick installer, install and copy the source tree from there to the RPi3.

So the crux of my question is:
Are there any file/directory permissions/ownership or other snafu's that would make a simple copying of source to another platform not work?
I could tar and copy if so needed. Maybe even untar the memstick src.txz file.

Thanks for the help and any pointers appreciated.
I am sorry for discussing /head related issues.


----------



## rigoletto@ (Nov 25, 2017)

If you already has it checked, I guess you need this:

`svn up -r 326056`

If not:

`svn checkout -r 326056 url://etc.`

or

`svn checkout url://etc./path@326056`


----------



## Phishfry (Nov 25, 2017)

Ok Thanks so I will try this next:
`svnlite checkout -r 326056 https://svn.freebsd.org/base/head /usr/src`


----------



## SirDice (Nov 27, 2017)

Phishfry said:


> So the crux of my question is:
> Are there any file/directory permissions/ownership or other snafu's that would make a simple copying of source to another platform not work?
> I could tar and copy if so needed. Maybe even untar the memstick src.txz file.


Nope, there's nothing special about the /usr/src/ directory and can easily be copied or NFS shared with other machines. It doesn't even need to be writable, you can share it read-only with NFS if you want. When building /usr/obj (or wherever MAKEOBJDIRPREFIX is pointing to) is used for the intermediate files.


----------



## balanga (Nov 28, 2017)

Just wondered.... what's the correct procedure for installing the source code tree on one's local hard disk?


----------



## SirDice (Nov 28, 2017)

SVN is the go to tool for that. Use svnlite(1): `svnlite co https://svn.freebsd.org/base/releng/11.1 /usr/src` for example.


----------



## ShelLuser (Nov 28, 2017)

balanga said:


> Just wondered.... what's the correct procedure for installing the source code tree on one's local hard disk?


`svnlite co https://svn.freebsd.org/base/releng/11.1 /usr/src`.


----------



## tobik@ (Nov 28, 2017)

... and if using SVN and freebsd-update(8) together disable the src component in /etc/freebsd-update.conf.


----------



## balanga (Nov 28, 2017)

Anything wrong with this?

```
cd /
fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.0-RELEASE/src.txz
tar zxf src.txz
```


----------



## tobik@ (Nov 28, 2017)

Using 11.0-RELEASE is wrong since it's not supported anymore on 2017-11-30.

Besides that it's ok if you do a freebsd-update(8) run afterwards or apply all errata and security patches since release yourself manually.


----------



## balanga (Nov 28, 2017)

tobik@ said:


> Using 11.0-RELEASE is wrong since it's not supported anymore on 2017-11-30.



Erm....


```
root@Test:~ # date
Tue Nov 28 22:58:22 GMT 2017
```


----------



## SirDice (Nov 29, 2017)

Yes, which means support ends in 2 days.


----------

