I'm trying to build shim from source but i'm getting the following error.
ld -o shimx64.so --hash-style=sysv -nostdlib -znocombreloc -T /home/john/git/shim/elf_x86_64_efi.lds -shared -Bsymbolic -L/usr/lib64/gnuefi -L/usr/lib64 -LCryptlib -LCryptlib/OpenSSL /usr/lib64/gnuefi/crt0-efi-x86_64.o --build-id=sha1 --no-undefined shim.o mok.o netboot.o cert.o replacements.o tpm.o version.o errlog.o Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a lib/lib.a -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group /usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a
ld: cannot find /usr/lib64/gnuefi/crt0-efi-x86_64.o: No such file or directory
ld: cannot find -lefi
ld: cannot find -lgnuefi
make: *** [Makefile:92: shimx64.so] Error 1
Any help would be much appreciated, thanks.
My environment
System
Packages
build-essential
make
gnu-efi
Update
Thomas answer helped me build but when running
make EFIDIR=/boot/efi install
I get the following error
gcc -Og -g3 -Wall -Werror -Wextra -o buildid /home/john/git/shim/buildid.c -lelf
/home/john/git/shim/buildid.c:15:10: fatal error: libelf.h: No such file or directory
15 | #include <libelf.h>
| ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:117: buildid] Error 1
Tried adding the same variables as per Thomas answer but did not work.
question from:
https://stackoverflow.com/questions/66045804/how-to-build-shim-from-source 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…