i have installed freebsd13, iwm_load is not in my loader.conf ,i compile a custom kernel without iwm module,when i restart i found that the iwm module has been loaded automatically.why? what's wrong?
This is because of devmatch(8) is taking effect. If you don't like this behavior, try putting devmatch_enable="NO" to /etc/rc.conf . BTW, it's recommended to use mailing list to ask questions, for example, https://lists.freebsd.org/mailman/listinfo/freebsd-questions
(In reply to Li-Wen Hsu from comment #1) that sounds like a big Hammer, when a smaller one is available in the form of the undocumented devmatch_blacklist="iwm.ko"
(In reply to Mina Galić from comment #2) Thanks for the tip. It's documented in rc.conf(5)
(In reply to Mina Galić from comment #2) There's also iwm_load="NO". Isn't there?
(In reply to Chris Hutchinson from comment #4) that's for loader.conf, and it's the default anyway, and it doesn't prevent devmatch from loading it. devmatch_blacklist="iwm.ko" should, and if it doesn't, that's a bug that needs to be addressed your next workaround then would be to rename or remove the module and rerun service kldxref.