blob: fcfcb302b0d74d68c81a1ec5a7bd5ece704e9b47 [file] [log] [blame]
Steven Rostedtdcc60242009-04-29 22:52:21 -04001#!/usr/bin/perl -w
2#
Uwe Kleine-Königcce1dac2011-01-24 21:12:01 +01003# Copyright 2005-2009 - Steven Rostedt
Steven Rostedtdcc60242009-04-29 22:52:21 -04004# Licensed under the terms of the GNU GPL License version 2
5#
6# It's simple enough to figure out how this works.
7# If not, then you can ask me at stripconfig@goodmis.org
8#
9# What it does?
10#
11# If you have installed a Linux kernel from a distribution
12# that turns on way too many modules than you need, and
13# you only want the modules you use, then this program
14# is perfect for you.
15#
16# It gives you the ability to turn off all the modules that are
17# not loaded on your system.
18#
19# Howto:
20#
21# 1. Boot up the kernel that you want to stream line the config on.
22# 2. Change directory to the directory holding the source of the
23# kernel that you just booted.
24# 3. Copy the configuraton file to this directory as .config
25# 4. Have all your devices that you need modules for connected and
26# operational (make sure that their corresponding modules are loaded)
27# 5. Run this script redirecting the output to some other file
28# like config_strip.
29# 6. Back up your old config (if you want too).
30# 7. copy the config_strip file to .config
31# 8. Run "make oldconfig"
32#
33# Now your kernel is ready to be built with only the modules that
34# are loaded.
35#
36# Here's what I did with my Debian distribution.
37#
38# cd /usr/src/linux-2.6.10
39# cp /boot/config-2.6.10-1-686-smp .config
40# ~/bin/streamline_config > config_strip
41# mv .config config_sav
42# mv config_strip .config
43# make oldconfig
44#
hiromucf5a1892010-08-17 19:49:18 +090045use strict;
Arnaud Lacombe22d550a2011-07-20 00:40:09 -040046use Getopt::Long;
hiromucf5a1892010-08-17 19:49:18 +090047
Steven Rostedtdcc60242009-04-29 22:52:21 -040048my $config = ".config";
Steven Rostedtdcc60242009-04-29 22:52:21 -040049
Steven Rostedtcdfc4792009-04-30 14:39:48 -040050my $uname = `uname -r`;
51chomp $uname;
52
53my @searchconfigs = (
54 {
Steven Rostedta9024832009-05-07 11:01:34 -040055 "file" => ".config",
56 "exec" => "cat",
57 },
58 {
Steven Rostedtcdfc4792009-04-30 14:39:48 -040059 "file" => "/proc/config.gz",
60 "exec" => "zcat",
61 },
62 {
Steven Rostedt810b2be2009-04-30 19:30:04 -040063 "file" => "/boot/config-$uname",
64 "exec" => "cat",
65 },
66 {
Steven Rostedtcdfc4792009-04-30 14:39:48 -040067 "file" => "/boot/vmlinuz-$uname",
68 "exec" => "scripts/extract-ikconfig",
69 "test" => "scripts/extract-ikconfig",
70 },
71 {
72 "file" => "vmlinux",
73 "exec" => "scripts/extract-ikconfig",
74 "test" => "scripts/extract-ikconfig",
75 },
76 {
77 "file" => "/lib/modules/$uname/kernel/kernel/configs.ko",
78 "exec" => "scripts/extract-ikconfig",
79 "test" => "scripts/extract-ikconfig",
80 },
81 {
82 "file" => "kernel/configs.ko",
83 "exec" => "scripts/extract-ikconfig",
84 "test" => "scripts/extract-ikconfig",
85 },
86 {
87 "file" => "kernel/configs.o",
88 "exec" => "scripts/extract-ikconfig",
89 "test" => "scripts/extract-ikconfig",
90 },
Steven Rostedtcdfc4792009-04-30 14:39:48 -040091);
92
93sub find_config {
94 foreach my $conf (@searchconfigs) {
95 my $file = $conf->{"file"};
96
97 next if ( ! -f "$file");
98
99 if (defined($conf->{"test"})) {
100 `$conf->{"test"} $conf->{"file"} 2>/dev/null`;
101 next if ($?);
102 }
103
104 my $exec = $conf->{"exec"};
105
106 print STDERR "using config: '$file'\n";
107
108 open(CIN, "$exec $file |") || die "Failed to run $exec $file";
109 return;
110 }
111 die "No config file found";
112}
113
114find_config;
115
Steven Rostedt4f4c51c2012-06-18 21:43:53 -0400116# Read in the entire config file into config_file
117my @config_file = <CIN>;
118close CIN;
119
Arnaud Lacombe22d550a2011-07-20 00:40:09 -0400120# Parse options
121my $localmodconfig = 0;
122my $localyesconfig = 0;
123
124GetOptions("localmodconfig" => \$localmodconfig,
125 "localyesconfig" => \$localyesconfig);
126
Steven Rostedt463bf902009-11-20 09:21:12 -0500127# Get the build source and top level Kconfig file (passed in)
128my $ksource = $ARGV[0];
129my $kconfig = $ARGV[1];
Arnaud Lacombef597a712011-07-01 17:45:31 -0400130my $lsmod_file = $ENV{'LSMOD'};
Steven Rostedt463bf902009-11-20 09:21:12 -0500131
Toralf Förster17431922010-05-26 20:22:02 +0200132my @makefiles = `find $ksource -name Makefile 2>/dev/null`;
133chomp @makefiles;
134
Steven Rostedtdcc60242009-04-29 22:52:21 -0400135my %depends;
136my %selects;
137my %prompts;
138my %objects;
139my $var;
Steven Rostedt13d7e932010-01-06 17:56:12 -0500140my $iflevel = 0;
141my @ifdeps;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400142
Steven Rostedtdcc60242009-04-29 22:52:21 -0400143# prevent recursion
144my %read_kconfigs;
145
146sub read_kconfig {
147 my ($kconfig) = @_;
148
149 my $state = "NONE";
150 my $config;
151 my @kconfigs;
152
Steven Rostedt20d19042010-10-28 22:13:51 -0400153 my $cont = 0;
154 my $line;
155
Steven Rostedt49089802010-10-29 00:56:46 -0400156 my $source = "$ksource/$kconfig";
157 my $last_source = "";
158
159 # Check for any environment variables used
160 while ($source =~ /\$(\w+)/ && $last_source ne $source) {
161 my $env = $1;
162 $last_source = $source;
163 $source =~ s/\$$env/$ENV{$env}/;
164 }
165
166 open(KIN, "$source") || die "Can't open $kconfig";
Steven Rostedtdcc60242009-04-29 22:52:21 -0400167 while (<KIN>) {
168 chomp;
169
Steven Rostedt20d19042010-10-28 22:13:51 -0400170 # Make sure that lines ending with \ continue
171 if ($cont) {
172 $_ = $line . " " . $_;
173 }
174
175 if (s/\\$//) {
176 $cont = 1;
177 $line = $_;
178 next;
179 }
180
181 $cont = 0;
182
Steven Rostedtdcc60242009-04-29 22:52:21 -0400183 # collect any Kconfig sources
184 if (/^source\s*"(.*)"/) {
185 $kconfigs[$#kconfigs+1] = $1;
186 }
187
188 # configs found
Steven Rostedt8ef17fa2010-10-28 22:21:57 -0400189 if (/^\s*(menu)?config\s+(\S+)\s*$/) {
Steven Rostedtdcc60242009-04-29 22:52:21 -0400190 $state = "NEW";
Steven Rostedt8ef17fa2010-10-28 22:21:57 -0400191 $config = $2;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400192
Steven Rostedt0b58a992012-06-18 14:09:22 -0400193 # Add depends for 'if' nesting
Steven Rostedt13d7e932010-01-06 17:56:12 -0500194 for (my $i = 0; $i < $iflevel; $i++) {
195 if ($i) {
196 $depends{$config} .= " " . $ifdeps[$i];
197 } else {
198 $depends{$config} = $ifdeps[$i];
199 }
200 $state = "DEP";
201 }
202
Steven Rostedtdcc60242009-04-29 22:52:21 -0400203 # collect the depends for the config
204 } elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) {
205 $state = "DEP";
206 $depends{$config} = $1;
207 } elsif ($state eq "DEP" && /^\s*depends\s+on\s+(.*)$/) {
208 $depends{$config} .= " " . $1;
209
210 # Get the configs that select this config
211 } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {
Steven Rostedt0b58a992012-06-18 14:09:22 -0400212 my $conf = $1;
213 if (defined($selects{$conf})) {
214 $selects{$conf} .= " " . $config;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400215 } else {
Steven Rostedt0b58a992012-06-18 14:09:22 -0400216 $selects{$conf} = $config;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400217 }
218
219 # configs without prompts must be selected
220 } elsif ($state ne "NONE" && /^\s*tristate\s\S/) {
221 # note if the config has a prompt
hiromu yaguraccece602010-08-15 13:13:17 +0900222 $prompts{$config} = 1;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400223
Steven Rostedt13d7e932010-01-06 17:56:12 -0500224 # Check for if statements
225 } elsif (/^if\s+(.*\S)\s*$/) {
226 my $deps = $1;
227 # remove beginning and ending non text
228 $deps =~ s/^[^a-zA-Z0-9_]*//;
229 $deps =~ s/[^a-zA-Z0-9_]*$//;
230
231 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
232
233 $ifdeps[$iflevel++] = join ':', @deps;
234
235 } elsif (/^endif/) {
236
237 $iflevel-- if ($iflevel);
238
Steven Rostedtdcc60242009-04-29 22:52:21 -0400239 # stop on "help"
240 } elsif (/^\s*help\s*$/) {
241 $state = "NONE";
242 }
243 }
244 close(KIN);
245
246 # read in any configs that were found.
247 foreach $kconfig (@kconfigs) {
248 if (!defined($read_kconfigs{$kconfig})) {
249 $read_kconfigs{$kconfig} = 1;
250 read_kconfig($kconfig);
251 }
252 }
253}
254
255if ($kconfig) {
256 read_kconfig($kconfig);
257}
258
Steven Rostedt0b58a992012-06-18 14:09:22 -0400259# Makefiles can use variables to define their dependencies
Steven Rostedt364212f2012-01-13 17:53:40 -0500260sub convert_vars {
261 my ($line, %vars) = @_;
262
263 my $process = "";
264
265 while ($line =~ s/^(.*?)(\$\((.*?)\))//) {
266 my $start = $1;
267 my $variable = $2;
268 my $var = $3;
269
270 if (defined($vars{$var})) {
271 $process .= $start . $vars{$var};
272 } else {
273 $process .= $start . $variable;
274 }
275 }
276
277 $process .= $line;
278
279 return $process;
280}
281
Steven Rostedtdcc60242009-04-29 22:52:21 -0400282# Read all Makefiles to map the configs to the objects
283foreach my $makefile (@makefiles) {
Steven Rostedtdcc60242009-04-29 22:52:21 -0400284
Steven Rostedtd060d962012-01-13 17:50:39 -0500285 my $line = "";
Steven Rostedt364212f2012-01-13 17:53:40 -0500286 my %make_vars;
Steven Rostedt20d19042010-10-28 22:13:51 -0400287
Steven Rostedtdcc60242009-04-29 22:52:21 -0400288 open(MIN,$makefile) || die "Can't open $makefile";
289 while (<MIN>) {
Steven Rostedtd060d962012-01-13 17:50:39 -0500290 # if this line ends with a backslash, continue
291 chomp;
292 if (/^(.*)\\$/) {
293 $line .= $1;
294 next;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400295 }
Steven Rostedtd060d962012-01-13 17:50:39 -0500296
297 $line .= $_;
298 $_ = $line;
299 $line = "";
300
301 my $objs;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400302
Steven Rostedt0b58a992012-06-18 14:09:22 -0400303 # Convert variables in a line (could define configs)
Steven Rostedt364212f2012-01-13 17:53:40 -0500304 $_ = convert_vars($_, %make_vars);
305
Steven Rostedtdcc60242009-04-29 22:52:21 -0400306 # collect objects after obj-$(CONFIG_FOO_BAR)
307 if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
308 $var = $1;
309 $objs = $2;
Steven Rostedt364212f2012-01-13 17:53:40 -0500310
311 # check if variables are set
312 } elsif (/^\s*(\S+)\s*[:]?=\s*(.*\S)/) {
313 $make_vars{$1} = $2;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400314 }
315 if (defined($objs)) {
Steven Rostedtdcc60242009-04-29 22:52:21 -0400316 foreach my $obj (split /\s+/,$objs) {
317 $obj =~ s/-/_/g;
318 if ($obj =~ /(.*)\.o$/) {
Toralf Foerster1d1d1fe2010-05-28 10:25:52 +0200319 # Objects may be enabled by more than one config.
Steven Rostedtdcc60242009-04-29 22:52:21 -0400320 # Store configs in an array.
321 my @arr;
322
323 if (defined($objects{$1})) {
324 @arr = @{$objects{$1}};
325 }
326
327 $arr[$#arr+1] = $var;
328
329 # The objects have a hash mapping to a reference
330 # of an array of configs.
331 $objects{$1} = \@arr;
332 }
333 }
334 }
335 }
336 close(MIN);
337}
338
339my %modules;
340
Steven Rostedt615f0832010-02-02 21:51:27 -0500341if (defined($lsmod_file)) {
342 if ( ! -f $lsmod_file) {
Arnaud Lacombef597a712011-07-01 17:45:31 -0400343 if ( -f $ENV{'objtree'}."/".$lsmod_file) {
344 $lsmod_file = $ENV{'objtree'}."/".$lsmod_file;
345 } else {
346 die "$lsmod_file not found";
347 }
Steven Rostedt88f66ea2010-01-06 18:49:44 -0500348 }
Steven Rostedt615f0832010-02-02 21:51:27 -0500349 if ( -x $lsmod_file) {
350 # the file is executable, run it
351 open(LIN, "$lsmod_file|");
352 } else {
353 # Just read the contents
354 open(LIN, "$lsmod_file");
355 }
356} else {
357
358 # see what modules are loaded on this system
359 my $lsmod;
360
hiromucf5a1892010-08-17 19:49:18 +0900361 foreach my $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) {
Steven Rostedt615f0832010-02-02 21:51:27 -0500362 if ( -x "$dir/lsmod" ) {
363 $lsmod = "$dir/lsmod";
364 last;
365 }
Steven Rostedt88f66ea2010-01-06 18:49:44 -0500366}
Steven Rostedt615f0832010-02-02 21:51:27 -0500367 if (!defined($lsmod)) {
368 # try just the path
369 $lsmod = "lsmod";
370 }
371
372 open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod";
Steven Rostedt88f66ea2010-01-06 18:49:44 -0500373}
374
Steven Rostedtdcc60242009-04-29 22:52:21 -0400375while (<LIN>) {
376 next if (/^Module/); # Skip the first line.
377 if (/^(\S+)/) {
378 $modules{$1} = 1;
379 }
380}
381close (LIN);
382
383# add to the configs hash all configs that are needed to enable
Steven Rostedt0b58a992012-06-18 14:09:22 -0400384# a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o
385# where we know we need bar.o so we add FOO to the list.
Steven Rostedtdcc60242009-04-29 22:52:21 -0400386my %configs;
387foreach my $module (keys(%modules)) {
388 if (defined($objects{$module})) {
Toralf Foerstere5199ed2010-05-28 10:24:59 +0200389 my @arr = @{$objects{$module}};
Steven Rostedtdcc60242009-04-29 22:52:21 -0400390 foreach my $conf (@arr) {
391 $configs{$conf} = $module;
392 }
393 } else {
394 # Most likely, someone has a custom (binary?) module loaded.
395 print STDERR "$module config not found!!\n";
396 }
397}
398
Steven Rostedt4f4c51c2012-06-18 21:43:53 -0400399# Read the current config, and see what is enabled. We want to
400# ignore configs that we would not enable anyway.
401
402my %orig_configs;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400403my $valid = "A-Za-z_0-9";
Steven Rostedt4f4c51c2012-06-18 21:43:53 -0400404
405foreach my $line (@config_file) {
406 $_ = $line;
407
408 if (/(CONFIG_[$valid]*)=(m|y)/) {
409 $orig_configs{$1} = $2;
410 }
411}
412
Steven Rostedtdcc60242009-04-29 22:52:21 -0400413my $repeat = 1;
414
415#
416# Note, we do not care about operands (like: &&, ||, !) we want to add any
417# config that is in the depend list of another config. This script does
418# not enable configs that are not already enabled. If we come across a
419# config A that depends on !B, we can still add B to the list of depends
420# to keep on. If A was on in the original config, B would not have been
421# and B would not be turned on by this script.
422#
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400423sub parse_config_depends
Steven Rostedtdcc60242009-04-29 22:52:21 -0400424{
425 my ($p) = @_;
426
427 while ($p =~ /[$valid]/) {
428
429 if ($p =~ /^[^$valid]*([$valid]+)/) {
430 my $conf = "CONFIG_" . $1;
431
432 $p =~ s/^[^$valid]*[$valid]+//;
433
Steven Rostedt4f4c51c2012-06-18 21:43:53 -0400434 # We only need to process if the depend config is a module
435 if (!defined($orig_configs{$conf}) || !$orig_configs{conf} eq "m") {
436 next;
437 }
438
Steven Rostedtdcc60242009-04-29 22:52:21 -0400439 if (!defined($configs{$conf})) {
440 # We must make sure that this config has its
441 # dependencies met.
442 $repeat = 1; # do again
443 $configs{$conf} = 1;
444 }
445 } else {
446 die "this should never happen";
447 }
448 }
449}
450
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400451# Select is treated a bit differently than depends. We call this
452# when a config has no prompt and requires another config to be
453# selected. We use to just select all configs that selected this
454# config, but found that that can balloon into enabling hundreds
455# of configs that we do not care about.
456#
457# The idea is we look at all the configs that select it. If one
458# is already in our list of configs to enable, then there's nothing
459# else to do. If there isn't, we pick the first config that was
460# enabled in the orignal config and use that.
461sub parse_config_selects
462{
463 my ($config, $p) = @_;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400464
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400465 my $next_config;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400466
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400467 while ($p =~ /[$valid]/) {
468
469 if ($p =~ /^[^$valid]*([$valid]+)/) {
470 my $conf = "CONFIG_" . $1;
471
472 $p =~ s/^[^$valid]*[$valid]+//;
473
474 # Make sure that this config exists in the current .config file
475 if (!defined($orig_configs{$conf})) {
476 next;
477 }
478
479 # Check if something other than a module selects this config
480 if (defined($orig_configs{$conf}) && $orig_configs{$conf} ne "m") {
481 # we are good with this
482 return;
483 }
484 if (defined($configs{$conf})) {
485 # A set config selects this config, we are good
486 return;
487 }
488 # Set this config to be selected
489 if (!defined($next_config)) {
490 $next_config = $conf;
491 }
492 } else {
493 die "this should never happen";
Steven Rostedtdcc60242009-04-29 22:52:21 -0400494 }
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400495 }
Steven Rostedtdcc60242009-04-29 22:52:21 -0400496
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400497 # If no possible config selected this, then something happened.
498 if (!defined($next_config)) {
499 print STDERR "WARNING: $config is required, but nothing in the\n";
500 print STDERR " current config selects it.\n";
501 return;
502 }
503
504 # If we are here, then we found no config that is set and
505 # selects this config. Repeat.
506 $repeat = 1;
507 # Make this config need to be selected
508 $configs{$next_config} = 1;
509}
510
511my %process_selects;
512
513# loop through all configs, select their dependencies.
514sub loop_depend {
515 $repeat = 1;
516
517 while ($repeat) {
518 $repeat = 0;
519
520 forloop:
521 foreach my $config (keys %configs) {
522
523 # If this config is not a module, we do not need to process it
524 if (defined($orig_configs{$config}) && $orig_configs{$config} ne "m") {
525 next forloop;
526 }
527
528 $config =~ s/^CONFIG_//;
529
530 if (defined($depends{$config})) {
531 # This config has dependencies. Make sure they are also included
532 parse_config_depends $depends{$config};
533 }
534
535 # If the config has no prompt, then we need to check if a config
536 # that is enabled selected it. Or if we need to enable one.
537 if (!defined($prompts{$config}) && defined($selects{$config})) {
538 $process_selects{$config} = 1;
539 }
Steven Rostedtdcc60242009-04-29 22:52:21 -0400540 }
Steven Rostedtdcc60242009-04-29 22:52:21 -0400541 }
542}
543
Steven Rostedtd4bb58b2012-06-18 22:22:33 -0400544sub loop_select {
545
546 foreach my $config (keys %process_selects) {
547 $config =~ s/^CONFIG_//;
548
549 # config has no prompt and must be selected.
550 parse_config_selects $config, $selects{$config};
551 }
552}
553
554while ($repeat) {
555 # Get the first set of configs and their dependencies.
556 loop_depend;
557
558 $repeat = 0;
559
560 # Now we need to see if we have to check selects;
561 loop_select;
562}
563
Steven Rostedtdcc60242009-04-29 22:52:21 -0400564my %setconfigs;
565
566# Finally, read the .config file and turn off any module enabled that
567# we could not find a reason to keep enabled.
Steven Rostedt4f4c51c2012-06-18 21:43:53 -0400568foreach my $line (@config_file) {
569 $_ = $line;
Steven Rostedt744ffcb2009-04-30 12:15:10 -0400570
571 if (/CONFIG_IKCONFIG/) {
572 if (/# CONFIG_IKCONFIG is not set/) {
573 # enable IKCONFIG at least as a module
574 print "CONFIG_IKCONFIG=m\n";
575 # don't ask about PROC
Steven Rostedtd08ca272009-04-30 19:24:00 -0400576 print "# CONFIG_IKCONFIG_PROC is not set\n";
Steven Rostedtdcc60242009-04-29 22:52:21 -0400577 } else {
Steven Rostedt744ffcb2009-04-30 12:15:10 -0400578 print;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400579 }
Steven Rostedt744ffcb2009-04-30 12:15:10 -0400580 next;
581 }
582
583 if (/^(CONFIG.*)=(m|y)/) {
584 if (defined($configs{$1})) {
Arnaud Lacombe22d550a2011-07-20 00:40:09 -0400585 if ($localyesconfig) {
586 $setconfigs{$1} = 'y';
587 } else {
588 $setconfigs{$1} = $2;
589 }
Steven Rostedt744ffcb2009-04-30 12:15:10 -0400590 } elsif ($2 eq "m") {
591 print "# $1 is not set\n";
Steven Rostedtd08ca272009-04-30 19:24:00 -0400592 next;
Steven Rostedt744ffcb2009-04-30 12:15:10 -0400593 }
Steven Rostedt744ffcb2009-04-30 12:15:10 -0400594 }
Steven Rostedtd08ca272009-04-30 19:24:00 -0400595 print;
Steven Rostedtdcc60242009-04-29 22:52:21 -0400596}
Steven Rostedtdcc60242009-04-29 22:52:21 -0400597
598# Integrity check, make sure all modules that we want enabled do
599# indeed have their configs set.
600loop:
601foreach my $module (keys(%modules)) {
602 if (defined($objects{$module})) {
603 my @arr = @{$objects{$module}};
604 foreach my $conf (@arr) {
605 if (defined($setconfigs{$conf})) {
606 next loop;
607 }
608 }
609 print STDERR "module $module did not have configs";
610 foreach my $conf (@arr) {
611 print STDERR " " , $conf;
612 }
613 print STDERR "\n";
614 }
615}