kernel: include modinfo for built-in modules

Add modules.builtin.modinfo to the kernel package, to support presence
testing using module aliases and printing module details with 'modinfo'.

With related kmodloader changes this adds ~2 KB to compressed image sizes.

     root@OpenWrt:/# modinfo unix
     name:           unix
     filename:       (builtin)
     alias:          net-pf-1
     license:        GPL

     root@OpenWrt:/# modprobe net-pf-1 && echo SUCCESS || echo FAIL
     SUCCESS

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
This commit is contained in:
Tony Ambardar 2023-12-05 01:09:46 -08:00
parent 29f6da4340
commit e1d8e57614

View File

@ -61,6 +61,9 @@ define Package/kernel/install
$(INSTALL_DIR) $(1)/$(MODULES_SUBDIR)
$(INSTALL_DATA) $(LINUX_DIR)/modules.builtin $(1)/$(MODULES_SUBDIR)
$(SED) 's,.*/,,' $(1)/$(MODULES_SUBDIR)/modules.builtin
strings $(LINUX_DIR)/modules.builtin.modinfo | \
grep -E -v "\.(file$(if CONFIG_MODULE_STRIPPED,|parmtype))=" | \
tr '\n' '\0' > $(1)/$(MODULES_SUBDIR)/modules.builtin.modinfo
endef
define Package/kernel/extra_provides