aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/streamline_config.pl63
1 files changed, 62 insertions, 1 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 233464185a92..9fa3f81b1ed9 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -45,7 +45,68 @@
45my $config = ".config"; 45my $config = ".config";
46my $linuxpath = "."; 46my $linuxpath = ".";
47 47
48open(CIN,$config) || die "Can't open current config file: $config"; 48my $uname = `uname -r`;
49chomp $uname;
50
51my @searchconfigs = (
52 {
53 "file" => "/proc/config.gz",
54 "exec" => "zcat",
55 },
56 {
57 "file" => "/boot/vmlinuz-$uname",
58 "exec" => "scripts/extract-ikconfig",
59 "test" => "scripts/extract-ikconfig",
60 },
61 {
62 "file" => "vmlinux",
63 "exec" => "scripts/extract-ikconfig",
64 "test" => "scripts/extract-ikconfig",
65 },
66 {
67 "file" => "/lib/modules/$uname/kernel/kernel/configs.ko",
68 "exec" => "scripts/extract-ikconfig",
69 "test" => "scripts/extract-ikconfig",
70 },
71 {
72 "file" => "kernel/configs.ko",
73 "exec" => "scripts/extract-ikconfig",
74 "test" => "scripts/extract-ikconfig",
75 },
76 {
77 "file" => "kernel/configs.o",
78 "exec" => "scripts/extract-ikconfig",
79 "test" => "scripts/extract-ikconfig",
80 },
81 {
82 "file" => ".config",
83 "exec" => "cat",
84 },
85);
86
87sub find_config {
88 foreach my $conf (@searchconfigs) {
89 my $file = $conf->{"file"};
90
91 next if ( ! -f "$file");
92
93 if (defined($conf->{"test"})) {
94 `$conf->{"test"} $conf->{"file"} 2>/dev/null`;
95 next if ($?);
96 }
97
98 my $exec = $conf->{"exec"};
99
100 print STDERR "using config: '$file'\n";
101
102 open(CIN, "$exec $file |") || die "Failed to run $exec $file";
103 return;
104 }
105 die "No config file found";
106}
107
108find_config;
109
49my @makefiles = `find $linuxpath -name Makefile`; 110my @makefiles = `find $linuxpath -name Makefile`;
50my %depends; 111my %depends;
51my %selects; 112my %selects;