Mageia Bugzilla – Attachment 6486 Details for
Bug 9431
No option in installer to install grub2 with non-graphical menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
add support for grub2-text (untested)
grub2-text.diff (text/plain), 2.82 KB, created by
Thierry Vignaud
on 2015-05-11 10:38:02 CEST
(
hide
)
Description:
add support for grub2-text (untested)
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2015-05-11 10:38:02 CEST
Size:
2.82 KB
patch
obsolete
>diff -up ./bootloader.pm.tv7 ./bootloader.pm >--- ./bootloader.pm.tv7 2015-05-11 04:26:46.292030301 -0400 >+++ ./bootloader.pm 2015-05-11 04:35:40.562022898 -0400 >@@ -299,7 +299,8 @@ sub read_grub2() { > $bootloader{timeout} = $h{GRUB_TIMEOUT}; > $bootloader{entries} = []; > my $entry; >- foreach (cat_utf8("$::prefix/boot/grub2/grub.cfg")) { >+ my $f = "$::prefix/boot/grub2/grub.cfg"; >+ foreach (cat_utf8($f)) { > next if /^#/; > if (/menuentry\s+['"]([^']+)["']/) { > push @{$bootloader{entries}}, $entry if $entry; >@@ -322,7 +323,8 @@ sub read_grub2() { > $bootloader{default} = $1 if /saved_entry=(.*)/; > } > >- $bootloader{method} = 'grub2'; >+ $bootloader{method} = cat_($f) =~ /set theme=.*maggy/ ? 'grub2-graphic' : 'grub2'; >+ > \%bootloader; > } > >@@ -1274,7 +1276,8 @@ sub method2text { > my ($method) = @_; > +{ > 'lilo-menu' => N("LILO with text menu"), >- 'grub2' => N("GRUB2 with graphical menu"), >+ 'grub2-graphic' => N("GRUB2 with graphical menu"), >+ 'grub2' => N("GRUB2 with text menu"), > 'grub-graphic' => N("GRUB with graphical menu"), > 'grub-menu' => N("GRUB with text menu"), > }->{$method}; >@@ -1286,7 +1289,7 @@ sub method_choices_raw { > arch() =~ /mips/ ? 'pmon2000' : > arch() =~ /arm/ ? 'uboot' : > if_(!$b_prefix_mounted || whereis_binary('grub2-reboot', $::prefix), >- 'grub2'), >+ 'grub2-graphic', 'grub2-menu'), > if_(!is_uefi(), ( > if_(!$b_prefix_mounted || whereis_binary('grub', $::prefix), > 'grub-graphic', 'grub-menu'), >@@ -1304,7 +1307,7 @@ sub method_choices { > grep { > !(/lilo/ && (isLoopback($root_part) || $have_dmraid)) > && (/grub2/ || $boot_part->{fs_type} ne 'btrfs') >- && !(/grub-graphic/ && cat_("/proc/cmdline") =~ /console=ttyS/); >+ && !(/grub2?-graphic/ && cat_("/proc/cmdline") =~ /console=ttyS/); > } method_choices_raw($b_prefix_mounted); > } > sub main_method_choices { >@@ -2130,11 +2133,16 @@ sub ensure_pkg_is_installed { > > my %pkg = ('grub2' => is_uefi() ? 'grub2-efi' : 'grub2'); > my %h = ('grub2' => 'grub2-install'); >+ my %suppl = ( >+ # method => [ 'pkg_name', 'file_to_test' ], >+ 'grub-graphic' => [ qw(mageia-gfxboot-theme /usr/share/gfxboot/themes/Mageia/boot/message) ], >+ 'grub2-graphic' => [ qw(grub2-mageia-theme /boot/grub2/themes/maggy/theme.txt) ], >+ ); > my $main_method = main_method($bootloader->{method}); > if (member($main_method, qw(grub grub2 lilo))) { > $do_pkgs->ensure_binary_is_installed($pkg{$main_method} || $main_method, $h{$main_method} || $main_method, 1) or return 0; >- if ($bootloader->{method} eq 'grub-graphic') { >- $do_pkgs->ensure_is_installed('mageia-gfxboot-theme', '/usr/share/gfxboot/themes/Mageia/boot/message', 1) or return 0; >+ if (my $pkg = $suppl{$bootloader->{method}}) { >+ $do_pkgs->ensure_is_installed(@$pkg, 1) or return 0; > } > } > 1;
diff -up ./bootloader.pm.tv7 ./bootloader.pm --- ./bootloader.pm.tv7 2015-05-11 04:26:46.292030301 -0400 +++ ./bootloader.pm 2015-05-11 04:35:40.562022898 -0400 @@ -299,7 +299,8 @@ sub read_grub2() { $bootloader{timeout} = $h{GRUB_TIMEOUT}; $bootloader{entries} = []; my $entry; - foreach (cat_utf8("$::prefix/boot/grub2/grub.cfg")) { + my $f = "$::prefix/boot/grub2/grub.cfg"; + foreach (cat_utf8($f)) { next if /^#/; if (/menuentry\s+['"]([^']+)["']/) { push @{$bootloader{entries}}, $entry if $entry; @@ -322,7 +323,8 @@ sub read_grub2() { $bootloader{default} = $1 if /saved_entry=(.*)/; } - $bootloader{method} = 'grub2'; + $bootloader{method} = cat_($f) =~ /set theme=.*maggy/ ? 'grub2-graphic' : 'grub2'; + \%bootloader; } @@ -1274,7 +1276,8 @@ sub method2text { my ($method) = @_; +{ 'lilo-menu' => N("LILO with text menu"), - 'grub2' => N("GRUB2 with graphical menu"), + 'grub2-graphic' => N("GRUB2 with graphical menu"), + 'grub2' => N("GRUB2 with text menu"), 'grub-graphic' => N("GRUB with graphical menu"), 'grub-menu' => N("GRUB with text menu"), }->{$method}; @@ -1286,7 +1289,7 @@ sub method_choices_raw { arch() =~ /mips/ ? 'pmon2000' : arch() =~ /arm/ ? 'uboot' : if_(!$b_prefix_mounted || whereis_binary('grub2-reboot', $::prefix), - 'grub2'), + 'grub2-graphic', 'grub2-menu'), if_(!is_uefi(), ( if_(!$b_prefix_mounted || whereis_binary('grub', $::prefix), 'grub-graphic', 'grub-menu'), @@ -1304,7 +1307,7 @@ sub method_choices { grep { !(/lilo/ && (isLoopback($root_part) || $have_dmraid)) && (/grub2/ || $boot_part->{fs_type} ne 'btrfs') - && !(/grub-graphic/ && cat_("/proc/cmdline") =~ /console=ttyS/); + && !(/grub2?-graphic/ && cat_("/proc/cmdline") =~ /console=ttyS/); } method_choices_raw($b_prefix_mounted); } sub main_method_choices { @@ -2130,11 +2133,16 @@ sub ensure_pkg_is_installed { my %pkg = ('grub2' => is_uefi() ? 'grub2-efi' : 'grub2'); my %h = ('grub2' => 'grub2-install'); + my %suppl = ( + # method => [ 'pkg_name', 'file_to_test' ], + 'grub-graphic' => [ qw(mageia-gfxboot-theme /usr/share/gfxboot/themes/Mageia/boot/message) ], + 'grub2-graphic' => [ qw(grub2-mageia-theme /boot/grub2/themes/maggy/theme.txt) ], + ); my $main_method = main_method($bootloader->{method}); if (member($main_method, qw(grub grub2 lilo))) { $do_pkgs->ensure_binary_is_installed($pkg{$main_method} || $main_method, $h{$main_method} || $main_method, 1) or return 0; - if ($bootloader->{method} eq 'grub-graphic') { - $do_pkgs->ensure_is_installed('mageia-gfxboot-theme', '/usr/share/gfxboot/themes/Mageia/boot/message', 1) or return 0; + if (my $pkg = $suppl{$bootloader->{method}}) { + $do_pkgs->ensure_is_installed(@$pkg, 1) or return 0; } } 1;
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 9431
:
6486
|
6489
|
6500
|
6501