@@ -27,11 +27,12 @@ enum alias_need {
2727};
2828
2929enum show_flags {
30- SHOW_DEPS = (1 << 1 ),
31- SHOW_MODULES = (1 << 2 ),
32- SHOW_FIRMWARE = (1 << 3 ),
33- SHOW_PREFIX = (1 << 4 ),
34- SHOW_BUILTIN = (1 << 5 ),
30+ SHOW_DEPS = (1 << 1 ),
31+ SHOW_MODULES = (1 << 2 ),
32+ SHOW_FIRMWARE = (1 << 3 ),
33+ SHOW_PREFIX = (1 << 4 ),
34+ SHOW_BUILTIN = (1 << 5 ),
35+ SHOW_MISSING_FIRMWARE = (1 << 6 ),
3536};
3637
3738static int show_tree = 0 ;
@@ -364,6 +365,9 @@ process_firmware(const char *firmware)
364365 break ;
365366 begin = end + 1 ;
366367 }
368+
369+ if (opts & SHOW_MISSING_FIRMWARE && !found )
370+ show_with_prefix (show_tree , "missing-firmware" , firmware );
367371}
368372
369373static int
@@ -385,7 +389,6 @@ __process_depends(struct kmod_ctx *ctx, const char *depends, const char *delim,
385389 return ret ;
386390}
387391
388-
389392static int
390393process_depends (struct kmod_ctx * ctx , const char * depends )
391394{
@@ -653,6 +656,7 @@ read_names(struct kmod_ctx *ctx, const char *file)
653656static const char cmdopts_s [] = "k:b:f:i:tDMFPBVh" ;
654657static const struct option cmdopts [] = {
655658 { "use-blacklist" , no_argument , 0 , 1 , },
659+ { "missing-firmware" , no_argument , 0 , 2 },
656660 { "tree" , no_argument , 0 , 't' },
657661 { "no-deps" , no_argument , 0 , 'D' },
658662 { "no-modules" , no_argument , 0 , 'M' },
@@ -687,7 +691,8 @@ print_help(const char *progname)
687691 " -b, --base-dir=DIR Use DIR as filesystem root for /lib/modules;\n"
688692 " -f, --firmware-dir=DIR Use DIR as colon-separated list of firmware directories\n"
689693 " (default: %s);\n"
690- " --use-blacklist Apply blacklist commands in the configuration files.\n"
694+ " --use-blacklist Apply blacklist commands in the configuration files;\n"
695+ " --missing-firmware Show firmware that could not be found;\n"
691696 " -i, --input=FILE Read names from FILE;\n"
692697 " -V, --version Show version of program and exit;\n"
693698 " -h, --help Show this text and exit.\n"
@@ -725,6 +730,9 @@ main(int argc, char **argv)
725730 case 1 :
726731 use_blacklist = 1 ;
727732 break ;
733+ case 2 :
734+ opts |= SHOW_MISSING_FIRMWARE ;
735+ break ;
728736 case 'D' :
729737 opts ^= SHOW_DEPS ;
730738 break ;
0 commit comments