diff --git a/man/depmod.8.scd b/man/depmod.8.scd index 7d2b3197..b7021f12 100644 --- a/man/depmod.8.scd +++ b/man/depmod.8.scd @@ -12,6 +12,8 @@ depmod - Generate modules.dep and map files. *depmod* [*-e*] [*-E* _Module.symvers_] [*-F* _System.map_] [*-n*] [*-v*] [*-P* _prefix_] \ \ \ \ \ \ \ \[*-w*] [_version_] [_filename_...] +*depmod* *-M* + # DESCRIPTION Linux kernel modules can provide services (called "symbols") for other modules @@ -80,6 +82,10 @@ rather than the current kernel version (as returned by *uname -r*). _/tmp/build/kernel-modules/$(uname -r)_ and generates index files under that same directory. +*-M* +*--moduledir-defualt* + Print the moduledir prefix @MODULE_DIRECTORY@ set at compile time. + *-o* _outdir_ *--outdir* _outdir_ Set the output directory where *depmod* will store any generated file. diff --git a/tools/depmod.c b/tools/depmod.c index 91bd1911..7e2c2348 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -50,12 +50,13 @@ static const char *const default_cfg_paths[] = { // clang-format on }; -static const char cmdopts_s[] = "aAb:m:o:C:E:F:evnP:wVh"; +static const char cmdopts_s[] = "aAb:m:Mo:C:E:F:evnP:wVh"; static const struct option cmdopts[] = { { "all", no_argument, 0, 'a' }, { "quick", no_argument, 0, 'A' }, { "basedir", required_argument, 0, 'b' }, { "moduledir", required_argument, 0, 'm' }, + { "moduledir-default", no_argument, 0, 'M' }, { "outdir", required_argument, 0, 'o' }, { "config", required_argument, 0, 'C' }, { "symvers", required_argument, 0, 'E' }, @@ -96,6 +97,7 @@ static void help(void) "\t-b, --basedir=DIR Root path (default: /).\n" "\t-m, --moduledir=DIR Module directory (default: " MODULE_DIRECTORY ").\n" + "\t-M, --moduledir-default Print MODULE_DIRECTORY default value.\n" "\t-o, --outdir=DIR Output root path (default: same as ).\n" "\t-F, --filesyms=FILE Use the file instead of the\n" "\t current kernel symbols.\n" @@ -2932,6 +2934,9 @@ static int do_depmod(int argc, char *argv[]) case 'm': module_directory = optarg; break; + case 'M': + puts(MODULE_DIRECTORY); + return EXIT_SUCCESS; case 'o': free(out_root); out_root = path_make_absolute_cwd(optarg);