From nobody Mon Apr 15 03:44:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VHtMQ1L0bz5Hdkh; Mon, 15 Apr 2024 03:44:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4VHtMQ0qHDz4R5m; Mon, 15 Apr 2024 03:44:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713152658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A/4wxyGtCnIikCGaqX4flPSlPS7eTHPLsPv69DRSlt0=; b=o+nF9a4Em79QAHOyhlCoBvS8QFuUY9LNJEsqAu+4WHMnHGkiAFD9gIkDe1ps1jfnZFEvv/ J9BzgV0bjcNGAblORHMGY3B8NZ4LWgiMtl+Cz9y8NOlJGMyARZ548h1d4+4iGV1r8ZB42f 9frLZRplMz32rAxIjf6gLw9/LfaETmkYxX2QfGDr0ylVcWZVA+y8IYHUrtoo0JmYyco15k PJRD1lUtA/8bbBlcGwE4u7/pbsw/H81PkLukwfzmqom0ir9qAEMk8gVOi+uknwLdV4Qv98 pgkeBH0P761SggbylgHSSaTK/JVrZQdWJXVWPFffqsGQqsfxw+Gg/hq3xP9XXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713152658; a=rsa-sha256; cv=none; b=Bi+mQSFCF1cyaRslFsHZayysKkwq9yOrl5dcD1pdWOpkHdhSrn8ndnoD9zgBAPgedmdRE1 ExXMDD+bfbHEfdvSg9EpESmcZ9pGkHXQtYTRFE8vh3RwdJn6vaC6td0Gs9foE4aXznCzHT 40aPIpe1iZFtgPcpsx8Ix3jh5dQNnW9dI5ZiYrjb9/dY00u9gC3b7bsGwOnlnFB5+YejZO vpI8L0RTzC8OvQDHndOzM89XLl0uTLK9FY8BKNp2/ZMW3Pnb0LHFBZMPXRZGS1eLn76tL4 lR7cIf0wXd0UQ/utVQgv8KlznPU0sz666ZtArCQq5azfXwv5PJB9yyRgxJplyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713152658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A/4wxyGtCnIikCGaqX4flPSlPS7eTHPLsPv69DRSlt0=; b=k7hYB113Txygqo+4VKHjoPQ/jAiUDoCS6neY2MY1H0joiIPBX+FQPqitQ4TRns7j+/e88+ 7a8LhN0Tu22OfjBoZCJE3a0Vhrs7XBsRr2r5ujX+MMc2k4uqmKzThsOSMmKBAWtI8uJWRl Skvg+iIMkfqkDzI/2S1BBu7yCUAjRQYA9g96aGv/1GAvymtAPaFoQNxpbTMUhqDrzJTpgF 8nsIijM5RZXwGySlFWIZ00uI5ootHTy3hl6w8lhrksZNFNTSmZhKcd4FhRxs4hT4Rox85S vsdKLkNR4KboDvwXDwUx4xxR8X1S4HJmmziwQqs0n3a5buai6dfvxIp9jyLhlA== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VHtMP4fX8zfmw; Mon, 15 Apr 2024 03:44:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <6114cce6-dd6e-478f-97af-1a2813f29332@FreeBSD.org> Date: Sun, 14 Apr 2024 22:44:15 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: bc0c6c9cf3a9 - main - freebsd-update: Add check for kernel modules Content-Language: en-US To: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202404141746.43EHkobl002927@gitrepo.freebsd.org> From: Kyle Evans In-Reply-To: <202404141746.43EHkobl002927@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/14/24 12:46, Fernando Apesteguía wrote: > The branch main has been updated by fernape: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bc0c6c9cf3a9f9a54dbdd92dd8f1f65ff8092d17 > > commit bc0c6c9cf3a9f9a54dbdd92dd8f1f65ff8092d17 > Author: Fernando Apesteguía > AuthorDate: 2023-04-19 16:08:47 +0000 > Commit: Fernando Apesteguía > CommitDate: 2024-04-14 17:46:23 +0000 > > freebsd-update: Add check for kernel modules > > People get confused when some software (VirtualBox, etc) does not work as > expected (or at all) after a major upgrade. > > We have a nice way to deal with this when using sources, namely including > PORTS_MODULES in /etc/make.conf, but we lack something similar for binary > updates. > > This patch retrieves a list of kernel modules installed from packages and > advises the user to recompile from ports to avoid problems. > > Approved by: zlei@ > Differential Revision: https://reviews.freebsd.org/D39695 > --- > usr.sbin/freebsd-update/freebsd-update.sh | 58 +++++++++++++++++++++++++++++++ > 1 file changed, 58 insertions(+) > > diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh > index 4a6a8d78330b..d1cd46963a6c 100644 > --- a/usr.sbin/freebsd-update/freebsd-update.sh > +++ b/usr.sbin/freebsd-update/freebsd-update.sh > @@ -655,6 +655,63 @@ fetch_setup_verboselevel () { > esac > } > > +# Check if there are any kernel modules installed from ports. > +# In that case warn the user that a rebuild from ports (i.e. not from > +# packages) might need necessary for the modules to work in the new release. > +upgrade_check_kmod_ports() { > + local mod_name > + local modules > + local pattern > + local pkg_name > + local port_name > + local report > + local w > + > + if ! command -v pkg >/dev/null; then > + echo "Skipping kernel modules check. pkg(8) not present." > + return > + fi > + > + # Most modules are in /boot/modules but we should actually look > + # in every path configured in module_path > + search_files="/boot/defaults/loader.conf /boot/loader.conf" Woof... this is inherently quite fragile, and it completely ignores how loader.conf are actually processed. The final module_path will always get passed to the kernel via kenv(1) and exposed as kern.module_path, please strongly consider just grabbing it from one of them instea . Thanks, Kyle Evans