为什么我的 FreeBSD 端口在 make 阶段失败了?
Why is my FreeBSD port failing on make stage?
我正在尝试为 Silicom 旁路控制器构建一个端口。我怀疑我的 Makefile
不完整,但我不确定。根据错误,我应该为 ld
添加一些内容吗?
更新:
在 Makefile
中添加 SSP_UNSAFE= yes
让我摆脱了原来的错误。不确定这是否是最好的方法。使用 -fstack-protector
添加对默认 SSP_CFLAGS
的支持似乎会导致此问题。这是需要在源代码中修复的东西吗?
生成文件:
PORTNAME= silicom_bpctl
PORTVERSION= 3.10.5
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://pkg.insecure-it.com/distfiles/
MAINTAINER= me@myemail.com
COMMENT= Silicom Bypass Controller utility (Zero Power Fail-Open for IPS)
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/license
SUB_FILES= pkg-message
SSP_UNSAFE= yes
.include <bsd.port.mk>
pkg-plist 文件:
boot/kernel/bpmod.ko
bin/bpctl_util
原始错误:
:/usr/local/poudriere/ports/default/sysutils/silicom_bpctl % sudo make stage
===> License GPLv2 accepted by the user
===> silicom_bpctl-3.10.5_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by silicom_bpctl-3.10.5_1 for building
===> Extracting for silicom_bpctl-3.10.5_1
=> SHA256 Checksum OK for silicom_bpctl-3.10.5.tar.gz.
===> Patching for silicom_bpctl-3.10.5_1
===> Configuring for silicom_bpctl-3.10.5_1
===> Building for silicom_bpctl-3.10.5_1
--- _sub.all ---
===> driver (all)
--- objwarn ---
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/@ ---
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/machine ---
--- opt_bdg.h ---
--- objwarn ---
Warning: Object directory not changed from original /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver
--- opt_bdg.h ---
:> opt_bdg.h
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/@ ---
@ -> /usr/src/sys
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/machine ---
machine -> /usr/src/sys/amd64/include
--- pci_if.h ---
--- bus_if.h ---
--- device_if.h ---
--- pci_if.h ---
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
--- bus_if.h ---
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
--- device_if.h ---
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
--- bp_mod.o ---
cc -O2 -pipe -fstack-protector -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c bp_mod.c -o bp_mod.o
--- bpmod.ko ---
ld -fstack-protector -d -warn-common -r -d -o bpmod.ko bp_mod.o
ld: -f may not be used without -shared
*** [bpmod.ko] Error code 1
make[2]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver
1 error
make[2]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver
*** [_sub.all] Error code 2
make[1]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5
1 error
make[1]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
Stop.
make: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl
手动安装此实用程序非常简单,只需 make
和 sudo make install
。
make
:
~/silicom/bp_ctl-3.10.5 % make
===> driver (all)
Warning: Object directory not changed from original /usr/home/arozar/silicom/bp_ctl-3.10.5/driver
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
:> opt_bdg.h
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c bp_mod.c
ld -d -warn-common -r -d -o bpmod.ko bp_mod.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk bpmod.ko export_syms | xargs -J% objcopy % bpmod.ko
objcopy --strip-debug bpmod.ko
===> util (all)
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1096:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:2617:30: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("Name\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
bpctl_util.c:2635:46: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("\n\tName\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
3 warnings generated.
sudo make install
:
~/silicom/bp_ctl-3.10.5 % sudo make install
===> driver (install)
install -o root -g wheel -m 555 bpmod.ko /boot/kernel
kldxref /boot/kernel
===> util (install)
install bpctl_util /bin
新错误:
现在安装失败必须是 pkg-plist
文件:
:/usr/local/poudriere/ports/default/sysutils/silicom-bpctl % sudo make stage
===> License GPLv2 accepted by the user
===> silicom-bpctl-3.10.5_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by silicom-bpctl-3.10.5_1 for building
===> Extracting for silicom-bpctl-3.10.5_1
=> SHA256 Checksum OK for silicom-bpctl-3.10.5.tar.gz.
===> Patching for silicom-bpctl-3.10.5_1
===> Configuring for silicom-bpctl-3.10.5_1
===> Building for silicom-bpctl-3.10.5_1
--- _sub.all ---
===> driver (all)
--- objwarn ---
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/@ ---
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/machine ---
--- opt_bdg.h ---
--- objwarn ---
Warning: Object directory not changed from original /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver
--- opt_bdg.h ---
:> opt_bdg.h
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/@ ---
@ -> /usr/src/sys
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/machine ---
machine -> /usr/src/sys/amd64/include
--- pci_if.h ---
--- bus_if.h ---
--- device_if.h ---
--- pci_if.h ---
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
--- bus_if.h ---
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
--- device_if.h ---
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
--- bp_mod.o ---
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c bp_mod.c -o bp_mod.o
--- bpmod.ko ---
ld -d -warn-common -r -d -o bpmod.ko bp_mod.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk bpmod.ko export_syms | xargs -J% objcopy % bpmod.ko
objcopy --strip-debug bpmod.ko
===> util (all)
--- bpctl_util ---
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1096:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:2617:30: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("Name\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
bpctl_util.c:2635:46: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("\n\tName\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
3 warnings generated.
===> Staging for silicom-bpctl-3.10.5_1
===> Generating temporary packing list
===> driver (install)
install -o root -g wheel -m 555 bpmod.ko /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/stage/boot/kernel
install: /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/stage/boot/kernel: No such file or directory
*** Error code 71
Stop.
make[2]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver
*** Error code 1
Stop.
make[1]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5
*** Error code 1
Stop.
make: stopped in /usr/local/poudriere/ports/default/sysutils/silicom-bpctl
不要在 pkg-plist 文件中对非 /usr/local
路径进行硬编码。
/%%KMODDIR%%/yourdriver.ko
应该是您在 plist 文件中指定驱动程序的方式 - 否则,您的端口不支持暂存。
如果您不知道暂存的作用,它会将端口内部安装到一个临时目录,对所有安装的文件进行编目,并将其与包列表进行比较。
创建分段是为了说明端口安装的每个文件,否则 pkg-plist 可能不会列出端口 make install
实际安装的文件;现在卸载失败了,因为它会留下文件。
您可能需要创建中间目录,尤其是为了支持暂存。在 nvidia-driver
的 Makefile 上达到顶峰在这方面很有帮助:
pre-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/${MODULESDIR}/drivers \
${STAGEDIR}${PREFIX}/${MODULESDIR}/extensions
我正在尝试为 Silicom 旁路控制器构建一个端口。我怀疑我的 Makefile
不完整,但我不确定。根据错误,我应该为 ld
添加一些内容吗?
更新:
在 Makefile
中添加 SSP_UNSAFE= yes
让我摆脱了原来的错误。不确定这是否是最好的方法。使用 -fstack-protector
添加对默认 SSP_CFLAGS
的支持似乎会导致此问题。这是需要在源代码中修复的东西吗?
生成文件:
PORTNAME= silicom_bpctl
PORTVERSION= 3.10.5
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://pkg.insecure-it.com/distfiles/
MAINTAINER= me@myemail.com
COMMENT= Silicom Bypass Controller utility (Zero Power Fail-Open for IPS)
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/license
SUB_FILES= pkg-message
SSP_UNSAFE= yes
.include <bsd.port.mk>
pkg-plist 文件:
boot/kernel/bpmod.ko
bin/bpctl_util
原始错误:
:/usr/local/poudriere/ports/default/sysutils/silicom_bpctl % sudo make stage
===> License GPLv2 accepted by the user
===> silicom_bpctl-3.10.5_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by silicom_bpctl-3.10.5_1 for building
===> Extracting for silicom_bpctl-3.10.5_1
=> SHA256 Checksum OK for silicom_bpctl-3.10.5.tar.gz.
===> Patching for silicom_bpctl-3.10.5_1
===> Configuring for silicom_bpctl-3.10.5_1
===> Building for silicom_bpctl-3.10.5_1
--- _sub.all ---
===> driver (all)
--- objwarn ---
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/@ ---
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/machine ---
--- opt_bdg.h ---
--- objwarn ---
Warning: Object directory not changed from original /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver
--- opt_bdg.h ---
:> opt_bdg.h
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/@ ---
@ -> /usr/src/sys
--- /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver/machine ---
machine -> /usr/src/sys/amd64/include
--- pci_if.h ---
--- bus_if.h ---
--- device_if.h ---
--- pci_if.h ---
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
--- bus_if.h ---
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
--- device_if.h ---
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
--- bp_mod.o ---
cc -O2 -pipe -fstack-protector -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c bp_mod.c -o bp_mod.o
--- bpmod.ko ---
ld -fstack-protector -d -warn-common -r -d -o bpmod.ko bp_mod.o
ld: -f may not be used without -shared
*** [bpmod.ko] Error code 1
make[2]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver
1 error
make[2]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5/driver
*** [_sub.all] Error code 2
make[1]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5
1 error
make[1]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl/work/silicom_bpctl-3.10.5
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
Stop.
make: stopped in /usr/local/poudriere/ports/default/sysutils/silicom_bpctl
手动安装此实用程序非常简单,只需 make
和 sudo make install
。
make
:
~/silicom/bp_ctl-3.10.5 % make
===> driver (all)
Warning: Object directory not changed from original /usr/home/arozar/silicom/bp_ctl-3.10.5/driver
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
:> opt_bdg.h
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c bp_mod.c
ld -d -warn-common -r -d -o bpmod.ko bp_mod.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk bpmod.ko export_syms | xargs -J% objcopy % bpmod.ko
objcopy --strip-debug bpmod.ko
===> util (all)
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1096:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:2617:30: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("Name\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
bpctl_util.c:2635:46: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("\n\tName\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
3 warnings generated.
sudo make install
:
~/silicom/bp_ctl-3.10.5 % sudo make install
===> driver (install)
install -o root -g wheel -m 555 bpmod.ko /boot/kernel
kldxref /boot/kernel
===> util (install)
install bpctl_util /bin
新错误:
现在安装失败必须是 pkg-plist
文件:
:/usr/local/poudriere/ports/default/sysutils/silicom-bpctl % sudo make stage
===> License GPLv2 accepted by the user
===> silicom-bpctl-3.10.5_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by silicom-bpctl-3.10.5_1 for building
===> Extracting for silicom-bpctl-3.10.5_1
=> SHA256 Checksum OK for silicom-bpctl-3.10.5.tar.gz.
===> Patching for silicom-bpctl-3.10.5_1
===> Configuring for silicom-bpctl-3.10.5_1
===> Building for silicom-bpctl-3.10.5_1
--- _sub.all ---
===> driver (all)
--- objwarn ---
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/@ ---
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/machine ---
--- opt_bdg.h ---
--- objwarn ---
Warning: Object directory not changed from original /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver
--- opt_bdg.h ---
:> opt_bdg.h
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/@ ---
@ -> /usr/src/sys
--- /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver/machine ---
machine -> /usr/src/sys/amd64/include
--- pci_if.h ---
--- bus_if.h ---
--- device_if.h ---
--- pci_if.h ---
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
--- bus_if.h ---
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
--- device_if.h ---
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
--- bp_mod.o ---
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c bp_mod.c -o bp_mod.o
--- bpmod.ko ---
ld -d -warn-common -r -d -o bpmod.ko bp_mod.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk bpmod.ko export_syms | xargs -J% objcopy % bpmod.ko
objcopy --strip-debug bpmod.ko
===> util (all)
--- bpctl_util ---
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1096:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:2617:30: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("Name\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
bpctl_util.c:2635:46: warning: format specifies type 'char *' but the argument has type 'int *' [-Wformat]
printf("\n\tName\t\t\t%s\n", bpctl_cmd.data);
~~ ^~~~~~~~~~~~~~
3 warnings generated.
===> Staging for silicom-bpctl-3.10.5_1
===> Generating temporary packing list
===> driver (install)
install -o root -g wheel -m 555 bpmod.ko /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/stage/boot/kernel
install: /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/stage/boot/kernel: No such file or directory
*** Error code 71
Stop.
make[2]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5/driver
*** Error code 1
Stop.
make[1]: stopped in /usr/local/poudriere/ports/default/sysutils/silicom-bpctl/work/silicom-bpctl-3.10.5
*** Error code 1
Stop.
make: stopped in /usr/local/poudriere/ports/default/sysutils/silicom-bpctl
不要在 pkg-plist 文件中对非 /usr/local
路径进行硬编码。
/%%KMODDIR%%/yourdriver.ko
应该是您在 plist 文件中指定驱动程序的方式 - 否则,您的端口不支持暂存。
如果您不知道暂存的作用,它会将端口内部安装到一个临时目录,对所有安装的文件进行编目,并将其与包列表进行比较。
创建分段是为了说明端口安装的每个文件,否则 pkg-plist 可能不会列出端口 make install
实际安装的文件;现在卸载失败了,因为它会留下文件。
您可能需要创建中间目录,尤其是为了支持暂存。在 nvidia-driver
的 Makefile 上达到顶峰在这方面很有帮助:
pre-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/${MODULESDIR}/drivers \
${STAGEDIR}${PREFIX}/${MODULESDIR}/extensions