aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.fwinst4
-rwxr-xr-xscripts/checksyscalls.sh2
-rw-r--r--scripts/coccinelle/api/memdup_user.cocci4
-rw-r--r--scripts/kconfig/streamline_config.pl50
-rw-r--r--scripts/link-vmlinux.sh7
5 files changed, 35 insertions, 32 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index c3f69ae275d1..4d908d16c035 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -27,7 +27,7 @@ endif
27installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) 27installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
28 28
29installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) 29installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
30installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. 30installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
31 31
32# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. 32# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
33PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs 33PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
@@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
42$(installed-fw-dirs): 42$(installed-fw-dirs):
43 $(call cmd,mkdir) 43 $(call cmd,mkdir)
44 44
45$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%) 45$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
46 $(call cmd,install) 46 $(call cmd,install)
47 47
48PHONY += __fw_install __fw_modinst FORCE 48PHONY += __fw_install __fw_modinst FORCE
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index d24810fc6af6..fd8fa9aa7c4e 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -200,7 +200,7 @@ EOF
200syscall_list() { 200syscall_list() {
201 grep '^[0-9]' "$1" | sort -n | ( 201 grep '^[0-9]' "$1" | sort -n | (
202 while read nr abi name entry ; do 202 while read nr abi name entry ; do
203 echo <<EOF 203 cat <<EOF
204#if !defined(__NR_${name}) && !defined(__IGNORE_${name}) 204#if !defined(__NR_${name}) && !defined(__IGNORE_${name})
205#warning syscall ${name} not implemented 205#warning syscall ${name} not implemented
206#endif 206#endif
diff --git a/scripts/coccinelle/api/memdup_user.cocci b/scripts/coccinelle/api/memdup_user.cocci
index 2efac289fd59..2b131a8a1306 100644
--- a/scripts/coccinelle/api/memdup_user.cocci
+++ b/scripts/coccinelle/api/memdup_user.cocci
@@ -51,10 +51,10 @@ statement S1,S2;
51p << r.p; 51p << r.p;
52@@ 52@@
53 53
54coccilib.org.print_todo(p[0], "WARNING opportunity for memdep_user") 54coccilib.org.print_todo(p[0], "WARNING opportunity for memdup_user")
55 55
56@script:python depends on report@ 56@script:python depends on report@
57p << r.p; 57p << r.p;
58@@ 58@@
59 59
60coccilib.report.print_report(p[0], "WARNING opportunity for memdep_user") 60coccilib.report.print_report(p[0], "WARNING opportunity for memdup_user")
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 2fbbbc1ddea0..33689396953a 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -100,7 +100,7 @@ my @searchconfigs = (
100 }, 100 },
101); 101);
102 102
103sub find_config { 103sub read_config {
104 foreach my $conf (@searchconfigs) { 104 foreach my $conf (@searchconfigs) {
105 my $file = $conf->{"file"}; 105 my $file = $conf->{"file"};
106 106
@@ -115,17 +115,15 @@ sub find_config {
115 115
116 print STDERR "using config: '$file'\n"; 116 print STDERR "using config: '$file'\n";
117 117
118 open(CIN, "$exec $file |") || die "Failed to run $exec $file"; 118 open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file";
119 return; 119 my @x = <$infile>;
120 close $infile;
121 return @x;
120 } 122 }
121 die "No config file found"; 123 die "No config file found";
122} 124}
123 125
124find_config; 126my @config_file = read_config;
125
126# Read in the entire config file into config_file
127my @config_file = <CIN>;
128close CIN;
129 127
130# Parse options 128# Parse options
131my $localmodconfig = 0; 129my $localmodconfig = 0;
@@ -135,7 +133,7 @@ GetOptions("localmodconfig" => \$localmodconfig,
135 "localyesconfig" => \$localyesconfig); 133 "localyesconfig" => \$localyesconfig);
136 134
137# Get the build source and top level Kconfig file (passed in) 135# Get the build source and top level Kconfig file (passed in)
138my $ksource = $ARGV[0]; 136my $ksource = ($ARGV[0] ? $ARGV[0] : '.');
139my $kconfig = $ARGV[1]; 137my $kconfig = $ARGV[1];
140my $lsmod_file = $ENV{'LSMOD'}; 138my $lsmod_file = $ENV{'LSMOD'};
141 139
@@ -173,8 +171,8 @@ sub read_kconfig {
173 $source =~ s/\$$env/$ENV{$env}/; 171 $source =~ s/\$$env/$ENV{$env}/;
174 } 172 }
175 173
176 open(KIN, "$source") || die "Can't open $kconfig"; 174 open(my $kinfile, '<', $source) || die "Can't open $kconfig";
177 while (<KIN>) { 175 while (<$kinfile>) {
178 chomp; 176 chomp;
179 177
180 # Make sure that lines ending with \ continue 178 # Make sure that lines ending with \ continue
@@ -251,10 +249,10 @@ sub read_kconfig {
251 $state = "NONE"; 249 $state = "NONE";
252 } 250 }
253 } 251 }
254 close(KIN); 252 close($kinfile);
255 253
256 # read in any configs that were found. 254 # read in any configs that were found.
257 foreach $kconfig (@kconfigs) { 255 foreach my $kconfig (@kconfigs) {
258 if (!defined($read_kconfigs{$kconfig})) { 256 if (!defined($read_kconfigs{$kconfig})) {
259 $read_kconfigs{$kconfig} = 1; 257 $read_kconfigs{$kconfig} = 1;
260 read_kconfig($kconfig); 258 read_kconfig($kconfig);
@@ -295,8 +293,8 @@ foreach my $makefile (@makefiles) {
295 my $line = ""; 293 my $line = "";
296 my %make_vars; 294 my %make_vars;
297 295
298 open(MIN,$makefile) || die "Can't open $makefile"; 296 open(my $infile, '<', $makefile) || die "Can't open $makefile";
299 while (<MIN>) { 297 while (<$infile>) {
300 # if this line ends with a backslash, continue 298 # if this line ends with a backslash, continue
301 chomp; 299 chomp;
302 if (/^(.*)\\$/) { 300 if (/^(.*)\\$/) {
@@ -343,10 +341,11 @@ foreach my $makefile (@makefiles) {
343 } 341 }
344 } 342 }
345 } 343 }
346 close(MIN); 344 close($infile);
347} 345}
348 346
349my %modules; 347my %modules;
348my $linfile;
350 349
351if (defined($lsmod_file)) { 350if (defined($lsmod_file)) {
352 if ( ! -f $lsmod_file) { 351 if ( ! -f $lsmod_file) {
@@ -356,13 +355,10 @@ if (defined($lsmod_file)) {
356 die "$lsmod_file not found"; 355 die "$lsmod_file not found";
357 } 356 }
358 } 357 }
359 if ( -x $lsmod_file) { 358
360 # the file is executable, run it 359 my $otype = ( -x $lsmod_file) ? '-|' : '<';
361 open(LIN, "$lsmod_file|"); 360 open($linfile, $otype, $lsmod_file);
362 } else { 361
363 # Just read the contents
364 open(LIN, "$lsmod_file");
365 }
366} else { 362} else {
367 363
368 # see what modules are loaded on this system 364 # see what modules are loaded on this system
@@ -379,16 +375,16 @@ if (defined($lsmod_file)) {
379 $lsmod = "lsmod"; 375 $lsmod = "lsmod";
380 } 376 }
381 377
382 open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod"; 378 open($linfile, '-|', $lsmod) || die "Can not call lsmod with $lsmod";
383} 379}
384 380
385while (<LIN>) { 381while (<$linfile>) {
386 next if (/^Module/); # Skip the first line. 382 next if (/^Module/); # Skip the first line.
387 if (/^(\S+)/) { 383 if (/^(\S+)/) {
388 $modules{$1} = 1; 384 $modules{$1} = 1;
389 } 385 }
390} 386}
391close (LIN); 387close ($linfile);
392 388
393# add to the configs hash all configs that are needed to enable 389# add to the configs hash all configs that are needed to enable
394# a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o 390# a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o
@@ -605,6 +601,8 @@ foreach my $line (@config_file) {
605 if (defined($configs{$1})) { 601 if (defined($configs{$1})) {
606 if ($localyesconfig) { 602 if ($localyesconfig) {
607 $setconfigs{$1} = 'y'; 603 $setconfigs{$1} = 'y';
604 print "$1=y\n";
605 next;
608 } else { 606 } else {
609 $setconfigs{$1} = $2; 607 $setconfigs{$1} = $2;
610 } 608 }
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 4235a6361fec..b3d907eb93a9 100644
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -74,8 +74,13 @@ kallsyms()
74 info KSYM ${2} 74 info KSYM ${2}
75 local kallsymopt; 75 local kallsymopt;
76 76
77 if [ -n "${CONFIG_SYMBOL_PREFIX}" ]; then
78 kallsymopt="${kallsymopt} \
79 --symbol-prefix=${CONFIG_SYMBOL_PREFIX}"
80 fi
81
77 if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then 82 if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then
78 kallsymopt=--all-symbols 83 kallsymopt="${kallsymopt} --all-symbols"
79 fi 84 fi
80 85
81 local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ 86 local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \