From owner-freebsd-current@freebsd.org Wed Feb 21 18:26:24 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 39A20F1C668 for ; Wed, 21 Feb 2018 18:26:24 +0000 (UTC) (envelope-from byond.lenox@gmail.com) 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 C61086A63B for ; Wed, 21 Feb 2018 18:26:23 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 87723F1C667; Wed, 21 Feb 2018 18:26:23 +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 60266F1C666 for ; Wed, 21 Feb 2018 18:26:23 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1E256A63A for ; Wed, 21 Feb 2018 18:26:22 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f46.google.com with SMTP id t204so3718157lff.9 for ; Wed, 21 Feb 2018 10:26:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dyzNrM25wFERvjnDJL/7gU01sFvEq4qXAim0oUp7C7I=; b=d84gU/atFUmUGlDgoVcLm7Muh7LfJGixOy7D3BDMai/Zwb2hpQGLQf9m//5fmQM2YJ CID5pzFned/wcgt6NdbH3vk8chIZ8sRadf2K1oWrJI9XMxxAsBxYCHronu0T5u0fjzT/ 4gf/QYzBc+HmuDXfJDu2LarvkeYQVKykhNWNznHRkZIjiiGMmsJFZBVy+Mcv5C3H5CCC FKtmawcNNJ84/+fwP7G0KUdda4GAvZ9uCHaHmSTyFxbM+syydFFAzKGi8fiongiO5MCu UlthJ6RbeYxNyygo+bVgjHI7dTS4NbWwk3qamSmdelfHmutXcq727E4qGxwWMQOT5U7D 6M1Q== X-Gm-Message-State: APf1xPBbBxg5LKFcCcoK/DZFdwhI6p8fZgdnSQx5eHx0bgrxW28esMA3 2ue0lfpWv1cIba4vhIoxjBlA7vNu X-Google-Smtp-Source: AH8x2246mI/TdubWQGOEBHVP4kfzsUItVoppvMA+f28sco17oDPl8O8NvK+kPalCJdP4LGANlwdfLA== X-Received: by 10.46.68.78 with SMTP id r75mr3000656lja.13.1519237580721; Wed, 21 Feb 2018 10:26:20 -0800 (PST) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com. [209.85.215.48]) by smtp.gmail.com with ESMTPSA id 207sm2305285lfb.61.2018.02.21.10.26.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 10:26:20 -0800 (PST) Received: by mail-lf0-f48.google.com with SMTP id x196so3701145lfd.12 for ; Wed, 21 Feb 2018 10:26:19 -0800 (PST) X-Received: by 10.25.158.149 with SMTP id h143mr2163940lfe.129.1519237579433; Wed, 21 Feb 2018 10:26:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Wed, 21 Feb 2018 10:25:58 -0800 (PST) In-Reply-To: <201802211818.w1LII7fh087166@pdx.rh.CN85.dnsmgr.net> References: <201802211818.w1LII7fh087166@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 21 Feb 2018 12:25:58 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Kernel selection in Lua loader To: "Rodney W. Grimes" Cc: current Content-Type: text/plain; charset="UTF-8" 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:26:24 -0000 On Wed, Feb 21, 2018 at 12:18 PM, Rodney W. Grimes wrote: >> 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. > 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.