diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 63 |
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 @@ | |||
45 | my $config = ".config"; | 45 | my $config = ".config"; |
46 | my $linuxpath = "."; | 46 | my $linuxpath = "."; |
47 | 47 | ||
48 | open(CIN,$config) || die "Can't open current config file: $config"; | 48 | my $uname = `uname -r`; |
49 | chomp $uname; | ||
50 | |||
51 | my @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 | |||
87 | sub 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 | |||
108 | find_config; | ||
109 | |||
49 | my @makefiles = `find $linuxpath -name Makefile`; | 110 | my @makefiles = `find $linuxpath -name Makefile`; |
50 | my %depends; | 111 | my %depends; |
51 | my %selects; | 112 | my %selects; |