Page MenuHomeFreeBSD

D50706.diff
No OneTemporary

D50706.diff

diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf
--- a/stand/defaults/loader.conf
+++ b/stand/defaults/loader.conf
@@ -105,6 +105,7 @@
# WidthxHeight (e.g. 1920x1080)
#kernels="kernel kernel.old" # Kernels to display in the boot menu
kernels_autodetect="YES" # Auto-detect kernel directories in /boot
+#loader_gfx="YES" # Use graphical images when available
#loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none
#comconsole_speed="115200" # Set the current serial console speed
#console="vidconsole" # A comma separated list of console(s)
diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5
--- a/stand/defaults/loader.conf.5
+++ b/stand/defaults/loader.conf.5
@@ -21,7 +21,7 @@
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
-.Dd February 9, 2025
+.Dd June 5, 2025
.Dt LOADER.CONF 5
.Os
.Sh NAME
@@ -414,6 +414,12 @@
If set to
.Dq NO ,
the autoboot menu will not be displayed
+.It Va loader_gfx
+If set to
+.Dq NO ,
+the ASCII art version of the brand and logo will be used even if graphical
+versions are available.
+Additionally, the menu frame will be drawn with ASCII art as well.
.It Va loader_logo Pq Dq Li orbbw
Selects a desired logo in the beastie boot menu.
Possible values are:
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -217,6 +217,13 @@
return "double"
end
+local function gfxenabled()
+ return (loader.getenv("loader_gfx") or "yes"):lower() ~= "no"
+end
+local function gfxcapable()
+ return core.isFramebufferConsole() and gfx.term_putimage
+end
+
local function drawframe()
local x = menu_position.x - 3
local y = menu_position.y - 1
@@ -242,7 +249,7 @@
x = x + shift.x
y = y + shift.y
- if core.isFramebufferConsole() and gfx.term_drawrect ~= nil then
+ if gfxenabled() and gfxcapable() then
gfx.term_drawrect(x, y, x + w, y + h)
return true
end
@@ -332,11 +339,9 @@
y = y + branddef.shift.y
end
- if core.isFramebufferConsole() and
- gfx.term_putimage ~= nil and
- branddef.image ~= nil then
- if gfx.term_putimage(branddef.image, x, y, 0, 7, 0)
- then
+ local gfx_requested = branddef.image and gfxenabled()
+ if gfx_requested and gfxcapable() then
+ if gfx.term_putimage(branddef.image, x, y, 0, 7, 0) then
return true
end
end
@@ -383,16 +388,11 @@
y = y + logodef.shift.y
end
- if core.isFramebufferConsole() and
- gfx.term_putimage ~= nil and
- logodef.image ~= nil then
- local y1 = 15
+ local gfx_requested = logodef.image and gfxenabled()
+ if gfx_requested and gfxcapable() then
+ local y1 = logodef.image_rl or 15
- if logodef.image_rl ~= nil then
- y1 = logodef.image_rl
- end
- if gfx.term_putimage(logodef.image, x, y, 0, y + y1, 0)
- then
+ if gfx.term_putimage(logodef.image, x, y, 0, y + y1, 0) then
return true
end
end

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 19, 6:28 AM (13 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23914030
Default Alt Text
D50706.diff (2 KB)

Event Timeline