title: Details of compiling out-of-tree drivers for Linux
body: <p>I am trying to compile a WiFi driver for an oldish (3.18.29) kernel.</p>
  
  <p>Processor is an MT7628 (mips), board is a VoCore2.</p>
  
  <p>I have the kernel correctly configured and built in <code>/home/mcon/vocore/kernel</code>.
  As I am cross-compiling I also need to give a pointer to my cross-toolchain.</p>
  
  <pre><code>mcon@cinderella:~/vocore/kernel$ make ARCH=mips CROSS_COMPILE=/home/mcon/vocore/Buildroot/toolchain/host/bin/mipsel-linux- 
    CHK     include/config/kernel.release
    CHK     include/generated/uapi/linux/version.h
    CHK     include/generated/utsrelease.h
    CALL    scripts/checksyscalls.sh
    HOSTCC  scripts/dtc/dtc.o
    ...
    IHEX    firmware/edgeport/down3.bin
    IHEX2FW firmware/whiteheat_loader.fw
    IHEX2FW firmware/whiteheat.fw
    IHEX2FW firmware/keyspan_pda/keyspan_pda.fw
    IHEX2FW firmware/keyspan_pda/xircom_pgs.fw
  mcon@cinderella:~/vocore/kernel$ make ARCH=mips CROSS_COMPILE=/home/mcon/vocore/Buildroot/toolchain/host/bin/mipsel-linux- modules_prepare
  scripts/kconfig/conf --silentoldconfig Kconfig
  net/sched/Kconfig:43: warning: menuconfig statement without prompt
    CHK     include/config/kernel.release
    CHK     include/generated/uapi/linux/version.h
    CHK     include/generated/utsrelease.h
    CALL    scripts/checksyscalls.sh
  </code></pre>
  
  <p>Diver is taken from <a href="https://github.com/saviourxx/openwrt_dl/raw/master/mt7628-p4rev-120395.tar.bz2" rel="nofollow noreferrer">here</a> and unpacked in <code>/home/mcon/vocore/mt7628-p4rev-120395</code></p>
  
  <p>I had to add a symlink because <code>Makefile</code> looks in <code>../mt_wifi</code> and not in <code>../src</code> if not compiling for OpenWRT.</p>
  
  <p>Anyways compilation doesn't seem to do anything:</p>
  
  <pre><code>mcon@cinderella:~/vocore/mt7628-p4rev-120395/build$ make -C /home/mcon/vocore/kernel M=$(pwd) CROSS_COMPILE=/home/mcon/vocore/Buildroot/toolchain/host/bin/mipsel-linux- ARCH=mips
  make: Entering directory '/home/mcon/vocore/linux-3.18-vocore2'
    Building modules, stage 2.
    MODPOST 0 modules
  make: Leaving directory '/home/mcon/vocore/linux-3.18-vocore2'
  </code></pre>
  
  <p>I have been unable to start kernel configuration for module:</p>
  
  <pre><code>mcon@cinderella:~/vocore/mt7628-p4rev-120395/build$ make -C /home/mcon/vocore/kernel M=$(pwd) CROSS_COMPILE=/home/mcon/vocore/Buildroot/toolchain/host/bin/mipsel-linux- ARCH=mips menuconfig
  make: Entering directory '/home/mcon/vocore/linux-3.18-vocore2'
  make: *** No rule to make target 'menuconfig'.  Stop.
  make: Leaving directory '/home/mcon/vocore/linux-3.18-vocore2'
  </code></pre>
  
  <p>... and I also tried to manually add relevant configuration variables to <code>.config</code> and/or command-line, but they seem to be completely ignored.</p>
  
  <p>I am obviously missing some needed step, but I'm unable to understand what.</p>