customize boot loader logo

I'm having hard times in trying to customize the boot loader logo.
I've started copying a .4th file and customizing it, so I created /boot/logo-postgresql.4th, and the configured the loader as
Code:
% cat /boot/loader.conf
loader_logo="postgresql"

but the logo is not showing up. Then I realized that options could be kind of hard-coded, so I tried to override the /boot/logo-orb.4th with my own and configured the boot loader to load the logo "orb", but again I'm not getting it.
So I must be missing some step in the workflow. Anyone knows how to do it?
 
Newer versions of FreeBSD have switched to LUA instead of Forth. The *.4th files are Forth.
 
Thanks for the explaination, but again I'm missing something. I've created the file /boot/lua/logo-postgresql.lua with the content as follows:

Code:
% cat /boot/lua/logo-postgresql.lua
local drawer = require("drawer")

local postgresql_color = {
"   ____  ______  ___   "
"  /    )/      \/   \  "
" (     / __    _\    ) "
"  \    (/ o)  ( o)   ) "
"   \_  (_  )   \ )  /  "
"     \  /\_/    \)_/   "
"      \/  //|  |\\     "
"          v |  | v     "
"            \__/       "
}

drawer.addLogo("postgresql", {
        requires_color = true,
        graphic = postgresql_color,
})

return true

and then in /boot/loader.conf I've got:

Code:
% cat /boot/loader.conf
loader_logo="postgresql"

but again, after a reboot, the orb logo is shown. Am I missing something? Do I have to rehash the booting scripts?

By the way, if now .4th files are no more used, why are they still there?
 
Good question, I don't know actually. I rarely touch any of those files.
 
With a print-reboot cycle I found out that lua was claiming about '\' in the string, that was interpreted as an escape sequence.
Therefore I tried first to use single ticks, but that did not solved the problem, so I doubled all the '\' chars in my logo. Now it works, some adjustements are required (position and colors) but at least I've got something working now.
 
So, in the case anybody needs, here are the links to the logos https://github.com/fluca1978/fluca1978-pg-utils/tree/master/logos.
In the case anybody attempts at doing something simiar, I've placed a
Code:
print( 'ret ' .. ret )
into /boot/lua/core.lua in the function try_include so that, in the case the logo does not get loaded, I can see the returning value and, therefore, the Lua error that prevented the logo to be loaded into the logodefs table. That of course means stopping the loader from continuing the load process until a boot command is issued.
 
So, in the case anybody needs, here are the links to the logos https://github.com/fluca1978/fluca1978-pg-utils/tree/master/logos.
In the case anybody attempts at doing something simiar, I've placed a
Code:
print( 'ret ' .. ret )
into /boot/lua/core.lua in the function try_include so that, in the case the logo does not get loaded, I can see the returning value and, therefore, the Lua error that prevented the logo to be loaded into the logodefs table. That of course means stopping the loader from continuing the load process until a boot command is issued.
I would put the UNIX logo on the boot of prompt and remove that ugly logo from the boot, how do proceed?
 
I would put the UNIX logo on the boot of prompt and remove that ugly logo from the boot, how do proceed?

What do you mean with "unix logo"?
At the time FreeBSD provides you with beastie, orb and a text one. So if you want to simply change the logo selecting one among those, you have to configure your /boot/loader.conf, while if you are going to build a new one (as I did with the PostgreSQL one), you have to follow my steps.
 
I would like to build a logo to my liking, what are the steps in this case for the logo to look UNIX at boot time?

You have to place a file into /boot/lua, proposing an escaped stringa based table that has the logo you want to display. Then you name it, provide right permissions to the file and set the loader_logo parameter. If you have a look at my PostgreSQL logo it woule be quite easy to do.
 
You have to place a file into /boot/lua, proposing an escaped stringa based table that has the logo you want to display. Then you name it, provide right permissions to the file and set the loader_logo parameter. If you have a look at my PostgreSQL logo it woule be quite easy to do.

I've already created a logo based on your file, it worked very well, and disappeared the ugly logo of the beast. What I have no idea all that procedure with (symbols, numbers, letters, others) as seen in the image, I would like to create my own logo that says UNIX at boot time.

screenlog.png
 
The "numbers and letters" are escape sequences used to make the colors.
I suggest you start with a blank and white logo, with only your ascii art, and then when ready switch to a coloured version.
 
fluca1978 i'm glad you figured this out for me already. I had a customized boot logo that i was using in FreeBSD10 and couldn't figure out why whatever i did seemed to have no impact. Seems dumb to still have all those 4th files in the boot folder if they're not used anymore. Thank you.
 
I found coding the table of strings easier with double brackets, I don't have to think about escape characters. Although, it might only work for black and white images. I haven't tried color.

Code:
-- This ASCII image was created by Blazej Kozlowski
-- The author of this code is not Blazej Kozlowski
-- Name this file logo-bunnybw.lua
-- Make sure it has read permissions
-- Place in /boot/lua
-- In /boot/loader.conf, change or add the loader_logo option to read:
-- loader_logo="bunnybw"

local drawer = require("drawer")

local bunny_bw = {
[[                              __]],
[[                     /\    .-" /]],
[[                    /  ; .'  .' ]],
[[                   :   :/  .'   ]],
[[                    \  ;-.'     ]],
[[       .--""""--..__/     `.    ]],
[[     .'           .'    `o  \   ]],
[[    /                    `   ;  ]],
[[   :                  \      :  ]],
[[ .-;        -.         `.__.-'  ]],
[[:  ;          \     ,   ;       ]],
[['._:           ;   :   (        ]],
[[    \/  .__    ;    \   `-.     ]],
[[     ;     "-,/_..--"`-..__)    ]],
[[     '""--.._:          ]]
}

drawer.addLogo("bunnybw", {
    graphic = bunny_bw,
    shift = {x = 2, y = 4},
})

return true
 
Here's another one just to show that this works.

Code:
-- Name this file logo-bunnyfacebw.lua
-- Make sure it has read permissions
-- Place in /boot/lua
-- In /boot/loader.conf, change or add the loader_logo option to read:
-- loader_logo="bunnyfacebw"

local drawer = require("drawer")

local bunnyface_bw = {
[[     / \                ]],
[[    / _ \               ]],
[[   | / \ |              ]],
[[   ||   || _______      ]],
[[   ||   || |\     \     ]],
[[   ||   || ||\     \    ]],
[[   ||   || || \    |    ]],
[[   ||   || ||  \__/     ]],
[[   ||   || ||   ||      ]],
[[    \\_/ \_/ \_//       ]],
[[   /   _     _   \      ]],
[[  /               \     ]],
[[  |    O     O    |     ]],
[[  |   \  ___  /   |     ]],
[[ /     \ \_/ /     \    ]],
[[/  -----  |  -----  \   ]],
[[|     \__/|\__/     |   ]],
[[\       |_|_|       /   ]],
[[ \_____       _____/    ]],
[[       \     /          ]],
[[       |     |          ]]
}

drawer.addLogo("bunnyfacebw", {
        graphic = bunnyface_bw,
        shift = {x = 2, y = -3},
})

return true
 

Attachments

  • DSC00048_small.JPG
    DSC00048_small.JPG
    153 KB · Views: 404
Try This [from ascii.co.uk, they let you create your own ascii art also]:

Code:
 _    _ _   _ _______   __
| |  | | \ | |_   _\ \ / /
| |  | |  \| | | |  \ V /
| |  | | . ` | | |   > < 
| |__| | |\  |_| |_ / . \
 \____/|_| \_|_____/_/ \_\
 
If you're not that creative like me, I can barely draw a stick figure, misc/figlet can be useful. It also has a bunch of extra fonts (misc/figlet-fonts).

Code:
% figlet "Hello World"
 _   _      _ _        __        __         _     _
| | | | ___| | | ___   \ \      / /__  _ __| | __| |
| |_| |/ _ \ | |/ _ \   \ \ /\ / / _ \| '__| |/ _` |
|  _  |  __/ | | (_) |   \ V  V / (_) | |  | | (_| |
|_| |_|\___|_|_|\___/     \_/\_/ \___/|_|  |_|\__,_|
 
I just added this little snippet and it made my day. Sometimes it's the little things I guess?
Yes, and "beastie" should be default FreeBSD logo. Current one, I don't know, sometimes it reminds me of a cat's head, sometime I feel I'm looking at the back of a fat chicken. Whatever it's, it's not "beastie"
 
Back
Top