From 678aa093a297e48931afd7f7654e34ada9f63dad Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 9 Aug 2022 15:07:07 +0100 Subject: drakboot: add options to change the rEFInd background (mga#28073) --- perl-install/any.pm | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'perl-install/any.pm') diff --git a/perl-install/any.pm b/perl-install/any.pm index 0a2efa1a7..2c496e39b 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -509,20 +509,63 @@ sub setupBootloader__refind { my $update_esp = !$already_installed; my $as_default = $already_in_default || $b->{removable}; - my $use_nvram = $b->{use_nvram}; - $use_nvram //= 1; + + if (!defined $b->{banner_path}) { + #- We haven't yet read any existing configuration, either because we are doing a clean + #- install or because we are switching from a different bootloader. Try to read it now. + #- Even if we are doing a clean install, rEFInd may already be installed in the ESP. + bootloader::read_refind_config($b); + } + + my $use_nvram = $b->{use_nvram}; + my $banner_path = $b->{banner_path}; + my $banner_scale = $b->{banner_scale}; + my $banner_type = $banner_path eq 'refind_banner.png' ? 'banner' + : $banner_path eq 'mageia_theme.png' ? 'theme' + : 'custom'; $in->ask_from_( { title => N("Bootloader Configuration"), interactive_help_id => 'setupBootloader', }, [ + { label => N("Install Options"), title => 1, }, { text => N("Install or update rEFInd in the EFI system partition"), val => \$update_esp, type => 'bool', disabled => sub { !$already_installed } }, { text => N("Install in /EFI/BOOT (removable device or workaround for some BIOSs)"), val => \$as_default, type => 'bool', disabled => sub { !$update_esp } }, { text => N("Configure rEFInd to store its variables in the EFI NVRAM"), val => \$use_nvram, type => 'bool' }, + { label => N("Background"), title => 1, }, + { val => \$banner_type, type => 'combo', list => [ 'banner', 'theme', 'custom' ], + format => sub { + my ($choice) = @_; + +{ + 'banner' => N("rEFInd banner"), + 'theme' => N("Mageia theme"), + 'custom' => N("Custom"), + }->{$choice}; + }, + changed => sub { + if ($banner_type eq 'banner') { + $banner_path = 'refind_banner.png'; + $banner_scale = 'noscale'; + } elsif ($banner_type eq 'theme') { + $banner_path = 'mageia_theme.png'; + $banner_scale = 'fillscreen'; + } + } + }, + { val => \$banner_path, type => 'entry', disabled => sub { $banner_type ne 'custom' } }, + { val => \$banner_scale, type => 'combo', list => [ 'noscale', 'fillscreen' ], + format => sub { + my ($choice) = @_; + +{ + 'noscale' => N("No scaling"), + 'fillscreen' => N("Scale to fit"), + }->{$choice}; + } + }, ] ) or return 0; @@ -531,7 +574,9 @@ sub setupBootloader__refind { } else { $b->{install_mode} = $as_default ? 'no_install' : 'nvram_only'; } - $b->{use_nvram} = $use_nvram; + $b->{use_nvram} = $use_nvram; + $b->{banner_path} = $banner_path; + $b->{banner_scale} = $banner_scale; if (my @esp = grep { $_->{mntpoint} eq '/boot/EFI' } @$fstab) { $b->{esp_device} = $esp[0]{real_device} || fs::wild_device::from_part('', $esp[0]); } -- cgit v1.2.1