Dash:
[t2-trunk.git] / architecture / riscv / package / linux-header / 12-conf-hacks.patch
blob4574ced9c2857902be0c5dba40697fb200b347a5
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
3 #
4 # T2 SDE: architecture/riscv/package/*/12-conf-hacks.patch
5 # Copyright (C) 2004 - 2021 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
7 #
8 # More information can be found in the files COPYING and README.
9 #
10 # This patch file is dual-licensed. It is available under the license the
11 # patched project is licensed under, as long as it is an OpenSource license
12 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
13 # of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
15 # version.
16 # --- T2-COPYRIGHT-NOTE-END ---
18 Set all unset options to module. Needed by the T2 SDE Linux kernel
19 auto configuration.
21 Initally written by Clifford Wolf <clifford@clifford.at> and adapted
22 for various new 2.5/2.6 kernels by Rene Rebe <rene@exactcode.de>.
24 --- linux-2.6.36/scripts/kconfig/conf.c.vanilla 2010-11-29 11:39:16.000000000 +0100
25 +++ linux-2.6.36/scripts/kconfig/conf.c 2010-11-29 11:34:27.000000000 +0100
26 @@ -24,6 +24,7 @@
27 oldaskconfig,
28 silentoldconfig,
29 oldconfig,
30 + setno2mod,
31 allnoconfig,
32 allyesconfig,
33 allmodconfig,
34 @@ -446,6 +447,7 @@
35 {"silentoldconfig", no_argument, NULL, silentoldconfig},
36 {"defconfig", optional_argument, NULL, defconfig},
37 {"savedefconfig", required_argument, NULL, savedefconfig},
38 + {"no2modconfig", no_argument, NULL, setno2mod},
39 {"allnoconfig", no_argument, NULL, allnoconfig},
40 {"allyesconfig", no_argument, NULL, allyesconfig},
41 {"allmodconfig", no_argument, NULL, allmodconfig},
42 @@ -562,6 +564,9 @@
43 else if (!stat("all.config", &tmpstat))
44 conf_read_simple("all.config", S_DEF_USER);
45 break;
46 + case setno2mod:
47 + conf_read_simple(".config", S_DEF_USER);
48 + break;
49 default:
50 break;
52 @@ -579,6 +584,9 @@
55 switch (input_mode) {
56 + case setno2mod:
57 + conf_set_all_new_symbols(def_no2mod);
58 + break;
59 case allnoconfig:
60 conf_set_all_new_symbols(def_no);
61 break;
62 --- linux-2.6.27/scripts/kconfig/lkc.h 2008-10-10 00:13:53.000000000 +0200
63 +++ linux-2.6.27.work/scripts/kconfig/lkc.h 2008-10-19 14:14:59.000000000 +0200
64 @@ -46,6 +46,7 @@
65 def_default,
66 def_yes,
67 def_mod,
68 + def_no2mod,
69 def_no,
70 def_random
72 --- linux-4.19-rc5/scripts/kconfig/Makefile.vanilla 2018-09-24 12:47:39.569030625 +0200
73 +++ linux-4.19-rc5/scripts/kconfig/Makefile 2018-09-24 12:48:00.641133642 +0200
74 @@ -4,7 +4,8 @@
75 # These targets are used from top-level makefile
77 PHONY += xconfig gconfig menuconfig config localmodconfig localyesconfig \
78 - build_menuconfig build_nconfig build_gconfig build_xconfig
79 + build_menuconfig build_nconfig build_gconfig build_xconfig \
80 + no2modconfig
82 ifdef KBUILD_KCONFIG
83 Kconfig := $(KBUILD_KCONFIG)
84 @@ -93,6 +93,9 @@
85 savedefconfig: $(obj)/conf
86 $< $(silent) --$@=defconfig $(Kconfig)
88 +no2modconfig: scripts/kconfig/conf
89 + $< --no2modconfig $(Kconfig)
91 defconfig: $(obj)/conf
92 ifeq ($(KBUILD_DEFCONFIG),)
93 $< $(silent) --defconfig $(Kconfig)
94 @@ -132,6 +135,7 @@
95 @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
96 @echo ' defconfig - New config with default from ARCH supplied defconfig'
97 @echo ' savedefconfig - Save current config as ./defconfig (minimal config)'
98 + @echo ' no2modconfig - New config selecting modules for disabled options'
99 @echo ' allnoconfig - New config where all options are answered with no'
100 @echo ' allyesconfig - New config where all options are accepted with yes'
101 @echo ' allmodconfig - New config selecting modules when possible'
102 --- linux-2.6.27.vanilla/scripts/kconfig/confdata.c 2008-10-10 00:13:53.000000000 +0200
103 +++ linux-2.6.27/scripts/kconfig/confdata.c 2008-10-20 12:45:07.000000000 +0200
104 @@ -824,6 +824,17 @@
105 for_all_symbols(i, sym) {
106 if (sym_has_value(sym))
107 continue;
108 + if ((mode == def_no2mod) && (sym->type == S_TRISTATE)) {
109 + if (sym_get_tristate_value(sym) == no)
110 + fprintf(stderr, "Setting %s to 'm'.\n", sym->name);
111 + if (sym_get_tristate_value(sym) == mod)
112 + fprintf(stderr, "Keep %s as 'm'.\n", sym->name);
113 + if (sym_get_tristate_value(sym) != yes)
114 + sym->def[S_DEF_USER].tri = mod;
115 + if (!sym_is_choice(sym))
116 + sym->flags |= SYMBOL_DEF_USER;
117 + continue;
119 switch (sym_get_type(sym)) {
120 case S_BOOLEAN:
121 case S_TRISTATE: