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 )) + ":" + (makeSearchPathOutput "bin" "sbin" [ 65 pkgs.mdadm pkgs.utillinux 66 ]); 67 - font = if lib.last (lib.splitString "." cfg.font) == "pf2" 68 then cfg.font 69 - else "${convertedFont}"; 70 }); 71 72 bootDeviceCounters = fold (device: attr: attr // { "${device}" = (attr."${device}" or 0) + 1; }) {}
··· 64 )) + ":" + (makeSearchPathOutput "bin" "sbin" [ 65 pkgs.mdadm pkgs.utillinux 66 ]); 67 + font = if cfg.font == null then "" 68 + else (if lib.last (lib.splitString "." cfg.font) == "pf2" 69 then cfg.font 70 + else "${convertedFont}"); 71 }); 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 else 282 insmod vbe 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 "; 297 298 if ($font) { 299 copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath\n"; 300 } 301 if ($splashImage) { 302 # Keeps the image's extension.
··· 281 else 282 insmod vbe 283 fi 284 "; 285 286 if ($font) { 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 + "; 302 } 303 if ($splashImage) { 304 # Keeps the image's extension.