On Friday, 2020-12-04 at 08:39:55 +02, Lars Wirzenius wrote:

> As it happens, David Edmonson (dme), added to cc, has been working on
> adding arm64 support for the grub plugin. Part of his changes is that the
> grub plugin will know the target archietecure, and choose the right grub
> .deb package to install based on that.
>
> Unfortunatly, the tests for his changes don't pass yet.

I figured that out today (need to specify a 64 bit CPU) and provided an
updated set of patches.

> David, do you have any commnent on this?

Gunnar's suggestion is much what is implemented in the patches - vmdb2
maintains a notion of "the VM architecture" that defaults to that of the
host. The qemu-debootstrap set updates that to the architecture
specified there and the grub plugin references it to determine which set
of grub packages to install.

The changes only support amd64 and arm64, but should be trivially
extended for other UEFI based platforms that use grub by updating the
dictionary in the plugin:

        variants = {
            "amd64": ("grub-efi-amd64", "x86_64-efi"),
            "arm64": ("grub-efi-arm64", "arm64-efi"),
            }

Non-UEFI platforms would need a similar patch to this, to add a map of
architecture to non-UEFI grub variant. I don't have any of those to
test, so it would make sense for someone more familiar with those
platforms to do it.

> On Sat, 2020-11-07 at 23:42 -0600, Gunnar Wolf wrote:
>> Hello Lars,
>> 
>> I am writing to you regarding the bug report I am Cc:ing here. Please
>> help me correctly answer to this! The submitter says, in the initial
>> mail:
>> 
>> > I am trying to let autopkgtest-build-qemu work on arm64.
>> > See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973038
>> > for relevant report.
>> > The original autopkgtest-build-qemu uses "grub: bios" for vmdb2,
>> > which let vmdb2 install grub-pc on arm64, and fail.
>> > 
>> > So I try "grub: uefi" for vmdb2.
>> > Then vmdb2 tries to install grub-efi-amd64,
>> > and again fails.
>> > There is no way to let vmdb2 to create a bootable image on arm64.
>> > vmdb2 seems completely unusable on arm64 (and armhf, armel, etc.)
>> > So I set severity grave.
>> 
>> He sent a workaround that does not fix the issue, but lets him build
>> for his target system:
>> 
>>     --- usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py-orig       
>> 2020-10-31 12:47:04.796899268 +0900
>>     +++ usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py    
>> 2020-10-31 12:50:00.322817935 +0900
>>     @@ -112,8 +112,8 @@
>>                  raise Exception('"efi" or "efi-part" required in UEFI GRUB 
>> installation')
>>  
>>              vmdb.progress("Installing GRUB for UEFI")
>>     -        grub_package = "grub-efi-amd64"
>>     -        grub_target = "x86_64-efi"
>>     +        grub_package = "grub-efi-arm64"
>>     +        grub_target = "arm64-efi"
>>              self.install_grub(values, settings, state, grub_package, 
>> grub_target)
>>  
>>          def install_bios(self, values, settings, state):
>> 
>> *If* there is any information to plugins as to which architecture is
>> being built, the fix is basically trivial... But I could not find
>> anything on that regard. Can you suggest anything?
>> 
>> Thanks a lot!

dme.
-- 
Do not leave the building.

Reply via email to