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

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

1 directory, 4 files
$ cat Makefile
 
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME     := helloworld1234
PKG_RELEASE  := 0.1
SOURCE_DIR   := src

include $(INCLUDE_DIR)/package.mk

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

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

$(eval $(call KernelPackage,helloworld1234))

cat src/Kconfig
config HELLO_WORLD_MODULE1234
    bool "Hello World Module"
    default y
    help
        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");
}

module_init(hello_init);
module_exit(hello_exit);

MODULE_LICENSE("GPL");

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,
Chinna

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 https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed
src-git egc https://github.com/egc112/OpenWRT-egc-add-on.git

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://git@git.viasat.com/gen3-term/openwrt-packages.git^8e3a1824645f5e73ec44c897ac0755c53fb4a1f8
src-git luci      ssh://git@git.viasat.com/gen3-term/openwrt-luci.git^7739e9f5b03b830f51d53c384be4baef95054cb3
src-git routing   ssh://git@git.viasat.com/gen3-term/openwrt-routing.git^83ef3784a9092cfd0a900cc28e2ed4e13671d667
src-git telephony ssh://git@git.viasat.com/gen3-term/openwrt-telephony.git^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.