diff options
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/Makefile | 13 | ||||
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 38 |
2 files changed, 38 insertions, 13 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 006c96f5fcb5..85b906547845 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -30,9 +30,18 @@ silentoldconfig: $(obj)/conf | |||
30 | $(Q)mkdir -p include/generated | 30 | $(Q)mkdir -p include/generated |
31 | $< -s $(Kconfig) | 31 | $< -s $(Kconfig) |
32 | 32 | ||
33 | # if no path is given, then use src directory to find file | ||
34 | ifdef LSMOD | ||
35 | LSMOD_F = $(shell if [ `basename $(LSMOD)` == $(LSMOD) ]; then \ | ||
36 | echo $(objtree)/$(LSMOD); \ | ||
37 | else \ | ||
38 | echo $(LSMOD); \ | ||
39 | fi) | ||
40 | endif | ||
41 | |||
33 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf | 42 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
34 | $(Q)mkdir -p include/generated | 43 | $(Q)mkdir -p include/generated |
35 | $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config | 44 | $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config |
36 | $(Q)if [ -f .config ]; then \ | 45 | $(Q)if [ -f .config ]; then \ |
37 | cmp -s .tmp.config .config || \ | 46 | cmp -s .tmp.config .config || \ |
38 | (mv -f .config .config.old.1; \ | 47 | (mv -f .config .config.old.1; \ |
@@ -47,7 +56,7 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf | |||
47 | 56 | ||
48 | localyesconfig: $(obj)/streamline_config.pl $(obj)/conf | 57 | localyesconfig: $(obj)/streamline_config.pl $(obj)/conf |
49 | $(Q)mkdir -p include/generated | 58 | $(Q)mkdir -p include/generated |
50 | $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config | 59 | $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config |
51 | $(Q)sed -i s/=m/=y/ .tmp.config | 60 | $(Q)sed -i s/=m/=y/ .tmp.config |
52 | $(Q)if [ -f .config ]; then \ | 61 | $(Q)if [ -f .config ]; then \ |
53 | cmp -s .tmp.config .config || \ | 62 | cmp -s .tmp.config .config || \ |
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index d7f7db73e587..afbd54ac1d83 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
@@ -113,6 +113,7 @@ find_config; | |||
113 | # Get the build source and top level Kconfig file (passed in) | 113 | # Get the build source and top level Kconfig file (passed in) |
114 | my $ksource = $ARGV[0]; | 114 | my $ksource = $ARGV[0]; |
115 | my $kconfig = $ARGV[1]; | 115 | my $kconfig = $ARGV[1]; |
116 | my $lsmod_file = $ARGV[2]; | ||
116 | 117 | ||
117 | my @makefiles = `find $ksource -name Makefile`; | 118 | my @makefiles = `find $ksource -name Makefile`; |
118 | my %depends; | 119 | my %depends; |
@@ -263,21 +264,36 @@ foreach my $makefile (@makefiles) { | |||
263 | 264 | ||
264 | my %modules; | 265 | my %modules; |
265 | 266 | ||
266 | # see what modules are loaded on this system | 267 | if (defined($lsmod_file)) { |
267 | my $lsmod; | 268 | if ( ! -f $lsmod_file) { |
268 | 269 | die "$lsmod_file not found"; | |
269 | foreach $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) { | 270 | } |
270 | if ( -x "$dir/lsmod" ) { | 271 | if ( -x $lsmod_file) { |
271 | $lsmod = "$dir/lsmod"; | 272 | # the file is executable, run it |
272 | last; | 273 | open(LIN, "$lsmod_file|"); |
274 | } else { | ||
275 | # Just read the contents | ||
276 | open(LIN, "$lsmod_file"); | ||
273 | } | 277 | } |
278 | } else { | ||
279 | |||
280 | # see what modules are loaded on this system | ||
281 | my $lsmod; | ||
282 | |||
283 | foreach $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) { | ||
284 | if ( -x "$dir/lsmod" ) { | ||
285 | $lsmod = "$dir/lsmod"; | ||
286 | last; | ||
287 | } | ||
274 | } | 288 | } |
275 | if (!defined($lsmod)) { | 289 | if (!defined($lsmod)) { |
276 | # try just the path | 290 | # try just the path |
277 | $lsmod = "lsmod"; | 291 | $lsmod = "lsmod"; |
292 | } | ||
293 | |||
294 | open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod"; | ||
278 | } | 295 | } |
279 | 296 | ||
280 | open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod"; | ||
281 | while (<LIN>) { | 297 | while (<LIN>) { |
282 | next if (/^Module/); # Skip the first line. | 298 | next if (/^Module/); # Skip the first line. |
283 | if (/^(\S+)/) { | 299 | if (/^(\S+)/) { |