Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 2013 22:18:51 +0200
From:      Polytropon <freebsd@edvax.de>
To:        andreas scherrer <ascherrer@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Keeping FreeBSD with custom kernel up to date: freebsd-update no option?
Message-ID:  <20130416221851.5d898701.freebsd@edvax.de>
In-Reply-To: <516DA8A8.5040305@gmail.com>
References:  <516DA8A8.5040305@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Apr 2013 21:38:16 +0200, andreas scherrer wrote:
> Dear FreeBSD savvies
> 
> I am (still) struggling to understand how to keep my FreeBSD system up
> to date ("world"/system, not ports). I want to "track" RELEASE (not a
> development branch) and I want to receive security related updates. And
> I want to run a custom kernel.

Without actually havint tested it, it seems that if you want
to use freebsd-update (binary updating), you should note this:

In /etc/freebsd-update.conf, you should have the line for what
to update as "Components src world".

This should prevent overwriting of the kernel, but you need to
compile your kernel and install it. The component "src" will
make sure you have the proper kernel sources. I assume a custom
kernel configuration file in /usr/src/sys/{i386|amd64}/conf/
is _not_ being overwritten by freebsd-update.

Use the -r option of freebsd-update to specify the correct
release if required. It should follow -RELEASE-p<N> for the
currentl patchlevel N (which you intend to follow) normally.



> From what I understand I cannot use "freebsd-update" in this case
> because it will invariably either overwrite my custom kernel (if I have
> "Components kernel" in the config file) or not update the kernel sources
> in /usr/src/sys (when I do not have "Components kernel" in the config
> file). See [1].

As far as I read from "man freebsd-update.conf", the "src" component
will not exclude kernel sources; "kernel" refers to the kernel and
the modules as binary stuff.

This is the relevant text passage:

	The components are ``src''
	(source code), ``world'' (non-kernel binaries),
	and ``kernel''; the sub-components are the indi-
	vidual distribution sets generated as part of
	the release process (e.g., ``src/base'',
	``src/sys'', ``world/base'', ``world/catpages'',
	``kernel/smp'').  Note that prior to
	FreeBSD 6.1, the ``kernel'' component was dis-
	tributed as part of ``world/base''.

So "src" will include "src/sys" which is the kernel sources you
will need to build your custom kernel.



> This leaves me with the only possibility to use SVN to update /usr/src,
> right?

No, but it might be the "more advanced" alternative, and it should
work. Note that in _this_ case, you will also have to rebuild the
world, so kernel and world are in sync after an update. Refer to
the comment header of /usr/src/Makefile for the whole process that
has to be performed after updating (or see in the Handbook: the
section about updating by source).



> I have a copy of the SVN sources (for the outdated RELEASE-9.0.0
> but that's a different story), see below for "svn info"). As I
> understand [2] I cannot mix freebsd-update and SVN, right?

It could cause trouble. Deciding for _one_ way should be better.



> So I can run "svn update" in /usr/src whenever I like. But what then? Do
> I need to rebuild the world and my custom kernel every time I run "svn
> update" (and there are some updates)?

Yes, or better: As soon as it is required. This depends on _what_
has been part of the update. For example, kernel updates _can_
require updates of userland programs or libraries, but it's also
possible that it's not the case. To be sure, rebuild.



> I'm on a low powered consumer
> device and it takes considerable amount of time to build the world and
> kernel (plus I still don't feel comfortable doing such tasks remotely).

In this case, use freebsd-update as explained at the beginning of
my message: Update components "world" and "src", leave out "kernel",
the rebuild the kernel by source and install it. Then reboot.



> Is this really "the way to do it" or am I missing something?

There are _several_ ways to do it. :-)



> There are quite some posts, websites and threads out there (see [3] or
> [4] for example) about this topic but (surprisingly?) I could not (yet)
> find a conclusive answer.

This is because the answer depends on what you actually want to do
(follow RELEASE, STABLE, CURRENT), and how you want to do it (binary,
by source).




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130416221851.5d898701.freebsd>