Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 12:25:58 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        "Rodney W. Grimes" <freebsd-rwg@pdx.rh.cn85.dnsmgr.net>
Cc:        current <current@freebsd.org>
Subject:   Re: Kernel selection in Lua loader
Message-ID:  <CACNAnaGuCT%2B0R3zeHbB=YEXu074f38JWLkJ8OrZAQ0boXrXTjw@mail.gmail.com>
In-Reply-To: <201802211818.w1LII7fh087166@pdx.rh.CN85.dnsmgr.net>
References:  <CAG6CVpUxXgNe1ZoXrzthPcgO=SwDkg-4f-NyME=GTbvdLCiUjw@mail.gmail.com> <201802211818.w1LII7fh087166@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 21, 2018 at 12:18 PM, Rodney W. Grimes
<freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote:
>> On Wed, Feb 21, 2018 at 6:11 AM, Kyle Evans <kevans@freebsd.org> wrote:
>> > On Wed, Feb 21, 2018 at 6:36 AM, David Wolfskill <david@catwhisker.org> wrote:
>> >>
>> >> ...
>> >> kernels="kernel kernel.old kernel.save"
>> >>
>> >> and the Forth loader presented (precisely) those kernels as the
>> >> available options for selecting a kernel to load and boot.
>> >>
>> >
>> > Right, so, we (and by we I mean cem@) actually implemented a form of
>> > auto-detection for kernels. Any directory in in /boot with a file
>> > named 'kernel' inside will be automatically listed, and that
>> > supplemented(*) 'kernels' and 'kernel' specified in loader.conf(5).
>> >
>> > (*) I use "supplemented" because I changed that in r329709, just a
>> > little bit ago, to not do the autodetection if a 'kernels' is
>> > explicitly set in loader.conf(5) My reasoning here is that there's
>> > probably a reason one has set it explicitly, whether it be to hide
>> > bogus kernels or just to slim down the list of kernels they need to
>> > cycle through.
>>
>> Yep.  And to add a little more detail, because I like this behavior,
>> I've convinced Kyle to add a knob to re-enable the autodetection
>> behavior even in the presence of kernels="", by adding a
>> kernels_autodetect="yes" knob to loader.conf (r329733).
>
> Or how about parse a wildcard * in kernels= to mean do the same as
> kernels_autodetect=yes
> the should make it possible to control the order of them on
> the list bo doing something like
> kernels=/boot/kernel;/boot/kernel.old;*;/altboot/kernel;/altboot/kernel.GENERIC
>
>
>
>> Note that any kernels in kernels="" are offered first in the list, in
>> the same order as configured; any additional autodetected kernels
>> follow at the end (as you observed earlier):
>
> The mechansism now only allows autodetec at end, use of a wildcard to
> show when to insert autodetect allows a fairly arbitrary order.
>

I think we might have a problem right now with trying to do this while
Forth is still the default; how would it interpret such an entry?

I'd almost want to go a step further and say that * should indicate
where we search. Right now, it's a hard-coded /boot. I'd express that
in kernels as /boot/*, which tells the loader to search directories
matching /boot/* for a 'kernel' file and use that.

This could then be expanded to do things like /altboot/* and search
/altboot for other kernels. That'd need a little more work because we
don't currently search non-/boot directories[*] when we're actually
trying to load kernels.

[*] Unless they appear in the module_path, then we search for
"$kernel" as a file.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGuCT%2B0R3zeHbB=YEXu074f38JWLkJ8OrZAQ0boXrXTjw>