Hello, the kernel build system (kbuild) allows to compile modules whose sources live outside the kernel source tree by setting SUBDIRS as follows (from the module sources's directory): $ make -C /lib/modules/$(uname -r)/build modules SUBDIRS=$(pwd) people use this mechanism to compile kernel modules that are missing in their kernel sources, or have been updated/fixed in the meantime. Currently there are a number of deficiencies for building such modules: (1) symbol versioning (MODVERSIONS) is not properly supported, and (2) only the `modules' make target is supported. Problem (1) did not exist in the 2.4 kernel series. The current situation has lead authors of several external modules to implement some of the kbuild functionality in their own makefiles, which can only lead to problems later on. During the kernel compile, a list of all files that export symbols is created in .tmp_versions/ of the kernel source tree. After everything is compiled, the module versions of all these object files are resolved with modpost. When an external module is compiled, it ends up being the only file in .tmp_versions/, and so symbols in other modules would not be found. An additional problem is that resolving symbol versions requires all module files plus vmlinux to be in the kernel source tree, so modules cannot be build against a clean kernel source tree. I propose the attached patch: It adds symbol version dump/load functionality to modpost: When compiling the kernel, the module versions are dumped to a file. When compiling external modules, the dumped symbols are first loaded. Also, to allow a read-only kernel source tree and not interfere with the kernel sources, the .tmp_versions/ directory is placed in the external module's directory. Furthermore, the patch adds clean/distclean/mrproper make targets with reasonable semantics for external modules, and also adds a modules_add target that installs the external modules into /lib/modules/$(KERNELRELEASE). (The modules_install target could be used, but it has different semantics, so I have used a different name instead.) There also is one fix for using tempfiles instead of writing into the kernel source tree. A few problems with compiling against a read-only kernel source tree seem to remain. Regards, -- Andreas Gruenbacher SUSE Labs, SUSE LINUX AG