regex in sys_module load guard too broad
lsmod | grep #{module_name}
will match if the module name is contained as a substring of another loaded module and the module will not be loaded.
Eg. msr
and intel_rapl_msr
.
"grep '^#{module_name} ' /proc/modules"
seems to be a better solution.