summaryrefslogtreecommitdiffstats
path: root/lib/MGA
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2019-01-08 19:47:50 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2019-01-11 18:33:00 +0000
commitfc1df87e90014c3befa671e84631cd0c55751891 (patch)
tree52783c16ee39af560a18637d59510a7a147e3906 /lib/MGA
parent6bf04a5608c9537de46ab8655b5ea09263fa8eb1 (diff)
downloaddrakiso-fc1df87e90014c3befa671e84631cd0c55751891.tar
drakiso-fc1df87e90014c3befa671e84631cd0c55751891.tar.gz
drakiso-fc1df87e90014c3befa671e84631cd0c55751891.tar.bz2
drakiso-fc1df87e90014c3befa671e84631cd0c55751891.tar.xz
drakiso-fc1df87e90014c3befa671e84631cd0c55751891.zip
Default to using linux16 and linuxefi GRUB2 commands (mga#24137).
Diffstat (limited to 'lib/MGA')
-rw-r--r--lib/MGA/DrakISO/BuildBoot.pm33
1 files changed, 26 insertions, 7 deletions
diff --git a/lib/MGA/DrakISO/BuildBoot.pm b/lib/MGA/DrakISO/BuildBoot.pm
index 2775203..ae84c34 100644
--- a/lib/MGA/DrakISO/BuildBoot.pm
+++ b/lib/MGA/DrakISO/BuildBoot.pm
@@ -300,7 +300,7 @@ sub build_grub2_boot_efi {
my ($output, $format) = @_;
my @modules = qw(iso9660 fat part_msdos all_video font gfxterm gfxmenu png
- configfile echo gettext linux linux16 ls search test);
+ configfile echo gettext linux linuxefi ls search test);
run_('grub2-mkimage',
'--output', $output,
@@ -320,6 +320,13 @@ sub build_grub2_cfg {
my $gettext = $add_lang_menu ? '$' : '';
+ my %initrd_command = (
+ 'linuxefi' => 'initrdefi',
+ 'linux16' => 'initrd16',
+ 'linux' => 'initrd',
+ '$linux' => '$initrd'
+ );
+
join("\n",
"if [ -z \$initialised ] ; then",
" set grub2=(\$root)/boot/grub2",
@@ -353,7 +360,18 @@ sub build_grub2_cfg {
" fi",
" export theme",
@loadfonts,
+ "",
),
+ " if [ x\$efi == 'xtrue' ] ; then",
+ " set linux=linuxefi",
+ " set initrd=initrdefi",
+ " else",
+ " set linux=linux16",
+ " set initrd=initrd16",
+ " fi",
+ " export linux",
+ " export initrd",
+ "",
" set initialised=true",
" export initialised",
"fi",
@@ -379,24 +397,25 @@ sub build_grub2_cfg {
),
(map {
my ($name, $options) = @$_;
- my $command = $options->{command} || 'linux';
+ my $command = $options->{command} || '$linux';
my $image = $options->{image} || get_default_image($build, $name);
my $initrd = $options->{initrd} || get_default_initrd($build);
my $append = $options->{append};
- my $initrd_command = $command eq 'linux16 ' ? 'initrd16' : 'initrd';
-
join("\n",
+ if_($command eq 'linuxefi',
+ "if [ x\$efi == 'xtrue' ] ; then", # EFI only
+ ),
if_($command eq 'linux16',
"if [ x\$efi != 'xtrue' ] ; then", # EFI doesn't support 16-bit
),
"menuentry $gettext\"$name\" {",
" $command $image " . join(' ', get_default_append($build), $append),
- if_($initrd ne 'none',
- " $initrd_command $initrd",
+ if_($initrd ne 'none' && defined $initrd_command{$command},
+ " $initrd_command{$command} $initrd",
),
"}",
- if_($command eq 'linux16',
+ if_($command eq 'linuxefi' || $command eq 'linux16',
"fi",
),
);