-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel-diff-configs
More file actions
executable file
·53 lines (44 loc) · 1.13 KB
/
Copy pathkernel-diff-configs
File metadata and controls
executable file
·53 lines (44 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/gawk -f
function usage() {
print "diff-configs.awk <config1> <config2> [<kernel directory>]"
print "This program checks if the config2 file is at the root of the kernel source directory."
print "If not found you need to pass the kernel directory as the third argument."
exit
}
BEGIN {
if (ARGC < 3)
usage()
CONFIG1 = ARGV[1]
CONFIG2 = ARGV[2]
if (ARGC >= 4)
DIR = ARGV[3]
else
"dirname " CONFIG2 | getline DIR
if ((getline < (DIR"/Kconfig")) == 1) {
print "Found " DIR "/Kconfig. Reading Kernel symbols from here.\n"
} else {
print "Could not find Kconfig in " DIR
usage()
}
print CONFIG1 "\t\t" CONFIG2
while ("find "DIR" -name \"Kconfig*\"" | getline) {
file = $0
while (getline < file) {
if ($1 == "config" || $1 == "menuconfig") {
var = "CONFIG_" $2
} else if (($1 == "bool" || $1 == "string" || $1 == "tristate" || $1 == "int" || $1 == "hex") && $2) {
config[var] = 1
}
}
}
while ("diff " CONFIG1 " " CONFIG2 | getline) {
if (/^(<|>) CONFIG/) {
sub(">", "\t\t\t\t\t\t ")
sub("<", " ")
var=$1
sub("=.*", "", var)
if (var in config)
print
}
}
}