[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setting a list of kernels to try in boot.conf
---- Nick Holland on 2004-02-07 15:15:53:52 CET (Saturday): ----
> Stoyan Genov wrote:
> > On an obsd/3.4 i386 (though arch might not be relevant),
> it is...every platform has its own booting process.
Yes, of course. I just didn't find the right way to say
"I have read the i386-specific man pages about bootstrapping,
but I didn't read the same man pages for other architectures,
and I do not know whether such a mechanism exists, can be applied
and is worth applying on other architectures than i386" :-)
> > 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.
"fail" = "fail to read and execute".
> > 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''
(answer is long and will make you laugh)
I have acquainted the habit of keeping all my custom kernels
(which I have to build because of RAID, increased number of
some pseudo-devices, and such). Usually, the number of kernels
I build roughly equals the number of kernel patches for an obsd
release. I have also acquainted the habit of naming the kernel files
by the features I put in, for example "3.4-raid-kgdb-008".
After applying 008_sem.patch, I made a typing mistake in boot.conf
on two of the machines :-D . I ended with /bsd on one of them,
and with nothing on the other, because /(o)bsd(.old) were missing there.
Since the machines live all-alone on the other end of the world,
it was quite complicated to bring back the second one.
So, you see it's all too specific, and the idea was born because
I wasn't careful enough...
> 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".
I'm not that naive, although such a feature would be a blessing ;-)
> 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.
That's it. I don't want more than this.
> IF this is really all you need, you might get by with hard links to
> your file.
I suppose that's what I am going to do.
> 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...
Pulling from a /subdirectory of the 'a' partitions works. I have not tested
other partitions, nor /more/than/one/level .