[LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
Cyril Hrubis
chrubis@suse.cz
Tue Apr 7 11:43:04 CEST 2026
Hi!
> > - return -1;
> > +int tst_check_module_driver(const char *driver)
> > +{
> > + return tst_search_driver(driver, "modules.dep");
>
> Thinking about it twice, could we check for the module by reading
> /sys/module/? Our current approach shows what module *should* be available, but
> that might not be true for some reason (i.e. loadable module not installed).
The modules.dep file contains names of all modules installed in
particular kernel modules directory. We cannot do anything better than
parsing that file because it's (re)genrated on the system each time
packages with modules have been installed/removed. If that wasn't the
case modprobe that depends on that file wouldn't work either.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list