Disable kmodloader [solved]

Hello.
Is it a way to disable kmodloader and use depmod only? (modules are loading as soon as they are needed) For example If I need some NAT rules, all needed modules are loaded after command

iptables -A POSTROUTING -t nat -j SNAT .....

OR let kmodloader usage only for modules in ../boot dir and any other modules load over modprobe or so on?

Thank you

There is no easy way to do that. We patch iptables to not load kernel modules by itself and iirc we also do not package module-init-tools so there is nothing available that can generate and workwith module dependency files.

It is for this "feauture" a good reason? AA 12.09, with first process init, works this way. It is because of procd and its features?

Workaround - could be possible to add a blacklist feature? (Not only move/remove files from /etc/init.d/modules.d/) "Do not load blacklisted modules until I whitelist them"
I'm using many OpenWRT/LEDE routers for many scenarios and for example NAT (a lot of cpu usage without any NAT rule), bonding (make unusable bond interface), u32 filters, mangling, etc etc, are not needed on all of them.

Installing all packages as soon as they are needed is inefficient :slight_smile: and mine routers has a lot of flash. (I don't need skimp it :slight_smile:)

The good reason is that we didn't want to waste space for module-init-tools and the dependency files which tend to become quite large. But I agree that a blacklist feature would make sense to add to kmodloader.

Last question. If I add busybox module-init-tools to my image, I'll find-and-delete the iptables patch and maybe I will need to do kernel_config changes, could it work? It will something correctly talk to the kernel "I need these modules, load it" ??

EDIT: One question save a lot of mine work :slight_smile:

I think it should work, yes.

Hello. I added module-init-tools [edit] tried kmod too[/edit], removed patches from iptables and now it seems, depmod generate wrong dependecy file. For example if i call mangle and filter table, it works. But when i call nat table, it still need insmod.

self genereated line in modules.dep after depmod command

iptable_nat.ko: ip_tables.ko x_tables.ko nf_nat_ipv4.ko nf_nat.ko nf_conntrack.ko

edited and working line in modules.dep

iptable_nat.ko: ip_tables.ko x_tables.ko nf_nat_ipv4.ko nf_nat.ko nf_conntrack.ko nf_conntrack_ipv4.ko

Could someone give me a hint, what could be wrong yet? Wrong dependecies in kernel? Faulty depmod?

depmod -a
modprobe iptable_nat
2 modules could not be probed
  - iptable_nat
  - nf_nat_ipv4

after

modprobe nf_conntrack_ipv4

its above modprobe working

Something happend and after kmodloader was upgraded (patched), it works as needed. All needed modules are loaded as soon as they are needed.