Bug 255202 - drawer.lua: brand positioning not working
Summary: drawer.lua: brand positioning not working
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Jose Luis Duran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-18 23:47 UTC by Jose Luis Duran
Modified: 2025-03-03 05:34 UTC (History)
3 users (show)

See Also:
jlduran: mfc-stable14+


Attachments
Screenshot with spindle artifact (77.36 KB, image/png)
2021-04-18 23:47 UTC, Jose Luis Duran
no flags Details
WIP of the patch (443 bytes, patch)
2021-04-18 23:49 UTC, Jose Luis Duran
no flags Details | Diff
Fix brand positioning and hide twiddle (673 bytes, patch)
2021-04-23 15:44 UTC, Jose Luis Duran
no flags Details | Diff
Patch using git format-patch (1006 bytes, patch)
2021-04-23 16:12 UTC, Jose Luis Duran
no flags Details | Diff
A more descriptive commit message (1.08 KB, patch)
2021-04-23 16:45 UTC, Jose Luis Duran
no flags Details | Diff
stand: Fix brand positioning with frame buffer (860 bytes, patch)
2024-10-01 02:18 UTC, Jose Luis Duran
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jose Luis Duran freebsd_committer freebsd_triage 2021-04-18 23:47:40 UTC
Created attachment 224233 [details]
Screenshot with spindle artifact

drawer.lua ignores the values in `loader_brand_x` and `loader_brand_y`.

I have attached a patch that *fixes* it, but I would like to request, if possible, some reviewing.

I have also attached a screenshot, taken with the patch applied, however there's the spindle? artifact hanging around, and being shifted by the offsetting of the brand (indicated by the red arrow). I don't know how to address this.

This can be replicated by creating two files:

/boot/loader.conf.d/bootloader.conf:
loader_logo="none"
loader_brand="nakatomi"
loader_brand_x="15"

/boot/lua/gfx-nakatomi.lua:
return {
	brand = {
		image = "/boot/images/freebsd-logo-rev.png"
	}
}

Thank you!
Comment 1 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-18 23:49:14 UTC
Created attachment 224234 [details]
WIP of the patch
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-19 03:42:56 UTC
Thank you for the bug report and patch Jose!
Comment 3 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-23 15:44:07 UTC
Created attachment 224378 [details]
Fix brand positioning and hide twiddle

This patch fixes the brand positioning, allowing it to be adjusted and also hides the "twiddle" (spinner, twiddler or whatever it is called).
Comment 4 Kyle Evans freebsd_committer freebsd_triage 2021-04-23 15:49:01 UTC
Hi,

Can you re-upload this patch in `git show`/`git format-patch` format, please? This includes authorship metadata and a proposed commit message-

Thanks,

Kyle Evans
Comment 5 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-23 16:12:12 UTC
Created attachment 224381 [details]
Patch using git format-patch
Comment 6 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-23 16:16:20 UTC
(In reply to Kyle Evans from comment #4)
For some reason it seems to have removed the last line of the file, this was unintended.  This is the first time I submit using git format-patch. I'll investigate. Thank you.
Comment 7 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-23 16:30:16 UTC
(In reply to Jose Luis Duran from comment #6)
Sorry, false alarm.  The patch is OK. Thank you for reviewing it!
Comment 8 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-23 16:45:58 UTC
Created attachment 224383 [details]
A more descriptive commit message
Comment 9 Jose Luis Duran freebsd_committer freebsd_triage 2021-04-24 00:56:53 UTC
While this should be OK for now,  there are a few minor things I discovered while testing.  I will enumerate them here for reference, but I think they can be addressed separately:

- [ ] Update drawer.lua.8 (use gfx-*)
      - [ ] Mention that the height of the brand is capped to 7 rows
      or
      - [ ] Implement `branddef.image_rl`
- [ ] Test the forth implementation

Thank you!
Comment 10 Jose Luis Duran freebsd_committer freebsd_triage 2024-10-01 02:18:57 UTC
Created attachment 253925 [details]
stand: Fix brand positioning with frame buffer

With frame buffer consoles, the brand positioning was not being set with `loader_brand_x` and `loader_brand_y`.

As a workaround for the twiddle printing on top of the menu, instead of hiding it with a white space on top, increase the the twiddle_divisor, for example:

    echo 'twiddle_divisor="320"' >> /boot/loader.conf
Comment 11 Jose Luis Duran freebsd_committer freebsd_triage 2024-10-01 17:25:06 UTC
(In reply to Jose Luis Duran from comment #10)
Another workaround to remove the twiddle artifact would be to completely remove the twiddle:

    echo 'module_verbose="1"' >> /boot/loader.conf

0	MODULE_VERBOSE_SILENT	None
1	MODULE_VERBOSE_SIZE	Pathname and size
2	MODULE_VERBOSE_TWIDDLE	Same as for 1 but also twiddle for progress
3	MODULE_VERBOSE_FULL	Extra detail

The default is "2".
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2024-10-08 05:01:49 UTC
^Triage: clear unneeded flags.  Nothing has yet been committed to be merged.
Comment 13 commit-hook freebsd_committer freebsd_triage 2025-02-24 14:40:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d1d7f42302d80c33243501601b77323acc0717f

commit 7d1d7f42302d80c33243501601b77323acc0717f
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-02-24 14:36:10 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-02-24 14:36:10 +0000

    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

 stand/lua/drawer.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 14 Mark Linimon freebsd_committer freebsd_triage 2025-03-02 11:39:07 UTC
^Triage: assign to committer.  Set flags in case of any desired MFCs.
Comment 15 commit-hook freebsd_committer freebsd_triage 2025-03-03 05:32:25 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f652eb792baf5902a367f68ea02014fdc47313d

commit 8f652eb792baf5902a367f68ea02014fdc47313d
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-02-24 14:36:10 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-03-03 05:29:47 +0000

    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

    (cherry picked from commit 7d1d7f42302d80c33243501601b77323acc0717f)

 stand/lua/drawer.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)