LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-01-2022, 04:18 PM   #1
amaretzek
LQ Newbie
 
Registered: Jun 2021
Location: Lisbon, Portugal
Distribution: Slackware
Posts: 8

Rep: Reputation: Disabled
grub2, font and background_image, loadfont fails, font directory empty, as of slackware current as of 2022-01-29


In /boot/grub/grub.cfg "loadfont" fails because /boot/grub/fonts/ is empty.
Hence, things like:
insmod jpeg
background_image -m stretch /grub/mybg.jpg
fail.
Having
font=unicode
or
font=dejavusansmono
and the ".pf2" in /boot/grub/fonts/ make background_image work.
"dejavusansmono" looked too big, "unicode" (got from 14.1) was ok.

Btw, testing this with UEFI, plain /boot and LUKS2 LVM root+home.
 
Old 02-03-2022, 05:25 AM   #2
chrisVV
Member
 
Registered: Aug 2010
Posts: 548

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
In slackware-current's version of grub, the supplied font file dejavusansmono.pf2 is installed in /usr/share/grub. But you can put your font file anywhere you want if you set GRUB_FONT in /etc/default/grub to the relevant file location. (In fact I use unicode.pf2 because in my opinion it is a much better font.)

If you alter /etc/default/grub, run grub-mkconfig again (or manually adjust your grub.cfg file).

I wasn't able to fully understand your post so this may or may not answer your problem.
 
Old 02-03-2022, 10:40 AM   #3
amaretzek
LQ Newbie
 
Registered: Jun 2021
Location: Lisbon, Portugal
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: Disabled
The behaviour you describe didn't work for me. Are you shure it worked for you?
Because, if "loadfont" fails, you have "console", which is not a graphical terminal, hence, no images for background.
But, the rest works. You have the menu, you can boot. Only if the font was in /boot/grub/fonts, the loadfont succeeded and a graphical terminal was active.
If you take out the "if", and load a graphical terminal, you can get a background image, but the only character printed is "?".
If you still don't get my message, please let me know and will take more time to re-phrase it...
Thanks
 
Old 02-03-2022, 04:16 PM   #4
chrisVV
Member
 
Registered: Aug 2010
Posts: 548

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
The way it works for me is that in a pristine slackware-current installation, with no GRUB_FONT specified in /etc/default/grub, then the grub.cfg file produced by grub-mkconfig will (by virtue of the only partly documented behavior of the normal.mod module) bring up a console login screen unless the dejavusansmono.pf2 font is installed in /boot/grub/fonts - in the latter case dejavusansmono is brought up. If like me, you want to use the unicode.pf2 font, then you need to set GRUB_FONT in /etc/default/grub to point to it.

In my opinion it would be better if slackware used unicode.pf2 as the default. But given that it has gone for dejavusansmono the behavior I have described doesn't seem unreasonable. Another alternative which has a lot going for it is not to use grub-mkconfig at all, and instead to write your own config file.

Summary: set GRUB_FONT and you will get what you have asked grub for.
 
Old 02-03-2022, 04:46 PM   #5
amaretzek
LQ Newbie
 
Registered: Jun 2021
Location: Lisbon, Portugal
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrisVV View Post

Summary: set GRUB_FONT and you will get what you have asked grub for.
Just tested it: No, you don't get what you want..

I have made my own grub.cfg, but grub-mkconfig exists to help people, so, if there is a "GRUB_FONT=" in /etc/default/grub, then grub-mkconfig should copy the font to /boot/grub/fonts.
Otherwise gfxterm will not load, no background image.
BTW, in "if loadfont /usr/share/grub/dejavusansmono.pf2 ; then" (in /boot/grub/grub.cfg), the path looks wrong to me.
"/usr" is not very likely to be accessible to grub on boot time, right?

Thanks again...
 
Old 02-03-2022, 05:57 PM   #6
chrisVV
Member
 
Registered: Aug 2010
Posts: 548

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
We seem to have a cognitive disconnect. If I set GRUB_FONT to point to /usr/share/grub/unicode.pf2 (as I do) then grub-mkconfig will construct a configuration file which loads that font file from that location on boot-up in order to display its boot menu. It doesn't need to copy anything to anywhere to work correctly: it will read it in location at /usr/share/grub/unicode.pf2, because it can read all common linux filesystems.

If that doesn't work for you then either I am especially blessed (which seems unlikely) or you have done something wrong.

I think this conversation has gone as far as is practicable unless there is some other issue arising here.

Edit This assumes that /usr/share/grub is on your root filesystem. If it isn't, but /boot/grub/fonts is, then copy your font file into /boot/grub/fonts (or into some other directory in your root file system) and set GRUB_FONT to point to the location in which you have put it.

Last edited by chrisVV; 02-03-2022 at 06:01 PM.
 
1 members found this post helpful.
Old 02-03-2022, 06:36 PM   #7
amaretzek
LQ Newbie
 
Registered: Jun 2021
Location: Lisbon, Portugal
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrisVV View Post
We seem to have a cognitive disconnect. If I set GRUB_FONT to point to /usr/share/grub/unicode.pf2 (as I do) then grub-mkconfig will construct a configuration file which loads that font file from that location on boot-up in order to display its boot menu. It doesn't need to copy anything to anywhere to work correctly: it will read it in location at /usr/share/grub/unicode.pf2, because it can read all common linux filesystems.

If that doesn't work for you then either I am especially blessed (which seems unlikely) or you have done something wrong.
So, you are saying that you get a background image on the boot screen?
Quote:
Originally Posted by chrisVV View Post
I think this conversation has gone as far as is practicable unless there is some other issue arising here.

Edit This assumes that /usr/share/grub is on your root filesystem. If it isn't, but /boot/grub/fonts is, then copy your font file into /boot/grub/fonts (or into some other directory in your root file system) and set GRUB_FONT to point to the location in which you have put it.
loadfont /somewhere_accessible_on_boot_time/unicode.pf2 doesn't work.
I tried it out.
The terminal is then "console" and not "gfxterm".

I posted to spare people from waisting time. Not shure if I managed to be clear enough...
 
Old 02-03-2022, 06:58 PM   #8
chrisVV
Member
 
Registered: Aug 2010
Posts: 548

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
What you said in your original post was
Quote:
In /boot/grub/grub.cfg "loadfont" fails because /boot/grub/fonts/ is empty
That is not correct if you set up your grub configuration (in particular GRUB_FONT) correctly: if loadfont fails then as I have tried to explain you have done something wrong. I have set up background colors without problems: if you cannot set up a background image (which I do not do) then I suspect you are doing some else wrong, or if not and there really is a problem with grub then it is not with font loading.

You also said
Quote:
"/usr" is not very likely to be accessible to grub on boot time, right?
which is wrong, as I have tried to explain.

I think it is probably pointless continuing with this.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] xterm back to defaults in slackware64-current 2022-01-16 gauchao Slackware 13 01-20-2022 02:49 PM
how to install grub2 on the first section of a partition and then how to chainload to this grub2 bootloader? centguy Linux - Software 9 09-14-2017 10:03 AM
grub2 can't see my win 7 partition and yast2 bootloader can't reinstall grub2 jjrojaspy SUSE / openSUSE 5 07-07-2013 10:38 PM
MyLQ, subscription folder, empty current folder fails with more than 100? threads zhjim LQ Suggestions & Feedback 2 06-08-2012 11:14 AM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration