From owner-freebsd-current@freebsd.org Wed Feb 21 17:10:51 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 D5A1EF164C2 for ; Wed, 21 Feb 2018 17:10:50 +0000 (UTC) (envelope-from cse.cem@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 64E8086F0F for ; Wed, 21 Feb 2018 17:10:50 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 240FDF164BE; Wed, 21 Feb 2018 17:10:50 +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 F0D6FF164BB for ; Wed, 21 Feb 2018 17:10:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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 8DD0786F0A; Wed, 21 Feb 2018 17:10:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f180.google.com with SMTP id 30so2889020iog.2; Wed, 21 Feb 2018 09:10:49 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=DZLc7nV/kOdDdqxS/W6ph72vcvD+DEZZtiUGxRtL0rI=; b=aySkX6qoe+ArlI616kPvwFTcHO3B/G8JZw/In7BIfgOhyniKS0Mjn54nmqyTm6/BKW fTOqbN2lnTZrGXMbgUKGCjxXIr2VpRikcEYCvwjod2u0zaUJSm1MTKdc6RswXHCw8PpF eBP54mezrvlj98N1UxGmEmeuLrBQI6cfDwaCyRIKEUl7JnXNEOCRHoYacXxeIS4ftTi6 wg05D0CIU/IG+YmXj+U2XH1xfav+WhwZxkmE5wjtHf0bjoMEb5mS2E5L2MCItiNm2NYG GHHWWfH9PL4p59YMUaWje4inORgOEoaw4AqEBbLKp/2Y8sydF20VkpQHSsRgPcYBWMi5 soYw== X-Gm-Message-State: APf1xPAn+2fwaaVVKDNs1q6mRMEsRyN4D24OfSvsUgphWAjHLV7H4Hy+ pJvIy4LVMKTXBk4hsJA6BDzyoUhl X-Google-Smtp-Source: AG47ELv1VHIE9EFGwCNdkdR0HmaEXjZmJ+ue0plZF/SAbD4cWLh+XPwfKza8m+Uwy6k8HvGHOdxECA== X-Received: by 10.107.135.207 with SMTP id r76mr4999418ioi.248.1519233043014; Wed, 21 Feb 2018 09:10:43 -0800 (PST) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com. [209.85.223.174]) by smtp.gmail.com with ESMTPSA id z131sm24221290itb.4.2018.02.21.09.10.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 09:10:42 -0800 (PST) Received: by mail-io0-f174.google.com with SMTP id e4so2867593iob.8; Wed, 21 Feb 2018 09:10:42 -0800 (PST) X-Received: by 10.107.41.16 with SMTP id p16mr5021470iop.173.1519233042679; Wed, 21 Feb 2018 09:10:42 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Wed, 21 Feb 2018 09:10:42 -0800 (PST) In-Reply-To: References: <20180221123617.GD1212@albert.catwhisker.org> From: Conrad Meyer Date: Wed, 21 Feb 2018 09:10:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Kernel selection in Lua loader To: David Wolfskill Cc: current , Warner Losh 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 17:10:51 -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). 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): >> 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