<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 15, 2018 at 12:39 PM, Aleksei Fedotov <span dir="ltr"><<a href="mailto:lexa@cfotr.com" target="_blank">lexa@cfotr.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> If for some reason make modules did not create module.symvers then try:<br>
><br>
>         cd /home/lexa/linux<br>
>         make<br>
>         [wait a few minutes as it builds some scripts and starts building kernel code...]<br>
>         hit <Ctrl-C><br>
><br>
> then go back and try building your module.<br>
<br>
</span>But i have my kernel completely build, including kernel modules.<br>
<br>
I get the error about ./Module.symvers only if I specify<br>
O=module_build_directory. When I build the module without O= there is<br>
not such error, but the object files are created in the same directory<br>
as module source, which I want to avoid.<br></blockquote></div><br>This will help:<br><a href="https://www.kernel.org/doc/Documentation/kbuild/modules.txt"><br>https://www.kernel.org/doc/Documentation/kbuild/modules.txt<br><br></a></div><div class="gmail_extra">In section 2. of the above link on "How to Build External Modules" it specifically mentions that:<br><pre>NOTE: "modules_prepare" will not build Module.symvers even if
CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be
executed to make module versioning work.</pre>

This is the *reason* I asked you to run make to trigger a full kernel build and press Ctrl+C because no one wants to hang around until it completes. Especially if one is on a Pentium 3 like I used to be with my first kernel compile which took over 6 hours.<br><br></div><div class="gmail_extra">And pay very careful attention to what is below, read ten times if u must but 'understand' what that is saying :-) took me more than ten times before I understood..<br><pre>6.2 Symbols and External Modules

        When building an external module, the build system needs access
        to the symbols from the kernel to check if all external symbols
        are defined. This is done in the MODPOST step. modpost obtains
        the symbols by reading Module.symvers from the kernel source
        tree. If a Module.symvers file is present in the directory
        where the external module is being built, this file will be
        read too. During the MODPOST step, a new Module.symvers file
        will be written containing all exported symbols that were not
        defined in the kernel.<br><br></pre><pre>So that is why Gregkh said run make modules_prepare ( which yet needs a full compile )<br><br></pre><pre>Hope this helps - Aruna<br></pre>

<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>