From owner-freebsd-current@freebsd.org Wed Feb 21 18:18:32 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9078AF1BAE3 for ; Wed, 21 Feb 2018 18:18:32 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 147A069E98 for ; Wed, 21 Feb 2018 18:18:32 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: by mailman.ysv.freebsd.org (Postfix) id CD2A0F1BADF; Wed, 21 Feb 2018 18:18:31 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7086F1BADE for ; Wed, 21 Feb 2018 18:18:31 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E27B69E94; Wed, 21 Feb 2018 18:18:30 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1LII7Q1087167; Wed, 21 Feb 2018 10:18:07 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1LII7fh087166; Wed, 21 Feb 2018 10:18:07 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201802211818.w1LII7fh087166@pdx.rh.CN85.dnsmgr.net> Subject: Re: Kernel selection in Lua loader In-Reply-To: To: cem@freebsd.org Date: Wed, 21 Feb 2018 10:18:07 -0800 (PST) CC: David Wolfskill , current , Warner Losh X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 18:18:32 -0000 > On Wed, Feb 21, 2018 at 6:11 AM, Kyle Evans wrote: > > On Wed, Feb 21, 2018 at 6:36 AM, David Wolfskill 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. > >> with the Lua loader, I was being offered a choice among 4 kernels > >> (rather than the expected 3). Cycling through them (twice; I wanted > >> to be sure the behavior was reproducible), I noted that the presented > >> options were: > >> > >> * default/kernel > >> * kernel.old > >> * kernel.save > >> * kernel.panic > >> > >> (in that sequence). > > Best, > Conrad -- Rod Grimes rgrimes@freebsd.org