diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.asm-generic | 1 | ||||
-rw-r--r-- | scripts/bootgraph.pl | 2 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 5 | ||||
-rwxr-xr-x | scripts/depmod.sh | 50 | ||||
-rw-r--r-- | scripts/docproc.c | 17 | ||||
-rw-r--r-- | scripts/gcc-goto.sh | 2 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 29 | ||||
-rw-r--r-- | scripts/package/Makefile | 8 |
8 files changed, 96 insertions, 18 deletions
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index 490122c3e2aa..40caf3c26cd5 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic @@ -17,6 +17,7 @@ quiet_cmd_wrap = WRAP $@ cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ all: $(patsubst %, $(obj)/%, $(generic-y)) + @: $(obj)/%.h: $(call cmd,wrap) diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index 12caa822a232..b78fca994a15 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl @@ -44,7 +44,7 @@ my %end; my %type; my $done = 0; my $maxtime = 0; -my $firsttime = 100; +my $firsttime = 99999; my $count = 0; my %pids; my %pidctr; diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8657f99bfb2b..b0aa2c680593 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1943,6 +1943,11 @@ sub process { WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); } +# check for uses of printk_ratelimit + if ($line =~ /\bprintk_ratelimit\s*\(/) { + WARN("Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr); + } + # printk should use KERN_* levels. Note that follow on printk's on the # same line do not need a level, so we use the current block context # to try and find and validate the current printk. In summary the current diff --git a/scripts/depmod.sh b/scripts/depmod.sh new file mode 100755 index 000000000000..a27235685949 --- /dev/null +++ b/scripts/depmod.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# +# A depmod wrapper used by the toplevel Makefile + +if test $# -ne 2; then + echo "Usage: $0 /sbin/depmod <kernelrelease>" >&2 + exit 1 +fi +DEPMOD=$1 +KERNELRELEASE=$2 + +if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then + echo "Warning: you may need to install module-init-tools" >&2 + echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2 + sleep 1 +fi + +if ! test -r System.map -a -x "$DEPMOD"; then + exit 0 +fi +# older versions of depmod require the version string to start with three +# numbers, so we cheat with a symlink here +depmod_hack_needed=true +tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX) +mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE" +if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then + if test -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep" -o \ + -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep.bin"; then + depmod_hack_needed=false + fi +fi +rm -rf "$tmp_dir" +if $depmod_hack_needed; then + symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" + ln -s "$KERNELRELEASE" "$symlink" + KERNELRELEASE=99.98.$KERNELRELEASE +fi + +set -- -ae -F System.map +if test -n "$INSTALL_MOD_PATH"; then + set -- "$@" -b "$INSTALL_MOD_PATH" +fi +"$DEPMOD" "$@" "$KERNELRELEASE" +ret=$? + +if $depmod_hack_needed; then + rm -f "$symlink" +fi + +exit $ret diff --git a/scripts/docproc.c b/scripts/docproc.c index 98dec87974d0..4cfdc1797eb8 100644 --- a/scripts/docproc.c +++ b/scripts/docproc.c @@ -205,8 +205,7 @@ static void find_export_symbols(char * filename) PATH_MAX - strlen(real_filename)); sym = add_new_file(filename); fp = fopen(real_filename, "r"); - if (fp == NULL) - { + if (fp == NULL) { fprintf(stderr, "docproc: "); perror(real_filename); exit(1); @@ -487,8 +486,7 @@ static void parse_file(FILE *infile) default: defaultline(line); } - } - else { + } else { defaultline(line); } } @@ -519,8 +517,7 @@ int main(int argc, char *argv[]) exit(2); } - if (strcmp("doc", argv[1]) == 0) - { + if (strcmp("doc", argv[1]) == 0) { /* Need to do this in two passes. * First pass is used to collect all symbols exported * in the various files; @@ -556,9 +553,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Warning: didn't use docs for %s\n", all_list[i]); } - } - else if (strcmp("depend", argv[1]) == 0) - { + } else if (strcmp("depend", argv[1]) == 0) { /* Create first part of dependency chain * file.tmpl */ printf("%s\t", argv[2]); @@ -571,9 +566,7 @@ int main(int argc, char *argv[]) findall = adddep; parse_file(infile); printf("\n"); - } - else - { + } else { fprintf(stderr, "Unknown option: %s\n", argv[1]); exit(1); } diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh index 520d16b1ffaf..98cffcb941ea 100644 --- a/scripts/gcc-goto.sh +++ b/scripts/gcc-goto.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Test for gcc 'asm goto' suport +# Test for gcc 'asm goto' support # Copyright (C) 2010, Jason Baron <jbaron@redhat.com> echo "int main(void) { entry: asm goto (\"\"::::entry); return 0; }" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 413c53693e62..a509ff8f32fa 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -254,6 +254,28 @@ static enum export export_no(const char *s) return export_unknown; } +static const char *sec_name(struct elf_info *elf, int secindex); + +#define strstarts(str, prefix) (strncmp(str, prefix, strlen(prefix)) == 0) + +static enum export export_from_secname(struct elf_info *elf, unsigned int sec) +{ + const char *secname = sec_name(elf, sec); + + if (strstarts(secname, "___ksymtab+")) + return export_plain; + else if (strstarts(secname, "___ksymtab_unused+")) + return export_unused; + else if (strstarts(secname, "___ksymtab_gpl+")) + return export_gpl; + else if (strstarts(secname, "___ksymtab_unused_gpl+")) + return export_unused_gpl; + else if (strstarts(secname, "___ksymtab_gpl_future+")) + return export_gpl_future; + else + return export_unknown; +} + static enum export export_from_sec(struct elf_info *elf, unsigned int sec) { if (sec == elf->export_sec) @@ -563,7 +585,12 @@ static void handle_modversions(struct module *mod, struct elf_info *info, Elf_Sym *sym, const char *symname) { unsigned int crc; - enum export export = export_from_sec(info, get_secindex(info, sym)); + enum export export; + + if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0) + export = export_from_secname(info, get_secindex(info, sym)); + else + export = export_from_sec(info, get_secindex(info, sym)); switch (sym->st_shndx) { case SHN_COMMON: diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 006960ebbce9..bc6aa003860e 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -118,10 +118,12 @@ perf-tar=perf-$(KERNELVERSION) quiet_cmd_perf_tar = TAR cmd_perf_tar = \ -git archive --prefix=$(perf-tar)/ HEAD^{tree} \ - $$(cat $(srctree)/tools/perf/MANIFEST) -o $(perf-tar).tar; \ +git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ + HEAD^{tree} $$(cd $(srctree); \ + echo $$(cat $(srctree)/tools/perf/MANIFEST)) \ + -o $(perf-tar).tar; \ mkdir -p $(perf-tar); \ -git rev-parse HEAD > $(perf-tar)/HEAD; \ +git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ tar rf $(perf-tar).tar $(perf-tar)/HEAD; \ rm -r $(perf-tar); \ $(if $(findstring tar-src,$@),, \ |