Mageia Bugzilla – Attachment 6410 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 (2/3)
0002-add-a-dedicate-step-for-grub2-mga-9627.patch (text/plain), 2.44 KB, created by
Thierry Vignaud
on 2015-05-01 12:01:09 CEST
(
hide
)
Description:
use a dedicate screen for grub2 (2/3)
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2015-05-01 12:01:09 CEST
Size:
2.44 KB
patch
obsolete
>From f37f57b41850ec1c0bfd626d8b1e8d7334bc89d6 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 2/3] 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 | 37 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > >diff --git a/perl-install/any.pm b/perl-install/any.pm >index 3592129..c7be754 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,37 @@ 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}; >+ >+ # get default parameters: >+ my $append = bootloader::get_grub2_append($b); >+ >+ require Xconfig::resolution_and_depth; >+ >+ require network::network; #- to list network profiles >+ my $vga = Xconfig::resolution_and_depth::from_bios($b->{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 f37f57b41850ec1c0bfd626d8b1e8d7334bc89d6 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 2/3] 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 | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/perl-install/any.pm b/perl-install/any.pm index 3592129..c7be754 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,37 @@ 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}; + + # get default parameters: + my $append = bootloader::get_grub2_append($b); + + require Xconfig::resolution_and_depth; + + require network::network; #- to list network profiles + my $vga = Xconfig::resolution_and_depth::from_bios($b->{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