Dash:
[t2-trunk.git] / package / base / linux / 12-conf-hacks.patch
blob200d48f84140a646bd839bc98cd6abebfc50dbbc
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/*/linux/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, 3.x, 4.x and 5.x kernels
23 by Rene Rebe <rene@exactcode.de>.
25 --- ./scripts/kconfig/conf.c.orig 2021-06-28 00:21:11.000000000 +0200
26 +++ ./scripts/kconfig/conf.c 2021-06-29 18:16:43.215860970 +0200
27 @@ -23,6 +23,7 @@
28 oldaskconfig,
29 syncconfig,
30 oldconfig,
31 + no2modconfig,
32 allnoconfig,
33 allyesconfig,
34 allmodconfig,
35 @@ -166,6 +167,7 @@
36 def_y2m,
37 def_m2y,
38 def_no,
39 + def_no2m,
40 def_random
43 @@ -228,8 +230,23 @@
46 for_all_symbols(i, sym) {
47 - if (sym_has_value(sym) || sym->flags & SYMBOL_VALID)
48 + if (sym_has_value(sym)) /* user defined? */
49 continue;
51 + if ((mode == def_no2m) && (sym->type == S_TRISTATE)) {
52 + fprintf(stderr, "%s %d\n", sym->name, sym_get_tristate_value(sym));
53 + if (sym_get_tristate_value(sym) != mod)
54 + fprintf(stderr, "Setting %s to 'm'.\n", sym->name);
55 + if (sym_get_tristate_value(sym) != mod) {
56 + sym->def[S_DEF_USER].tri = mod;
57 + sym->flags |= SYMBOL_DEF_USER;
58 + }
59 + continue;
60 + }
62 + if (sym->flags & SYMBOL_VALID)
63 + continue;
65 switch (sym_get_type(sym)) {
66 case S_BOOLEAN:
67 case S_TRISTATE:
68 @@ -690,6 +705,7 @@
69 {"allyesconfig", no_argument, &input_mode_opt, allyesconfig},
70 {"allmodconfig", no_argument, &input_mode_opt, allmodconfig},
71 {"alldefconfig", no_argument, &input_mode_opt, alldefconfig},
72 + {"no2modconfig", no_argument, &input_mode_opt, no2modconfig},
73 {"randconfig", no_argument, &input_mode_opt, randconfig},
74 {"listnewconfig", no_argument, &input_mode_opt, listnewconfig},
75 {"helpnewconfig", no_argument, &input_mode_opt, helpnewconfig},
76 @@ -799,6 +815,7 @@
77 case olddefconfig:
78 case yes2modconfig:
79 case mod2yesconfig:
80 + case no2modconfig:
81 conf_read(NULL);
82 break;
83 case allnoconfig:
84 @@ -851,6 +867,9 @@
87 switch (input_mode) {
88 + case no2modconfig:
89 + conf_set_all_new_symbols(def_no2m);
90 + break;
91 case allnoconfig:
92 conf_set_all_new_symbols(def_no);
93 break;
94 --- linux-5.13/scripts/kconfig/Makefile.orig 2021-06-28 00:21:11.000000000 +0200
95 +++ linux-5.13/scripts/kconfig/Makefile 2021-06-29 17:15:30.664703774 +0200
96 @@ -69,7 +69,7 @@
97 # deprecated for external use
98 simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
99 alldefconfig randconfig listnewconfig olddefconfig syncconfig \
100 - helpnewconfig yes2modconfig mod2yesconfig
101 + helpnewconfig yes2modconfig mod2yesconfig no2modconfig
103 PHONY += $(simple-targets)
105 @@ -127,6 +127,7 @@
106 @echo ' except those preserved by LMC_KEEP environment variable'
107 @echo ' defconfig - New config with default from ARCH supplied defconfig'
108 @echo ' savedefconfig - Save current config as ./defconfig (minimal config)'
109 + @echo ' no2modconfig - New config selecting modules for disabled options'
110 @echo ' allnoconfig - New config where all options are answered with no'
111 @echo ' allyesconfig - New config where all options are accepted with yes'
112 @echo ' allmodconfig - New config selecting modules when possible'