I have an embedded Linux device (Ubiquiti EdgeRouter-X, see this thread for more detail) for which I cross-compiled the kernel module nf_conntrack.ko
(part of netfilter
) to support a protocol that was not built into the inbox module. This module is loaded and being used as soon as the device becomes accessible over SSH. The OS is debian-based, FWIW.
I want to try out this version of the module, but it could be faulty and crash the kernel (happened in another module I compiled at the same time). If I could reload at runtime, then a crash would merely result in a reboot, which is fine. But I can't find a way to load a different version side-by-side with the running module.
Or else, I'd have to unload the running module, and load the new one, but I'm just unable to do that with rmmod
or modprobe -r
or even rmmod -f
. I've checked multiple questions like this and none of the subtle variants helped.
But if I modify the boot configuration to load this module and reboot to test it, I'm scared that it might be stuck in a bootloop. The device does not have a physical console port so it really does need to boot up fully.
Is there a way to set the OS to load a module only once, and skip if it doesn't work, or else load the known-working version? Any way I can avoid saving a risky boot configuration to disk but still find out if the module can be loaded?