简体   繁体   中英

Deploying USB gadget kernel modules into rootfs with yocto

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.

I've also compiled the net2280 peripheral device directly into the kernel and it is loading and binding to the PCI device just fine.

After I run bitbake , the newly built rootfs doesn't include the newly built gadget modules yet I can see the .ko files have been built:

$ 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

but when I look in the image I get nothing.

$ tar -tzvf tmp/deploy/images/t1040rdb/fsl-image-core-t1040rdb.tar.gz | grep g_zero

One thing I found in searching is that it was suggested that .config needs to be copied into meta-fsl-arm/recipies-kernel/linux/ . Unfortunately I'm using meta-fsl-ppc and it seems to use a completely different scheme for the kernel config.

First, there is a variable defined in meta-fsl-ppc/conf/machine/machine.conf that looks like this:

KERNEL_DEFCONFIG ?= "${S}/arch/powerpc/configs/corenet32_fmanv3_smp_defconfig"

My thinking was that maybe I need to overwrite that file. However, I'm confused as to where ${S} is actually pointing.

$ 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"

Which matches nothing in my tree:

$ 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

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?

The fact that you find the .ko in the kernel build directory's image/ directory (which is where the kernel does "make install" into) but not packages-split implies that the kernel module isn't actually packaged. You'll want to check the path it gets installed to to see why it doesn't get packaged, and then add the package that it ends up in to the rootfs as kernel modules get packaged individually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM