##// END OF EJS Templates
test
Unknown -
r349:473ede01c20c
parent child
Show More
@@ -83,6 +83,9 if [ "$BUILD_KERNEL" = true ] ; then
83 83 "${KERNEL_DIR}/.config"
84 84 fi
85 85
86 #Switch to KERNELSRC_DIR
87 pushd "${KERNELSRC_DIR}"
88
86 89 # GPL v2.0
87 90 #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh
88 91 if [ "$KERNEL_ZSWAP" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
@@ -91,12 +94,12 if [ "$BUILD_KERNEL" = true ] ; then
91 94 # see e.g. https://askubuntu.com/a/472227 for a summary of ZSWAP (vs ZRAM etc.)
92 95 # and e.g. https://wiki.archlinux.org/index.php/zswap for parameters etc.
93 96
94 set_kernel_config ZPOOL y "${KERNEL_DIR}"/.config
95 set_kernel_config ZSWAP y "${KERNEL_DIR}"/.config
96 set_kernel_config ZBUD y "${KERNEL_DIR}"/.config
97 set_kernel_config Z3FOLD y "${KERNEL_DIR}"/.config
98 set_kernel_config ZSMALLOC y "${KERNEL_DIR}"/.config
99 set_kernel_config PGTABLE_MAPPING y "${KERNEL_DIR}"/.config
97 set_kernel_config ZPOOL y
98 set_kernel_config ZSWAP y
99 set_kernel_config ZBUD y
100 set_kernel_config Z3FOLD y
101 set_kernel_config ZSMALLOC y
102 set_kernel_config PGTABLE_MAPPING y
100 103 fi
101 104
102 105 if [ "$KERNEL_VIRT" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
@@ -107,41 +110,115 if [ "$BUILD_KERNEL" = true ] ; then
107 110 # enable basic KVM support; see e.g.
108 111 # https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453
109 112
110 set_kernel_config VIRTUALIZATION y "${KERNEL_DIR}"/.config
111 set_kernel_config KVM y "${KERNEL_DIR}"/.config
112 set_kernel_config VHOST_NET m "${KERNEL_DIR}"/.config
113 set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y "${KERNEL_DIR}"/.config
113 set_kernel_config VIRTUALIZATION y
114 set_kernel_config KVM y
115 set_kernel_config VHOST_NET m
116 set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y
114 117 fi
115 118
116 119 if [ "$KERNEL_NF" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
117 # Netfilter Xtables support (required for ip_tables - should be enabled already)
118 set_kernel_config NETFILTER_XTABLES m "${KERNEL_DIR}"/.config"
119 # Netfilter nf_tables support
120 set_kernel_config NF_TABLES m "${KERNEL_DIR}"/.config"
121 set_kernel_config NFT_PAYLOAD m "${KERNEL_DIR}"/.config"
122 set_kernel_config NFT_EXTHDR m "${KERNEL_DIR}"/.config"
123 set_kernel_config NFT_META m "${KERNEL_DIR}"/.config"
124 set_kernel_config NFT_CT m "${KERNEL_DIR}"/.config"
125 set_kernel_config NFT_RBTREE m "${KERNEL_DIR}"/.config"
126 set_kernel_config NFT_HASH m "${KERNEL_DIR}"/.config"
127 set_kernel_config NFT_COUNTER m "${KERNEL_DIR}"/.config"
128 set_kernel_config NFT_LOG m "${KERNEL_DIR}"/.config"
129 set_kernel_config NFT_LIMIT m "${KERNEL_DIR}"/.config"
130 set_kernel_config NFT_NAT m "${KERNEL_DIR}"/.config"
131 set_kernel_config NFT_COMPAT m "${KERNEL_DIR}"/.config"
132 # IPv4 nf_tables support
133 set_kernel_config NF_TABLES_IPV4 m
134 set_kernel_config NFT_REJECT_IPV4 m
135 set_kernel_config NFT_CHAIN_ROUTE_IPV4 m
136 set_kernel_config NFT_CHAIN_NAT_IPV4 m
137 # IPv6 nf_tables support
138 set_kernel_config NF_TABLES_IPV6 m
139 set_kernel_config NFT_CHAIN_ROUTE_IPV6 m
140 set_kernel_config NFT_CHAIN_NAT_IPV6 m
141 # Ethernet Bridge nf_tables support
142 set_kernel_config NF_TABLES_BRIDGE m
120 #See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406
121 # Netfilter kernel support
122 # xtables
123 set_kernel_config NETFILTER_XTABLES m
124 # Netfilter nf_tables support
125 set_kernel_config NF_TABLES m
126
127 set_kernel_config CONFIG_NETFILTER_XTABLES m
128 set_kernel_config CONFIG_NF_TABLES_BRIDGE m
129
130 set_kernel_config CONFIG_NF_NAT_SIP m
131 set_kernel_config CONFIG_NF_NAT_TFTP m
132 set_kernel_config CONFIG_NF_NAT_REDIRECT m
133 set_kernel_config CONFIG_NF_TABLES_INET m
134 set_kernel_config CONFIG_NF_TABLES_NETDEV m
135 set_kernel_config CONFIG_NF_TABLES_ARP m
136 set_kernel_config CONFIG_NF_DUP_IPV4 m
137 set_kernel_config CONFIG_NF_LOG_IPV4 m
138 set_kernel_config CONFIG_NF_REJECT_IPV4 m
139 set_kernel_config CONFIG_NF_NAT_IPV4 m
140 set_kernel_config CONFIG_NF_DUP_NETDEV m
141 set_kernel_config CONFIG_NF_DEFRAG_IPV4 m
142 set_kernel_config CONFIG_NF_CONNTRACK_IPV4 m
143 set_kernel_config CONFIG_NF_TABLES_IPV4 m
144 set_kernel_config CONFIG_NF_NAT_MASQUERADE_IPV4 m
145 set_kernel_config CONFIG_NF_NAT_SNMP_BASIC m
146 set_kernel_config CONFIG_NF_NAT_PROTO_GRE m
147 set_kernel_config CONFIG_NF_NAT_PPTP m
148 set_kernel_config CONFIG_NF_DEFRAG_IPV6 m
149 set_kernel_config CONFIG_NF_CONNTRACK_IPV6 m
150 set_kernel_config CONFIG_NF_TABLES_IPV6 m
151 set_kernel_config CONFIG_NF_DUP_IPV6 m
152 set_kernel_config CONFIG_NF_REJECT_IPV6 m
153 set_kernel_config CONFIG_NF_LOG_IPV6 m
154 set_kernel_config CONFIG_NF_NAT_IPV6 m
155 set_kernel_config CONFIG_NF_NAT_MASQUERADE_IPV6 m
156
157 set_kernel_config CONFIG_NFT_EXTHDR m
158 set_kernel_config CONFIG_NFT_META m
159 set_kernel_config CONFIG_NFT_NUMGEN m
160 set_kernel_config CONFIG_NFT_CT m
161 set_kernel_config CONFIG_NFT_SET_RBTREE m
162 set_kernel_config CONFIG_NFT_SET_HASH m
163 set_kernel_config CONFIG_NFT_COUNTER m
164 set_kernel_config CONFIG_NFT_LOG m
165 set_kernel_config CONFIG_NFT_LIMIT m
166 set_kernel_config CONFIG_NFT_MASQ m
167 set_kernel_config CONFIG_NFT_REDIR m
168 set_kernel_config CONFIG_NFT_NAT m
169 set_kernel_config CONFIG_NFT_QUEUE m
170 set_kernel_config CONFIG_NFT_QUOTA m
171 set_kernel_config CONFIG_NFT_REJECT m
172 set_kernel_config CONFIG_NFT_REJECT_INET m
173 set_kernel_config CONFIG_NFT_COMPAT m
174 set_kernel_config CONFIG_NFT_HASH m
175 set_kernel_config CONFIG_NFT_DUP_NETDEV m
176 set_kernel_config CONFIG_NFT_FWD_NETDEV m
177 set_kernel_config CONFIG_NFT_CHAIN_ROUTE_IPV4 m
178 set_kernel_config CONFIG_NFT_REJECT_IPV4 m
179 set_kernel_config CONFIG_NFT_DUP_IPV4 m
180 set_kernel_config CONFIG_NFT_CHAIN_NAT_IPV4 m
181 set_kernel_config CONFIG_NFT_MASQ_IPV4 m
182 set_kernel_config CONFIG_NFT_REDIR_IPV4 m
183 set_kernel_config CONFIG_NFT_CHAIN_ROUTE_IPV6 m
184 set_kernel_config CONFIG_NFT_REJECT_IPV6 m
185 set_kernel_config CONFIG_NFT_DUP_IPV6 m
186 set_kernel_config CONFIG_NFT_CHAIN_NAT_IPV6 m
187 set_kernel_config CONFIG_NFT_MASQ_IPV6 m
188 set_kernel_config CONFIG_NFT_REDIR_IPV6 m
189 set_kernel_config CONFIG_NFT_BRIDGE_META m
190 set_kernel_config CONFIG_NFT_BRIDGE_REJECT m
191
192 set_kernel_config CONFIG_IP_SET_BITMAP_IPMAC m
193 set_kernel_config CONFIG_IP_SET_BITMAP_PORT m
194 set_kernel_config CONFIG_IP_SET_HASH_IP m
195 set_kernel_config CONFIG_IP_SET_HASH_IPMARK m
196 set_kernel_config CONFIG_IP_SET_HASH_IPPORT m
197 set_kernel_config CONFIG_IP_SET_HASH_IPPORTIP m
198 set_kernel_config CONFIG_IP_SET_HASH_IPPORTNET m
199 set_kernel_config CONFIG_IP_SET_HASH_MAC m
200 set_kernel_config CONFIG_IP_SET_HASH_NETPORTNET m
201 set_kernel_config CONFIG_IP_SET_HASH_NET m
202 set_kernel_config CONFIG_IP_SET_HASH_NETNET m
203 set_kernel_config CONFIG_IP_SET_HASH_NETPORT m
204 set_kernel_config CONFIG_IP_SET_HASH_NETIFACE m
205 set_kernel_config CONFIG_IP_SET_LIST_SET m
206
207 set_kernel_config CONFIG_IP6_NF_IPTABLES m
208 set_kernel_config CONFIG_IP6_NF_MATCH_AH m
209 set_kernel_config CONFIG_IP6_NF_MATCH_EUI64 m
210 set_kernel_config CONFIG_IP6_NF_NAT m
211 set_kernel_config CONFIG_IP6_NF_TARGET_MASQUERADE m
212 set_kernel_config CONFIG_IP6_NF_TARGET_NPT m
213
214 set_kernel_config CONFIG_NF_LOG_BRIDGE m
215 set_kernel_config CONFIG_BRIDGE_NF_EBTABLES m
216 set_kernel_config CONFIG_BRIDGE_EBT_BROUTE m
217 set_kernel_config CONFIG_BRIDGE_EBT_T_FILTER m
143 218 fi
144 219
220 popd
221
145 222 if [ "$KERNELSRC_CONFIG" = true ] ; then
146 223 # Load default raspberry kernel configuration
147 224 make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}"
@@ -87,17 +87,17 set_kernel_config() {
87 87 # flag as $1, value to set as $2, config must exist at "./.config"
88 88 local TGT="CONFIG_${1}"
89 89 local REP="${2//\//\\/}"
90 if grep -q "^${TGT}[^_]" "${3}"; then
91 sed -i "s/^\(${TGT}=.*\|# ${TGT} is not set\)/${TGT}=${REP}/" "${3}"
90 if grep -q "^${TGT}[^_]" .config; then
91 sed -i "s/^\(${TGT}=.*\|# ${TGT} is not set\)/${TGT}=${REP}/" .config
92 92 else
93 echo "${TGT}=${2}" >> "${3}"
93 echo "${TGT}=${2}" >> .config
94 94 fi
95 95 }
96 96
97 97 unset_kernel_config() {
98 98 # unsets flag with the value of $1, config must exist at "./.config"
99 99 local TGT="CONFIG_${1}"
100 sed -i "s/^${TGT}=.*/# ${TGT} is not set/" "${2}"
100 sed -i "s/^${TGT}=.*/# ${TGT} is not set/" .config
101 101 }
102 102 #
103 103 #end
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant