Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2021 09:12:57 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org, Warner Losh <imp@freebsd.org>
Subject:   Re: git: 0495ed398c4f - main - contrib/lua: update to 5.4.2
Message-ID:  <CACNAnaHAMFBz7G9bMmawr1mUj3JAUBpBMOQO7bR7rniWfgH=tg@mail.gmail.com>
In-Reply-To: <CAGudoHGv3aP-QgR23NPvnJHcwMMc=qAs7HSMnxQMaZu-RywKSg@mail.gmail.com>
References:  <202101140558.10E5wMNW079125@gitrepo.freebsd.org> <CAGudoHGv3aP-QgR23NPvnJHcwMMc=qAs7HSMnxQMaZu-RywKSg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 15, 2021 at 7:06 AM Mateusz Guzik <mjguzik@gmail.com> wrote:
>
> There is some garbage shown by the boot loader since this commit.
> Screenshot from VirtualBox:
> https://people.freebsd.org/~mjg/loader_artifact.png
>
> An additional fixup is needed to see it:
> commit 0974bfa3a8da2201b0a415e72593552f5ac59379 (HEAD -> main,
> freebsd/main, freebsd/HEAD)
> Author: Toomas Soome <tsoome@FreeBSD.org>
> Date:   Fri Jan 15 14:58:12 2021 +0200
>
>     loader: do not update palette in text mode (real fix)
>
> otherwise the screen is blank.
>

The patch below will fix it (assuming we're both looking at the
"Welcome to FreeBSD" misposition + leading garbage); there's clearly
an additional hack needed with Lua 5.4 to make sure that we don't get
a "float" (of course it's floored because we can't do floating point
here) from division, but this comes up so rarely that I'm not sure
it's worth specifically hacking around. Notably, below is the only
place that stock lualoader does arithmetic that results in a "float"
and, IMHO, it really should be a floor division like this anyways to
be more explicit that we're flooring it.

I'll push something to fix it within a couple hours. CC imp@, I'm
leaning towards just pushing the below and not hacking lua further,
but a second opinion would be appreciated.

diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index 3ace3884ff8..6062d7e87a0 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -283,7 +283,7 @@ local function drawbox()
                end
        end
        if menu_header_x == nil then
-               menu_header_x = x + (w / 2) - (#menu_header / 2)
+               menu_header_x = x + (w // 2) - (#menu_header // 2)
        end
        screen.setcursor(menu_header_x, y)
        printc(menu_header)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaHAMFBz7G9bMmawr1mUj3JAUBpBMOQO7bR7rniWfgH=tg>