Mailing List Archive

[SOLVED} Exact setting in grub to default to a kernel by name?
On Tue, Jun 15, 2021 at 02:56:48PM +0100, Neil Bothwick wrote
> On Mon, 14 Jun 2021 16:25:00 -0400, Walter Dnes wrote:
>
> > Unfortunately, just like the standard grub.cfg, it's a tiny-looking
> > text font on my 1920x1080 monitor that I have to squint at. Next
> > step... what do I do to get a functioning GUI?
>
> Set up a theme, you can use one of the supplied examples as a base, with
> a larger font.
>
> https://www.gnu.org/software/grub/manual/grub/grub.html#Fonts

After more reboots than I want to remember, I'm finally where I want
to be. Thanks for everybody's help. I found a thread on Stackexchange
https://unix.stackexchange.com/questions/31672/can-grub-font-size-be-customised
which supplied the final piece of the puzzle. That thread was started
9 years, 4 months ago. grub1 is now a distant memory, so change all
mentions of "grub2" to plain "grub". As per the Stackexchange thread,
there's a grub-mkfont command that can translate ttf files to pf2 files
readable by grub. ***AND YOU CAN RESIZE THE FONT WHILE YOURE AT IT***.
So I ran grub-mkfont, with "-s 64" which means 64 pixels high...

grub-mkfont -s 64 -o /boot/grub/fonts/HonkingBigFont.pf2 /usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf

My grub.cfg follows. Yours would obviously differ in details.

====================================================================
search --set=root --label rootfs
sleep 2

set timeout=15
set gfxmode=640x480
set gfxpayload=keep
loadfont /boot/grub/fonts/HonkingBigFont.pf2
insmod all_video
insmod gfxterm
terminal_output gfxterm

menuentry 'Linux Experimental' {
linux /vmlinuz-experimental root=/dev/sda2 ro noexec=on net.ifnames=0
intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Experimental Recovery' {
linux /vmlinuz-experimental root=/dev/sda2 ro
}
menuentry 'Linux Production' {
linux /vmlinuz-production root=/dev/sda2 ro noexec=on net.ifnames=0 i
ntel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Production Recovery' {
linux /vmlinuz-production root=/dev/sda2 ro
}
====================================================================

The menu output is Y-U-U-U-U-U-GE, which makes it nice and readable on
my 1920x1080 monitor. There's a cosmetic problem in that this font
doesn't have "line-drawing characters"...

1) The box around the menu is composed of garbage characters.
2) The bit about using up-arrow and down-arrow keys to select also shows
the same garbage characters.

grub-mkfont man page says "Convert common font file formats into PF2",
so I may look at other character sets that have line-drawing characters.

--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications