mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
nixos/grub: Insert required image modules for themes
With a limited testing of all packaged GRUB 2 themes (pkgs.nixos-grub2-theme) this is tested to work. Without this change, the theme loading will error out (waiting for a key press). With this change, the theme loads and works as expected.
This commit is contained in:
parent
50063bf9d6
commit
c867c6d172
@ -385,6 +385,31 @@ rmtree("$bootPath/theme") or die "cannot clean up theme folder in $bootPath\n" i
|
||||
if ($theme) {
|
||||
# Copy theme
|
||||
rcopy($theme, "$bootPath/theme") or die "cannot copy $theme to $bootPath\n";
|
||||
|
||||
# Detect which modules will need to be loaded
|
||||
my $with_png = 0;
|
||||
my $with_jpeg = 0;
|
||||
|
||||
find({ wanted => sub {
|
||||
if ($_ =~ /\.png$/i) {
|
||||
$with_png = 1;
|
||||
}
|
||||
elsif ($_ =~ /\.jpe?g$/i) {
|
||||
$with_jpeg = 1;
|
||||
}
|
||||
}, no_chdir => 1 }, $theme);
|
||||
|
||||
if ($with_png) {
|
||||
$conf .= "
|
||||
insmod png
|
||||
"
|
||||
}
|
||||
if ($with_jpeg) {
|
||||
$conf .= "
|
||||
insmod jpeg
|
||||
"
|
||||
}
|
||||
|
||||
$conf .= "
|
||||
# Sets theme.
|
||||
set theme=" . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/theme/theme.txt
|
||||
|
Loading…
Reference in New Issue
Block a user