aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.modinst7
-rw-r--r--scripts/Makefile.modsign2
-rwxr-xr-xscripts/bloat-o-meter2
-rwxr-xr-xscripts/checkpatch.pl5
-rwxr-xr-xscripts/checkstack.pl7
-rw-r--r--scripts/kallsyms.c2
-rw-r--r--scripts/kconfig/Makefile19
-rw-r--r--scripts/mod/modpost.c27
-rwxr-xr-xscripts/sign-file2
-rwxr-xr-xscripts/tags.sh6
10 files changed, 59 insertions, 20 deletions
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 95ec7b35e8b6..e48a4e9d8868 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -18,7 +18,12 @@ __modinst: $(modules)
18 18
19# Don't stop modules_install if we can't sign external modules. 19# Don't stop modules_install if we can't sign external modules.
20quiet_cmd_modules_install = INSTALL $@ 20quiet_cmd_modules_install = INSTALL $@
21 cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) ; $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) 21 cmd_modules_install = \
22 mkdir -p $(2) ; \
23 cp $@ $(2) ; \
24 $(mod_strip_cmd) $(2)/$(notdir $@) ; \
25 $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \
26 $(mod_compress_cmd) $(2)/$(notdir $@)
22 27
23# Modules built outside the kernel source tree go into extra by default 28# Modules built outside the kernel source tree go into extra by default
24INSTALL_MOD_DIR ?= extra 29INSTALL_MOD_DIR ?= extra
diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign
index abfda626dbad..b6ac7084da79 100644
--- a/scripts/Makefile.modsign
+++ b/scripts/Makefile.modsign
@@ -7,7 +7,7 @@ __modsign:
7 7
8include scripts/Kbuild.include 8include scripts/Kbuild.include
9 9
10__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 10__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
11modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) 11modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
12 12
13PHONY += $(modules) 13PHONY += $(modules)
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 549d0ab8c662..23e78dcd12bf 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -20,6 +20,8 @@ def getsizes(file):
20 if type in "tTdDbBrR": 20 if type in "tTdDbBrR":
21 # strip generated symbols 21 # strip generated symbols
22 if name.startswith("__mod_"): continue 22 if name.startswith("__mod_"): continue
23 if name.startswith("SyS_"): continue
24 if name.startswith("compat_SyS_"): continue
23 if name == "linux_banner": continue 25 if name == "linux_banner": continue
24 # statics and some other optimizations adds random .NUMBER 26 # statics and some other optimizations adds random .NUMBER
25 name = re.sub(r'\.[0-9]+', '', name) 27 name = re.sub(r'\.[0-9]+', '', name)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b385bcbbf2f5..4d08b398411f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2133,7 +2133,10 @@ sub process {
2133# Check for improperly formed commit descriptions 2133# Check for improperly formed commit descriptions
2134 if ($in_commit_log && 2134 if ($in_commit_log &&
2135 $line =~ /\bcommit\s+[0-9a-f]{5,}/i && 2135 $line =~ /\bcommit\s+[0-9a-f]{5,}/i &&
2136 $line !~ /\b[Cc]ommit [0-9a-f]{12,40} \("/) { 2136 !($line =~ /\b[Cc]ommit [0-9a-f]{12,40} \("/ ||
2137 ($line =~ /\b[Cc]ommit [0-9a-f]{12,40}\s*$/ &&
2138 defined $rawlines[$linenr] &&
2139 $rawlines[$linenr] =~ /^\s*\("/))) {
2137 $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i; 2140 $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i;
2138 my $init_char = $1; 2141 my $init_char = $1;
2139 my $orig_commit = lc($2); 2142 my $orig_commit = lc($2);
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 899b4230320e..dd8397894d5c 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -13,7 +13,7 @@
13# Random bits by Matt Mackall <mpm@selenic.com> 13# Random bits by Matt Mackall <mpm@selenic.com>
14# M68k port by Geert Uytterhoeven and Andreas Schwab 14# M68k port by Geert Uytterhoeven and Andreas Schwab
15# AVR32 port by Haavard Skinnemoen (Atmel) 15# AVR32 port by Haavard Skinnemoen (Atmel)
16# PARISC port by Kyle McMartin <kyle@parisc-linux.org> 16# AArch64, PARISC ports by Kyle McMartin
17# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> 17# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
18# 18#
19# Usage: 19# Usage:
@@ -45,7 +45,10 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
45 $x = "[0-9a-f]"; # hex character 45 $x = "[0-9a-f]"; # hex character
46 $xs = "[0-9a-f ]"; # hex character or space 46 $xs = "[0-9a-f ]"; # hex character or space
47 $funcre = qr/^$x* <(.*)>:$/; 47 $funcre = qr/^$x* <(.*)>:$/;
48 if ($arch eq 'arm') { 48 if ($arch eq 'aarch64') {
49 #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp,#-80]!
50 $re = qr/^.*stp.*sp,\#-([0-9]{1,8})\]\!/o;
51 } elsif ($arch eq 'arm') {
49 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 52 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64
50 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; 53 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
51 } elsif ($arch eq 'avr32') { 54 } elsif ($arch eq 'avr32') {
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index dc7aa45e80ce..c6d33bd15b04 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -84,7 +84,7 @@ static void usage(void)
84 */ 84 */
85static inline int is_arm_mapping_symbol(const char *str) 85static inline int is_arm_mapping_symbol(const char *str)
86{ 86{
87 return str[0] == '$' && strchr("atd", str[1]) 87 return str[0] == '$' && strchr("axtd", str[1])
88 && (str[2] == '\0' || str[2] == '.'); 88 && (str[2] == '\0' || str[2] == '.');
89} 89}
90 90
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 9c4d2412fb72..ebf40f6edb4d 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -104,6 +104,23 @@ endif
104%_defconfig: $(obj)/conf 104%_defconfig: $(obj)/conf
105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
106 106
107configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
108
109define mergeconfig
110$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
111$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
112$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
113$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
114endef
115
116PHONY += kvmconfig
117kvmconfig:
118 $(call mergeconfig,kvm_guest)
119
120PHONY += tinyconfig
121tinyconfig: allnoconfig
122 $(call mergeconfig,tiny)
123
107# Help text used by make help 124# Help text used by make help
108help: 125help:
109 @echo ' config - Update current config utilising a line-oriented program' 126 @echo ' config - Update current config utilising a line-oriented program'
@@ -124,6 +141,8 @@ help:
124 @echo ' randconfig - New config with random answer to all options' 141 @echo ' randconfig - New config with random answer to all options'
125 @echo ' listnewconfig - List new options' 142 @echo ' listnewconfig - List new options'
126 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' 143 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
144 @echo ' kvmconfig - Enable additional options for guest kernel support'
145 @echo ' tinyconfig - Configure the tiniest possible kernel'
127 146
128# lxdialog stuff 147# lxdialog stuff
129check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh 148check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 091d90573b63..d439856f8176 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -24,9 +24,9 @@
24#include "../../include/linux/export.h" 24#include "../../include/linux/export.h"
25 25
26/* Are we using CONFIG_MODVERSIONS? */ 26/* Are we using CONFIG_MODVERSIONS? */
27int modversions = 0; 27static int modversions = 0;
28/* Warn about undefined symbols? (do so if we have vmlinux) */ 28/* Warn about undefined symbols? (do so if we have vmlinux) */
29int have_vmlinux = 0; 29static int have_vmlinux = 0;
30/* Is CONFIG_MODULE_SRCVERSION_ALL set? */ 30/* Is CONFIG_MODULE_SRCVERSION_ALL set? */
31static int all_versions = 0; 31static int all_versions = 0;
32/* If we are modposting external module set to 1 */ 32/* If we are modposting external module set to 1 */
@@ -229,7 +229,7 @@ static struct symbol *find_symbol(const char *name)
229 return NULL; 229 return NULL;
230} 230}
231 231
232static struct { 232static const struct {
233 const char *str; 233 const char *str;
234 enum export export; 234 enum export export;
235} export_list[] = { 235} export_list[] = {
@@ -805,7 +805,7 @@ static int match(const char *sym, const char * const pat[])
805} 805}
806 806
807/* sections that we do not want to do full section mismatch check on */ 807/* sections that we do not want to do full section mismatch check on */
808static const char *section_white_list[] = 808static const char *const section_white_list[] =
809{ 809{
810 ".comment*", 810 ".comment*",
811 ".debug*", 811 ".debug*",
@@ -882,17 +882,18 @@ static void check_section(const char *modname, struct elf_info *elf,
882#define MEM_EXIT_SECTIONS ".memexit.*" 882#define MEM_EXIT_SECTIONS ".memexit.*"
883 883
884/* init data sections */ 884/* init data sections */
885static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL }; 885static const char *const init_data_sections[] =
886 { ALL_INIT_DATA_SECTIONS, NULL };
886 887
887/* all init sections */ 888/* all init sections */
888static const char *init_sections[] = { ALL_INIT_SECTIONS, NULL }; 889static const char *const init_sections[] = { ALL_INIT_SECTIONS, NULL };
889 890
890/* All init and exit sections (code + data) */ 891/* All init and exit sections (code + data) */
891static const char *init_exit_sections[] = 892static const char *const init_exit_sections[] =
892 {ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL }; 893 {ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL };
893 894
894/* data section */ 895/* data section */
895static const char *data_sections[] = { DATA_SECTIONS, NULL }; 896static const char *const data_sections[] = { DATA_SECTIONS, NULL };
896 897
897 898
898/* symbols in .data that may refer to init/exit sections */ 899/* symbols in .data that may refer to init/exit sections */
@@ -906,8 +907,8 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL };
906 "*_probe_one", \ 907 "*_probe_one", \
907 "*_console" 908 "*_console"
908 909
909static const char *head_sections[] = { ".head.text*", NULL }; 910static const char *const head_sections[] = { ".head.text*", NULL };
910static const char *linker_symbols[] = 911static const char *const linker_symbols[] =
911 { "__init_begin", "_sinittext", "_einittext", NULL }; 912 { "__init_begin", "_sinittext", "_einittext", NULL };
912 913
913enum mismatch { 914enum mismatch {
@@ -929,7 +930,7 @@ struct sectioncheck {
929 const char *symbol_white_list[20]; 930 const char *symbol_white_list[20];
930}; 931};
931 932
932const struct sectioncheck sectioncheck[] = { 933static const struct sectioncheck sectioncheck[] = {
933/* Do not reference init/exit code/data from 934/* Do not reference init/exit code/data from
934 * normal code and data 935 * normal code and data
935 */ 936 */
@@ -1146,7 +1147,7 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
1146 1147
1147static inline int is_arm_mapping_symbol(const char *str) 1148static inline int is_arm_mapping_symbol(const char *str)
1148{ 1149{
1149 return str[0] == '$' && strchr("atd", str[1]) 1150 return str[0] == '$' && strchr("axtd", str[1])
1150 && (str[2] == '\0' || str[2] == '.'); 1151 && (str[2] == '\0' || str[2] == '.');
1151} 1152}
1152 1153
@@ -2211,7 +2212,7 @@ int main(int argc, char **argv)
2211 err = 0; 2212 err = 0;
2212 2213
2213 for (mod = modules; mod; mod = mod->next) { 2214 for (mod = modules; mod; mod = mod->next) {
2214 char fname[strlen(mod->name) + 10]; 2215 char fname[PATH_MAX];
2215 2216
2216 if (mod->skip) 2217 if (mod->skip)
2217 continue; 2218 continue;
diff --git a/scripts/sign-file b/scripts/sign-file
index 2b7c4484d46c..3906ee1e2f76 100755
--- a/scripts/sign-file
+++ b/scripts/sign-file
@@ -398,7 +398,7 @@ if ($verbose) {
398 print "Size of signer's name : ", length($signers_name), "\n"; 398 print "Size of signer's name : ", length($signers_name), "\n";
399 print "Size of key identifier : ", length($key_identifier), "\n"; 399 print "Size of key identifier : ", length($key_identifier), "\n";
400 print "Size of signature : ", length($signature), "\n"; 400 print "Size of signature : ", length($signature), "\n";
401 print "Size of informaton : ", length($info), "\n"; 401 print "Size of information : ", length($info), "\n";
402 print "Size of magic number : ", length($magic_number), "\n"; 402 print "Size of magic number : ", length($magic_number), "\n";
403 print "Signer's name : '", $signers_name, "'\n"; 403 print "Signer's name : '", $signers_name, "'\n";
404 print "Digest : $dgst\n"; 404 print "Digest : $dgst\n";
diff --git a/scripts/tags.sh b/scripts/tags.sh
index cbfd269a6011..293828bfd4ac 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -197,6 +197,9 @@ exuberant()
197 --regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \ 197 --regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
198 --regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \ 198 --regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
199 --regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \ 199 --regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
200 --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
201 --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
202 --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
200 --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \ 203 --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
201 --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \ 204 --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
202 --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \ 205 --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \
@@ -260,6 +263,9 @@ emacs()
260 --regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \ 263 --regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
261 --regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \ 264 --regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
262 --regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \ 265 --regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
266 --regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
267 --regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
268 --regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \
263 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \ 269 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
264 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \ 270 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
265 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\ 271 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\