From nobody Thu Aug 01 14:57:37 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 4WZXBT668Qz5StZD; Thu, 01 Aug 2024 14:57:37 +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 4WZXBT3l2bz4MPB; Thu, 1 Aug 2024 14:57:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524257; 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=GZwvKrVtVDvvMVry9GBEBwpYaPIhfYc31fYiRigfoUY=; b=kKLWqBzu7boYcvlC8XrSqUEG5A6pA7Cn9XIZmnKTXBem/bEXwpWDEG6fTiN+CH3O5dO296 Zpi6GmRswGAHItK4ineQqYfkXUnVfkbzJVIFWt8mYA78v5olA+CeVPVS187c9jSwjsvDy+ mS4XcIIPr2SR+VXmMEdiPHOypUhbMlwO+xUjjOeHkUwongRwde5AWRPI3j4l9htPS8G+sP yWaSAQPdYc3J5/o0rKBG1P0LQ1bOBHGX9r6kdwnwlZCxWn5qDH81bcJ6IbiTsJP4nClNJ/ iJVq+oUk1aQACfn0JjbI+8jaxKEpiqDOrIy+GLxvSMdAsBxCM2Bogapqfcc9Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524257; a=rsa-sha256; cv=none; b=hQ1FnlAvESpVPN3EP7pTmQId2DCN1BMbrh5LfdIx8HTCaodkfwh8Ps9U5R1ZeKivxXY2c4 9uUDBYdqwyNSquwgKRPVMgqYEoQ7YT1wXzZALN77rxJ0ZtL92O0fP+I1ZNsWwj24koGrhM pArP3APvpZyhv9sOC8hXlHCWKv614uA4Xf5z5QHx/86FK0YSflc+8rE1EFEnLTSq25WKJT zNSJD/c5c127m9MrwXuiRP76XOyq9OPe/mDjkotU3ud1oTJ9iwvjROEIkcd7fx0N4Q60nM qnogrnl430+btbm5/EYY0APFTYQhH9mPHXVwQAf2VD5iMUFjPQa3vpnqkD9PHg== 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=1722524257; 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=GZwvKrVtVDvvMVry9GBEBwpYaPIhfYc31fYiRigfoUY=; b=DYwGOLVmc6CcAiRyDiTC5BE211oVfzJDAPvhw3H/eEQidtAGN4rJJeNhUHQlLlK/g4tqc6 c/dul1T9MJK/nUN47rvtE76OYl29fexHkLPjyor22QOpGe3GKznTacyngMhZ/dZ3+RVeBU H7gjnuDmI2IGmkfJqCms80X6jxDXnaDXv5YPPcOJUlGo3mxl3ZAjP0CXdFrJNK2ttZHkSL elithp/rwL/jW+1QZ1ccVjUs8RmlpdialonzBF9uWH8+WQx6OXdCg8g3PpuMlT7OMEPMyu cv5g/FgxPgAMlFBIAVbUSDLBwmqpI3TnBItzR5En6dk2BubGw7uUjC36HBpdqg== 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 4WZXBT3JmRzpZX; Thu, 1 Aug 2024 14:57:37 +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 471Evb9u057703; Thu, 1 Aug 2024 14:57:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Evboq057700; Thu, 1 Aug 2024 14:57:37 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:37 GMT Message-Id: <202408011457.471Evboq057700@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: 6b0a2b19c845 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 6b0a2b19c84551251336efdde40f96848b199050 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b0a2b19c84551251336efdde40f96848b199050 commit 6b0a2b19c84551251336efdde40f96848b199050 Author: Warner Losh AuthorDate: 2024-07-29 22:57:30 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:53:46 +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 747f8c1f0fcf..81ba5d561442 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -549,6 +549,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 e1752475f942..7ab3f6e4ff12 100644 --- a/stand/lua/core.lua.8 +++ b/stand/lua/core.lua.8 @@ -224,6 +224,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 ,