[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting a list of kernels to try in boot.conf



Stoyan Genov wrote:
> 
> Hi,
> 
> On an obsd/3.4 i386 (though arch might not be relevant),

it is...every platform has its own booting process.

> I have the need to boot several customly-named kernels
> in custom locations, in the manner boot(8) will try to boot
> /bsd, /obsd and /bsd.old (that is, try to boot /bsd, if fail
> try to boot /obsd, if fail try to boot /bsd.old)

Careful.  "fail" here is defined in a way you may not agree with.

> Looking at boot(8) and /usr/src/sys/stand/boot/boot.c, it seems
> one can set only one custom location and name of the kernel file
> via ``set image'' in /etc/boot.conf .
> 
> So, questions:
> 1) Does a way to set several custom locations exist?
> 2) If 1) is false, do you think it's worth implementing this
>     feature -- something like ``set image /my/kernel/1 /other/kernels/2''

why?

The process used by the boot loader is pretty simple.  If it looks
like a kernel, it is going to be attempted to be loaded and started. 
If the kernel crashes and dies, the system is either going to hang or
loop, rebooting the same kernel -- it doesn't have a watchdog saying,
"Oh, look, Kernel '/bsd' died, let's go try '/obsd' next".  The only
time that happens (that I have seen) is if there is a read error
loading the kernel or if the first kernel doesn't exist on the disk.

IF this is really all you need, you might get by with hard links to
your file.

Keep in mind /my/kernel/1 will need to be on hd0a, if /my/kernel is on
partition 'g', you would rather use "hd0g:1".  I'm not sure if boot(8)
can pull from a partition other than 'a', nor am I sure if it can pull
from a subdirectory anyway...  Easy enough to find out if you care...

Nick.
-- 
http://www.holland-consulting.net