tools/modprobe: properly deprecate --remove-dependencies

The option was annotated as deprecated a while ago, although we never
flagged a warning when it is in use.

Do that, remove it from the --help screen and add an explicit "will be
removed" notice in the manual page.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/353
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This commit is contained in:
Emil Velikov 2025-06-13 16:34:22 +01:00 committed by Lucas De Marchi
parent d9778a6d9c
commit f9ecaf7e1f
2 changed files with 7 additions and 2 deletions

View File

@ -154,6 +154,9 @@ database.
This option causes *modprobe* to remove the mentioned module(s), alongside
other modules that depend on it/them - aka the reverse dependency list.
For compatibility reasons *--remove-dependencies* is also accepted for
this option but will be removed after kmod 36.
*-w* _TIMEOUT_MSEC_, *--wait* _TIMEOUT_MSEC_
This option causes *modprobe -r *to continue trying to remove a module
if it fails due to the module being busy, i.e. its refcount is not 0 at

View File

@ -51,7 +51,7 @@ static const struct option cmdopts[] = {
{ "all", no_argument, 0, 'a' },
{ "remove", no_argument, 0, 'r' },
{ "remove-dependencies", no_argument, 0, 5 },
{ "remove-dependencies", no_argument, 0, 7 },
{ "remove-holders", no_argument, 0, 5 },
{ "wait", required_argument, 0, 'w' },
@ -100,7 +100,6 @@ static void help(void)
"\t be a module name to be inserted\n"
"\t or removed (-r)\n"
"\t-r, --remove Remove modules instead of inserting\n"
"\t --remove-dependencies Deprecated: use --remove-holders\n"
"\t --remove-holders Also remove module holders (use together with -r)\n"
"\t-w, --wait MSEC When removing a module, wait up to MSEC for\n"
"\t module's refcount to become 0 so it can be\n"
@ -784,6 +783,9 @@ static int do_modprobe(int argc, char **orig_argv)
case 'r':
do_remove = 1;
break;
case 7:
WRN("--remove-dependencies is deprecated and scheduled for removal; use --remove-holders\n");
/* fall through */
case 5:
remove_holders = 1;
break;