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

grub: Support when boot.loader.grub.font is null

authored by Graham Christensen and committed by GitHub 5467f0ed bd005845

+17 -14
+3 -2
nixos/modules/system/boot/loader/grub/grub.nix
··· 64 64 )) + ":" + (makeSearchPathOutput "bin" "sbin" [ 65 65 pkgs.mdadm pkgs.utillinux 66 66 ]); 67 - font = if lib.last (lib.splitString "." cfg.font) == "pf2" 67 + font = if cfg.font == null then "" 68 + else (if lib.last (lib.splitString "." cfg.font) == "pf2" 68 69 then cfg.font 69 - else "${convertedFont}"; 70 + else "${convertedFont}"); 70 71 }); 71 72 72 73 bootDeviceCounters = fold (device: attr: attr // { "${device}" = (attr."${device}" or 0) + 1; }) {}
+14 -12
nixos/modules/system/boot/loader/grub/install-grub.pl
··· 281 281 else 282 282 insmod vbe 283 283 fi 284 - insmod font 285 - if loadfont " . $grubBoot->path . "/converted-font.pf2; then 286 - insmod gfxterm 287 - if [ \"\${grub_platform}\" = \"efi\" ]; then 288 - set gfxmode=$gfxmodeEfi 289 - set gfxpayload=keep 290 - else 291 - set gfxmode=$gfxmodeBios 292 - set gfxpayload=text 293 - fi 294 - terminal_output gfxterm 295 - fi 296 284 "; 297 285 298 286 if ($font) { 299 287 copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath\n"; 288 + $conf .= " 289 + insmod font 290 + if loadfont " . $grubBoot->path . "/converted-font.pf2; then 291 + insmod gfxterm 292 + if [ \"\${grub_platform}\" = \"efi\" ]; then 293 + set gfxmode=$gfxmodeEfi 294 + set gfxpayload=keep 295 + else 296 + set gfxmode=$gfxmodeBios 297 + set gfxpayload=text 298 + fi 299 + terminal_output gfxterm 300 + fi 301 + "; 300 302 } 301 303 if ($splashImage) { 302 304 # Keeps the image's extension.