From nobody Mon Jul 29 22:57:32 2024 X-Original-To: dev-commits-src-all@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 4WXtzd01mDz5S91Y; Mon, 29 Jul 2024 22:57:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXtzc4GJJz438q; Mon, 29 Jul 2024 22:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722293852; 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; bh=Tb00aXQ7V3xhL0siS20zCqU/j31sMSjnEgRrFP3pnW8=; b=KA1S5Av2On+3nqZIGlzV84yIgD/51zyND+QIKNp6iXyPPDIFK8w03eTfCViFJwofizArVF Qy37jjw6+f1kRrsXf4BjM3GUj87AuoFnYZK/bPoZyawd0kjvXhZYX+CWeSD4wxcw2OarOE LfpSOHRJbLt8nH9XA19IWmORPDa80z7MoYkCwPi8dz5pDgJn/ednNZIvPkbPvw0+4YAZT2 RQ/flGDPfnXo6Aq1HLA5yPEl7TOtbI4FkYwWJkdRLaCkVnFV0TyCyV3cuijhTYKeAixuCm 95yHoJN+2VlQBZxN11bRCJYasB06qQEeCnUhn1odSBfA883UKoQtkbB713TR2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722293852; a=rsa-sha256; cv=none; b=cvlN0TAUKzHQxpcT2eRWGnl5xw7sghWCWfoxJLHWfPk+heOapNTKGx2/TnJaB+JRz1r9oJ OLOWH28Dog/baY0AsElGwnPeYOxqcOQuyJaa4QaOxVu288O7jFRDLMwAxcFH+ZX+zKq3/t /R8VRkLXzz6zvPBX+Ro9tAxpSl0pL0CBlpWJE58bBZBS1zPL7aYDO0S1RhdA3Ii8n4QjDi 1GyWOJQkWpum7Jx8XQAeUDIbm7B+ZtnVJpMMy0cZ+SNhA40IV2OkciIttuyIovk8dmjz5I Iq+I5KprEIEZU3z6aKILTz7Y9D6By8/z8rTKUoWfy3vdn23WMRvPs7f8v5PJow== 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=1722293852; 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; bh=Tb00aXQ7V3xhL0siS20zCqU/j31sMSjnEgRrFP3pnW8=; b=HU/OPg06oFVT+SPVgHmVxXn5b2C5c6TE/12+Xx4yleIiR3DnvkeR425rEsq2A6ngwdSNYn 5YYZDHXsr7QFy1YL+GoFKOsmEbONvknwNYWzMjs5y9+U2HQUvpvh6EJIFF07+iuXIrios3 mEsst5nXjyalAsAkrIyzQ8avxUozBNtWQfMTC6GLILbL7pkDiQoiooRxDaWpDAH6svJZrM SSQ1OEsx5CbTBuMGgEFDs2/NIq8PKLU2De9xZsTCbJlcIuBTc85n1BC4OFFHSlYJbC8yHU c/RUUMIp1luSfT9iea4eXCJmwctbeT5qtMoYfuOeUtL0bXhme1V1+GiBbROYEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXtzc3qWDzt4W; Mon, 29 Jul 2024 22:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46TMvWVq049698; Mon, 29 Jul 2024 22:57:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TMvWoH049695; Mon, 29 Jul 2024 22:57:32 GMT (envelope-from git) Date: Mon, 29 Jul 2024 22:57:32 GMT Message-Id: <202407292257.46TMvWoH049695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a2fd7ae87991 - main - stand: Print a warning of the loader is too old List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2fd7ae87991044ca283974ced8f6ed635d1cb0c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2fd7ae87991044ca283974ced8f6ed635d1cb0c commit a2fd7ae87991044ca283974ced8f6ed635d1cb0c Author: Warner Losh AuthorDate: 2024-07-29 22:57:30 +0000 Commit: Warner Losh CommitDate: 2024-07-29 22:57:30 +0000 stand: Print a warning of the loader is too old If the loader is < 3.0, print a warning that it's too old and needs to be upgraded. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45889 --- stand/lua/core.lua | 21 +++++++++++++++++++++ stand/lua/core.lua.8 | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 9226de564348..7b7560ddc820 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -542,6 +542,27 @@ function core.nextConsoleChoice() end end +-- Sanity check the boot loader revision +-- Loaders with version 3.0 have everything that we need without backwards +-- compatible hacks. Warn users that still have old versions to upgrade so +-- that we can remove the backwards compatible hacks in the future since +-- they have been there a long time. +local loader_major = 3 + +function core.loaderTooOld() + return loader.version == nil or loader.version < loader_major * 1000 +end + +if core.loaderTooOld() then + print("**********************************************************************") + print("**********************************************************************") + print("***** *****") + print("***** BOOT LOADER IS TOO OLD. PLEASE UPGRADE. *****") + print("***** *****") + print("**********************************************************************") + print("**********************************************************************") +end + recordDefaults() hook.register("config.reloaded", core.clearCachedKernels) return core diff --git a/stand/lua/core.lua.8 b/stand/lua/core.lua.8 index 84447d7632b9..0bdf88c1a364 100644 --- a/stand/lua/core.lua.8 +++ b/stand/lua/core.lua.8 @@ -218,6 +218,10 @@ If there are no elements, this returns nil and nil. If there is one element, this returns the front element and an empty table. This will not operate on truly associative tables; numeric indices are required. +.It Fn core.loaderTooOld +Returns true if the loader is too old. +Specifically, this means, is the loader old enough to require one or more +workarounds in the current lua base modules. .El .Sh SEE ALSO .Xr loader.conf 5 ,