[rfc] replacing /boot/kernel.old with a unique directory name

Test Rat ttsestt at gmail.com
Sun Aug 14 18:52:01 UTC 2011


Freddie Cash <fjwcash at gmail.com> writes:

> On Sat, Aug 13, 2011 at 12:51 PM, Alexander Best <arundel at freebsd.org>wrote:
>
>> hi there,
>>
>> i just had the following idea: how about instead of copying the current
>> kernel
>> to /boot/kernel.old and then installing the new one under /boot/kernel as
>> the
>> results of target installkernel, we create a unique directory name for the
>> old
>> kernel?
>>
>> something like /boot/kernel-r${revision}-${/dev/random}?
>>
>> that would let people not only boot the previous kernel, but all kernels
>> that
>> have been replaced by target installkernel. this would make tracking
>> issues,
>> which have been introduced by a certain commit much easier, imho.
>>
>> i don't think implementing this logic would be that difficult. the only
>> problem
>> i see is with ${/dev/random} in the case where people are running a kernel
>> without /dev/{u}random support.
>>
>
> A better method may be to use KODIR to install the *new* kernel to a unique
> directory via installkernel (make KERNCONF=SOMEKERNEL
> KODIR=/boot/SOMEKERNEL-rev-whatever installkernel) and then using "nextboot
> -k SOMEKERNEL-rev-whatever" to set that kernel as bootable on the next boot.
>
> You reboot, make sure everything works with SOMEKERNEL-rev-whatever, and
> then make that the default kernel (rm -rf /boot/kernel; cp -Rvp
> /boot/SOMEKERNEL-rev-whatever /boot/kernel; shutdown -r now).
[...]

nextboot needs write access in loader to reset kernel, which is only
available for ufs. So, forget about zfs and every other fs from
libstand(3), e.g. ext2fs, msdosfs, nfs.

bootonce is also only supported in gptboot (ufs), not gptzfsboot.


More information about the freebsd-current mailing list