]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/modprobe: properly deprecate --remove-dependencies
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 13 Jun 2025 15:34:22 +0000 (16:34 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 13 Jun 2025 18:52:41 +0000 (13:52 -0500)
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>
man/modprobe.8.scd
tools/modprobe.c

index 78ecbb733879223b224c9b9d9bd8ecae19f7b8aa..62450b134da7fd217ac62c2bde1875bae56a0767 100644 (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
index f919253bb4c8e5eed9a11e16af8a01208ae90c33..392978e7177067a13d4bac3e82503c1a0e310e76 100644 (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;