Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2012 13:24:05 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Brett Glass <brett@lariat.net>
Cc:        questions@freebsd.org
Subject:   Re: How to keep freebsd-update from trashing custom kernel?
Message-ID:  <20120813132405.8f912cab.freebsd@edvax.de>
In-Reply-To: <201208130250.UAA08187@lariat.net>
References:  <201208130250.UAA08187@lariat.net>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Sun, 12 Aug 2012 20:50:43 -0600, Brett Glass wrote:
> Everyone:
> 
> Just ran freebsd-update (fetch, then install) on a system on which 
> I run a customized kernel, and discovered that it has overwritten 
> my custom kernel... even though I'd copied the original to 
> /boot/GENERIC when I first installed the system. I was under the 
> impression that creating /boot/GENERIC, and putting the GENERIC 
> kernel in it, would cause freebsd-update to update that directory 
> rather than one's custom kernel. I now must rebuild the kernel to 
> keep the machine working.

That seems to be the default behaviour, as freebsd-update is
not supposed to be used with a custom kernel. It works with
GENERIC kernels (because it updates them by overwriting).



> What went wrong, and how do stop it from recurring?

Nothing went wrong. :-)

Just an idea, not tested: Leave the GENERIC kernel updated
by freebsd-update, and put your own kernel unter a different
name into /boot, for example:

	/boot/kernel/kernel		<- GENERIC kernel
	/boot/mykernel/kernel		<- your kernel

Then change /boot/loader.conf to contain:

	kernel="mykernel"
	bootfile="/boot/mykernel/kernel"

See /boot/defaults/loader.conf and "man loader.conf" for details.
I'm _not_ sure freebsd-update doesn't touch that file, but if
my assumption is correct, it won't, and it will therefore only
update /boot/kernel/ containing the GENERIC kernel that matches
your binarily updated world (so it's a good fallback kernel in
case of problems!), and you boot from /boot/mykernel which still
contains your untouched kernel.

However, what you're doing seems to be "not supported", but it
would be a shame if it was impossible. :-)


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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20120813132405.8f912cab.freebsd>