Mageia Bugzilla – Attachment 6407 Details for
Bug 9627
MCC -> Boot -> Set up boot system -> Modify does not effect Grub2 entries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
use a dedicate screen for grub2 (1/2)
0001-add-a-dedicate-step-for-grub2-mga-9627.patch (text/plain), 2.52 KB, created by
Thierry Vignaud
on 2015-05-01 11:48:57 CEST
(
hide
)
Description:
use a dedicate screen for grub2 (1/2)
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2015-05-01 11:48:57 CEST
Size:
2.52 KB
patch
obsolete
>From 7a55e8f8ca15e73a293773c8306ed73c3d41511b Mon Sep 17 00:00:00 2001 >From: Thierry Vignaud <thierry.vignaud@gmail.com> >Date: Fri, 1 May 2015 11:42:40 +0200 >Subject: [PATCH 1/2] add a dedicate step for grub2 (mga#9627) > >rationale: grub2 entries are autogenerated, thus: >- we cannot just reuse labels from previous bootloader > (grub-legacy/lilo) >- we cannot alter entries >--- > perl-install/any.pm | 38 +++++++++++++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) > >diff --git a/perl-install/any.pm b/perl-install/any.pm >index 3592129..ad070f9 100644 >--- a/perl-install/any.pm >+++ b/perl-install/any.pm >@@ -224,7 +224,11 @@ sub setupBootloader { > setupBootloader__boot_bios_drive($in, $b, $all_hds->{hds}) or goto general; > { > local $::Wizard_finished = 1 if $::isStandalone; >- setupBootloader__entries($in, $b, $all_hds, $fstab) or goto general; >+ if ($b->{method} eq 'grub2') { >+ setupBootloader__grub2($in, $b, $all_hds, $fstab) or goto general; >+ } else { >+ setupBootloader__entries($in, $b, $all_hds, $fstab) or goto general; >+ } > } > 1; > } >@@ -603,6 +607,38 @@ You can create additional entries or change the existing ones."), [ { > } > } > >+sub setupBootloader__grub2 { >+ my ($in, $b, $all_hds, $fstab) = @_; >+ >+ # update entries (so that we can display their list below): >+ my $error; >+ run_program::rooted($::prefix, 'update-grub2', '2>', \$error) or die "update-grub2 failed: $error"; >+ # read grub2 auto-generated entries (instead of keeping eg: grub/lilo ones): >+ my $b2 = bootloader::read_grub2(); >+ local $b->{entries} = $b2->{entries}; >+ >+ # set default parameters: >+ my ($entry) = grep { $_->{kernel_or_dev} =~ /vmlin/ } @{$b->{entries}}; >+ my $append = $entry->{append}; >+ >+ require Xconfig::resolution_and_depth; >+ >+ require network::network; #- to list network profiles >+ my $vga = Xconfig::resolution_and_depth::from_bios($b->{vga} || $entry->{vga}); >+ >+ $in->ask_from_( >+ { >+ title => N("Bootloader Configuration"), >+ }, >+ [ >+ { label => N("Default"), val => \$b->{default}, >+ list => [ map { $_->{label} } @{$b->{entries}} ] }, >+ { 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 }, >+ ]) ? 1 : ''; >+} >+ > sub get_autologin() { > my %desktop = getVarsFromSh("$::prefix/etc/sysconfig/desktop"); > my $gdm_file = "$::prefix/etc/X11/gdm/custom.conf"; >-- >2.3.2 >
From 7a55e8f8ca15e73a293773c8306ed73c3d41511b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud <thierry.vignaud@gmail.com> Date: Fri, 1 May 2015 11:42:40 +0200 Subject: [PATCH 1/2] add a dedicate step for grub2 (mga#9627) rationale: grub2 entries are autogenerated, thus: - we cannot just reuse labels from previous bootloader (grub-legacy/lilo) - we cannot alter entries --- perl-install/any.pm | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/perl-install/any.pm b/perl-install/any.pm index 3592129..ad070f9 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -224,7 +224,11 @@ sub setupBootloader { setupBootloader__boot_bios_drive($in, $b, $all_hds->{hds}) or goto general; { local $::Wizard_finished = 1 if $::isStandalone; - setupBootloader__entries($in, $b, $all_hds, $fstab) or goto general; + if ($b->{method} eq 'grub2') { + setupBootloader__grub2($in, $b, $all_hds, $fstab) or goto general; + } else { + setupBootloader__entries($in, $b, $all_hds, $fstab) or goto general; + } } 1; } @@ -603,6 +607,38 @@ You can create additional entries or change the existing ones."), [ { } } +sub setupBootloader__grub2 { + my ($in, $b, $all_hds, $fstab) = @_; + + # update entries (so that we can display their list below): + my $error; + run_program::rooted($::prefix, 'update-grub2', '2>', \$error) or die "update-grub2 failed: $error"; + # read grub2 auto-generated entries (instead of keeping eg: grub/lilo ones): + my $b2 = bootloader::read_grub2(); + local $b->{entries} = $b2->{entries}; + + # set default parameters: + my ($entry) = grep { $_->{kernel_or_dev} =~ /vmlin/ } @{$b->{entries}}; + my $append = $entry->{append}; + + require Xconfig::resolution_and_depth; + + require network::network; #- to list network profiles + my $vga = Xconfig::resolution_and_depth::from_bios($b->{vga} || $entry->{vga}); + + $in->ask_from_( + { + title => N("Bootloader Configuration"), + }, + [ + { label => N("Default"), val => \$b->{default}, + list => [ map { $_->{label} } @{$b->{entries}} ] }, + { 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 }, + ]) ? 1 : ''; +} + sub get_autologin() { my %desktop = getVarsFromSh("$::prefix/etc/sysconfig/desktop"); my $gdm_file = "$::prefix/etc/X11/gdm/custom.conf"; -- 2.3.2
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 9627
:
4188
|
6407
|
6408
|
6409
|
6410
|
6411
|
6418
|
6420