Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes needed for running fedora linux distribution on aarch64 #329

Merged
merged 2 commits into from
Oct 14, 2021

Conversation

afbjorklund
Copy link
Member

The distribution uses BIOS for x86_64 and UEFI for aarch64, so needs to fallback gracefully.

There was also some problem with the old param, fixed in https://wiki.debian.org/Arm64Qemu

Tested on the Raspberry Pi.

Hopefully also works on M1 ?

Closes #327

Closes #328

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic seems more correct after this PR (the original code said it would ignore legacyBIOS on aarch64, but didn't).

I've also tested this PR on M1, and it works there as well.

I'm unsure what the change from -drive to -bios entails, so I'll leave the final decision to @AkihiroSuda.

@afbjorklund
Copy link
Member Author

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922979 for details.

2048	/usr/share/qemu-efi-aarch64/QEMU_EFI.fd
65540	/usr/share/AAVMF/AAVMF_CODE.fd

It was supposed to pad for readonly, but it didn't seem to be happening ?

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it breaks on macOS Intel (using default image):

DEBU[0004] [hostagent] qemu[stderr]: qemu: could not load PC BIOS '/usr/local/share/qemu/edk2-x86_64-code.fd'

@jandubois
Copy link
Member

File exists, but can't be loaded via -bios /usr/local/share/qemu/edk2-x86_64-code.fd:

$ ls -ld /usr/local/share/qemu/edk2-x86_64-code.fd
-rw-r--r--  1 jan  admin  3653632 24 Aug 10:36 /usr/local/share/qemu/edk2-x86_64-code.fd

@afbjorklund
Copy link
Member Author

The firmware are actually described in some JSON files...

/usr/share/qemu/firmware/60-edk2-x86_64.json

{
    "description": "UEFI firmware for x86_64, without Secure Boot without SMM, with empty varstore",
    "interface-types": [
        "uefi"
    ],
    "mapping": {
        "device": "flash",
        "executable": {
            "filename": "/usr/share/OVMF/OVMF_CODE.fd",
            "format": "raw"
        },
        "nvram-template": {
            "filename": "/usr/share/OVMF/OVMF_VARS.fd",
            "format": "raw"
        }
    },
    "targets": [
        {
            "architecture": "x86_64",
            "machines": [
                "pc-i440fx-*",
                "pc-q35-*"
            ]
        }
    ],
    "features": [
        "acpi-s3",
        "amd-sev",
        "verbose-dynamic"
    ],
    "tags": [

    ]
}

/usr/share/qemu/firmware/60-edk2-aarch64.json

{
    "description": "UEFI firmware for aarch64",
    "interface-types": [
        "uefi"
    ],
    "mapping": {
        "device": "flash",
        "executable": {
            "filename": "/usr/share/AAVMF/AAVMF_CODE.fd",
            "format": "raw"
        },
        "nvram-template": {
            "filename": "/usr/share/AAVMF/AAVMF_VARS.fd",
            "format": "raw"
        }
    },
    "targets": [
        {
            "architecture": "aarch64",
            "machines": [
                "virt-*"
            ]
        }
    ],
    "features": [
        "verbose-static"
    ],
    "tags": [

    ]
}

So changing the search path for the padded version should work (untested)

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on both Intel and Apple macOS again.

Please squash commits (the revert commit is also missing DCO).

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the vNext milestone Oct 14, 2021
@AkihiroSuda AkihiroSuda merged commit 5bbacf2 into lima-vm:master Oct 14, 2021
@AkihiroSuda AkihiroSuda mentioned this pull request Oct 16, 2021
@AkihiroSuda AkihiroSuda added the guest/fedora Guest: Fedora label Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guest/fedora Guest: Fedora
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Size restrictions on the firmware used for UEFI The legacyBIOS fallback to UEFI on arm64 is not working
3 participants