Closed lybtongji closed 6 years ago
I haven't tried, but I am guessing you need to modify the kernel config for the module to be built. I am still on a holiday but will put instructions how to do it here when I return.
@htot Thanks for reply. Have a nice holiday!
OK. I have made it.
First, I use bitbake virtual/kernel -c menuconfig
to generate .config
.
Device drivers > Network device support > Universal TUN/TAP device driver support.
And I found CONFIG_TUN=m
appeared in ~/os/out/linux64/build/tmp/work/edison-poky-linux/linux-yocto/4.16.0-r0/linux-edison-standard-build/.config
Then I copied the file to recipes-kernel
directory.
cp ~/os/out/linux64/build/tmp/work/edison-poky-linux/linux-yocto/4.16.0-r0/linux-edison-standard-build/.config ~/os/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/files/defconfig
And edited the file ~/os/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/linux-yocto_4.16.0.bb
.
vim ~/os/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/linux-yocto_4.16.0.bb
Add file://defconfig
to SRC_URI
.
At last, I rebuilt the image and found the tun.ko
was appeared in out/linux64/build/tmp/work/edison-poky-linux/linux-yocto/4.16.0-r0/linux-edison-standard-build/drivers/net/
.
Is there a better way?
So replacing defconfig is one way, but it's quite invasive.
Much more modular and focused one would be to use the so called kernel config fragments (a Yocto feature - see developer's manual) - see e.g. all those *.cfg
files in https://github.com/edison-fw/meta-intel-edison/tree/master/meta-intel-edison-bsp/recipes-kernel/linux/files
What I do to create kernel fragments:
bitbake linux-yocto -c kernel_configme -f
bitbake linux-yocto -c menuconfig // configure the kernel
bitbake linux-yocto -c diffconfig // create kernel fragment after configuring, manually copy to recipe files
bitbake linux-yocto -c cleansstate // clean up
solved
I have tried to add
IMAGE_INSTALL_append += " kernel-module-tun"
toout/linux64/build/conf/local.conf
. But got error: