From owner-dev-commits-src-all@freebsd.org Mon Feb 8 15:22:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36B43536AC2; Mon, 8 Feb 2021 15:22:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ8sW0x1zz3tlt; Mon, 8 Feb 2021 15:22:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 135C5266C3; Mon, 8 Feb 2021 15:22:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id q85so2405433qke.8; Mon, 08 Feb 2021 07:22:39 -0800 (PST) X-Gm-Message-State: AOAM533qkRWzmGWOo1B1yjSFHcf6MObstldQAC/q+qBst+nLbPbTi2h+ XvPk0AL8OXLMIKiGQSwB4/yfOHxAzeOYou1G+N0= X-Google-Smtp-Source: ABdhPJw/nKbjAsQTUEyQeeN+Jzy5piR5L9unDFjC1k0NlnOg5DwJWuAuXeBBb4Wk5AIQwroCJHbqD7oSLu9DijGvUbI= X-Received: by 2002:a37:f50d:: with SMTP id l13mr8954784qkk.34.1612797758723; Mon, 08 Feb 2021 07:22:38 -0800 (PST) MIME-Version: 1.0 References: <202102080704.11874w7E017472@gitrepo.freebsd.org> <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> In-Reply-To: <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> From: Kyle Evans Date: Mon, 8 Feb 2021 09:22:25 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Eugene Grosbein Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 15:22:39 -0000 On Mon, Feb 8, 2021 at 9:07 AM Eugene Grosbein wrote: > > 08.02.2021 21:58, Kyle Evans wrote: > > >>>> kld_list cannot do that. > >>> > >>> Huh? kld_list accepts a full pathname, which is the same kind of > >>> specification you'd need to do with one from port in loader with > >>> *_name. > >> > >> Good, but seems to be undocumented. > >> > > > > In what sense? Is there some other place that kld_list is even > > documented than kldload(8)? > > Naturally: rc.conf(5), also in /etc/defaults/rc.conf > Wow, that documentation is just flat wrong for multiple reasons. kld_list (str) A whitespace-separated list of kernel modules to load right after the local disks are mounted, without any .ko extension or path. Loading modules at this point in the boot process is much faster than doing it via /boot/loader.conf for those modules not necessary for mounting local disks. The second part of the first sentence is a self-imposed limitation, and an incredibly unimportant one at that. Specifying a .ko will only break the existing "Is it loaded" behavior and cause it to always try, which is mostly a nuisance at best because it will get rejected if the kldstat inquiry is wrong -- the kld rc script will append .ko whether the path has one or not, so this should be fixed. Despite that, a path will work just fine for the most part; kldstat -v shows the fully qualified path. If it wanted to be improved, it just needs to basename what it was given to be able to detect if it was loaded from any other path and pass that in as the -e argument to load_kld if it really was a file. It's not wrong about loading modules being faster here, and at some point in the past it was even necessary due to loader(8) being too early or problematic in some terrible cases (e.g. nvidia modsetting bits), but the second half of that sentence should probably just be omitted or reworked to more vaguely refer to "... those modules not necessary for booting the system, including those required for mounting the root filesystem." The key changes being that there are other reasons you might need to load something early enough in boot, and that root isn't always a local disk. It's OK to call out the more common case for folks, but this feels a lot more absolute than it needs to be.