Mageia Bugzilla – Attachment 5845 Details for
Bug 15153
Patches to add support for the rEFInd boot manager in drakboot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch for /lib/libDrakX/any.pm
any.pm.patch (text/plain), 2.23 KB, created by
Martin Whitaker
on 2015-01-29 00:39:14 CET
(
hide
)
Description:
Patch for /lib/libDrakX/any.pm
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2015-01-29 00:39:14 CET
Size:
2.23 KB
patch
obsolete
>--- /lib/libDrakX/any.pm 2015-01-09 01:32:23.000000000 +0000 >+++ any.pm 2015-01-28 21:30:26.149830592 +0000 >@@ -488,7 +488,12 @@ > } @$fstab; > > my @l; >- if ($e->{type} eq "image") { >+ if ($b->{method} eq 'refind') { >+ @l = ( >+{ label => N("Append"), val => \$append }, >+{ label => N("Video mode"), val => \$vga, list => [ '', Xconfig::resolution_and_depth::bios_vga_modes() ], format => \&Xconfig::resolution_and_depth::to_string, advanced => 1 }, >+ ); >+ } elsif ($e->{type} eq "image") { > @l = ( > { label => N("Image"), val => \$e->{kernel_or_dev}, list => [ map { "/boot/$_" } bootloader::installed_vmlinuz() ], not_edit => 0 }, > { label => N("Root"), val => \$e->{root}, list => [ map { fs::wild_device::from_part('', $_) } @$fstab ], format => sub { $root_descr{$_[0]} } }, >@@ -537,9 +542,15 @@ > my $Add = sub { > my @labels = map { $_->{label} } @{$b->{entries}}; > my ($e, $prefix); >- if ($in->ask_from_list_('', N("Which type of entry do you want to add?"), >- [ N_("Linux"), N_("Other OS (Windows...)") ] >- ) eq "Linux") { >+ if ($b->{method} eq 'refind') { >+ $e = { type => 'image', >+ kernel_or_dev => '/boot/vmlinuz', >+ root => '/dev/' . fs::get::root($fstab)->{device}, #- assume a good default. >+ }; >+ $prefix = "linux"; >+ } elsif ($in->ask_from_list_('', N("Which type of entry do you want to add?"), >+ [ N_("Linux"), N_("Other OS (Windows...)") ] >+ ) eq "Linux") { > $e = { type => 'image', > root => '/dev/' . fs::get::root($fstab)->{device}, #- assume a good default. > }; >@@ -585,6 +596,18 @@ > }; > > my @prev_entries = @{$b->{entries}}; >+ >+ #- the rEFInd configuration file just provides alternative kernel command lines >+ #- so we only want to display entries that relate to the default kernel. >+ if ($b->{method} eq 'refind') { >+ @{$b->{entries}} = >+ grep { >+ my $pb = $_->{type} ne 'image' || $_->{kernel_or_dev} ne '/boot/vmlinuz'; >+ log::l("dropping bootloader entry $_->{label} because it is not needed by rEFInd") if $pb; >+ !$pb; >+ } @{$b->{entries}}; >+ } >+ > if ($in->ask_from__add_modify_remove(N("Bootloader Configuration"), > N("Here are the entries on your boot menu so far. > You can create additional entries or change the existing ones."), [ {
--- /lib/libDrakX/any.pm 2015-01-09 01:32:23.000000000 +0000 +++ any.pm 2015-01-28 21:30:26.149830592 +0000 @@ -488,7 +488,12 @@ } @$fstab; my @l; - if ($e->{type} eq "image") { + if ($b->{method} eq 'refind') { + @l = ( +{ label => N("Append"), val => \$append }, +{ label => N("Video mode"), val => \$vga, list => [ '', Xconfig::resolution_and_depth::bios_vga_modes() ], format => \&Xconfig::resolution_and_depth::to_string, advanced => 1 }, + ); + } elsif ($e->{type} eq "image") { @l = ( { label => N("Image"), val => \$e->{kernel_or_dev}, list => [ map { "/boot/$_" } bootloader::installed_vmlinuz() ], not_edit => 0 }, { label => N("Root"), val => \$e->{root}, list => [ map { fs::wild_device::from_part('', $_) } @$fstab ], format => sub { $root_descr{$_[0]} } }, @@ -537,9 +542,15 @@ my $Add = sub { my @labels = map { $_->{label} } @{$b->{entries}}; my ($e, $prefix); - if ($in->ask_from_list_('', N("Which type of entry do you want to add?"), - [ N_("Linux"), N_("Other OS (Windows...)") ] - ) eq "Linux") { + if ($b->{method} eq 'refind') { + $e = { type => 'image', + kernel_or_dev => '/boot/vmlinuz', + root => '/dev/' . fs::get::root($fstab)->{device}, #- assume a good default. + }; + $prefix = "linux"; + } elsif ($in->ask_from_list_('', N("Which type of entry do you want to add?"), + [ N_("Linux"), N_("Other OS (Windows...)") ] + ) eq "Linux") { $e = { type => 'image', root => '/dev/' . fs::get::root($fstab)->{device}, #- assume a good default. }; @@ -585,6 +596,18 @@ }; my @prev_entries = @{$b->{entries}}; + + #- the rEFInd configuration file just provides alternative kernel command lines + #- so we only want to display entries that relate to the default kernel. + if ($b->{method} eq 'refind') { + @{$b->{entries}} = + grep { + my $pb = $_->{type} ne 'image' || $_->{kernel_or_dev} ne '/boot/vmlinuz'; + log::l("dropping bootloader entry $_->{label} because it is not needed by rEFInd") if $pb; + !$pb; + } @{$b->{entries}}; + } + if ($in->ask_from__add_modify_remove(N("Bootloader Configuration"), N("Here are the entries on your boot menu so far. You can create additional entries or change the existing ones."), [ {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15153
:
5844
|
5845
|
5932
|
5933
|
5936
|
5975
|
6187
|
6188
|
6308
|
8124
|
8125
|
8126
|
8127
|
8128
|
10371