From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: Richard Palethorpe <rpalethorpe@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/4] lib: Add .modprobe
Date: Fri, 3 Nov 2023 16:54:09 +0100 [thread overview]
Message-ID: <20231103155409.GB1087887@pevik> (raw)
In-Reply-To: <ZUJ-N8ji_KdOOfyr@yuki>
> Hi!
> > > if (tst_test->mount_device)
> > > tst_test->format_device = 1;
> > > @@ -1362,6 +1402,19 @@ static void do_cleanup(void)
> > > tst_sys_conf_restore(0);
> > > + if (tst_test->modprobe) {
> > > + const char *name;
> > > + int i;
> > > +
> > > + for (i = 0; (name = tst_test->modprobe[i]); ++i) {
> > > + if (!modules_loaded[i])
> > > + continue;
> > > +
> > > + const char *const cmd_rmmod[] = {"rmmod", name, NULL};
> > modprobe -r please, rmmod has been deprecated for ages.
> And one more minor point, we should attempt to remove the module only if
> it has shown up in the /proc/modules.
+1
> Assuming that we want to skip the tst_module_is_buildin() check on some
> systems as Ritchie suggested we would attempt to remove build in modules
> here if we blindly trusted the return value from modpprobe.
I guess for most of distros tst_check_builtin_driver() (which reads
modules.builtin) makes sense. And with it we will have valid info if we should
remove module or not.
Then there is:
1) AOSP (Android), we should ask Edward what makes sense in Android.
IMHO old AOSP versions used insmod and rmmod, but newer could support it [2].
@Edward, am I correct? Also do AOSP even care about tests which use
tst_module_unload()?
2) NixOS
This should be IMHO fixed by checking also the correct directory (ideally
wrapped by some #ifdef, but can be even without it, if there is none).
BTW, there is also /proc/sys/kernel/modules_disabled [1], I'm not sure if we
want to just ignore it.
Kind regards,
Petr
[1] https://www.kernel.org/doc/Documentation/sysctl/kernel.txt
[2] https://source.android.com/docs/core/architecture/kernel/loadable-kernel-modules
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-11-03 15:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-13 7:47 [LTP] [PATCH 0/4] Add .modprobe (loading modules in C API) Petr Vorel
2023-10-13 7:47 ` [LTP] [PATCH 1/4] tst_kernel: Add safe_check_driver() Petr Vorel
2023-10-13 12:24 ` Petr Vorel
2023-10-13 7:47 ` [LTP] [PATCH 2/4] lib: Add .modprobe Petr Vorel
2023-10-13 12:09 ` Li Wang
2023-10-13 12:22 ` Petr Vorel
2023-10-16 9:05 ` Li Wang
2023-10-27 12:01 ` Petr Vorel
2023-11-01 16:33 ` Cyril Hrubis
2023-11-03 15:22 ` Petr Vorel
2023-10-13 12:30 ` Petr Vorel
2023-10-13 13:27 ` Li Wang
2023-10-13 13:50 ` Petr Vorel
2023-10-16 8:28 ` Li Wang
2023-11-01 16:26 ` Cyril Hrubis
2023-11-01 16:35 ` Cyril Hrubis
2023-11-03 15:54 ` Petr Vorel [this message]
2023-11-03 16:31 ` Edward Liaw via ltp
2023-11-03 12:12 ` Petr Vorel
2023-11-03 12:21 ` Cyril Hrubis
2023-11-03 14:58 ` Petr Vorel
2023-10-13 7:47 ` [LTP] [PATCH 3/4] madvise11: Replace .needs_drivers with .modprobe Petr Vorel
2023-10-13 7:47 ` [LTP] [PATCH 4/4] can_bcm01: Move vcan to .modprobe Petr Vorel
2023-11-02 9:22 ` Richard Palethorpe
2023-11-03 15:08 ` Petr Vorel
2023-10-16 7:47 ` [LTP] [PATCH 0/4] Add .modprobe (loading modules in C API) Richard Palethorpe
2023-10-16 8:41 ` Richard Palethorpe
2023-10-16 15:12 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231103155409.GB1087887@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.