title: I cannot load the kernel of a Raspberry Pi and use modprobe afterward in order to use i2c_stub
body: <p>I am trying to read from virtual sensors on a Raspberry Pi B3. I want to create the virtual sensors on the i2c port. The first thing I did was enable the i2c port of course. With the commands below I can see if the i2c interface is working:</p>
  
  <pre><code># i2cdetect -y 1
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
  10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
  20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
  30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
  40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
  50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
  60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
  70: -- -- -- -- -- -- -- --                         
  # ls /dev/*i2c*
  /dev/i2c-1
  </code></pre>
  
  <p>Then I try to run these two <code>make</code> commands that <code>uname -r</code> does not match with the directory which has the <code>build</code> subdirectory. If I hardcode <code>uname -r</code> to the directory that has the <code>build</code> subdirectory I can proceed, however the command <code>sudo modprobe -r i2c_stub</code> that I have to execute after will not work. Error: <code>modprobe: FATAL: Module i2c_stub not found.</code>. I already followed this question <a href="https://superuser.com/questions/952688/installing-new-driver-on-linux-missing-the-build-directory">https://superuser.com/questions/952688/installing-new-driver-on-linux-missing-the-build-directory</a> but it didn't solve my problem.</p>
  
  <pre><code># sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
  make: *** /lib/modules/4.4.16-v7+/build: No such file or directory.  Stop.
  # sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
  make: *** /lib/modules/4.4.16-v7+/build: No such file or directory.  Stop.
  # uname -r
  4.4.16-v7+
  # ls -l /lib/modules/4.4.16-v7+/
  total 1716
  drwxr-xr-x 11 root root   4096 Aug  2  2016 kernel
  -rw-r--r--  1 root root 447387 Aug  2  2016 modules.alias
  -rw-r--r--  1 root root 463774 Aug  2  2016 modules.alias.bin
  -rw-r--r--  1 root root   4574 Aug  2  2016 modules.builtin
  -rw-r--r--  1 root root   6025 Aug  2  2016 modules.builtin.bin
  -rw-r--r--  1 root root 142062 Aug  2  2016 modules.dep
  -rw-r--r--  1 root root 207587 Aug  2  2016 modules.dep.bin
  -rw-r--r--  1 root root    302 Aug  2  2016 modules.devname
  -rw-r--r--  1 root root  58127 Aug  2  2016 modules.order
  -rw-r--r--  1 root root     55 Aug  2  2016 modules.softdep
  -rw-r--r--  1 root root 175706 Aug  2  2016 modules.symbols
  -rw-r--r--  1 root root 218826 Aug  2  2016 modules.symbols.bin
  # ls -l /lib/modules/4.9.35-v7+/
  total 1848
  lrwxrwxrwx  1 root root     33 Jul  3  2017 build -&gt; /usr/src/linux-headers-4.9.35-v7+
  drwxr-xr-x 11 root root   4096 Jun 23 08:54 kernel
  -rw-r--r--  1 root root 478139 Jul  3  2017 modules.alias
  -rw-r--r--  1 root root 492852 Jul  3  2017 modules.alias.bin
  -rw-r--r--  1 root root   4778 Jul  3  2017 modules.builtin
  -rw-r--r--  1 root root   6290 Jul  3  2017 modules.builtin.bin
  -rw-r--r--  1 root root 153132 Jul  3  2017 modules.dep
  -rw-r--r--  1 root root 222028 Jul  3  2017 modules.dep.bin
  -rw-r--r--  1 root root    302 Jul  3  2017 modules.devname
  -rw-r--r--  1 root root  61224 Jul  3  2017 modules.order
  -rw-r--r--  1 root root     55 Jul  3  2017 modules.softdep
  -rw-r--r--  1 root root 198792 Jul  3  2017 modules.symbols
  -rw-r--r--  1 root root 245292 Jul  3  2017 modules.symbols.bin
  </code></pre>