From nobody Mon Jul 21 02:13:53 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 4blkTs5bJ5z61y0F; Mon, 21 Jul 2025 02:13:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blkTs29fcz3NKb; Mon, 21 Jul 2025 02:13:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753064033; 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=4CPcXfHH9lQY3G7dvXLWjyyxasNCFfgU2ej99o3pX7A=; b=WYQ9LKPf0WOw0GgJWoF18aHcAOy5Ph9WeJVX/ZrNVj+kubBj7KPWRVS7x6rzEInRiiE8tW AxNwd9wqzN8OCO1YS1U79CnnTY2YQ1htGGKx7zS20iPl2JvUdiWllyBjAMfzYBmLN/E+FW 61BT57dSEQXh75XE6VQ0KMyePC+xUyL/jx9xZyhQsCGn5lhIdvT7XClKTbqax2jPKRQM5R AR/SC4LsvozI/agUNqzMy4kpMjG6n29zxZrtivCTvDXaRBZeUSYefbEmu4yQjIsNctfc0q mTmGtVrmB2Cl4/Vfd48i1t5lUCXkk2RzMx4IwRqtc76BBZqEkSggZdvi4oe7qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753064033; 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=4CPcXfHH9lQY3G7dvXLWjyyxasNCFfgU2ej99o3pX7A=; b=k1agGOLa0iHZetCrDdxMIJlCHa0PeP+bV96bgVrLhtHYJo5ijsMYRnLs3Ne7cH1KrCx05G gZTsbUiL+bRDqjQpM/aMRpC0xogGjuaz474oSKc2+sgnM+wlb58pzqVdxmU5lukt3UukB7 L/4rCl9ypD97iCvG3+Znr3oWBiHCIrQgP2076TgDpt3LIXlvyMIYLZZPyq42SG/KWBSINV zsOqb9JYTtlUIusR/LQ5EDMSZKU7KWfpFrBmZ1fqs9QZ5HXCXAqWu9iHSV2Jd/VYXQ0ez8 2aSdmFeXp1cTN6poTNVk3lBujSp3sJbdpkuHhfVu2dNNYIep0HfwfYidoFfv6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753064033; a=rsa-sha256; cv=none; b=LISBontgl2zE14r2iEI2KAkU6SA6WClA8q8ZZ3jmrKDx8Mn+FK7QfWj8vNS4j57fMC5oTA Ijj9uzU4qqJWssoDWK66LTXZ8JZGzWwSQgsepTUv1nHr+lUQM7oQYy8VbdvK+in/MU1fT4 eiG7hwDGLz9GdPjYKsqZB1KSgMTE5x0gEiwsLhGx2iQLRl19fHeXWljK8oSUDj7aLE5Q1y Zn5Hpq6JrIjeNGoh/S1wDU37CQzYMVlRLbxCbAhyLfwRx1f6ZhDzttDEf3P4etRyK03gQc gIEfmA7lno4GQsgTF9J/5jI9PB/BalsVA9gGHjsPnNS+Xq3/A8gyCCw01hWOVg== 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 4blkTs1lxJzfdP; Mon, 21 Jul 2025 02:13:53 +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 56L2Drrq013764; Mon, 21 Jul 2025 02:13:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56L2DrJa013761; Mon, 21 Jul 2025 02:13:53 GMT (envelope-from git) Date: Mon, 21 Jul 2025 02:13:53 GMT Message-Id: <202507210213.56L2DrJa013761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: cd8ab8cecff5 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: cd8ab8cecff5eca1b6aaf671a840ee840c8e73c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cd8ab8cecff5eca1b6aaf671a840ee840c8e73c7 commit cd8ab8cecff5eca1b6aaf671a840ee840c8e73c7 Author: Kyle Evans AuthorDate: 2025-06-18 15:12:54 +0000 Commit: Kyle Evans CommitDate: 2025-07-21 02:12:27 +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 (cherry picked from commit abdbd85d1b6af892c18eaae0330a146b01ff6712) --- 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 46390590352e..b8fcb0b35ba5 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 @@ -503,37 +540,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