nixos/grub: Adds background color and mode options
The background color option is self-explanatory. The mode is either `normal` or `stretch`, they are as defined by GRUB, where normal will put the image in the top-left corner of the menu, and stretch is the default, where it stretches the image without consideration for the aspect ratio. * https://www.gnu.org/software/grub/manual/grub/grub.html#background_005fimage
This commit is contained in:
@@ -51,6 +51,8 @@ my $extraEntries = get("extraEntries");
|
||||
my $extraEntriesBeforeNixOS = get("extraEntriesBeforeNixOS") eq "true";
|
||||
my $extraInitrd = get("extraInitrd");
|
||||
my $splashImage = get("splashImage");
|
||||
my $splashMode = get("splashMode");
|
||||
my $backgroundColor = get("backgroundColor");
|
||||
my $configurationLimit = int(get("configurationLimit"));
|
||||
my $copyKernels = get("copyKernels") eq "true";
|
||||
my $timeout = int(get("timeout"));
|
||||
@@ -307,10 +309,15 @@ else {
|
||||
if ($suffix eq ".jpg") {
|
||||
$suffix = ".jpeg";
|
||||
}
|
||||
if ($backgroundColor) {
|
||||
$conf .= "
|
||||
background_color '$backgroundColor'
|
||||
";
|
||||
}
|
||||
copy $splashImage, "$bootPath/background$suffix" or die "cannot copy $splashImage to $bootPath\n";
|
||||
$conf .= "
|
||||
insmod " . substr($suffix, 1) . "
|
||||
if background_image " . $grubBoot->path . "/background$suffix; then
|
||||
if background_image --mode '$splashMode' " . $grubBoot->path . "/background$suffix; then
|
||||
set color_normal=white/black
|
||||
set color_highlight=black/white
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user