From owner-freebsd-questions@freebsd.org Mon Jul 4 14:20:06 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F19EB91E99 for ; Mon, 4 Jul 2016 14:20:06 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF3E212E for ; Mon, 4 Jul 2016 14:20:05 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id u64EJMOq040503 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 4 Jul 2016 08:19:22 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id u64EJM6R040500; Mon, 4 Jul 2016 08:19:22 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Mon, 4 Jul 2016 08:19:22 -0600 (MDT) From: Warren Block To: Nan Xiao cc: freebsd-questions Subject: Re: A question about downloading FreeBSD kernel code In-Reply-To: <2016070420234846698317@chinadtrace.org> Message-ID: References: <2016070420234846698317@chinadtrace.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Mon, 04 Jul 2016 08:19:22 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2016 14:20:06 -0000 On Mon, 4 Jul 2016, Nan Xiao wrote: > 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! 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 root@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