New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes grub splashImage documentation + implementation #40462
Conversation
GRUB 2.0 supports png, jpeg and tga. This will use the image's suffix to load the right module. As jpeg module is named jpeg, jpg is renamed jpeg. If the user uses wrong image suffix for an image, it wouldn't work anyway. This will leave up to two additional left-over files in /boot/ if user switches through all the supported file formats. The module already left the png image if the user disabled the splash image.
@@ -299,12 +299,16 @@ sub GrubFs { | |||
copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath\n"; | |||
} | |||
if ($splashImage) { | |||
# FIXME: GRUB 1.97 doesn't resize the background image if it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before anyone asks, this comment has been "wrong" for a while.
GRUB 1.97 may still not resize the background image, but GRUB 2.02 does!
$conf .= " | ||
insmod png | ||
if background_image " . $grubBoot->path . "/background.png; then | ||
insmod " . substr($suffix, 1) . " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we validate the suffix is one of N supported formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the image format isn't supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous behaviour:
- Image did not load, text mode console
(Just tested) the new behaviour:
- Exact same thing, image does not load, text mode console.
I'm guessing that an error message is quickly shown and hidden (error: file '/grub/x86_64-efi/ext.mod
) as it would if I tried insmod ext
in the console.
Motivation for this change
This (first) fixes the documentation for the option, adding the details about the file format for grub 2.
Then, this fixes the implementation to make jpg and tga files loadable too. This will not work with a progressive jpeg, this is a known issue. This implementation will simply fail without background (grub behaviour) if a progressive jpeg image is used. I don't think (tell me if I'm wrong) that it's the module system's job to check for this.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)I can split the PR if it is wanted, though it will mean the documentation for the option will be slightly wrong until both commits are applied.