diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 16 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 51 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 12 | ||||
-rw-r--r-- | scripts/package/Makefile | 3 | ||||
-rwxr-xr-x | scripts/package/mkspec | 2 | ||||
-rw-r--r-- | scripts/unifdef.c | 6 |
7 files changed, 70 insertions, 22 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3b949a354470..979619574f70 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -97,7 +97,7 @@ modname_flags = $(if $(filter 1,$(words $(modname))),\ | |||
97 | -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") | 97 | -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") |
98 | 98 | ||
99 | #hash values | 99 | #hash values |
100 | ifdef CONFIG_DYNAMIC_PRINTK_DEBUG | 100 | ifdef CONFIG_DYNAMIC_DEBUG |
101 | debug_flags = -D"DEBUG_HASH=$(shell ./scripts/basic/hash djb2 $(@D)$(modname))"\ | 101 | debug_flags = -D"DEBUG_HASH=$(shell ./scripts/basic/hash djb2 $(@D)$(modname))"\ |
102 | -D"DEBUG_HASH2=$(shell ./scripts/basic/hash r5 $(@D)$(modname))" | 102 | -D"DEBUG_HASH2=$(shell ./scripts/basic/hash r5 $(@D)$(modname))" |
103 | else | 103 | else |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 3e1057f885c6..d190092c3b6e 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <time.h> | 11 | #include <time.h> |
12 | #include <unistd.h> | 12 | #include <unistd.h> |
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
14 | #include <sys/time.h> | ||
14 | 15 | ||
15 | #define LKC_DIRECT_LINK | 16 | #define LKC_DIRECT_LINK |
16 | #include "lkc.h" | 17 | #include "lkc.h" |
@@ -464,9 +465,22 @@ int main(int ac, char **av) | |||
464 | input_mode = set_yes; | 465 | input_mode = set_yes; |
465 | break; | 466 | break; |
466 | case 'r': | 467 | case 'r': |
468 | { | ||
469 | struct timeval now; | ||
470 | unsigned int seed; | ||
471 | |||
472 | /* | ||
473 | * Use microseconds derived seed, | ||
474 | * compensate for systems where it may be zero | ||
475 | */ | ||
476 | gettimeofday(&now, NULL); | ||
477 | |||
478 | seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1)); | ||
479 | srand(seed); | ||
480 | |||
467 | input_mode = set_random; | 481 | input_mode = set_random; |
468 | srand(time(NULL)); | ||
469 | break; | 482 | break; |
483 | } | ||
470 | case 'h': | 484 | case 'h': |
471 | printf(_("See README for usage info\n")); | 485 | printf(_("See README for usage info\n")); |
472 | exit(0); | 486 | exit(0); |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 830d9eae11f9..273d73888f9d 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -843,7 +843,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
843 | default: | 843 | default: |
844 | continue; | 844 | continue; |
845 | } | 845 | } |
846 | if (!sym_is_choice(sym) || mode != def_random) | 846 | if (!(sym_is_choice(sym) && mode == def_random)) |
847 | sym->flags |= SYMBOL_DEF_USER; | 847 | sym->flags |= SYMBOL_DEF_USER; |
848 | break; | 848 | break; |
849 | default: | 849 | default: |
@@ -856,28 +856,49 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
856 | 856 | ||
857 | if (mode != def_random) | 857 | if (mode != def_random) |
858 | return; | 858 | return; |
859 | 859 | /* | |
860 | * We have different type of choice blocks. | ||
861 | * If curr.tri equal to mod then we can select several | ||
862 | * choice symbols in one block. | ||
863 | * In this case we do nothing. | ||
864 | * If curr.tri equal yes then only one symbol can be | ||
865 | * selected in a choice block and we set it to yes, | ||
866 | * and the rest to no. | ||
867 | */ | ||
860 | for_all_symbols(i, csym) { | 868 | for_all_symbols(i, csym) { |
861 | if (sym_has_value(csym) || !sym_is_choice(csym)) | 869 | if (sym_has_value(csym) || !sym_is_choice(csym)) |
862 | continue; | 870 | continue; |
863 | 871 | ||
864 | sym_calc_value(csym); | 872 | sym_calc_value(csym); |
873 | |||
874 | if (csym->curr.tri != yes) | ||
875 | continue; | ||
876 | |||
865 | prop = sym_get_choice_prop(csym); | 877 | prop = sym_get_choice_prop(csym); |
866 | def = -1; | 878 | |
867 | while (1) { | 879 | /* count entries in choice block */ |
868 | cnt = 0; | 880 | cnt = 0; |
869 | expr_list_for_each_sym(prop->expr, e, sym) { | 881 | expr_list_for_each_sym(prop->expr, e, sym) |
870 | if (sym->visible == no) | 882 | cnt++; |
871 | continue; | 883 | |
872 | if (def == cnt++) { | 884 | /* |
873 | csym->def[S_DEF_USER].val = sym; | 885 | * find a random value and set it to yes, |
874 | break; | 886 | * set the rest to no so we have only one set |
875 | } | 887 | */ |
888 | def = (rand() % cnt); | ||
889 | |||
890 | cnt = 0; | ||
891 | expr_list_for_each_sym(prop->expr, e, sym) { | ||
892 | if (def == cnt++) { | ||
893 | sym->def[S_DEF_USER].tri = yes; | ||
894 | csym->def[S_DEF_USER].val = sym; | ||
895 | } | ||
896 | else { | ||
897 | sym->def[S_DEF_USER].tri = no; | ||
876 | } | 898 | } |
877 | if (def >= 0 || cnt < 2) | ||
878 | break; | ||
879 | def = (rand() % cnt) + 1; | ||
880 | } | 899 | } |
881 | csym->flags |= SYMBOL_DEF_USER; | 900 | csym->flags |= SYMBOL_DEF_USER; |
901 | /* clear VALID to get value calculated */ | ||
902 | csym->flags &= ~(SYMBOL_VALID); | ||
882 | } | 903 | } |
883 | } | 904 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 4eea60b1693e..a3344285ccf4 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -710,6 +710,14 @@ static int do_dmi_entry(const char *filename, struct dmi_system_id *id, | |||
710 | strcat(alias, ":"); | 710 | strcat(alias, ":"); |
711 | return 1; | 711 | return 1; |
712 | } | 712 | } |
713 | |||
714 | static int do_platform_entry(const char *filename, | ||
715 | struct platform_device_id *id, char *alias) | ||
716 | { | ||
717 | sprintf(alias, PLATFORM_MODULE_PREFIX "%s", id->name); | ||
718 | return 1; | ||
719 | } | ||
720 | |||
713 | /* Ignore any prefix, eg. some architectures prepend _ */ | 721 | /* Ignore any prefix, eg. some architectures prepend _ */ |
714 | static inline int sym_is(const char *symbol, const char *name) | 722 | static inline int sym_is(const char *symbol, const char *name) |
715 | { | 723 | { |
@@ -849,6 +857,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
849 | do_table(symval, sym->st_size, | 857 | do_table(symval, sym->st_size, |
850 | sizeof(struct dmi_system_id), "dmi", | 858 | sizeof(struct dmi_system_id), "dmi", |
851 | do_dmi_entry, mod); | 859 | do_dmi_entry, mod); |
860 | else if (sym_is(symname, "__mod_platform_device_table")) | ||
861 | do_table(symval, sym->st_size, | ||
862 | sizeof(struct platform_device_id), "platform", | ||
863 | do_platform_entry, mod); | ||
852 | free(zeros); | 864 | free(zeros); |
853 | } | 865 | } |
854 | 866 | ||
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 8c6b7b09606a..fa4a0a17b7e0 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -35,9 +35,10 @@ $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile | |||
35 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE | 35 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE |
36 | $(MAKE) clean | 36 | $(MAKE) clean |
37 | $(PREV) ln -sf $(srctree) $(KERNELPATH) | 37 | $(PREV) ln -sf $(srctree) $(KERNELPATH) |
38 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion | ||
38 | $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. | 39 | $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. |
39 | $(PREV) rm $(KERNELPATH) | 40 | $(PREV) rm $(KERNELPATH) |
40 | 41 | rm -f $(objtree)/.scmversion | |
41 | set -e; \ | 42 | set -e; \ |
42 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version | 43 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version |
43 | set -e; \ | 44 | set -e; \ |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index ee448cdc6a2b..3d93f8c81252 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -96,7 +96,7 @@ echo "%endif" | |||
96 | 96 | ||
97 | echo "" | 97 | echo "" |
98 | echo "%clean" | 98 | echo "%clean" |
99 | echo '#echo -rf $RPM_BUILD_ROOT' | 99 | echo 'rm -rf $RPM_BUILD_ROOT' |
100 | echo "" | 100 | echo "" |
101 | echo "%files" | 101 | echo "%files" |
102 | echo '%defattr (-, root, root)' | 102 | echo '%defattr (-, root, root)' |
diff --git a/scripts/unifdef.c b/scripts/unifdef.c index 552025e72acb..05a31a6c7e1b 100644 --- a/scripts/unifdef.c +++ b/scripts/unifdef.c | |||
@@ -206,7 +206,7 @@ static void done(void); | |||
206 | static void error(const char *); | 206 | static void error(const char *); |
207 | static int findsym(const char *); | 207 | static int findsym(const char *); |
208 | static void flushline(bool); | 208 | static void flushline(bool); |
209 | static Linetype getline(void); | 209 | static Linetype get_line(void); |
210 | static Linetype ifeval(const char **); | 210 | static Linetype ifeval(const char **); |
211 | static void ignoreoff(void); | 211 | static void ignoreoff(void); |
212 | static void ignoreon(void); | 212 | static void ignoreon(void); |
@@ -512,7 +512,7 @@ process(void) | |||
512 | 512 | ||
513 | for (;;) { | 513 | for (;;) { |
514 | linenum++; | 514 | linenum++; |
515 | lineval = getline(); | 515 | lineval = get_line(); |
516 | trans_table[ifstate[depth]][lineval](); | 516 | trans_table[ifstate[depth]][lineval](); |
517 | debug("process %s -> %s depth %d", | 517 | debug("process %s -> %s depth %d", |
518 | linetype_name[lineval], | 518 | linetype_name[lineval], |
@@ -526,7 +526,7 @@ process(void) | |||
526 | * help from skipcomment(). | 526 | * help from skipcomment(). |
527 | */ | 527 | */ |
528 | static Linetype | 528 | static Linetype |
529 | getline(void) | 529 | get_line(void) |
530 | { | 530 | { |
531 | const char *cp; | 531 | const char *cp; |
532 | int cursym; | 532 | int cursym; |