From nobody Wed Jun 18 15:21:49 2025 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 4bMnXF3q01z5pl3q; Wed, 18 Jun 2025 15:21:49 +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 4bMnXF36Xgz3ZHx; Wed, 18 Jun 2025 15:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750260109; 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=36A6yyNYt8hgHCWqgzghLF3cCz52AtW6pk7rU0xOwqE=; b=GNPBz7xo2T+LXLQ3kpOdhJoSsRthBBsMInQBB5IR0tbJthN5BNr4AgEtQqZjJatqH1XZ4Q UgSGNzawCyNdY8Cv3TauFxy6gKN1NcBPa8nRoSvUyxmHTpdftts7P8K+pVnSxUqJy+9HrN fi3/ejih+woiIbqvoHfRImfoXjti4NrPggssXj8PvY9hGMuA0VS5vi/Q41/fX2INqVtDrE 6GZy9TfcGY5X1/Tb6nxHVGXyyCixEQw4uibsEsWy3+adHaP2tPswBnvKEw1k/XH0MT7qIm uaooV3dM7iKQYATN1EuTL89tMcaWraU7G+DQ/TNtDHYw5sW/MK9Jc+IPHQE0+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750260109; 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=36A6yyNYt8hgHCWqgzghLF3cCz52AtW6pk7rU0xOwqE=; b=tH0Y2oaWlSIbxbo90V3qEcz1CyDmc2Ub1CzZ9hi9kgv5S6r7zh+9zHLrKXctWWMytTpAi2 ItZTFyvxmooIsfbwFEwvflnplgHSG4BfqpnMcal7aPxAfUUycsQ45bk7QhG2US5vDgeBBu mYqBZalIIMsSL0aGBJ95B3MX4KTCTuMqCcaPUJJ/BGqS5z/hmMbJhSFJzw+40eIBE3wgal NkKhSeHePMsKcg8qdUxlqsKcrqU1er8pwtbw7WIMs+NEEFgMfK7hqeWPJIwhk4W/vk+5Vk ZaCRiSbvIgBi1G/pbDveaEG5xznA7wgT1/G+eIRJzpOTZp3Cvl2McNgKqiH1sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750260109; a=rsa-sha256; cv=none; b=UBeRCqcmMr6KCLUR4qdZ/wkdX7Aw5l7Q5lEaQSFKt+roLB8iwDhU48WlNSJbPiE7ZPNcrT j/VuR4ZMGAB6Esgp9rrSNB1riFiLV19wNFAbzd7gqicndzYEhWq0hnxuK4msGcsTfQwVaS o1v1MxfB32oEUPiHcLMo8S9hB0Ts/1F3EADCz1G75aselksnRAbLzuayHtuZEk+SfSIuxW 5sgwhwRBJnMATdOw111G6lkJkWK9zqtd/ozRFAe41sGIzDKBHm3cU11lof/dPDfQF6h6m7 U+uAkek1E/sZnyv3uqpbQRIBtTJdPb2e5wJAf59h62akcnT5ehdOQNrP6usTBA== 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 4bMnXF2jlkzbbw; Wed, 18 Jun 2025 15:21:49 +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 55IFLnmv004563; Wed, 18 Jun 2025 15:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55IFLnjk004560; Wed, 18 Jun 2025 15:21:49 GMT (envelope-from git) Date: Wed, 18 Jun 2025 15:21:49 GMT Message-Id: <202506181521.55IFLnjk004560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: abdbd85d1b6a - main - lualoader: adapt builtin brand/logo definitions as well 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abdbd85d1b6af892c18eaae0330a146b01ff6712 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=abdbd85d1b6af892c18eaae0330a146b01ff6712 commit abdbd85d1b6af892c18eaae0330a146b01ff6712 Author: Kyle Evans AuthorDate: 2025-06-18 15:12:54 +0000 Commit: Kyle Evans CommitDate: 2025-06-18 15:21:37 +0000 lualoader: adapt builtin brand/logo definitions as well While these should be moved to the new format, it wasn't my intention to force them over immediately. Downstreams may embed their own brands in drawer.lua, and we shouldn't break them for something like this. Move adapt_fb_shim() up and use it for preloaded definitions to avoid forcing the matter for now. Perhaps in the future we'll start writing out warnings for those that do need adapted. Reported by: 0x1eef on IRC --- stand/lua/drawer.lua | 68 ++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 9d5417737489..1c03ed93f00a 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -101,6 +101,39 @@ local function processFile(gfxname) return true end +-- Backwards compatibility shims for previous FreeBSD versions, please document +-- new additions +local function adapt_fb_shim(def) + -- In FreeBSD 14.x+, we have improved framebuffer support in the loader + -- and some graphics may have images that we can actually draw on the + -- screen. Those graphics may come with shifts that are distinct from + -- the ASCII version, so we move both ascii and image versions into + -- their own tables. + if not def.ascii then + def.ascii = { + image = def.graphic, + requires_color = def.requires_color, + shift = def.shift, + } + end + if def.image then + assert(not def.fb, + "Unrecognized graphic definition format") + + -- Legacy images may have adapted a shift from the ASCII + -- version, or perhaps we just didn't care enough to adjust it. + -- Steal the shift. + def.fb = { + image = def.image, + width = def.image_rl, + shift = def.shift, + } + end + + def.adapted = true + return def +end + local function getBranddef(brand) if brand == nil then return nil @@ -123,6 +156,8 @@ local function getBranddef(brand) end branddef = branddefs[brand] + elseif not branddef.adapted then + adapt_fb_shim(branddef) end return branddef @@ -150,6 +185,8 @@ local function getLogodef(logo) end logodef = logodefs[logo] + elseif not logodef.adapted then + adapt_fb_shim(logodef) end return logodef @@ -511,37 +548,6 @@ drawer.default_bw_logodef = 'orbbw' -- drawer module in case it's a filesystem issue. drawer.default_fallback_logodef = 'none' --- Backwards compatibility shims for previous FreeBSD versions, please document --- new additions -local function adapt_fb_shim(def) - -- In FreeBSD 14.x+, we have improved framebuffer support in the loader - -- and some graphics may have images that we can actually draw on the - -- screen. Those graphics may come with shifts that are distinct from - -- the ASCII version, so we move both ascii and image versions into - -- their own tables. - if not def.ascii then - def.ascii = { - image = def.graphic, - requires_color = def.requires_color, - shift = def.shift, - } - end - if def.image then - assert(not def.fb, - "Unrecognized graphic definition format") - - -- Legacy images may have adapted a shift from the ASCII - -- version, or perhaps we just didn't care enough to adjust it. - -- Steal the shift. - def.fb = { - image = def.image, - width = def.image_rl, - shift = def.shift, - } - end - return def -end - function drawer.addBrand(name, def) branddefs[name] = adapt_fb_shim(def) end