]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/modprobe: standardize on --show-foo, deprecate the rest
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 30 May 2025 18:11:48 +0000 (19:11 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 13 Jun 2025 18:52:41 +0000 (13:52 -0500)
Currently we have a range of options which show specific details,
although they vary in prefix or spelling:
 - prefix: dump vs resolve vs show
 - with and without dash after show

Converge on --show-foo and deprecate the rest. The old options are still
accepted but will throw a warning. Only the (new) consistent names are
listed in --help, while the manual page lists both but spells out that
the old ones will be removed.

To avoid any confusion with --show (aka --dry-run) the option is also
soft-deprecated.

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 62450b134da7fd217ac62c2bde1875bae56a0767..065313a694dbe8b5fe3ba708210c99eb8ff0b922 100644 (file)
@@ -13,7 +13,7 @@ modprobe - Add and remove modules from the Linux Kernel
 
 *modprobe* [*-c*]
 
-*modprobe* [*--dump-modversions*] [_filename_]
+*modprobe* [*--show-modversions*] [_filename_]
 
 # DESCRIPTION
 
@@ -61,14 +61,20 @@ database.
        This option is passed through *install* or *remove* commands to other
        *modprobe* commands in the MODPROBE_OPTIONS environment variable.
 
-*-c*, *--showconfig*
-       Dump out the effective configuration from the config directory and exit.
+*-c*, *--show-config*
+       Print out the effective configuration from the config directory and exit.
 
-*--dump-modversions*
+       For compatibility reasons *--showconfig* is also accepted for this option
+       but will be removed after kmod 36.
+
+*--show-modversions*
        Print out a list of module versioning information required by a module.
        This option is commonly used by distributions in order to package up a
        Linux kernel module using module versioning deps.
 
+       For compatibility reasons *--dump-modversions* is also accepted for this
+       option but will be removed after kmod 36.
+
 *-d*, *--dirname*
        Root directory for modules, / by default.
 
@@ -122,11 +128,13 @@ database.
        the request was more specifically made with only one or other (and not
        both) of *--ignore-install* or *--ignore-remove*. See *modprobe.d*(5).
 
-*-n*, *--dry-run*, *--show*
+*-n*, *--dry-run*
        This option does everything but actually insert or delete the modules
        (or run the install or remove commands). Combined with *-v*, it is
-       useful for debugging problems. For historical reasons both *--dry-run*
-       and *--show* actually mean the same thing and are interchangeable.
+       useful for debugging problems.
+
+       For compatibility reasons *--show* is also accepted for this option but
+       will be removed after kmod 36.
 
 *-q*, *--quiet*
        With this flag, *modprobe* won't print an error message if you try to
@@ -135,10 +143,13 @@ database.
        exit status. The kernel uses this to opportunistically probe for modules
        which might exist using request_module.
 
-*-R*, *--resolve-alias*
+*-R*, *--show-alias*
        Print all module names matching an alias. This can be useful for
        debugging module alias problems.
 
+       For compatibility reasons *--resolve-alias* is also accepted for this
+       option but will be removed after kmod 36.
+
 ***-r*, *--remove*
        This option causes *modprobe* to remove rather than insert a module. If
        the modules it depends on are also unused, *modprobe* will try to remove
index 392978e7177067a13d4bac3e82503c1a0e310e76..fe5db66d348191de09ea4efe87e110248dcb5dc6 100644 (file)
@@ -55,7 +55,8 @@ static const struct option cmdopts[] = {
        { "remove-holders", no_argument, 0, 5 },
        { "wait", required_argument, 0, 'w' },
 
-       { "resolve-alias", no_argument, 0, 'R' },
+       { "resolve-alias", no_argument, 0, 8 },
+       { "show-alias", no_argument, 0, 'R' },
        { "first-time", no_argument, 0, 3 },
        { "ignore-install", no_argument, 0, 'i' },
        { "ignore-remove", no_argument, 0, 'i' },
@@ -65,14 +66,14 @@ static const struct option cmdopts[] = {
        { "force-vermagic", no_argument, 0, 1 },
 
        { "show-depends", no_argument, 0, 'D' },
-       { "showconfig", no_argument, 0, 'c' },
+       { "showconfig", no_argument, 0, 9 },
        { "show-config", no_argument, 0, 'c' },
        { "show-modversions", no_argument, 0, 4 },
-       { "dump-modversions", no_argument, 0, 4 },
+       { "dump-modversions", no_argument, 0, 10 },
        { "show-exports", no_argument, 0, 6 },
 
        { "dry-run", no_argument, 0, 'n' },
-       { "show", no_argument, 0, 'n' },
+       { "show", no_argument, 0, 11 },
 
        { "config", required_argument, 0, 'C' },
        { "dirname", required_argument, 0, 'd' },
@@ -94,7 +95,7 @@ static void help(void)
               "\t%s [options] -r [-i] modulename\n"
               "\t%s [options] -r -a [-i] modulename [modulename...]\n"
               "\t%s [options] -c\n"
-              "\t%s [options] --dump-modversions filename\n"
+              "\t%s [options] --show-modversions filename\n"
               "Management Options:\n"
               "\t-a, --all                   Consider every non-argument to\n"
               "\t                            be a module name to be inserted\n"
@@ -115,17 +116,14 @@ static void help(void)
               "\t    --force-vermagic        Ignore module's version magic\n"
               "\n"
               "Query Options:\n"
-              "\t-R, --resolve-alias         Only lookup and print alias and exit\n"
-              "\t-D, --show-depends          Only print module dependencies and exit\n"
-              "\t-c, --showconfig            Print out known configuration and exit\n"
-              "\t-c, --show-config           Same as --showconfig\n"
-              "\t    --show-modversions      Dump module symbol version and exit\n"
-              "\t    --dump-modversions      Same as --show-modversions\n"
-              "\t    --show-exports          Only print module exported symbol versions and exit\n"
+              "\t-R, --show-alias            Print module(s) matching given alias and exit\n"
+              "\t-D, --show-depends          Print module dependencies and exit\n"
+              "\t-c, --show-config           Print known configuration and exit\n"
+              "\t    --show-modversions      Print module symbol version and exit\n"
+              "\t    --show-exports          Print module exported symbol versions and exit\n"
               "\n"
               "General Options:\n"
               "\t-n, --dry-run               Do not execute operations, just print out\n"
-              "\t-n, --show                  Same as --dry-run\n"
 
               "\t-C, --config FILE           Use FILE instead of default search paths\n"
               "\t-d, --dirname DIR           Use DIR as filesystem root for " MODULE_DIRECTORY
@@ -823,18 +821,30 @@ static int do_modprobe(int argc, char **orig_argv)
                        dry_run = 1;
                        do_show = 1;
                        break;
+               case 8:
+                       WRN("--resolve-alias is deprecated and scheduled for removal; use --show-alias\n");
+                       /* fall through */
                case 'R':
                        lookup_only = 1;
                        break;
+               case 9:
+                       WRN("--showconfig is deprecated and scheduled for removal; use --show-config\n");
+                       /* fall through */
                case 'c':
                        do_show_config = 1;
                        break;
+               case 10:
+                       WRN("--dump-modversions is deprecated and scheduled for removal; use --show-modversions\n");
+                       /* fall through */
                case 4:
                        do_show_modversions = 1;
                        break;
                case 6:
                        do_show_exports = 1;
                        break;
+               case 11:
+                       WRN("--show is deprecated and scheduled for removal; use --dry-run\n");
+                       /* fall through */
                case 'n':
                        dry_run = 1;
                        break;