diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.lib | 14 | ||||
-rw-r--r-- | scripts/basic/fixdep.c | 2 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 36 | ||||
-rw-r--r-- | scripts/coccinelle/api/devm_ioremap_resource.cocci | 90 | ||||
-rwxr-xr-x | scripts/get_maintainer.pl | 2 | ||||
-rw-r--r-- | scripts/headers_install.pl | 6 | ||||
-rwxr-xr-x | scripts/kernel-doc | 1 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 2 | ||||
-rwxr-xr-x | scripts/sign-file | 134 | ||||
-rw-r--r-- | scripts/sortextable.h | 2 | ||||
-rwxr-xr-x | scripts/tags.sh | 24 |
11 files changed, 224 insertions, 89 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index bdf42fdf64c9..07125e697d7a 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -156,6 +156,11 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | |||
156 | 156 | ||
157 | ld_flags = $(LDFLAGS) $(ldflags-y) | 157 | ld_flags = $(LDFLAGS) $(ldflags-y) |
158 | 158 | ||
159 | dtc_cpp_flags = -Wp,-MD,$(depfile) -nostdinc \ | ||
160 | -I$(srctree)/arch/$(SRCARCH)/boot/dts \ | ||
161 | -I$(srctree)/arch/$(SRCARCH)/include/dts \ | ||
162 | -undef -D__DTS__ | ||
163 | |||
159 | # Finds the multi-part object the current object will be linked into | 164 | # Finds the multi-part object the current object will be linked into |
160 | modname-multi = $(sort $(foreach m,$(multi-used),\ | 165 | modname-multi = $(sort $(foreach m,$(multi-used),\ |
161 | $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) | 166 | $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) |
@@ -269,6 +274,15 @@ cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile | |||
269 | $(obj)/%.dtb: $(src)/%.dts FORCE | 274 | $(obj)/%.dtb: $(src)/%.dts FORCE |
270 | $(call if_changed_dep,dtc) | 275 | $(call if_changed_dep,dtc) |
271 | 276 | ||
277 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts) | ||
278 | |||
279 | quiet_cmd_dtc_cpp = DTC+CPP $@ | ||
280 | cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ | ||
281 | $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp) | ||
282 | |||
283 | $(obj)/%.dtb: $(src)/%.dtsp FORCE | ||
284 | $(call if_changed_dep,dtc_cpp) | ||
285 | |||
272 | # Bzip2 | 286 | # Bzip2 |
273 | # --------------------------------------------------------------------------- | 287 | # --------------------------------------------------------------------------- |
274 | 288 | ||
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index cb1f50cf12e3..7f6425e24ce3 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -409,7 +409,7 @@ static void traps(void) | |||
409 | int *p = (int *)test; | 409 | int *p = (int *)test; |
410 | 410 | ||
411 | if (*p != INT_CONF) { | 411 | if (*p != INT_CONF) { |
412 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", | 412 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n", |
413 | *p); | 413 | *p); |
414 | exit(2); | 414 | exit(2); |
415 | } | 415 | } |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4d2c7dfdaabd..747bcd768da0 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -230,12 +230,12 @@ our $Inline = qr{inline|__always_inline|noinline}; | |||
230 | our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; | 230 | our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; |
231 | our $Lval = qr{$Ident(?:$Member)*}; | 231 | our $Lval = qr{$Ident(?:$Member)*}; |
232 | 232 | ||
233 | our $Float_hex = qr{(?i:0x[0-9a-f]+p-?[0-9]+[fl]?)}; | 233 | our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; |
234 | our $Float_dec = qr{(?i:((?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?))}; | 234 | our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; |
235 | our $Float_int = qr{(?i:[0-9]+e-?[0-9]+[fl]?)}; | 235 | our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; |
236 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; | 236 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; |
237 | our $Constant = qr{(?:$Float|(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*))}; | 237 | our $Constant = qr{$Float|(?i)(?:0x[0-9a-f]+|[0-9]+)[ul]*}; |
238 | our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; | 238 | our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; |
239 | our $Compare = qr{<=|>=|==|!=|<|>}; | 239 | our $Compare = qr{<=|>=|==|!=|<|>}; |
240 | our $Operators = qr{ | 240 | our $Operators = qr{ |
241 | <=|>=|==|!=| | 241 | <=|>=|==|!=| |
@@ -1931,6 +1931,12 @@ sub process { | |||
1931 | "use the SSYNC() macro in asm/blackfin.h\n" . $herevet); | 1931 | "use the SSYNC() macro in asm/blackfin.h\n" . $herevet); |
1932 | } | 1932 | } |
1933 | 1933 | ||
1934 | # check for old HOTPLUG __dev<foo> section markings | ||
1935 | if ($line =~ /\b(__dev(init|exit)(data|const|))\b/) { | ||
1936 | WARN("HOTPLUG_SECTION", | ||
1937 | "Using $1 is unnecessary\n" . $herecurr); | ||
1938 | } | ||
1939 | |||
1934 | # Check for potential 'bare' types | 1940 | # Check for potential 'bare' types |
1935 | my ($stat, $cond, $line_nr_next, $remain_next, $off_next, | 1941 | my ($stat, $cond, $line_nr_next, $remain_next, $off_next, |
1936 | $realline_next); | 1942 | $realline_next); |
@@ -2430,6 +2436,15 @@ sub process { | |||
2430 | "Prefer pr_warn(... to pr_warning(...\n" . $herecurr); | 2436 | "Prefer pr_warn(... to pr_warning(...\n" . $herecurr); |
2431 | } | 2437 | } |
2432 | 2438 | ||
2439 | if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) { | ||
2440 | my $orig = $1; | ||
2441 | my $level = lc($orig); | ||
2442 | $level = "warn" if ($level eq "warning"); | ||
2443 | $level = "dbg" if ($level eq "debug"); | ||
2444 | WARN("PREFER_DEV_LEVEL", | ||
2445 | "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr); | ||
2446 | } | ||
2447 | |||
2433 | # function brace can't be on same line, except for #defines of do while, | 2448 | # function brace can't be on same line, except for #defines of do while, |
2434 | # or if closed on same line | 2449 | # or if closed on same line |
2435 | if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and | 2450 | if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and |
@@ -2915,6 +2930,7 @@ sub process { | |||
2915 | my $var = $1; | 2930 | my $var = $1; |
2916 | if ($var !~ /$Constant/ && | 2931 | if ($var !~ /$Constant/ && |
2917 | $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && | 2932 | $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && |
2933 | $var !~ /^Page[A-Z]/ && | ||
2918 | !defined $camelcase{$var}) { | 2934 | !defined $camelcase{$var}) { |
2919 | $camelcase{$var} = 1; | 2935 | $camelcase{$var} = 1; |
2920 | WARN("CAMELCASE", | 2936 | WARN("CAMELCASE", |
@@ -3237,9 +3253,9 @@ sub process { | |||
3237 | } | 3253 | } |
3238 | 3254 | ||
3239 | # prefer usleep_range over udelay | 3255 | # prefer usleep_range over udelay |
3240 | if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) { | 3256 | if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { |
3241 | # ignore udelay's < 10, however | 3257 | # ignore udelay's < 10, however |
3242 | if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) { | 3258 | if (! ($1 < 10) ) { |
3243 | CHK("USLEEP_RANGE", | 3259 | CHK("USLEEP_RANGE", |
3244 | "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); | 3260 | "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); |
3245 | } | 3261 | } |
@@ -3460,6 +3476,12 @@ sub process { | |||
3460 | "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); | 3476 | "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); |
3461 | } | 3477 | } |
3462 | 3478 | ||
3479 | # check for alloc argument mismatch | ||
3480 | if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) { | ||
3481 | WARN("ALLOC_ARRAY_ARGS", | ||
3482 | "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); | ||
3483 | } | ||
3484 | |||
3463 | # check for multiple semicolons | 3485 | # check for multiple semicolons |
3464 | if ($line =~ /;\s*;\s*$/) { | 3486 | if ($line =~ /;\s*;\s*$/) { |
3465 | WARN("ONE_SEMICOLON", | 3487 | WARN("ONE_SEMICOLON", |
diff --git a/scripts/coccinelle/api/devm_ioremap_resource.cocci b/scripts/coccinelle/api/devm_ioremap_resource.cocci new file mode 100644 index 000000000000..495daa3dbf77 --- /dev/null +++ b/scripts/coccinelle/api/devm_ioremap_resource.cocci | |||
@@ -0,0 +1,90 @@ | |||
1 | virtual patch | ||
2 | virtual report | ||
3 | |||
4 | @depends on patch@ | ||
5 | expression base, dev, res; | ||
6 | @@ | ||
7 | |||
8 | -base = devm_request_and_ioremap(dev, res); | ||
9 | +base = devm_ioremap_resource(dev, res); | ||
10 | ... | ||
11 | if ( | ||
12 | -base == NULL | ||
13 | +IS_ERR(base) | ||
14 | || ...) { | ||
15 | <... | ||
16 | - return ...; | ||
17 | + return PTR_ERR(base); | ||
18 | ...> | ||
19 | } | ||
20 | |||
21 | @depends on patch@ | ||
22 | expression e, E, ret; | ||
23 | identifier l; | ||
24 | @@ | ||
25 | |||
26 | e = devm_ioremap_resource(...); | ||
27 | ... | ||
28 | if (IS_ERR(e) || ...) { | ||
29 | ... when any | ||
30 | - ret = E; | ||
31 | + ret = PTR_ERR(e); | ||
32 | ... | ||
33 | ( | ||
34 | return ret; | ||
35 | | | ||
36 | goto l; | ||
37 | ) | ||
38 | } | ||
39 | |||
40 | @depends on patch@ | ||
41 | expression e; | ||
42 | @@ | ||
43 | |||
44 | e = devm_ioremap_resource(...); | ||
45 | ... | ||
46 | if (IS_ERR(e) || ...) { | ||
47 | ... | ||
48 | - \(dev_dbg\|dev_err\|pr_debug\|pr_err\|DRM_ERROR\)(...); | ||
49 | ... | ||
50 | } | ||
51 | |||
52 | @depends on patch@ | ||
53 | expression e; | ||
54 | identifier l; | ||
55 | @@ | ||
56 | |||
57 | e = devm_ioremap_resource(...); | ||
58 | ... | ||
59 | if (IS_ERR(e) || ...) | ||
60 | -{ | ||
61 | ( | ||
62 | return ...; | ||
63 | | | ||
64 | goto l; | ||
65 | ) | ||
66 | -} | ||
67 | |||
68 | @r depends on report@ | ||
69 | expression e; | ||
70 | identifier l; | ||
71 | position p1; | ||
72 | @@ | ||
73 | |||
74 | *e = devm_request_and_ioremap@p1(...); | ||
75 | ... | ||
76 | if (e == NULL || ...) { | ||
77 | ... | ||
78 | ( | ||
79 | return ...; | ||
80 | | | ||
81 | goto l; | ||
82 | ) | ||
83 | } | ||
84 | |||
85 | @script:python depends on r@ | ||
86 | p1 << r.p1; | ||
87 | @@ | ||
88 | |||
89 | msg = "ERROR: deprecated devm_request_and_ioremap() API used on line %s" % (p1[0].line) | ||
90 | coccilib.report.print_report(p1[0], msg) | ||
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 8b673dd4627f..18d4ab55606b 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -433,7 +433,7 @@ foreach my $file (@ARGV) { | |||
433 | 433 | ||
434 | while (<$patch>) { | 434 | while (<$patch>) { |
435 | my $patch_line = $_; | 435 | my $patch_line = $_; |
436 | if (m/^\+\+\+\s+(\S+)/) { | 436 | if (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) { |
437 | my $filename = $1; | 437 | my $filename = $1; |
438 | $filename =~ s@^[^/]*/@@; | 438 | $filename =~ s@^[^/]*/@@; |
439 | $filename =~ s@\n@@; | 439 | $filename =~ s@\n@@; |
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl index 6c353ae8a451..581ca99c96f2 100644 --- a/scripts/headers_install.pl +++ b/scripts/headers_install.pl | |||
@@ -42,9 +42,9 @@ foreach my $filename (@files) { | |||
42 | $line =~ s/(^|\s)(inline)\b/$1__$2__/g; | 42 | $line =~ s/(^|\s)(inline)\b/$1__$2__/g; |
43 | $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; | 43 | $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; |
44 | $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; | 44 | $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; |
45 | $line =~ s/#ifndef _UAPI/#ifndef /; | 45 | $line =~ s/#ifndef\s+_UAPI/#ifndef /; |
46 | $line =~ s/#define _UAPI/#define /; | 46 | $line =~ s/#define\s+_UAPI/#define /; |
47 | $line =~ s!#endif /[*] _UAPI!#endif /* !; | 47 | $line =~ s!#endif\s+/[*]\s*_UAPI!#endif /* !; |
48 | printf {$out} "%s", $line; | 48 | printf {$out} "%s", $line; |
49 | } | 49 | } |
50 | close $out; | 50 | close $out; |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 28b761567815..f565536a2bef 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -2079,7 +2079,6 @@ sub dump_function($$) { | |||
2079 | $prototype =~ s/^__inline +//; | 2079 | $prototype =~ s/^__inline +//; |
2080 | $prototype =~ s/^__always_inline +//; | 2080 | $prototype =~ s/^__always_inline +//; |
2081 | $prototype =~ s/^noinline +//; | 2081 | $prototype =~ s/^noinline +//; |
2082 | $prototype =~ s/__devinit +//; | ||
2083 | $prototype =~ s/__init +//; | 2082 | $prototype =~ s/__init +//; |
2084 | $prototype =~ s/__init_or_module +//; | 2083 | $prototype =~ s/__init_or_module +//; |
2085 | $prototype =~ s/__must_check +//; | 2084 | $prototype =~ s/__must_check +//; |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 11a8c3010ed9..78b30c1548e9 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -830,6 +830,8 @@ static const char *section_white_list[] = | |||
830 | ".toc*", | 830 | ".toc*", |
831 | ".xt.prop", /* xtensa */ | 831 | ".xt.prop", /* xtensa */ |
832 | ".xt.lit", /* xtensa */ | 832 | ".xt.lit", /* xtensa */ |
833 | ".arcextmap*", /* arc */ | ||
834 | ".gnu.linkonce.arcext*", /* arc : modules */ | ||
833 | NULL | 835 | NULL |
834 | }; | 836 | }; |
835 | 837 | ||
diff --git a/scripts/sign-file b/scripts/sign-file index 974a20b661b7..2b7c4484d46c 100755 --- a/scripts/sign-file +++ b/scripts/sign-file | |||
@@ -2,51 +2,45 @@ | |||
2 | # | 2 | # |
3 | # Sign a module file using the given key. | 3 | # Sign a module file using the given key. |
4 | # | 4 | # |
5 | # Format: | 5 | |
6 | # | 6 | my $USAGE = |
7 | # ./scripts/sign-file [-v] <key> <x509> <module> [<dest>] | 7 | "Usage: scripts/sign-file [-v] <hash algo> <key> <x509> <module> [<dest>]\n" . |
8 | # | 8 | " scripts/sign-file [-v] -s <raw sig> <hash algo> <x509> <module> [<dest>]\n"; |
9 | # | 9 | |
10 | use strict; | 10 | use strict; |
11 | use FileHandle; | 11 | use FileHandle; |
12 | use IPC::Open2; | 12 | use IPC::Open2; |
13 | use Getopt::Std; | ||
13 | 14 | ||
14 | my $verbose = 0; | 15 | my %opts; |
15 | if ($#ARGV >= 0 && $ARGV[0] eq "-v") { | 16 | getopts('vs:', \%opts) or die $USAGE; |
16 | $verbose = 1; | 17 | my $verbose = $opts{'v'}; |
17 | shift; | 18 | my $signature_file = $opts{'s'}; |
18 | } | ||
19 | 19 | ||
20 | die "Format: ./scripts/sign-file [-v] <key> <x509> <module> [<dest>]\n" | 20 | die $USAGE if ($#ARGV > 4); |
21 | if ($#ARGV != 2 && $#ARGV != 3); | 21 | die $USAGE if (!$signature_file && $#ARGV < 3 || $signature_file && $#ARGV < 2); |
22 | 22 | ||
23 | my $private_key = $ARGV[0]; | 23 | my $dgst = shift @ARGV; |
24 | my $x509 = $ARGV[1]; | 24 | my $private_key; |
25 | my $module = $ARGV[2]; | 25 | if (!$signature_file) { |
26 | my $dest = ($#ARGV == 3) ? $ARGV[3] : $ARGV[2] . "~"; | 26 | $private_key = shift @ARGV; |
27 | } | ||
28 | my $x509 = shift @ARGV; | ||
29 | my $module = shift @ARGV; | ||
30 | my ($dest, $keep_orig); | ||
31 | if (@ARGV) { | ||
32 | $dest = $ARGV[0]; | ||
33 | $keep_orig = 1; | ||
34 | } else { | ||
35 | $dest = $module . "~"; | ||
36 | } | ||
27 | 37 | ||
28 | die "Can't read private key\n" unless (-r $private_key); | 38 | die "Can't read private key\n" if (!$signature_file && !-r $private_key); |
39 | die "Can't read signature file\n" if ($signature_file && !-r $signature_file); | ||
29 | die "Can't read X.509 certificate\n" unless (-r $x509); | 40 | die "Can't read X.509 certificate\n" unless (-r $x509); |
30 | die "Can't read module\n" unless (-r $module); | 41 | die "Can't read module\n" unless (-r $module); |
31 | 42 | ||
32 | # | 43 | # |
33 | # Read the kernel configuration | ||
34 | # | ||
35 | my %config = ( | ||
36 | CONFIG_MODULE_SIG_SHA512 => 1 | ||
37 | ); | ||
38 | |||
39 | if (-r ".config") { | ||
40 | open(FD, "<.config") || die ".config"; | ||
41 | while (<FD>) { | ||
42 | if ($_ =~ /^(CONFIG_.*)=[ym]/) { | ||
43 | $config{$1} = 1; | ||
44 | } | ||
45 | } | ||
46 | close(FD); | ||
47 | } | ||
48 | |||
49 | # | ||
50 | # Function to read the contents of a file into a variable. | 44 | # Function to read the contents of a file into a variable. |
51 | # | 45 | # |
52 | sub read_file($) | 46 | sub read_file($) |
@@ -321,73 +315,71 @@ my $id_type = 1; # Identifier type: X.509 | |||
321 | # | 315 | # |
322 | # Digest the data | 316 | # Digest the data |
323 | # | 317 | # |
324 | my ($dgst, $prologue) = (); | 318 | my $prologue; |
325 | if (exists $config{"CONFIG_MODULE_SIG_SHA1"}) { | 319 | if ($dgst eq "sha1") { |
326 | $prologue = pack("C*", | 320 | $prologue = pack("C*", |
327 | 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, | 321 | 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, |
328 | 0x2B, 0x0E, 0x03, 0x02, 0x1A, | 322 | 0x2B, 0x0E, 0x03, 0x02, 0x1A, |
329 | 0x05, 0x00, 0x04, 0x14); | 323 | 0x05, 0x00, 0x04, 0x14); |
330 | $dgst = "-sha1"; | ||
331 | $hash = 2; | 324 | $hash = 2; |
332 | } elsif (exists $config{"CONFIG_MODULE_SIG_SHA224"}) { | 325 | } elsif ($dgst eq "sha224") { |
333 | $prologue = pack("C*", | 326 | $prologue = pack("C*", |
334 | 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, | 327 | 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, |
335 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, | 328 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, |
336 | 0x05, 0x00, 0x04, 0x1C); | 329 | 0x05, 0x00, 0x04, 0x1C); |
337 | $dgst = "-sha224"; | ||
338 | $hash = 7; | 330 | $hash = 7; |
339 | } elsif (exists $config{"CONFIG_MODULE_SIG_SHA256"}) { | 331 | } elsif ($dgst eq "sha256") { |
340 | $prologue = pack("C*", | 332 | $prologue = pack("C*", |
341 | 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, | 333 | 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, |
342 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, | 334 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, |
343 | 0x05, 0x00, 0x04, 0x20); | 335 | 0x05, 0x00, 0x04, 0x20); |
344 | $dgst = "-sha256"; | ||
345 | $hash = 4; | 336 | $hash = 4; |
346 | } elsif (exists $config{"CONFIG_MODULE_SIG_SHA384"}) { | 337 | } elsif ($dgst eq "sha384") { |
347 | $prologue = pack("C*", | 338 | $prologue = pack("C*", |
348 | 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, | 339 | 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, |
349 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, | 340 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, |
350 | 0x05, 0x00, 0x04, 0x30); | 341 | 0x05, 0x00, 0x04, 0x30); |
351 | $dgst = "-sha384"; | ||
352 | $hash = 5; | 342 | $hash = 5; |
353 | } elsif (exists $config{"CONFIG_MODULE_SIG_SHA512"}) { | 343 | } elsif ($dgst eq "sha512") { |
354 | $prologue = pack("C*", | 344 | $prologue = pack("C*", |
355 | 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, | 345 | 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, |
356 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, | 346 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, |
357 | 0x05, 0x00, 0x04, 0x40); | 347 | 0x05, 0x00, 0x04, 0x40); |
358 | $dgst = "-sha512"; | ||
359 | $hash = 6; | 348 | $hash = 6; |
360 | } else { | 349 | } else { |
361 | die "Can't determine hash algorithm"; | 350 | die "Unknown hash algorithm: $dgst\n"; |
362 | } | 351 | } |
363 | 352 | ||
364 | # | ||
365 | # Generate the digest and read from openssl's stdout | ||
366 | # | ||
367 | my $digest; | ||
368 | $digest = readpipe("openssl dgst $dgst -binary $module") || die "openssl dgst"; | ||
369 | |||
370 | # | ||
371 | # Generate the binary signature, which will be just the integer that comprises | ||
372 | # the signature with no metadata attached. | ||
373 | # | ||
374 | my $pid; | ||
375 | $pid = open2(*read_from, *write_to, | ||
376 | "openssl rsautl -sign -inkey $private_key -keyform PEM") || | ||
377 | die "openssl rsautl"; | ||
378 | binmode write_to; | ||
379 | print write_to $prologue . $digest || die "pipe to openssl rsautl"; | ||
380 | close(write_to) || die "pipe to openssl rsautl"; | ||
381 | |||
382 | binmode read_from; | ||
383 | my $signature; | 353 | my $signature; |
384 | read(read_from, $signature, 4096) || die "pipe from openssl rsautl"; | 354 | if ($signature_file) { |
385 | close(read_from) || die "pipe from openssl rsautl"; | 355 | $signature = read_file($signature_file); |
356 | } else { | ||
357 | # | ||
358 | # Generate the digest and read from openssl's stdout | ||
359 | # | ||
360 | my $digest; | ||
361 | $digest = readpipe("openssl dgst -$dgst -binary $module") || die "openssl dgst"; | ||
362 | |||
363 | # | ||
364 | # Generate the binary signature, which will be just the integer that | ||
365 | # comprises the signature with no metadata attached. | ||
366 | # | ||
367 | my $pid; | ||
368 | $pid = open2(*read_from, *write_to, | ||
369 | "openssl rsautl -sign -inkey $private_key -keyform PEM") || | ||
370 | die "openssl rsautl"; | ||
371 | binmode write_to; | ||
372 | print write_to $prologue . $digest || die "pipe to openssl rsautl"; | ||
373 | close(write_to) || die "pipe to openssl rsautl"; | ||
374 | |||
375 | binmode read_from; | ||
376 | read(read_from, $signature, 4096) || die "pipe from openssl rsautl"; | ||
377 | close(read_from) || die "pipe from openssl rsautl"; | ||
378 | waitpid($pid, 0) || die; | ||
379 | die "openssl rsautl died: $?" if ($? >> 8); | ||
380 | } | ||
386 | $signature = pack("n", length($signature)) . $signature, | 381 | $signature = pack("n", length($signature)) . $signature, |
387 | 382 | ||
388 | waitpid($pid, 0) || die; | ||
389 | die "openssl rsautl died: $?" if ($? >> 8); | ||
390 | |||
391 | # | 383 | # |
392 | # Build the signed binary | 384 | # Build the signed binary |
393 | # | 385 | # |
@@ -424,6 +416,6 @@ print FD | |||
424 | ; | 416 | ; |
425 | close FD || die $dest; | 417 | close FD || die $dest; |
426 | 418 | ||
427 | if ($#ARGV != 3) { | 419 | if (!$keep_orig) { |
428 | rename($dest, $module) || die $module; | 420 | rename($dest, $module) || die $module; |
429 | } | 421 | } |
diff --git a/scripts/sortextable.h b/scripts/sortextable.h index e4fd45b7e456..f5eb43d42926 100644 --- a/scripts/sortextable.h +++ b/scripts/sortextable.h | |||
@@ -182,7 +182,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_t custom_sort) | |||
182 | _r(&sort_needed_sym->st_value) - | 182 | _r(&sort_needed_sym->st_value) - |
183 | _r(&sort_needed_sec->sh_addr); | 183 | _r(&sort_needed_sec->sh_addr); |
184 | 184 | ||
185 | #if 1 | 185 | #if 0 |
186 | printf("sort done marker at %lx\n", | 186 | printf("sort done marker at %lx\n", |
187 | (unsigned long)((char *)sort_done_location - (char *)ehdr)); | 187 | (unsigned long)((char *)sort_done_location - (char *)ehdr)); |
188 | #endif | 188 | #endif |
diff --git a/scripts/tags.sh b/scripts/tags.sh index 08f06c00745e..65f9595acea9 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -149,12 +149,17 @@ dogtags() | |||
149 | exuberant() | 149 | exuberant() |
150 | { | 150 | { |
151 | all_target_sources | xargs $1 -a \ | 151 | all_target_sources | xargs $1 -a \ |
152 | -I __initdata,__exitdata,__acquires,__releases \ | 152 | -I __initdata,__exitdata,__initconst,__devinitdata \ |
153 | -I __read_mostly,____cacheline_aligned \ | 153 | -I __devinitconst,__cpuinitdata,__initdata_memblock \ |
154 | -I __refdata,__attribute \ | ||
155 | -I __acquires,__releases,__deprecated \ | ||
156 | -I __read_mostly,__aligned,____cacheline_aligned \ | ||
154 | -I ____cacheline_aligned_in_smp \ | 157 | -I ____cacheline_aligned_in_smp \ |
155 | -I ____cacheline_internodealigned_in_smp \ | 158 | -I ____cacheline_internodealigned_in_smp \ |
159 | -I __used,__packed,__packed2__,__must_check,__must_hold \ | ||
156 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ | 160 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ |
157 | -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ | 161 | -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ |
162 | -I static,const \ | ||
158 | --extra=+f --c-kinds=+px \ | 163 | --extra=+f --c-kinds=+px \ |
159 | --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \ | 164 | --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \ |
160 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ | 165 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ |
@@ -182,8 +187,19 @@ exuberant() | |||
182 | --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ | 187 | --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ |
183 | --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ | 188 | --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ |
184 | --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ | 189 | --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ |
185 | --regex-c='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \ | 190 | --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \ |
186 | --regex-c='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/' | 191 | --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \ |
192 | --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \ | ||
193 | --regex-c='/DEFINE_(RAW_SPINLOCK|RWLOCK|SEQLOCK)\((\w*)/\2/v/' \ | ||
194 | --regex-c='/DECLARE_(RWSEM|COMPLETION)\((\w*)/\2/v/' \ | ||
195 | --regex-c='/DECLARE_BITMAP\((\w*)/\1/v/' \ | ||
196 | --regex-c='/(^|\s)(|L|H)LIST_HEAD\((\w*)/\3/v/' \ | ||
197 | --regex-c='/(^|\s)RADIX_TREE\((\w*)/\2/v/' \ | ||
198 | --regex-c='/DEFINE_PER_CPU\(([^,]*,\s*)(\w*).*\)/\2/v/' \ | ||
199 | --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \ | ||
200 | --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \ | ||
201 | --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \ | ||
202 | --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' | ||
187 | 203 | ||
188 | all_kconfigs | xargs $1 -a \ | 204 | all_kconfigs | xargs $1 -a \ |
189 | --langdef=kconfig --language-force=kconfig \ | 205 | --langdef=kconfig --language-force=kconfig \ |