Merge pull request #40462 from samueldr/fix/grub-background
Fixes grub splashImage documentation + implementation
This commit is contained in:
commit
290505bf1b
@ -308,10 +308,22 @@ in
|
|||||||
type = types.nullOr types.path;
|
type = types.nullOr types.path;
|
||||||
example = literalExample "./my-background.png";
|
example = literalExample "./my-background.png";
|
||||||
description = ''
|
description = ''
|
||||||
Background image used for GRUB. It must be a 640x480,
|
Background image used for GRUB.
|
||||||
|
Set to <literal>null</literal> to run GRUB in text mode.
|
||||||
|
|
||||||
|
<note><para>
|
||||||
|
For grub 1:
|
||||||
|
It must be a 640x480,
|
||||||
14-colour image in XPM format, optionally compressed with
|
14-colour image in XPM format, optionally compressed with
|
||||||
<command>gzip</command> or <command>bzip2</command>. Set to
|
<command>gzip</command> or <command>bzip2</command>.
|
||||||
<literal>null</literal> to run GRUB in text mode.
|
</para></note>
|
||||||
|
|
||||||
|
<note><para>
|
||||||
|
For grub 2:
|
||||||
|
File must be one of .png, .tga, .jpg, or .jpeg. JPEG images must
|
||||||
|
not be progressive.
|
||||||
|
The image will be scaled if necessary to fit the screen.
|
||||||
|
</para></note>
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -299,12 +299,16 @@ else {
|
|||||||
copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath\n";
|
copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath\n";
|
||||||
}
|
}
|
||||||
if ($splashImage) {
|
if ($splashImage) {
|
||||||
# FIXME: GRUB 1.97 doesn't resize the background image if it
|
# Keeps the image's extension.
|
||||||
# doesn't match the video resolution.
|
my ($filename, $dirs, $suffix) = fileparse($splashImage, qr"\..[^.]*$");
|
||||||
copy $splashImage, "$bootPath/background.png" or die "cannot copy $splashImage to $bootPath\n";
|
# The module for jpg is jpeg.
|
||||||
|
if ($suffix eq ".jpg") {
|
||||||
|
$suffix = ".jpeg";
|
||||||
|
}
|
||||||
|
copy $splashImage, "$bootPath/background$suffix" or die "cannot copy $splashImage to $bootPath\n";
|
||||||
$conf .= "
|
$conf .= "
|
||||||
insmod png
|
insmod " . substr($suffix, 1) . "
|
||||||
if background_image " . $grubBoot->path . "/background.png; then
|
if background_image " . $grubBoot->path . "/background$suffix; then
|
||||||
set color_normal=white/black
|
set color_normal=white/black
|
||||||
set color_highlight=black/white
|
set color_highlight=black/white
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user