Error while compiling Kernel module placed under different location other than package/kernel

$ tree
|-- Makefile
`-- src
    |-- helloworld1234.c
    |-- Kconfig
    `-- Makefile

1 directory, 4 files
$ cat Makefile
include $(TOPDIR)/
include $(INCLUDE_DIR)/

PKG_NAME     := helloworld1234
SOURCE_DIR   := src

include $(INCLUDE_DIR)/

define KernelPackage/helloworld1234
  CATEGORY    := Viasat
  SUBMENU     := Kernel modules
  TITLE       := Hello World Kernel Module
  FILES       := $(PKG_BUILD_DIR)/helloworld1234.ko
  AUTOLOAD    :=
  KCONFIG     :=
        KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)" \
        M="$(PKG_BUILD_DIR)" \

define Build/Compile
     $(KERNEL_MAKE) \
        $(MAKE_OPTS) \

$(eval $(call KernelPackage,helloworld1234))

cat src/Kconfig
    bool "Hello World Module"
    default y
        Say hello from a kernel module.
    select MODULES

cat src/Makefile
obj-$(CONFIG_HELLO_WORLD_MODULE1234) += helloworld1234.o

cat src/helloworld1234.c
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>

static int __init hello_init(void)
    printk(KERN_INFO "Hello, world\n");
    return 0;

static void __exit hello_exit(void)
    printk(KERN_INFO "Goodbye, world\n");



I have the above simple helloworld kernel module in OpenWrt 23.05. When I placed that helloworld folder under openwrt/package/kernel, I can see that this KM(Kernel Module) get listed under menuconfig and able to compileit successfully without any issues.

However if I place the same folder under the feed which I created and that I added as src_link in feeds.conf, I can't see that under menuconfig and also not able to compile it .

For every new kernel module, do we need to updated the scripts(./scripts/feeds update -a; ./scripts/feeds install -a), compile the kernel (make target/linux/install) and then compile the kernel module ?

Can someone please help to resolve this issue ?

Also I need to link the below kernel modules in my customized i2c driver. What should be the dependent module I need to include for teh below driver modules ?

[root @openwrt]# lsmod |grep i2c

regmap_i2c 12915 2 snd_soc_rt5640,snd_soc_ssm4567

i2c_designware_platform 12921 0

i2c_designware_core 18779 1 i2c_designware_platform

i2c_hid 18877 0

Thanks & Regards,

Can someone please guide me on this issue ?

Post your feeds.conf file.

I have added my git as source in feeds.conf.default see the last line

src-git packages
src-git luci
src-git routing
src-git telephony
#src-git video
#src-git targets
#src-git oldpackages
#src-link custom /usr/src/openwrt/custom-feed
src-git egc

I have two scripts which I wanted to be configurable in the menu, wireguard-watchdog and wireguard-companion.
That works as advertised after ./scripts/feeds update -a && ./scripts/feeds install -a and make menuconfig, see the Makefile of the scripts how to define the package so that is shows up in the menu

Yes this is my feeds.conf

# Open-source feeds -- Required: commit hashes must match "feeds.conf.default"
# =============================================================================
src-git packages  ssh://^8e3a1824645f5e73ec44c897ac0755c53fb4a1f8
src-git luci      ssh://^7739e9f5b03b830f51d53c384be4baef95054cb3
src-git routing   ssh://^83ef3784a9092cfd0a900cc28e2ed4e13671d667
src-git telephony ssh://^9746ae8f964e18f04b64fbe1956366954ff223f8

src-link     m3_platform /home/cmuthusamy/drivers/m3-platform

Actually the kernel module which copied into some folder has some config file like Kbuild and some Makefile. We haev ported that code from centos and we are retaining those files to maintain the history. So having Kbuild and someother makefile will imapct this KO compilation ?

I would agree with that assessment.