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

regression (3beb971 -> a4a1fbe): fails to load fwupd #194

Closed
julian-klode opened this issue Mar 3, 2020 · 9 comments
Closed

regression (3beb971 -> a4a1fbe): fails to load fwupd #194

julian-klode opened this issue Mar 3, 2020 · 9 comments

Comments

@julian-klode
Copy link
Collaborator

julian-klode commented Mar 3, 2020

In Ubuntu, we recently updated our shim snapshot from 3beb971 to a4a1fbe - and we realized a bit after that that we cannot load fwupd anymore.

fwupdx64.efi is located in \EFI\ubuntu\ alongside shimx64.efi, it's bootloader entry is

Boot0001* Linux-Firmware-Updater        HD(1,GPT,a155bb6c-2d31-4a90-8678-f0f921e11e9b,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)\.f.w.u.p.d.x.6.4...e.f.i...

This worked fine in commit 3beb971, but fails to load in commit a4a1fbe - shim just loads grub instead.

I tried launching fwupdx64.efi from an EFI shell as well, but shimx64.efi fwupdx64.efi also loaded grub (though that might be caused by #181).

I tried copying fwupdx64.efi to the root of the ESP, because there was a slash in front of it, but that did not seem to help either.

My next step would be to bisect this, but I'm going to need time to set this up first (wanna bisect in a VM, not on my actual machine), so I'm writing the bug first.

@superm1
Copy link

superm1 commented Mar 12, 2020

Before bothering to bisect, maybe try updating to a newer snapshot of shim?

@superm1
Copy link

superm1 commented Mar 12, 2020

That being said, a625fa5 and e563bc3 would be the most suspicious commits to me which haven't changed in any significant way in master.

@martinezjavier
Copy link
Contributor

@julian-klode as @superm1 correctly pointed out, commit e563bc3 is the one to blame for this bug.

In the is_our_path() function, two UCS-2 strings are compared but I wrongly used strlen() to calculate the string length instead of using StrLen(). Sorry about that...

@vathpela fixed this bug some time ago with commit 1870bae ("Fix a use of strlen() instead of Strlen()").

@superm1
Copy link

superm1 commented Mar 16, 2020

@martinezjavier thanks for your confirmation and pointer on the fixed commit. I suppose this can be closed now then.

@martinezjavier
Copy link
Contributor

@superm1 you are welcome. Yes, I'll close it now. Sorry for the inconvenience with this bug.

@julian-klode
Copy link
Collaborator Author

@superm1 @martinezjavier I'm trying to see if the mentioned commit fixes the bug, but it does not seem to help - fwupd is still not being loaded. To investigate this further, I'd like to look at this in a VM with a serial console so I can actually see the messages printed and don't have them fly past me. Any pointers? Any IRC channel to join?

@julian-klode
Copy link
Collaborator Author

Uh, um, this should have gone to the invalid fwupd bug I suppose, as I need to see if I can load fwupd from shim and hence need fwupd to install itself to the ESP and the boot order, which it does not do if there are no update-able devices.

@superm1
Copy link

superm1 commented Mar 20, 2020

@julian-klode Assuming you have an updatable device, you should be able to use the reinstall command in fwupd to try to reinstall the current firmware.

@julian-klode
Copy link
Collaborator Author

Oh I was dumb, and never actually updated the shim on the ESP, hence why it still failed, sorry for the noise. Time to finish the update and start signing request and stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants