我目前正在尝试编译 Jammy Jellyfish 中的标头,但遇到以下错误:
/usr/src/linux-headers-5.15.0-25-generic$ sudo make
SYNC include/config/auto.conf.cmd
make[1]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make: *** [arch/x86/Makefile:213: archheaders] Error 2
在运行 make 命令之前,我将旧的 .config 文件 /boot/config-5.15.0-25-generic 复制到 /usr/src/linux-headers-5.15.0-25-generic/ 中的 .config 文件中
我看过一些发布此错误的帖子,但我还没有看到任何解决该问题的答案。如果需要更多信息,请告诉我。
谢谢
答案1
我能够在这里发布一个解决方案https://stackoverflow.com/questions/39107811/no-rule-to-make-target-arch-x86-entry-syscalls-syscall-32-tbl-needed-by-arch
我尝试为 Linux Mint Vanessa 构建 HP PC 内核模块。第一件事 - 从您正在构建的文件夹路径中删除所有空格(如果有)。我也尝试在我的 Debian 机器上构建它以进行测试。这是我的构建,希望它能提供解决方案。编辑您的项目 Makefile。
Debian/Mint:原始
#
# Makefile for hpuefi loadable kernel module
#
KVERS:=$(shell uname -r)
KSRC:=/lib/modules/$(KVERS)/build
KDIR:=/lib/modules/$(KVERS)/kernel/drivers/misc
DESTDIR:=
TARGET=hpuefi
obj-m:=$(TARGET).o
default:
$(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
clean:
$(RM) .*.cmd *.mod.c *.o *.ko *.order *.symvers -r .tmp*
install:
install -D -m 0644 $(TARGET).ko $(DESTDIR)$(KDIR)/$(TARGET).ko
之前的Debian
user@machine:/media/user/usbdisk/SP58029/hpuefi-mod-1.0.3-deb$ make
make -C /lib/modules/5.10.0-19-amd64/build SUBDIRS=/media/user/usbdisk/SP58029/hpuefi-mod-1.0.3-deb modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-19-amd64'
/usr/src/linux-headers-5.10.0-19-common/Makefile:225: =============== ERROR ==============
/usr/src/linux-headers-5.10.0-19-common/Makefile:226: 'SUBDIRS' was removed in Linux 5.3
/usr/src/linux-headers-5.10.0-19-common/Makefile:227: Use 'M=' or 'KBUILD_EXTMOD=' instead
/usr/src/linux-headers-5.10.0-19-common/Makefile:228: ====================================
/usr/src/linux-headers-5.10.0-19-common/Makefile:229: *** .. Stop.
make[1]: *** [/usr/src/linux-headers-5.10.0-19-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-19-amd64'
make: *** [Makefile:13: default] Error 2
Debian 修复
default:
$(MAKE) -C $(KSRC) M=$(PWD) modules
Linux Mint 之前
mint@mint:/media/mint/DAC4798DC4796D1F/swsetup/SP58029/HP_Utilities_for_Linux/hpuefi-mod-1.0.3$ sudo make
make -C /lib/modules/5.15.0-41-generic/build M= modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-41-generic'
make[2]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make[1]: *** [arch/x86/Makefile:213: archheaders] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-41-generic'
make: *** [Makefile:13: default] Error 2
Linux Mint 修复:
default:
$(MAKE) -C $(KSRC) M=$(shell pwd) modules