Date: Fri, 15 Jan 2021 16:21:06 +0100 From: Mateusz Guzik <mjguzik@gmail.com> To: Kyle Evans <kevans@freebsd.org> 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: <CAGudoHG_XDoZ8n_E9w6g=hMH6MN0pSdXjr-Ay95u9i1onAx3MQ@mail.gmail.com> In-Reply-To: <CACNAnaHAMFBz7G9bMmawr1mUj3JAUBpBMOQO7bR7rniWfgH=tg@mail.gmail.com> References: <202101140558.10E5wMNW079125@gitrepo.freebsd.org> <CAGudoHGv3aP-QgR23NPvnJHcwMMc=qAs7HSMnxQMaZu-RywKSg@mail.gmail.com> <CACNAnaHAMFBz7G9bMmawr1mUj3JAUBpBMOQO7bR7rniWfgH=tg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I confirm this fixes it. On 1/15/21, Kyle Evans <kevans@freebsd.org> wrote: > 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) > -- Mateusz Guzik <mjguzik gmail.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHG_XDoZ8n_E9w6g=hMH6MN0pSdXjr-Ay95u9i1onAx3MQ>