Out-of-tree module build in a dedicated build directory.

Greg KH greg at kroah.com
Thu Mar 15 13:14:59 EDT 2018


On Thu, Mar 15, 2018 at 05:39:36PM +0100, Aleksei Fedotov wrote:
> > If for some reason make modules did not create module.symvers then try:
> >
> >         cd /home/lexa/linux
> >         make
> >         [wait a few minutes as it builds some scripts and starts building kernel code...]
> >         hit <Ctrl-C>
> >
> > then go back and try building your module.
> 
> But i have my kernel completely build, including kernel modules.
> 
> I get the error about ./Module.symvers only if I specify
> O=module_build_directory. When I build the module without O= there is
> not such error, but the object files are created in the same directory
> as module source, which I want to avoid.

You have to do 'make module_prepare' with your 'O=' set correctly as
well, otherwise how will the build system know where to look for the
object files to link/build against?

thanks,

greg k-h



More information about the Kernelnewbies mailing list