title: Unable to load kernel module after compiling it separately
body: <p>I am trying to "make" and load the "/drivers/md/raid0.ko" module into my linux kernel but I am getting this error.</p>
  
  <pre><code># modprobe raid0 --force-vermagic
  modprobe: ERROR: could not insert 'raid0': Exec format error
  </code></pre>
  
  <p>dmesg</p>
  
  <pre><code>[Dec 2 15:10] raid0: version magic '5.0.0 SMP mod_unload ' should be '5.0.0-36-generic SMP mod_unload '
  </code></pre>
  
  <p>My kernel version is</p>
  
  <pre><code># uname -a
  Linux ubuntu1 5.0.0-36-generic #39-Ubuntu SMP Tue Nov 12 09:46:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  </code></pre>
  
  <p>and the code from which I am trying to load is taken from the link <a href="https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.0.tar.xz" rel="nofollow noreferrer">https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.0.tar.xz</a></p>
  
  <p>Hence the version in that is 5.0.0, without the EXTRAVERSION -36</p>
  
  <p>I have tried a number of things but failed.</p>
  
  <ol>
  <li>Setting the EXTRAVERSION using command <code>make EXTRAVERSION=-1 modules_prepare</code>, before building the module</li>
  <li>Using the <code>--force-vermagic</code> while loading the kernel, but it fails.</li>
  <li>Copying the Makefile firectly from <code>/usr/lib/modules/$(uname -r)/build/Makefile</code> before building the kernel.</li>
  </ol>
  
  <p>I have used both <code>make SUBDIRS=drivers/md modules</code> and <code>make M=drivers/md</code> for building, but same result for both.</p>
  
  <p>Need help!</p>