From nobody Thu Aug 01 14:50:31 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 4WZX2J2sRzz5Sswv; Thu, 01 Aug 2024 14:50:32 +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 4WZX2J0JZzz4JZl; Thu, 1 Aug 2024 14:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523832; 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=Qbt2WEJiwl9M9RuswbMUcl0dx5TP8kLYW9T9hTJYYcE=; b=pr77PAj/9lzT9MC6fOYEnrrUaB/zL29JWSmhY12bnOOEvFH5FHdhAkgqt/4wJCrBNLuTtO SiV7lUktsgaG+qvSCBj7DFuAmAXfAu/cGExBASigpSzbmFdGwfOSwyxvF4SiEmE0E/HMsZ OIin7XcUOOb3bo84QnReAan40XSCgUf9H89eJ5F1KkJOO3DjZOc7SbaNfBMoHD9fMOWwtS h8yVbnmBRL8Fpeays9Mi0Xev4NINc87IeHOX4CXFTU66X3KC9w7aw1/EknnPk0XeANYvol V1bYJxCCvdEX7pc0Fi+uPYzV+cjYCTufDV/c6l+Gj4wD+yOcUfHsgf0lvP8c+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523832; a=rsa-sha256; cv=none; b=JY/1wfVXnY2INIPImrLqqQm9+vNIIIXHuv9edprezMEdmrlObwqtKJcYkr0VGXd1ob24mf idpZWu1M6NgqfBV78uSUnZKOWABJ/pcc5D7Aaa5iROTaoRv2/V6APmCTv0gEVyY9c3YdAk 3um3AQWE7yK7Hbz/K7fapJOiDoaneGIRSSfAbhEabHAQ64LiQuaX8uUhbXuv8Nr1X8Li2Z nRvr1qKRJgsE4TY0tPKI+E25+GTFPF8aIhMF4HXgG7kyTvTVweADFNVuea6hI39G17g6N5 wjTzUnHaOX46oBGpzqGawy8V1xcEOhr4HxjZkdWpu+ODWx5BUexmy4FbAr1dww== 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=1722523832; 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=Qbt2WEJiwl9M9RuswbMUcl0dx5TP8kLYW9T9hTJYYcE=; b=r0SaP0k4ql/+VwOPE2hvuYh32K7j+Gm3SaSd04oCgQNnCzZnOJbtrf1yyJKVHyDn/S+/EA Rn/lFjbpBXfavSNYb+4Msvgyg+/vKoPwYYmpa7QUX1HXNpo1mqV2LAxQU6jV9PGMlnVZXO UTzhvovKN6pv7npOSe9lJbEidEHaJnp9xqMhPG10ddrkopsnOw0vyWooQMzhOjWgbskcA2 dcs8qzFJbTDANESoD4hv1chAga+qI+iMZNLB00dPCDTiF9yfeA2Ic1usnAXA5peDl0GagT PEZCSe68L6gwyAxYVvp5Z5T9PdsHNt1/KzHroaBZMhiojj7pWKVp8N9dmHqqpg== 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 4WZX2H6kgszpKK; Thu, 1 Aug 2024 14:50:31 +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 471EoVAi049672; Thu, 1 Aug 2024 14:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoVqW049669; Thu, 1 Aug 2024 14:50:31 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:31 GMT Message-Id: <202408011450.471EoVqW049669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 53a4bf76c57b - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 53a4bf76c57bc02dce7c521235d10dc7fec298a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=53a4bf76c57bc02dce7c521235d10dc7fec298a0 commit 53a4bf76c57bc02dce7c521235d10dc7fec298a0 Author: Warner Losh AuthorDate: 2024-07-29 22:57:30 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +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 (cherry picked from commit a2fd7ae87991044ca283974ced8f6ed635d1cb0c) --- 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 e12f80671c00..208dbf5e12c9 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 ,