From: Emil Velikov Date: Fri, 13 Jun 2025 15:34:22 +0000 (+0100) Subject: tools/modprobe: properly deprecate --remove-dependencies X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9ecaf7e1fe3efff9c23594864923a3482cc975d;p=thirdparty%2Fkmod.git 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 Link: https://github.com/kmod-project/kmod/pull/353 Signed-off-by: Lucas De Marchi --- diff --git a/man/modprobe.8.scd b/man/modprobe.8.scd index 78ecbb73..62450b13 100644 --- a/man/modprobe.8.scd +++ b/man/modprobe.8.scd @@ -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 diff --git a/tools/modprobe.c b/tools/modprobe.c index f919253b..392978e7 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -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;