Discussion:
A question about downloading FreeBSD kernel code
(too old to reply)
Nan Xiao
2016-07-04 12:23:50 UTC
Permalink
Hi all,

I want to install FreeBSD kernel source files, and my FreeBSD kernel version is:

# freebsd-version -k
10.3-RELEASE-p4

But from ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/, there is only 10.3-RELEASE code.
So is it mapping to my kernel version (10.3-RELEASE-p4)? Or where should I download the right
10.3-RELEASE-p4 code?

Thanks very much in advance!



Best Regards
Nan Xiao (肖楠)
Skype: xiaonan19830818
Jabber/XMPP: ***@xmpp.ru.net
Telegram: nanxiao
Personal website (Chinese): http://nanxiao.me/
Personal website (English): http://nanxiao.me/en
Chinese DTrace website: http://chinadtrace.org/
Eir Nym
2016-07-04 13:28:31 UTC
Permalink

Post by Nan Xiao
Hi all,
# freebsd-version -k
10.3-RELEASE-p4
But from ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/, there is only 10.3-RELEASE code.
So is it mapping to my kernel version (10.3-RELEASE-p4)? Or where should I download the right
10.3-RELEASE-p4 code?
You should download src tarball. It contains kernel inside and you need to unpack anything to /usr/src. I didn't checked if you need other sources or not. I leave every bit of them.
Post by Nan Xiao
Thanks very much in advance!
Best Regards
Nan Xiao (肖楠)
Skype: xiaonan19830818
Telegram: nanxiao
Personal website (Chinese): http://nanxiao.me/
Personal website (English): http://nanxiao.me/en
Chinese DTrace website: http://chinadtrace.org/
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
Warren Block
2016-07-04 14:19:22 UTC
Permalink
Post by Nan Xiao
Hi all,
# freebsd-version -k
10.3-RELEASE-p4
But from ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/, there is only 10.3-RELEASE code.
So is it mapping to my kernel version (10.3-RELEASE-p4)? Or where should I download the right
10.3-RELEASE-p4 code?
Thanks very much in advance!
Usually, uname -a will show the revision number of the code in use.
That revision number can be used to check out the correct version of the
source from the repository. For example, on a 10-STABLE system I have
here:

uname -a
FreeBSD lightning 10.3-STABLE FreeBSD 10.3-STABLE #0 r302243: Mon Jun 27 19:27:54 MDT 2016 ***@lightning:/usr/obj/usr/src/sys/LIGHTNING amd64

So this is built from revision 302243 of the source.

If /usr/src exists, it is deleted to make sure there is no old source in
there:

rm -rf /usr/src

Then check out the source for that revision. I use 'svn' here because I
have installed the Subversion port, but svnlite is in the base system
and usually works the same.

Source for a -RELEASE system will come from the releng branch, so your
checkout will look like this (the nnnnnn coming from the uname -a
output):

svn checkout -r nnnnnn https://svn.freebsd.org/base/releng/10.3 /usr/src
William A. Mahaffey III
1970-01-01 00:00:00 UTC
Permalink
Post by Warren Block
Post by Nan Xiao
Hi all,
I want to install FreeBSD kernel source files, and my FreeBSD kernel
# freebsd-version -k
10.3-RELEASE-p4
But from ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/, there is
only 10.3-RELEASE code.
So is it mapping to my kernel version (10.3-RELEASE-p4)? Or where
should I download the right
10.3-RELEASE-p4 code?
Thanks very much in advance!
Usually, uname -a will show the revision number of the code in use.
That revision number can be used to check out the correct version of
the source from the repository. For example, on a 10-STABLE system I
uname -a
FreeBSD lightning 10.3-STABLE FreeBSD 10.3-STABLE #0 r302243: Mon Jun
So this is built from revision 302243 of the source.
If /usr/src exists, it is deleted to make sure there is no old source
rm -rf /usr/src
Then check out the source for that revision. I use 'svn' here because
I have installed the Subversion port, but svnlite is in the base
system and usually works the same.
Source for a -RELEASE system will come from the releng branch, so your
checkout will look like this (the nnnnnn coming from the uname -a
svn checkout -r nnnnnn https://svn.freebsd.org/base/releng/10.3 /usr/src
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
Did that (revision serializing) start w/ 10.n ? I don't see that on my
9.3R box:

[***@kabini1, ~, 9:32:26am] 490 % uname -a
FreeBSD kabini1.local 9.3-RELEASE-p33 FreeBSD 9.3-RELEASE-p33 #0: Wed
Jan 13 17:55:39 UTC 2016
***@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
[***@kabini1, ~, 9:34:02am] 491 %
--
William A. Mahaffey III

----------------------------------------------------------------------

"The M1 Garand is without doubt the finest implement of war
ever devised by man."
-- Gen. George S. Patton Jr.
Matthew Seaman
2016-07-04 16:32:22 UTC
Permalink
Post by William A. Mahaffey III
Post by Warren Block
Post by Nan Xiao
Hi all,
I want to install FreeBSD kernel source files, and my FreeBSD kernel
# freebsd-version -k
10.3-RELEASE-p4
But from ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/, there is
only 10.3-RELEASE code.
So is it mapping to my kernel version (10.3-RELEASE-p4)? Or where
should I download the right
10.3-RELEASE-p4 code?
Thanks very much in advance!
Usually, uname -a will show the revision number of the code in use.
That revision number can be used to check out the correct version of
the source from the repository. For example, on a 10-STABLE system I
uname -a
FreeBSD lightning 10.3-STABLE FreeBSD 10.3-STABLE #0 r302243: Mon Jun
So this is built from revision 302243 of the source.
If /usr/src exists, it is deleted to make sure there is no old source
rm -rf /usr/src
Then check out the source for that revision. I use 'svn' here because
I have installed the Subversion port, but svnlite is in the base
system and usually works the same.
Source for a -RELEASE system will come from the releng branch, so your
checkout will look like this (the nnnnnn coming from the uname -a
svn checkout -r nnnnnn https://svn.freebsd.org/base/releng/10.3 /usr/src
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
Did that (revision serializing) start w/ 10.n ? I don't see that on my
FreeBSD kabini1.local 9.3-RELEASE-p33 FreeBSD 9.3-RELEASE-p33 #0: Wed
Jan 13 17:55:39 UTC 2016
Warren's system was built locally from some point on the 10-STABLE branch,
with the sources checked out from subversion and without any local
modifications. That's where the r302243 in his uname output comes from. If
he'd checked out the sources through some other VCS, such as Github or he'd
applied patches locally you could tell that from the form of the
revision tag
in the uname output. This is done on the basis that compiling your own
system
is something a developer would do, and revision numbers like that are really
very useful when discussing bugs or other code-related things with other
developers.

William on the other hand, is using the 9.3-RELEASE branch -- presumably
installed and updated through freebsd-update(8). As a standard install
from a release channel (a) we can discover exactly what the revision is
from the release tag in uname(1) and (b) given you're unlikely to be
building your own if you're using freebsd-update(8) the revision tag
stuff doesn't really add anything useful for end-users.

While Warren is correct in his command line:

svn checkout -r nnnnnn https://svn.freebsd.org/base/releng/10.3 /usr/src

actually, for -RELEASE branches, you typically want to have all the
available SA and EN patches applied, and you can do that without having
to know a revision number:

svn checkout https://svn.freebsd.org/base/releng/10.3 /usr/src

However, since you're already using freebsd-update(8), why not use that
to maintain your copy of the system sources instead? When you install,
you need to tick the box about 'installing system sources', or after the
fact, you can download a tarball from one of the FTP servers: eg.

ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.3-RELEASE/src.txz

Untar that so that it populates /usr/src and check that
/etc/freebsd-update.conf lists 'src' as one of the active items on the
'Components' line. Now, when you update your system, it will pull down
the source code changes for any SA or EN patches as well as the binary
patches to the installed system. (Why would you want to do this as well
as applying binary patches to the system? Well, usually it's because
you want to run a non-standard kernel configuration, which you compile
yourself.)

Cheers,

Matthew
Warren Block
2016-07-04 17:50:11 UTC
Permalink
Post by Warren Block
svn checkout -r nnnnnn https://svn.freebsd.org/base/releng/10.3 /usr/src
actually, for -RELEASE branches, you typically want to have all the
available SA and EN patches applied, and you can do that without having
svn checkout https://svn.freebsd.org/base/releng/10.3 /usr/src
Right... but I was concerned with trying to match the installed version
already on the system. Not a problem if world and kernel are going to
be built and installed, though.

Loading...