[LTP] [PATCH 1/1] lib/tst_module.c: Replace "rmmod" with "modprobe -r"

Petr Vorel pvorel@suse.cz
Fri Nov 3 23:16:30 CET 2023


Hi Edward,

> Hi,



> On Fri, Nov 3, 2023 at 9:03 AM Petr Vorel <pvorel@suse.cz> wrote:

> > "modprobe -r" will remove also the dependencies loaded for kernel
> > modules.

> > Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  lib/tst_module.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > diff --git a/lib/tst_module.c b/lib/tst_module.c
> > index 9bd443623..e52bb6e00 100644
> > --- a/lib/tst_module.c
> > +++ b/lib/tst_module.c
> > @@ -105,7 +105,7 @@ void tst_module_unload_(void (cleanup_fn)(void), const char *mod_name)
> >  {
> >         int i, rc;

> > -       const char *const argv[] = { "rmmod", mod_name, NULL };
> > +       const char *const argv[] = { "modprobe", "-r", mod_name, NULL };

> >         rc = 1;
> >         for (i = 0; i < 50; i++) {
> > --
> > 2.42.0


> This is fine with all the supported versions of Android GKI.
> Reviewed-by: Edward Liaw <edliaw@google.com>

Thanks for confirmation. Although this patch will not be merged, we know we can
use 'modprobe -r'.

BTW is it ok for AOSP which uses latest LTP to rely on modules.builtin and
modules.dep? (there is #ifdef __ANDROID__ in tst_search_driver()).

Kind regards,
Petr


More information about the ltp mailing list