[Linux] 에러해결: make[1]: Entering directory '/usr/src/linux-headers-5.15.0-89-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.
[문제/에러]
주요 에러는 빨간 글씨로 표현했다.
$ sudo make
[sudo] password for kai:
make -C /lib/modules/5.15.0-89-generic/build M= modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-89-generic'
make[2]: *** No rule to make target 'arch/x86/entry/syscalls/ syscall_32 ', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make[1]: *** [arch/x86/Makefile:217: archheaders] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-89-generic'
make: *** [Makefile:4: all] Error 2
[해결방안]
root 유저로 변환 후, make를 하면 된다.
$ su
Password:
# make
make -C /lib/modules/5.15.0-89-generic/build M=/home/kai/98.Study/20231210/char_device_driver4 modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-89-generic'
CC [M] /home/kai/98.Study/20231210/char_device_driver4/chardev.o
MODPOST /home/kai/98.Study/20231210/char_device_driver4/Module.symvers
CC [M] /home/kai/98.Study/20231210/char_device_driver4/chardev.mod.o
LD [M] /home/kai/98.Study/20231210/char_device_driver4/chardev.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-89-generic'
# ls
chardev.c chardev.ko chardev.mod chardev.mod.c chardev.mod.o chardev.o Makefile modules.order Module.symvers
mod파일이 잘 생성되는걸 확인하였다.
시간을 절약했으면 아래의 좋아요 부탁드립니다.