linux kernel_module compiling shows MODPOST 0 modules

最近在考古,电子考古学,我独创的学科。主要从事翻新一些二十年前的Linux C项目。新的Kernel下一make就是一串的错,准带熟悉了一下linux kernel编程。遇到两个问题,这个粗略总结一下。

#MODPOST 0 modules
Any posts shows playing around with the makefile with spaces and TABs will help. Problem will eventually goes away. But please also check the following:
1.compilation as ordinary user or root, at /usr/src, /home, /root
2.on ext3 or reiserfs filesystems
3.compilation of a couple of kernel versions between, and including, 2.6.24.2 (yes, that problem is that old :/ ) - 2.6.33
4.downloaded from kernel.org and that from slackware packages
5.with default slackware .config files, and with simply make menuconfig and save (without making any changes)
6.using some slackBuild from slackbuilds.net
7.different slackware versions (12.2, 13.0, and -current now)
8.windows-style “format c:”, i mean, dd if=/dev/zero of=/dev/sdaX, and reinstall of Slackware

#No rule to make target “syscall_32.tbl”
The Reason
At last we had to look the output ourselves.
You can notice that M is getting no value. (See M= in the first output line of make.)

That means M=$(PWD) in the Makefile is wrong. It would have worked if PWD had been defined in the shell beforehand. But this is not so, we need to replace it with something that returns the present working directory (PWD).

The Solution
That can be done perfectly with $(shell pwd). So just replace M=$(PWD) with M=$(shell pwd) in the Makefile.

Worked perfectly for me. Hope it saves some time for you.

more kbuild check https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/modules.txt

加载评论框需要翻墙