[Bug 894307] New: kiwi: EFI + grub2 doesn't work on AArch64

https://bugzilla.novell.com/show_bug.cgi?id=894307 https://bugzilla.novell.com/show_bug.cgi?id=894307#c0 Summary: kiwi: EFI + grub2 doesn't work on AArch64 Classification: openSUSE Product: openSUSE Factory Version: 201408* Platform: aarch64 OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Installation AssignedTo: ms@suse.com ReportedBy: agraf@suse.com QAContact: ms@suse.com Found By: --- Blocker: --- While trying to create an image with efi and grub2, kiwi failed to account for path names that were not i386 or x86_64. [ 259s] (cd /tmp/kiwiboot.fGUdty && cpio -i -d 'usr/share/grub2/themes/*' -d 'usr/lib/grub/i386-pc/*' -d 'usr/lib/grub/i386-efi/*' -d 2>&1)] [ 260s] Aug-30 23:00:36 <3> : No grub2 stage files found in boot image Instead, kiwi should look for arm64 path names. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.

https://bugzilla.novell.com/show_bug.cgi?id=894307 https://bugzilla.novell.com/show_bug.cgi?id=894307#c1 --- Comment #1 from Alexander Graf <agraf@suse.com> 2014-08-30 23:35:18 UTC --- The following patch does look correct to me, but still fails at the same spot: --- /var/tmp/build-root/images-aarch64/usr/share/kiwi/modules/KIWIBoot.pm.orig 2014-08-31 01:07:37.422519879 +0200 +++ /var/tmp/build-root/images-aarch64/usr/share/kiwi/modules/KIWIBoot.pm 2014-08-31 01:23:08.439754072 +0200 @@ -561,9 +561,13 @@ my $appid = $this->{mbrid}; my $type = $this->{type}; my $bootloader= "syslinux"; - my $efi_arch = 'x86_64'; - if ($arch ne 'x86_64') { + my $efi_arch; + if ($arch eq 'x86_64') { + $efi_arch = 'x86_64'; + } elsif ($arch =~ /i.86/) { $efi_arch = 'i386'; + } elsif (($arch eq 'aarch64') || ($arch eq 'arm64')) { + $efi_arch = 'arm64'; } my $status; my $result; @@ -3482,8 +3486,8 @@ # Grub2 #------------------------------------------ if ($loader eq "grub2") { - my $efipc = 'x86_64-efi'; - my $grubpc = 'i386-pc'; + my $efipc; + my $grubpc; my $grubofw = 'powerpc-ieee1275'; my $bootbios = "$tmpdir/boot/grub2/bootpart.cfg"; my $bootofw = "$tmpdir/boot/grub2/bootpart.cfg"; @@ -3502,8 +3506,18 @@ $grubpc = 'i386-xen'; } } - if ($arch ne 'x86_64') { + if ($arch eq 'x86_64') { + $efipc = 'x86_64-efi'; + } elsif ($arch =~ /i.86/) { $efipc = 'i386-efi'; + } elsif (($arch eq 'aarch64') || ($arch eq 'arm64')) { + $efipc = 'arm64-efi'; + $grubpc = 'arm64-efi'; + } else { + $kiwi -> failed (); + $kiwi -> error ("grub2: Unknown architecture"); + $kiwi -> failed (); + return; } if ($zipped) { $test = $unzip; @@ -3779,11 +3793,22 @@ return; } my @modules = @efi_core_modules; - my $fo = 'x86_64-efi'; - my $fo_bin = 'bootx64.efi'; - if ($arch ne 'x86_64') { + my $fo; + my $fo_bin; + if ($arch eq 'x86_64') { + $fo = 'x86_64-efi'; + $fo_bin = 'bootx64.efi'; + } elsif ($arch =~ /i.86/) { $fo = 'i386-efi'; $fo_bin = 'bootx32.efi'; + } elsif (($arch eq 'aarch64') || ($arch eq 'arm64')) { + $fo = 'arm64-efi'; + $fo_bin = 'boota64.efi'; + } else { + $kiwi -> failed (); + $kiwi -> error ("grub2: Unknown architecture"); + $kiwi -> failed (); + return; } my $core= "$tmpdir/EFI/BOOT/$fo_bin"; my $core_opts; @@ -3810,9 +3835,19 @@ my $s_shim_ms = $stages{efi}{shim_ms}; my $s_shim_suse = $stages{efi}{shim_suse}; my $s_signed = $stages{efi}{signed}; - my $fo_bin = 'bootx64.efi'; - if ($arch ne 'x86_64') { + my $fo_bin; + + if ($arch eq 'x86_64') { + $fo_bin = 'bootx64.efi'; + } elsif ($arch =~ /i.86/) { $fo_bin = 'bootx32.efi'; + } elsif (($arch eq 'aarch64') || ($arch eq 'arm64')) { + $fo_bin = 'boota64.efi'; + } else { + $kiwi -> failed (); + $kiwi -> error ("grub2: Unknown architecture"); + $kiwi -> failed (); + return; } $result = 0; if ($zipped) { @@ -4397,8 +4432,15 @@ print $FD "\t"."set root='hd0,1'"."\n"; if ($arch eq 'x86_64') { print $FD "\t".'chainloader /EFI/BOOT/bootx64.efi'."\n"; - } else { + } elsif ($arch =~ /i.86/) { print $FD "\t".'chainloader /EFI/BOOT/bootx32.efi'."\n"; + } elsif (($arch eq 'aarch64') || ($arch eq 'arm64')) { + print $FD "\t".'chainloader /EFI/BOOT/boota64.efi'."\n"; + } else { + $kiwi -> failed (); + $kiwi -> error ("grub2: Unknown architecture"); + $kiwi -> failed (); + return; } } else { print $FD "\t"."set root='hd0'"."\n"; -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.

https://bugzilla.novell.com/show_bug.cgi?id=894307 https://bugzilla.novell.com/show_bug.cgi?id=894307#c3 --- Comment #3 from Alexander Graf <agraf@suse.com> 2014-08-30 23:47:43 UTC --- Ah, sorry, the patch above does seem to be quite ok. I didn't put grub2 as bootincluded. However, with the patch above and grub2 set as bootinclude, I now get the following error: [ 311s] Aug-30 23:44:47 <1> : warning: grub2-efi-mkimage not found [ 311s] Aug-30 23:44:47 <1> : Creating grub2 efi boot imageAug-30 23:44:47 <1> : EXEC [/usr/bin/grub2-mkimage -O arm64-efi -o /tmp/kiwiboot.w4s1Ln/EFI/BOOT/boota64.efi -c /tmp/kiwiboot.w4s1Ln/boot/grub2-efi/bootpart.cfg -d /tmp/kiwiboot.w4s1Ln//usr/lib/grub2/arm64-efi part_gpt efi_gop efi_uga ext2 iso9660 linux echo configfile search_label search_fs_file search search_fs_uuid ls normal gzio png fat gettext font minicmd gfxterm gfxmenu video video_fb lvm boot 2>&1] [ 311s] Aug-30 23:44:47 <3> : Couldn't create efi boot image: /usr/bin/grub2-mkimage: error: cannot open `/tmp/kiwiboot.w4s1Ln//usr/lib/grub2/arm64-efi/efi_uga.mod': No such file or directory. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.

https://bugzilla.novell.com/show_bug.cgi?id=894307 https://bugzilla.novell.com/show_bug.cgi?id=894307#c4 --- Comment #4 from Alexander Graf <agraf@suse.com> 2014-08-31 00:07:59 UTC --- The following 2 patches fix the unavailable grub modules for arm64: --- /var/tmp/build-root/images-aarch64/usr/share/kiwi/modules/KIWIBoot.pm.orig 2014-08-31 01:48:59.332894021 +0200 +++ /var/tmp/build-root/images-aarch64/usr/share/kiwi/modules/KIWIBoot.pm 2014-08-31 01:51:18.050563325 +0200 @@ -3600,7 +3600,7 @@ push @bios_core_modules, qw /biosdisk vga vbe chain multiboot/; } my @efi_core_modules = ( - 'part_gpt','efi_gop','efi_uga' + 'part_gpt','efi_gop' ); my @ofw_core_modules = ( 'ofnet','part_gpt','part_msdos' @@ -3620,6 +3620,9 @@ if ($firmware eq "ofw") { @bootdir = ("$tmpdir/boot/grub2/$grubofw"); } + if ($arch =~ /i.86|x86_64/) { + push @efi_core_modules,'efi_uga'; + } $status = KIWIQX::qxx ("mkdir -p @bootdir 2>&1"); $result = $? >> 8; if ($result != 0) { --- /var/tmp/build-root/images-aarch64/usr/share/kiwi/modules/KIWIBoot.pm.orig 2014-08-31 01:58:18.672524268 +0200 +++ /var/tmp/build-root/images-aarch64/usr/share/kiwi/modules/KIWIBoot.pm 2014-08-31 02:00:35.479984157 +0200 @@ -3597,7 +3597,10 @@ } if ($firmware ne 'ec2') { push @core_modules, 'boot'; - push @bios_core_modules, qw /biosdisk vga vbe chain multiboot/; + push @bios_core_modules, qw /chain/; + if ($arch =~ /i.86|x86_64/) { + push @bios_core_modules, qw /biosdisk vga vbe multiboot/; + } } my @efi_core_modules = ( 'part_gpt','efi_gop' -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.

https://bugzilla.novell.com/show_bug.cgi?id=894307 https://bugzilla.novell.com/show_bug.cgi?id=894307#c5 --- Comment #5 from Alexander Graf <agraf@suse.com> 2014-08-31 20:58:59 UTC --- One small bug in the patches above - the file name is "bootaa64.efi", not "boota64.efi". -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.

https://bugzilla.novell.com/show_bug.cgi?id=894307 https://bugzilla.novell.com/show_bug.cgi?id=894307#c6 Marcus Schaefer <ms@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #6 from Marcus Schaefer <ms@suse.com> 2014-09-02 12:54:08 UTC --- thanks for the patches. I added them. With regards to ppc support I had to update the patch a bit and I leave only one check for the support state in the code which I think is enough. I also changed from boota64.efi to bootaa64.efi as you stated all this in: commit 1e72c711b350f35058faa6a7f9a3b19441b66d57 Author: Marcus Schäfer <ms@suse.de> Date: Tue Sep 2 14:30:15 2014 +0200 Fixed grub2 EFI setup for aarch64 (bnc #894307) Thanks for double checking -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com