History log of /src/stand/lua/drawer.lua (Results 1 – 25 of 237)
Revision Date Author Comments
# abdbd85d 18-Jun-2025 Kyle Evans <kevans@FreeBSD.org>

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

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

show more ...


# 7e193048 16-Jun-2025 Emmanuel Vadot <manu@FreeBSD.org>

loader: Fix loader_brand = none

Setting loader_brand to none in loader.conf now result in a lua error
as we try to get a non-existant table
Defines it

Differential Revision: https://reviews.freebsd

loader: Fix loader_brand = none

Setting loader_brand to none in loader.conf now result in a lua error
as we try to get a non-existant table
Defines it

Differential Revision: https://reviews.freebsd.org/D50875
Fixes: bef6d85b6de5 ("lualoader: allow graphical bits to be disabled with loader_gfx")
Reviewed by: kevans, tsoome
Sponsored by: Beckhoff Automation GmbH & Co. KG

show more ...


# 1beab149 13-Jun-2025 Kyle Evans <kevans@FreeBSD.org>

stand: lua: add a more productive comment

The global `shift` is a special little hack for shifting everything when
the logo is gone, and we should explain that.

Fixes: 33d3373faf30d ("stand: lua: c

stand: lua: add a more productive comment

The global `shift` is a special little hack for shifting everything when
the logo is gone, and we should explain that.

Fixes: 33d3373faf30d ("stand: lua: convert orb to a new format [...]")

show more ...


# 33d3373f 13-Jun-2025 Kyle Evans <kevans@FreeBSD.org>

stand: lua: convert orb to a new format that allows per-graphic shift

Previously, we had one shift that had to work for both the ASCII version
and the image that we may draw if we have a framebuffer

stand: lua: convert orb to a new format that allows per-graphic shift

Previously, we had one shift that had to work for both the ASCII version
and the image that we may draw if we have a framebuffer to play with.
That makes it more difficult to get the positioning just right, so split
them out into their own tables for convenience.

While we're here, stop clipping off the bottom of the orb when the
autoboot sequence is interrupted. There's plenty of space for it to
move up a hair, so let's do that..

Reviewed by: imp, tsoome
Differential Revision: https://reviews.freebsd.org/D50801

show more ...


# bef6d85b 06-Jun-2025 Kyle Evans <kevans@FreeBSD.org>

lualoader: allow graphical bits to be disabled with loader_gfx

Some people prefer the old ASCII art look and it's good to have a way
to confirm that the fallbacks still work right on systems that ha

lualoader: allow graphical bits to be disabled with loader_gfx

Some people prefer the old ASCII art look and it's good to have a way
to confirm that the fallbacks still work right on systems that have a
functional framebuffer available. Add a loader_gfx loader.conf(5)
variable to disable the eager use of graphics for these use-cases.

While we're here, clean up the style in the area a little bit; the early
porting that I did to lualoader did a lot of redundant ~= nil that has
carried over into some of the later work. We can drop some of that, and
also re-organize some of these variables to improve readability.

ziaee notes that the positioning of the orb is a bit off; this is due to
a change in positioning that happened in
1b4e1171315398dec ("loader: Fix orb position") to account for the image
dimensions. This should be partially reverted to get it right; we
shouldn't assume that we can use the same shift in gfx-* definitions for
both the ASCII art and the associated image -- the {image, image_rl}
pair should be converted to something more like an fbimg or gfx table
that has the image, image width and a shift override to avoid messing
up the ASCII positioning when disabled (or with no graphics available).

Reviewed by: imp, manu, ziaee (manpages)
Differential Revision: https://reviews.freebsd.org/D50706

show more ...


# a962800a 14-Apr-2025 Emmanuel Vadot <manu@FreeBSD.org>

loader: Add loader_menu

If set to 'none' then the menu isn't displayed.
The 'brand' and 'logo' part are stil displayed.

Differential Revision: https://reviews.freebsd.org/D49820
Reviewed by: imp, k

loader: Add loader_menu

If set to 'none' then the menu isn't displayed.
The 'brand' and 'logo' part are stil displayed.

Differential Revision: https://reviews.freebsd.org/D49820
Reviewed by: imp, kevans
Sponsored by: Beckhoff Automation GmbH & Co. KG

show more ...


# 7d1d7f42 24-Feb-2025 Jose Luis Duran <jlduran@FreeBSD.org>

stand: Fix brand positioning on framebuffer console

The drawer.lua script ignores the values in loader_brand_x and
loader_brand_y on framebuffer consoles, always positioning the brand at
(1, 1).

Al

stand: Fix brand positioning on framebuffer console

The drawer.lua script ignores the values in loader_brand_x and
loader_brand_y on framebuffer consoles, always positioning the brand at
(1, 1).

Allow it to be positioned by accepting the x and y values just like the
text version. For example:

/boot/lua/gfx-nanobsd.lua:

return {
brand = {
graphic = {
""
},
requires_color = true,
image = "/boot/images/freebsd-logo-rev.png"
}
}

/boot/loader.conf.d/bootloader.conf:

loader_logo="none"
loader_brand="nanobsd"
loader_brand_x="15"

PR: 255202
Reviewed by: manu, imp
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D49092

show more ...


# 1b4e1171 07-Jan-2025 Emmanuel Vadot <manu@FreeBSD.org>

loader: Fix orb position

Fix the orb position to be aligned with the menu

Differential Revision: https://reviews.freebsd.org/D48353
Reviewed by: imp, tsoome
Sponsored by: Beckhoff Automation GmbH &

loader: Fix orb position

Fix the orb position to be aligned with the menu

Differential Revision: https://reviews.freebsd.org/D48353
Reviewed by: imp, tsoome
Sponsored by: Beckhoff Automation GmbH & Co. KG

show more ...


# c2ba66d4 02-Nov-2024 Warner Losh <imp@FreeBSD.org>

loader: Fix boot menu on BIOS

Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.

loader: Fix boot menu on BIOS

Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.term_drawbox function. If we do, we support the
unicode drawing characters. If we don't, then we have an older loader
that doesn't support it *OR* we have the reduced function, text-only
boot loader. In either of those cases, we need to use the old graphics
characters. Abstract all those details into core.hasUnicode function.

PR: 282465
MFC After: 2 day
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D47403

show more ...


# 101afbc6 22-Aug-2024 Warner Losh <imp@FreeBSD.org>

loader/menu: tweak for added line

I added a line to the menu, but didn't adjust so things were a
line off. Make the necessary adjustments.

Fixes: 7cb65be96d47
Sponsored by: Netflix
MFC After: 3 days


# 0fd98b8a 16-Feb-2024 Warner Losh <imp@FreeBSD.org>

loader: Move drawer.lua over to gfx table.

Drawer.lua is the only bit of lua code in the base that uses any of the
functons moved from the loader table to the gfx table. Move the main
code to using

loader: Move drawer.lua over to gfx table.

Drawer.lua is the only bit of lua code in the base that uses any of the
functons moved from the loader table to the gfx table. Move the main
code to using the gfx dispatch. Add compat code for running on old
loaders that creates the newer-style gfx table with the term_* functions
we call in it populated. This will even work on the super old versions
of the loader that don't have them (we'll still skip using them).

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43908

show more ...


# 9636a145 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line lua tag

Remove /^--\n--\s*\$FreeBSD\$.*$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# e19d9a9b 08-Sep-2021 Kyle Evans <kevans@FreeBSD.org>

lualoader: allow brands to specify a shift

Some brands will want to specify a shift to make sure they're properly
centered; let it happen.


# 763bcebe 08-Sep-2021 Kyle Evans <kevans@FreeBSD.org>

lualoader: remove shadowed local from graphics:drawitem()

for loop vars are local already and distinct from this earlier
declaration; remove it.


# 4ba91fa0 21-Apr-2021 Toomas Soome <tsoome@FreeBSD.org>

loader: do not output empty menu title

As we output spaces around the menu title, we should also check,
if the title is actually empty string.

PR: 255299
Submitted by: Jose Luis Duran
Reported by:

loader: do not output empty menu title

As we output spaces around the menu title, we should also check,
if the title is actually empty string.

PR: 255299
Submitted by: Jose Luis Duran
Reported by: Jose Luis Duran
MFC after: 1 week

show more ...


# 62ffcaab 23-Mar-2021 Toomas Soome <tsoome@FreeBSD.org>

loader: insert spaces around menu title

Small visual nit, make menu title more clean

MFC after: 3 days


# 96bef205 08-Feb-2021 Toomas Soome <tsoome@FreeBSD.org>

loader: remove BORDER_PIXELS

BORDER_PIXELS is left over from picking up the source from illumos
port. Since FreeBSD VT does not use border in terminal size
calculation, there is no reason why should

loader: remove BORDER_PIXELS

BORDER_PIXELS is left over from picking up the source from illumos
port. Since FreeBSD VT does not use border in terminal size
calculation, there is no reason why should loader use it.

MFC after: 1 week

show more ...


# 994e1f40 15-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

lualoader: use floor division to get correct type

This fixes the positioning of the "Welcome to FreeBSD" heading, which was
misplaced after the recent update to Lua 5.4. The issue was previously
mas

lualoader: use floor division to get correct type

This fixes the positioning of the "Welcome to FreeBSD" heading, which was
misplaced after the recent update to Lua 5.4. The issue was previously
masked by a compatibility knob in Lua 5.3 that would cause float-tagged
numbers to render faithfully without the decimal component. Lua 5.4 dropped
that and ensures that it always prints a decimal component, even if it has
to append a ".0" to the value.

Standard division produces a "float", floor division (//) can be used to
guarantee an integer. Floating point operations have been completely ripped
out of the liblua compiled for the bootloader, so this is a nop. This is
decidedly better than trying to hack out the float tag entirely.

Reported-by: mjg, probably others
MFC-after: 3 days

show more ...


# 3630506b 21-Dec-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: implement framebuffer console

Draw console on efi.
Add vbe framebuffer for BIOS loader (vbe off, vbe on, vbe list,
vbe set xxx).
autoload font (/boot/fonts) based on resolution and font size

loader: implement framebuffer console

Draw console on efi.
Add vbe framebuffer for BIOS loader (vbe off, vbe on, vbe list,
vbe set xxx).
autoload font (/boot/fonts) based on resolution and font size.
Add command loadfont (set font by file) and
variable screen.font (set font by size). Pass loaded font to kernel.

Export variables:
screen.height
screen.width
screen.depth

Add gfx primitives to draw the screen and put png image on the screen.
Rework menu draw to iterate list of consoles to enamble device specific
output.

Probably something else I forgot...

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27420

show more ...


# 546f18f3 04-Oct-2020 Kyle Evans <kevans@FreeBSD.org>

lualoader: improve the design of the brand-/logo- mechanism

In the previous world order, any brand/logo was forced to pull in the
drawer and call drawer.add{Brand,Logo} with the name their brand/log

lualoader: improve the design of the brand-/logo- mechanism

In the previous world order, any brand/logo was forced to pull in the
drawer and call drawer.add{Brand,Logo} with the name their brand/logo is
taking and a table describing it.

In the new world order, these files just need to return a table that maps
out graphics types to a table of the exact same format as what was
previously being passed back into the drawer. The appeal here is not needing
to grab a reference back to the drawer module and having a cleaner
data-driven looking format for these. The format has been renamed to 'gfx-*'
prefixes and each one can provide a logo and a brand.

drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as
there's no overhead to them and it's not yet worth the break in
compatibility with any pre-existing brands and logos.

Reviewed by: freqlabs
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24966

show more ...


# 6697f577 01-Jun-2020 Kyle Evans <kevans@FreeBSD.org>

lualoader: improve drawer error handling

At least one user has landed in a scenario where logo files appear to be
misnamed, and we failed to find them. Our fallback for missing logodefs is
orb/orbbw

lualoader: improve drawer error handling

At least one user has landed in a scenario where logo files appear to be
misnamed, and we failed to find them. Our fallback for missing logodefs is
orb/orbbw, based on the color status. In a scenario where we can't locate
the logos, though, this is not ideal. Add in one more layer of fallback
to properly just don't draw any logo if the fan has been jam packed with
foreign material.

PR: 246046
MFC after: 3 days

show more ...


# 61c1328e 13-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352105 through r352307.


# 90a25417 10-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

lualoader: Revert to ASCII menu frame for serial console

The box drawing characters we use aren't necessarily safe with a serial
console; for instance, in the report by npn@, these were causing his

lualoader: Revert to ASCII menu frame for serial console

The box drawing characters we use aren't necessarily safe with a serial
console; for instance, in the report by npn@, these were causing his xterm
to send back a sequence that lua picked up as input and halted the boot.
This is less than ideal.

Fallback to ASCII frames for console with 'comconsole' in it. This is a
partial revert r338108 by imp@ -- instead of removing the menu entirely and
disabling color/cursor sequences, just reverting the default frame to ASCII
is enough to not break in this setup.

Reported by: npn
Triaged and recommended by: tsoome

show more ...


# f993ed2f 09-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r351732 through r352104.


12345678910