Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread Paul Schmehl
--On January 2, 2013 6:45:50 PM +0100 andreas scherrer 
ascher...@gmail.com wrote:



Hi

This can be considered a follow up to the message How to keep
freebsd-update from trashing custom kernel? sent to this list by Brett
Glass on August 13th 2012 (see [1]). Unfortunately there is no solution
to the problem in that thread (or I cannot see it).

I am running currently running 9.0-RELEASE-p4 and freebsd-update
recommends to update to p5. It states:

-
The following files will be updated as part of updating to 9.0-RELEASE-p5:
/boot/kernel/kernel
snip
-

And from experience this is what it will do: replace /boot/kernel/kernel
which is my custom kernel with a GENERIC kernel.

As it seems that freebsd-update works by comparing a hash of
/boot/kernel/kernel with the GENERIC kernel's hash I checked the md5 and
sha1 hash of /boot/kernel/kernel and /boot/GENERIC/kernel. They differ
(see [3]).

So why is freebsd-update going to overwrite my custom kernel? And how
can I prevent it from doing so?



Read man (5) freebsd-update.conf.  Particularly the COMPONENTS portion that 
explains how to update world without changing kernel.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead. Thomas Jefferson
There are some ideas so wrong that only a very
intelligent person could believe in them. George Orwell

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread Michael Sierchio
The confusion comes from the fact that the original behavior of
freebsd-update was NOT to update the kernel binaries if a custom kernel was
detected.

FYI my /etc/freebsd-update.conf has

# Components of the base system which should be kept updated.
#Components src world kernel
Components src world
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread andreas scherrer
on 2.1.13 19:15  Paul Schmehl said the following:
 --On January 2, 2013 6:45:50 PM +0100 andreas scherrer
 And from experience this is what it will do: replace /boot/kernel/kernel
 which is my custom kernel with a GENERIC kernel.

 As it seems that freebsd-update works by comparing a hash of
 /boot/kernel/kernel with the GENERIC kernel's hash I checked the md5 and
 sha1 hash of /boot/kernel/kernel and /boot/GENERIC/kernel. They differ
 (see [3]).

 So why is freebsd-update going to overwrite my custom kernel? And how
 can I prevent it from doing so?

 
 Read man (5) freebsd-update.conf.  Particularly the COMPONENTS portion
 that explains how to update world without changing kernel.

Thanks for pointing this out. I might change my freebsd-update.conf to
not update the kernel. But still I believe this to be more of a kludge
than a solution: in my opinion the handbook suggests that a custom
kernel should be detected and left alone. But at the same time a GENERIC
kernel in /boot/GENERIC should be patched.

http://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html
-
However, freebsd-update will detect and update the GENERIC kernel in
/boot/GENERIC (if it exists), even if it is not the current (running)
kernel of the system.
-

Furthermore if I remove the kernel option from the COMPONENTS in
freebsd-update.conf I think I will not get the kernel source patches
anymore, right? Which in turn means I have to get them via some other
mechanism, no?

From the same link as above to the handbook:
-
Unless the default configuration in /etc/freebsd-update.conf has been
changed, freebsd-update will install the updated kernel sources along
with the rest of the updates.
-

I think something does not add up here but I can't get my head around it
(yet?).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread Michael Sierchio
On Wed, Jan 2, 2013 at 11:18 AM, andreas scherrer ascher...@gmail.comwrote:

This is no longer true, though it was true at the time that was written...

-
 However, freebsd-update will detect and update the GENERIC kernel in
 /boot/GENERIC (if it exists), even if it is not the current (running)
 kernel of the system.


This is no longer true, though it was true at the time


 -

 Furthermore if I remove the kernel option from the COMPONENTS in
 freebsd-update.conf I think I will not get the kernel source patches
 anymore, right? Which in turn means I have to get them via some other
 mechanism, no?


No.  If you  have

Components src world

you'll get all sources - which you want, presumably, since /usr/src/sys
changes are sometimes motivated by security vulnerabilities..

- M
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread Paul Schmehl
--On January 2, 2013 8:18:38 PM +0100 andreas scherrer 
ascher...@gmail.com wrote:



on 2.1.13 19:15  Paul Schmehl said the following:

--On January 2, 2013 6:45:50 PM +0100 andreas scherrer

And from experience this is what it will do: replace /boot/kernel/kernel
which is my custom kernel with a GENERIC kernel.

As it seems that freebsd-update works by comparing a hash of
/boot/kernel/kernel with the GENERIC kernel's hash I checked the md5 and
sha1 hash of /boot/kernel/kernel and /boot/GENERIC/kernel. They differ
(see [3]).

So why is freebsd-update going to overwrite my custom kernel? And how
can I prevent it from doing so?



Read man (5) freebsd-update.conf.  Particularly the COMPONENTS portion
that explains how to update world without changing kernel.


Thanks for pointing this out. I might change my freebsd-update.conf to
not update the kernel. But still I believe this to be more of a kludge
than a solution: in my opinion the handbook suggests that a custom
kernel should be detected and left alone. But at the same time a GENERIC
kernel in /boot/GENERIC should be patched.

http://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html
-


That needs to be updated.


However, freebsd-update will detect and update the GENERIC kernel in
/boot/GENERIC (if it exists), even if it is not the current (running)
kernel of the system.
-

Furthermore if I remove the kernel option from the COMPONENTS in
freebsd-update.conf I think I will not get the kernel source patches
anymore, right? Which in turn means I have to get them via some other
mechanism, no?



See UpdateIfUnmodified in the man page.  You can specify a regex pattern 
that prevents the kernel from being modified but still downloads the 
sources.


Or you can simply pull source from svn, which I think would be my preferred 
method.  Once you've made the first pull, you can use svn to pull all the 
kernel updates subsequent to that first pull and then buildkernel as you 
normally do.




From the same link as above to the handbook:

-
Unless the default configuration in /etc/freebsd-update.conf has been
changed, freebsd-update will install the updated kernel sources along
with the rest of the updates.
-

I think something does not add up here but I can't get my head around it
(yet?).



The Handbook is out of date.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead. Thomas Jefferson
There are some ideas so wrong that only a very
intelligent person could believe in them. George Orwell

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread Paul Schmehl
--On January 2, 2013 1:46:25 PM -0600 Paul Schmehl 
pschmehl_li...@tx.rr.com wrote:



--On January 2, 2013 8:18:38 PM +0100 andreas scherrer
ascher...@gmail.com wrote:


on 2.1.13 19:15  Paul Schmehl said the following:

--On January 2, 2013 6:45:50 PM +0100 andreas scherrer

And from experience this is what it will do: replace
/boot/kernel/kernel which is my custom kernel with a GENERIC kernel.

As it seems that freebsd-update works by comparing a hash of
/boot/kernel/kernel with the GENERIC kernel's hash I checked the md5
and sha1 hash of /boot/kernel/kernel and /boot/GENERIC/kernel. They
differ (see [3]).

So why is freebsd-update going to overwrite my custom kernel? And how
can I prevent it from doing so?



Read man (5) freebsd-update.conf.  Particularly the COMPONENTS portion
that explains how to update world without changing kernel.


Thanks for pointing this out. I might change my freebsd-update.conf to
not update the kernel. But still I believe this to be more of a kludge
than a solution: in my opinion the handbook suggests that a custom
kernel should be detected and left alone. But at the same time a GENERIC
kernel in /boot/GENERIC should be patched.

http://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html
-


That needs to be updated.


However, freebsd-update will detect and update the GENERIC kernel in
/boot/GENERIC (if it exists), even if it is not the current (running)
kernel of the system.
-

Furthermore if I remove the kernel option from the COMPONENTS in
freebsd-update.conf I think I will not get the kernel source patches
anymore, right? Which in turn means I have to get them via some other
mechanism, no?



See UpdateIfUnmodified in the man page.  You can specify a regex pattern
that prevents the kernel from being modified but still downloads the
sources.



I wasn't thinking when I wrote this.  Freebsd-update pulls *binary* copies 
of files, so you're not ever going to get the src files to rebuild your 
kernel from freebsd-update.  You need to pull those in using svn.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead. Thomas Jefferson
There are some ideas so wrong that only a very
intelligent person could believe in them. George Orwell

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: freebsd-update patches custom /boot/kernel/kernel which it should not

2013-01-02 Thread Matthew Seaman
On 02/01/2013 20:55, Paul Schmehl wrote:
 I wasn't thinking when I wrote this.  Freebsd-update pulls *binary*
 copies of files, so you're not ever going to get the src files to
 rebuild your kernel from freebsd-update.  You need to pull those in
 using svn.

Not so.  Take a look at /etc/freebsd-update.conf -- if you have 'src'
listed as one of the Components, freebsd-update will keep your /usr/src
up to date.

Primarily this is intendend for people that want to do binary updates of
userland, but compile their own kernels for particular device support or
whatever reason.  However there's no reason why you couldn't just use
freebsd-update just to grab system sources, and them update by building
and installing world.

If you want to track a release brance, and you don't intend to do any
development work on the sources, then freebsd-update is going to be a
lot more efficient for you than SVN.  Outside that particular audience,
however, svn rules.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey




signature.asc
Description: OpenPGP digital signature