title: Deploying USB gadget kernel modules into rootfs with yocto
body: <p>I'm using the Freescale QorIQ SDK 1.7.  I've modified my kernel config 'make menuconfig' to include the USB gadget drivers as a module and to include either Gadget zero or the serial gadget as a module.</p>
  
  <p>I've also compiled the net2280 peripheral device directly into the kernel and it is loading and binding to the PCI device just fine.</p>
  
  <p>After I run <code>bitbake</code>, the newly built rootfs doesn't include the newly built gadget modules yet I can see the <code>.ko</code> files have been built:</p>
  
  <pre><code>$ find -name g_zero.ko
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/git/drivers/usb/gadget/g_zero.ko
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/image/lib/modules/3.12.19-rt30-QorIQ-SDK-V1.7+g6619b8b/kernel/drivers/usb/gadget/g_zero.ko
  </code></pre>
  
  <p>but when I look in the image I get nothing.</p>
  
  <pre><code>$ tar -tzvf tmp/deploy/images/t1040rdb/fsl-image-core-t1040rdb.tar.gz | grep g_zero
  </code></pre>
  
  <p>One thing I found in searching is that it was suggested that <code>.config</code> needs to be copied into <code>meta-fsl-arm/recipies-kernel/linux/</code>. Unfortunately I'm using <code>meta-fsl-ppc</code> and it seems to use a completely different scheme for the kernel config.</p>
  
  <p>First, there is a variable defined in <code>meta-fsl-ppc/conf/machine/machine.conf</code> that looks like this:</p>
  
  <pre><code>KERNEL_DEFCONFIG ?= "${S}/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig"
  </code></pre>
  
  <p>My thinking was that maybe I need to overwrite that file. However, I'm confused as to where <code>${S}</code> is <em>actually</em> pointing.</p>
  
  <pre><code>$ bitbake -e | grep KERNEL_DEFCONFIG
  KERNEL_DEFCONFIG="/home/jaket/QorIQ-SDK-V1.7-20141218-yocto/build_t1040rdb_release/tmp/work/ppce5500-fsl-linux/defaultpkgname/1.0-r0/defaultpkgname-1.0/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig"
  </code></pre>
  
  <p>Which matches nothing in my tree:</p>
  
  <pre><code>$ find -name corenet32_fmanv3_smp_defconfig
  ./tmp/sysroots/t1040rdb/usr/src/kernel/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/sysroot-destdir/usr/src/kernel/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/package/usr/src/kernel/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/git/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/image/usr/src/kernel/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig
  ./tmp/work/t1040rdb-fsl-linux/linux-qoriq/3.12-r0/packages-split/kernel-dev/usr/src/kernel/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig
  </code></pre>
  
  <p>So I guess my question is: when a loadable module is configured in the kernel, is it expected that the module will magically find its way onto the rootfs or is there more to it than that?</p>