Skip to content

Commit

Permalink
Merge pull request #58027 from DanielFabian/gfxpayload
Browse files Browse the repository at this point in the history
grub: Add gfxpayload
  • Loading branch information
samueldr committed Apr 8, 2019
2 parents 6630307 + 84ff095 commit ef0ca61
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 19 additions & 1 deletion nixos/modules/system/boot/loader/grub/grub.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let
inherit (cfg)
version extraConfig extraPerEntryConfig extraEntries forceInstall useOSProber
extraEntriesBeforeNixOS extraPrepareConfig extraInitrd configurationLimit copyKernels
default fsIdentifier efiSupport efiInstallAsRemovable gfxmodeEfi gfxmodeBios;
default fsIdentifier efiSupport efiInstallAsRemovable gfxmodeEfi gfxmodeBios gfxpayloadEfi gfxpayloadBios;
path = with pkgs; makeBinPath (
[ coreutils gnused gnugrep findutils diffutils btrfs-progs utillinux mdadm ]
++ optional (cfg.efiSupport && (cfg.version == 2)) efibootmgr
Expand Down Expand Up @@ -393,6 +393,24 @@ in
'';
};

gfxpayloadEfi = mkOption {
default = "keep";
example = "text";
type = types.str;
description = ''
The gfxpayload to pass to GRUB when loading a graphical boot interface under EFI.
'';
};

gfxpayloadBios = mkOption {
default = "text";
example = "keep";
type = types.str;
description = ''
The gfxpayload to pass to GRUB when loading a graphical boot interface under BIOS.
'';
};

configurationLimit = mkOption {
default = 100;
example = 120;
Expand Down
6 changes: 4 additions & 2 deletions nixos/modules/system/boot/loader/grub/install-grub.pl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ sub runCommand {
my $efiSysMountPoint = get("efiSysMountPoint");
my $gfxmodeEfi = get("gfxmodeEfi");
my $gfxmodeBios = get("gfxmodeBios");
my $gfxpayloadEfi = get("gfxpayloadEfi");
my $gfxpayloadBios = get("gfxpayloadBios");
my $bootloaderId = get("bootloaderId");
my $forceInstall = get("forceInstall");
my $font = get("font");
Expand Down Expand Up @@ -293,10 +295,10 @@ sub GrubFs {
insmod gfxterm
if [ \"\${grub_platform}\" = \"efi\" ]; then
set gfxmode=$gfxmodeEfi
set gfxpayload=keep
set gfxpayload=$gfxpayloadEfi
else
set gfxmode=$gfxmodeBios
set gfxpayload=text
set gfxpayload=$gfxpayloadBios
fi
terminal_output gfxterm
fi
Expand Down

0 comments on commit ef0ca61

Please sign in to comment.