linux - 在 @INC 中找不到 File/Slurp.pm
问题描述
我正在尝试在 Ubuntu 20.04.2 LTS 上编译uefi 应用程序,但编译因错误而终止。
./mkkeys.sh
Enter a Common Name to embed in the keys: keys
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c cert-to-efi-sig-list.c -o cert-to-efi-sig-list.o
cert-to-efi-sig-list.c:9: warning: "__STDC_VERSION__" redefined
9 | #define __STDC_VERSION__ 199901L
|
<built-in>: note: this is the location of the previous definition
make -C lib lib.a
make[1]: Entering directory '/home/jr/Downloads/xen-uefi/efitools/lib'
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c simple_file.c -o simple_file.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c pecoff.c -o pecoff.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c guid.c -o guid.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c sha256.c -o sha256.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c console.c -o console.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c execute.c -o execute.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c configtable.c -o configtable.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c shell.c -o shell.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c security_policy.c -o security_policy.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c shim_protocol.c -o shim_protocol.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c pkcs7verify.c -o pkcs7verify.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c kernel_efivars.c -o kernel_efivars.o
kernel_efivars.c:19: warning: "__STDC_VERSION__" redefined
19 | #define __STDC_VERSION__ 199901L
|
<built-in>: note: this is the location of the previous definition
kernel_efivars.c: In function ‘kernel_variable_init’:
kernel_efivars.c:61:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
61 | read(fd, buf, st.st_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
kernel_efivars.c: In function ‘get_variable’:
kernel_efivars.c:107:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
107 | read(fd, &attr, sizeof(attr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel_efivars.c:113:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
113 | read(fd, buf, st.st_size - sizeof(attr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar rcv lib.a simple_file.o pecoff.o guid.o sha256.o console.o execute.o configtable.o shell.o security_policy.o shim_protocol.o pkcs7verify.o kernel_efivars.o
a - simple_file.o
a - pecoff.o
a - guid.o
a - sha256.o
a - console.o
a - execute.o
a - configtable.o
a - shell.o
a - security_policy.o
a - shim_protocol.o
a - pkcs7verify.o
a - kernel_efivars.o
make[1]: Leaving directory '/home/jr/Downloads/xen-uefi/efitools/lib'
cc -o cert-to-efi-sig-list cert-to-efi-sig-list.o -lcrypto lib/lib.a
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c sign-efi-sig-list.c -o sign-efi-sig-list.o
sign-efi-sig-list.c:7: warning: "__STDC_VERSION__" redefined
7 | #define __STDC_VERSION__ 199901L
|
<built-in>: note: this is the location of the previous definition
sign-efi-sig-list.c: In function ‘main’:
sign-efi-sig-list.c:163:3: warning: implicit declaration of function ‘strptime’; did you mean ‘strftime’? [-Wimplicit-function-declaration]
163 | strptime(timestampstr, "%Y-%m-%d %H:%M:%S", &tms);
| ^~~~~~~~
| strftime
sign-efi-sig-list.c:221:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
221 | read(fdefifile, ptr, st.st_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sign-efi-sig-list.c:244:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
244 | read(infile, sigbuf, sigsize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sign-efi-sig-list.c:316:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
316 | write(fdoutfile, out, outlen);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sign-efi-sig-list.c:319:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
319 | write(fdoutfile, ptr, st.st_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make -C lib lib.a
make[1]: Entering directory '/home/jr/Downloads/xen-uefi/efitools/lib'
make[1]: 'lib.a' is up to date.
make[1]: Leaving directory '/home/jr/Downloads/xen-uefi/efitools/lib'
cc -o sign-efi-sig-list sign-efi-sig-list.o -lcrypto lib/lib.a
Generating a RSA private key
..........................................+++++
.......................................................................................................+++++
writing new private key to 'PK.key'
-----
Generating a RSA private key
....................................+++++
....................................................................................................+++++
writing new private key to 'KEK.key'
-----
Generating a RSA private key
..................+++++
...........................................................+++++
writing new private key to 'DB.key'
-----
Generating a RSA private key
.............+++++
..................................................+++++
writing new private key to 'SHIM.key'
-----
Timestamp is 2021-9-23 15:55:51
Authentication Payload size 861
Signature of size 1182
Signature at: 40
Timestamp is 2021-9-23 15:55:51
Authentication Payload size 865
Signature of size 1182
Signature at: 40
Timestamp is 2021-9-23 15:55:51
Authentication Payload size 861
Signature of size 1185
Signature at: 40
Timestamp is 2021-9-23 15:55:52
Authentication Payload size 40
Signature of size 1182
Signature at: 40
make -C lib lib.a
make[1]: Entering directory '/home/jr/Downloads/xen-uefi/efitools/lib'
make[1]: 'lib.a' is up to date.
make[1]: Leaving directory '/home/jr/Downloads/xen-uefi/efitools/lib'
./xxdi.pl PK.auth > PK.h
Can't locate File/Slurp.pm in @INC (you may need to install the File::Slurp module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./xxdi.pl line 17.
BEGIN failed--compilation aborted at ./xxdi.pl line 17.
make: *** [Make.rules:69: PK.h] Error 2
我究竟做错了什么?我需要安装perl吗?which perl in terminal 返回安装 perl 的目录。这是否意味着 perl 不是问题?我不知道要提供哪些其他细节,但如果有人能指出我正确的方向,我将不胜感激。
解决方案
Perl 带有大量扩展其功能的标准库。但是CPAN还提供了数以千计的其他扩展库。
File::Slurp是一个 CPAN 模块。它不是标准 Perl 发行版的一部分,因此您需要单独安装它。
幸运的是,Ubuntu 打包了大量的 CPAN 模块,并从其标准存储库中提供它们。所以,要安装它,你只需要运行:
$ sudo apt-get install libfile-slurp-perl
推荐阅读
- java - 将从springboot返回的json对象映射到打字稿中的映射
- autodesk-forge - 在 Autodesk Forge 上组合模型
- ios - iOS 14 中没有出现分页点
- html - 选项卡内的 IFRAME URL 内容未加载
- c# - 运行方法结束而不关心异常
- flutter - Flutter:在 SizedBox 之前添加图标。为什么 Row 在 AppBar 之后消失了?
- javascript - 在 Jquery 的循环内移动 Div
- amazon-web-services - 为什么 AWS ec2 实例会降级?
- python - 运行泊坞窗图像给出 - 无法找到图像错误
- reactjs - 无法解决 'react-horizontal-scrolling-menu/build/scrollMenu'