edison-fw / meta-intel-edison

Here is the meta-intel-edison that builds, tries to stay up to date. Master is based on Yocto Poky Gatesgarth LTS 5.10.yy vanilla kernels. It builds a 32bit kernel (Gatesgarth branch 64bit) with ACPI enabled and corresponding rootfs. Telegram group: https://t.me/IntelEdison Web-site:
https://edison-fw.github.io/meta-intel-edison/
MIT License
60 stars 37 forks source link

How to add or modify menuconfig? #102

Closed shawnhsoia97 closed 4 years ago

shawnhsoia97 commented 4 years ago

Hi ,I want to modify driver or add new driver in menuconfig,so I modify ./out/linux64/build/tmp/work-shared/edison/kernel-source/drivers/usb/serial/Kconfig to add new option. But when make edison-image,I found that the modified file was re-created. So do you know how to add new option or modify menuconfig? Thank you so much!

htot commented 4 years ago

Sure: https://edison-fw.github.io/meta-intel-edison/5.1-Bitbake-tricks#configuring-the-kernel-and-grab-the-kernel-fragment

shawnhsoia97 commented 4 years ago

Hi @htot ,you misunderstood me. I mean I want Add New Kernel Configuration Options. e.g. $vi ./out/linux64/build/tmp/work-shared/edison/kernel-source/drivers/net/usb/Kconfig Add below

config USB_NET_TEST
        tristate "Test"
        depends on USB_USBNET
        select USB_WDM
        help
          test

$vi ./out/linux64/build/tmp/work-shared/edison/kernel-source/drivers/net/usb/Makefile add"obj-$(CONFIG_USB_NET_TEST) += test.o"

Menuconfig show:

image

But when make edison-image,I found that the modified file was removed and recreated,So my previous changes are restored to their original state. So do you know how to solve it?

htot commented 4 years ago

I see.

In that case you need to add a patch to the kernel. Bitbake will always download kernel again and unpack if you modify stuff. So there are 2 ways: 1) fork the kernel (on github or locally) and add your patches there and tell the recipe the new location of the fork and the new SHA (or HEAD) to checkout 2) create patch, save under files and tell the recipe to apply the patch after unpacking, if you look in the recipe your will see we are already applying a few patches

shawnhsoia97 commented 4 years ago

I get it! Really thank you very much!! ^^