Merge pull request #41486 from grahamc/support-null-font

grub: Support when boot.loader.grub.font is null
wip/yesman
Graham Christensen 6 years ago committed by GitHub
commit 5467f0ed7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      nixos/modules/system/boot/loader/grub/grub.nix
  2. 26
      nixos/modules/system/boot/loader/grub/install-grub.pl

@ -64,9 +64,10 @@ let
)) + ":" + (makeSearchPathOutput "bin" "sbin" [
pkgs.mdadm pkgs.utillinux
]);
font = if lib.last (lib.splitString "." cfg.font) == "pf2"
font = if cfg.font == null then ""
else (if lib.last (lib.splitString "." cfg.font) == "pf2"
then cfg.font
else "${convertedFont}";
else "${convertedFont}");
});
bootDeviceCounters = fold (device: attr: attr // { "${device}" = (attr."${device}" or 0) + 1; }) {}

@ -281,22 +281,24 @@ else {
else
insmod vbe
fi
insmod font
if loadfont " . $grubBoot->path . "/converted-font.pf2; then
insmod gfxterm
if [ \"\${grub_platform}\" = \"efi\" ]; then
set gfxmode=$gfxmodeEfi
set gfxpayload=keep
else
set gfxmode=$gfxmodeBios
set gfxpayload=text
fi
terminal_output gfxterm
fi
";
if ($font) {
copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath\n";
$conf .= "
insmod font
if loadfont " . $grubBoot->path . "/converted-font.pf2; then
insmod gfxterm
if [ \"\${grub_platform}\" = \"efi\" ]; then
set gfxmode=$gfxmodeEfi
set gfxpayload=keep
else
set gfxmode=$gfxmodeBios
set gfxpayload=text
fi
terminal_output gfxterm
fi
";
}
if ($splashImage) {
# Keeps the image's extension.

Loading…
Cancel
Save