Closed johnandersen777 closed 5 years ago
This appears to be happening in InitializeLib
You are running the UEFI applications. The LibLocateProtocol
function is failing though. I didn't write a function to decode the EFI_STATUS
values though there may be a strerror
equivalent now that you mention it.
Anyways these values are in /usr/include/efi/efierr.h
:
#define EFI_NOT_FOUND EFIERR(14)
LibLocateProtocol
is the function used to locate protocol drivers. In this case the code is searching for the TCG2 protcol driver and it's ... EFI_NOT_FOUND
. Likely this means that the TCG2 protocol isn't loaded because your system / QEMU doesn't have a TPM2. Either you need to enable it in your BIOS interface or you need to configure QEMU properly.
Also see docs here: https://github.com/flihp/tpm2-tcti-uefi/blob/master/docs/example.md#qemu-ovmf-and-swtpm and script with example QEMU options to enable TPM2 here: https://github.com/flihp/tpm2-tcti-uefi/blob/master/lib/qemu-tpm2.sh#L8
I'm working on a test by getting qemu running in travis
Travis: https://travis-ci.com/pdxjohnny/tpm2-tcti-uefi/builds/94843799 Dockerfile: https://github.com/pdxjohnny/tpm2-tcti-uefi/blob/travis_qemu/Dockerfile
example/run.sh
#!/usr/bin/env bash
sh lib/swtpm2.sh &
sed -i 's/-vnc.*/-nographic \\/g' lib/qemu-tpm2.sh
exec timeout 30s unbuffer sh lib/qemu-tpm2.sh
This Dockerfile / travis build is my second attempt to follow example.md
. I can't figure out what I'm configuring wrong, but hopefully you might be able to tell off the bat. If we can get that working then I'll fix the travis build matrix (i took it out for now) and we can have travis test things in QEMU.
This may be a silly question but have you got it working on your development system?
Nah, still haven't gotten it working
Start there. Doing stuff in travis-ci is like doing that same thing blindfolded and with one hand tied behind your back. You miss out on really valuable output and the test cycle is a lot longer. You went straight to my end goal of building an integration test harness from this mess but I'm expecting that will take some doing.
Got it! Ubuntu bionic and debian buster have different OVMFs I think. Debian works, ubuntu does not. https://travis-ci.com/pdxjohnny/tpm2-tcti-uefi/builds/95151602
I'll try to get the build matrix working again. I went from the travis file which was xenial to a dockerfile with was bionic for ovmf. However, I should have gone the ground up route and followed your example.md to the letter, it said debian and I tried ubuntu anyway.
Niiiiiiice. Sucks about the Ubuntu packages. I stopped using Ubuntu for similar reasons a long time ago.
Not sure how to run the efi applications. I'm sure I'm missing something here.