diff options
author | Tom Gundersen <teg@jklm.no> | 2013-09-09 20:01:01 +0200 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2013-09-10 00:49:41 -0300 |
commit | 6506ddf5a37849049509324eeff72697f94584e3 (patch) | |
tree | ba2f3373c2a22b8307296ae73ff2c20fc8b4b2cf | |
parent | 4c2dc16a2ef46cf139f505379927a68fdb798ce9 (diff) | |
download | kmod-6506ddf5a37849049509324eeff72697f94584e3.tar.gz |
depmod: warn on invalid devname specification
During the last merge window (3.12) a couple of modules gained devname
aliases, but without the necessary major and minor information. These were
then silently ignored when generating modules.devname.
Complain loudly to avoid such errors sneaking in undetected in the future:
depmod: ERROR: Module 'zram' has devname (zram) but lacks major and minor information. Ignoring.
depmod: ERROR: Module 'uhid' has devname (uhid) but lacks major and minor information. Ignoring.
Cc: Kay Sievers <kay@vrfy.org>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
-rw-r--r-- | tools/depmod.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/depmod.c b/tools/depmod.c index 58f0f58..b1b5874 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -2112,11 +2112,18 @@ static int output_devname(struct depmod *depmod, FILE *out) minor = min; } - if (type != '\0' && devname != NULL) { + if (type != '\0' && devname != NULL) + break; + } + + if (devname != NULL) { + if (type != '\0') fprintf(out, "%s %s %c%u:%u\n", mod->modname, devname, type, major, minor); - break; - } + else + ERR("Module '%s' has devname (%s) but " + "lacks major and minor information. " + "Ignoring.\n", mod->modname, devname); } } |