##// END OF EJS Templates
code position corrected so it gets executed
Unknown -
r358:8742a7c8d9bb
parent child
Show More
@@ -83,148 +83,147 if [ "$BUILD_KERNEL" = true ] ; then
83 "${KERNEL_DIR}/.config"
83 "${KERNEL_DIR}/.config"
84 fi
84 fi
85
85
86 #Switch to KERNELSRC_DIR
86 if [ "$KERNELSRC_CONFIG" = true ] ; then
87 pushd "${KERNEL_DIR}"
87 # Load default raspberry kernel configuration
88 make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}"
89
90 #Switch to KERNELSRC_DIR
91 pushd "${KERNEL_DIR}"
88
92
89 # GPL v2.0
93 # GPL v2.0
90 #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh
94 #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh
91 if [ "$KERNEL_ZSWAP" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
95 if [ "$KERNEL_ZSWAP" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
92 # enable ZSWAP support for better performance during large builds etc.
96 # enable ZSWAP support for better performance during large builds etc.
93 # requires activation via kernel parameter or sysfs
97 # requires activation via kernel parameter or sysfs
94 # see e.g. https://askubuntu.com/a/472227 for a summary of ZSWAP (vs ZRAM etc.)
98 # see e.g. https://askubuntu.com/a/472227 for a summary of ZSWAP (vs ZRAM etc.)
95 # and e.g. https://wiki.archlinux.org/index.php/zswap for parameters etc.
99 # and e.g. https://wiki.archlinux.org/index.php/zswap for parameters etc.
96
100 set_kernel_config ZPOOL y
97 set_kernel_config ZPOOL y
101 set_kernel_config ZSWAP y
98 set_kernel_config ZSWAP y
102 set_kernel_config ZBUD y
99 set_kernel_config ZBUD y
103 set_kernel_config Z3FOLD y
100 set_kernel_config Z3FOLD y
104 set_kernel_config ZSMALLOC y
101 set_kernel_config ZSMALLOC y
105 set_kernel_config PGTABLE_MAPPING y
102 set_kernel_config PGTABLE_MAPPING y
106 fi
103 fi
104
107
105 if [ "$KERNEL_VIRT" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
108 if [ "$KERNEL_VIRT" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
106 # enable basic KVM support; see e.g.
109 # enable basic KVM support; see e.g.
107 # https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453
110 # https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453
108
111 set_kernel_config VIRTUALIZATION y
109 set_kernel_config VIRTUALIZATION y
112 set_kernel_config KVM y
110 set_kernel_config KVM y
113 set_kernel_config VHOST_NET m
111 set_kernel_config VHOST_NET m
114 set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y
112 set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y
115 fi
113 fi
116 #See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406
114 #See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406
117 # Netfilter kernel support
115 # Netfilter kernel support
118 if [ "$KERNEL_NF" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
116 if [ "$KERNEL_NF" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
119 # xtables
117 # xtables
120 set_kernel_config NETFILTER_XTABLES m
118 set_kernel_config NETFILTER_XTABLES m
121 # Netfilter nf_tables support
119 # Netfilter nf_tables support
122 set_kernel_config NF_TABLES m
120 set_kernel_config NF_TABLES m
121
123
122 set_kernel_config CONFIG_NETFILTER_XTABLES m
124 set_kernel_config CONFIG_NETFILTER_XTABLES m
123 set_kernel_config CONFIG_NF_TABLES_BRIDGE m
125 set_kernel_config CONFIG_NF_TABLES_BRIDGE m
124
126
125 set_kernel_config CONFIG_NF_NAT_SIP m
127 set_kernel_config CONFIG_NF_NAT_SIP m
126 set_kernel_config CONFIG_NF_NAT_TFTP m
128 set_kernel_config CONFIG_NF_NAT_TFTP m
127 set_kernel_config CONFIG_NF_NAT_REDIRECT m
129 set_kernel_config CONFIG_NF_NAT_REDIRECT m
128 set_kernel_config CONFIG_NF_TABLES_INET m
130 set_kernel_config CONFIG_NF_TABLES_INET m
129 set_kernel_config CONFIG_NF_TABLES_NETDEV m
131 set_kernel_config CONFIG_NF_TABLES_NETDEV m
130 set_kernel_config CONFIG_NF_TABLES_ARP m
132 set_kernel_config CONFIG_NF_TABLES_ARP m
131 set_kernel_config CONFIG_NF_DUP_IPV4 m
133 set_kernel_config CONFIG_NF_DUP_IPV4 m
132 set_kernel_config CONFIG_NF_LOG_IPV4 m
134 set_kernel_config CONFIG_NF_LOG_IPV4 m
133 set_kernel_config CONFIG_NF_REJECT_IPV4 m
135 set_kernel_config CONFIG_NF_REJECT_IPV4 m
134 set_kernel_config CONFIG_NF_NAT_IPV4 m
136 set_kernel_config CONFIG_NF_NAT_IPV4 m
135 set_kernel_config CONFIG_NF_DUP_NETDEV m
137 set_kernel_config CONFIG_NF_DUP_NETDEV m
136 set_kernel_config CONFIG_NF_DEFRAG_IPV4 m
138 set_kernel_config CONFIG_NF_DEFRAG_IPV4 m
137 set_kernel_config CONFIG_NF_CONNTRACK_IPV4 m
139 set_kernel_config CONFIG_NF_CONNTRACK_IPV4 m
138 set_kernel_config CONFIG_NF_TABLES_IPV4 m
140 set_kernel_config CONFIG_NF_TABLES_IPV4 m
139 set_kernel_config CONFIG_NF_NAT_MASQUERADE_IPV4 m
141 set_kernel_config CONFIG_NF_NAT_MASQUERADE_IPV4 m
140 set_kernel_config CONFIG_NF_NAT_SNMP_BASIC m
142 set_kernel_config CONFIG_NF_NAT_SNMP_BASIC m
141 set_kernel_config CONFIG_NF_NAT_PROTO_GRE m
143 set_kernel_config CONFIG_NF_NAT_PROTO_GRE m
142 set_kernel_config CONFIG_NF_NAT_PPTP m
144 set_kernel_config CONFIG_NF_NAT_PPTP m
143 set_kernel_config CONFIG_NF_DEFRAG_IPV6 m
145 set_kernel_config CONFIG_NF_DEFRAG_IPV6 m
144 set_kernel_config CONFIG_NF_CONNTRACK_IPV6 m
146 set_kernel_config CONFIG_NF_CONNTRACK_IPV6 m
145 set_kernel_config CONFIG_NF_TABLES_IPV6 m
147 set_kernel_config CONFIG_NF_TABLES_IPV6 m
146 set_kernel_config CONFIG_NF_DUP_IPV6 m
148 set_kernel_config CONFIG_NF_DUP_IPV6 m
147 set_kernel_config CONFIG_NF_REJECT_IPV6 m
149 set_kernel_config CONFIG_NF_REJECT_IPV6 m
148 set_kernel_config CONFIG_NF_LOG_IPV6 m
150 set_kernel_config CONFIG_NF_LOG_IPV6 m
149 set_kernel_config CONFIG_NF_NAT_IPV6 m
151 set_kernel_config CONFIG_NF_NAT_IPV6 m
150 set_kernel_config CONFIG_NF_NAT_MASQUERADE_IPV6 m
152 set_kernel_config CONFIG_NF_NAT_MASQUERADE_IPV6 m
151
153
152 set_kernel_config CONFIG_NFT_EXTHDR m
154 set_kernel_config CONFIG_NFT_EXTHDR m
153 set_kernel_config CONFIG_NFT_META m
155 set_kernel_config CONFIG_NFT_META m
154 set_kernel_config CONFIG_NFT_NUMGEN m
156 set_kernel_config CONFIG_NFT_NUMGEN m
155 set_kernel_config CONFIG_NFT_CT m
157 set_kernel_config CONFIG_NFT_CT m
156 set_kernel_config CONFIG_NFT_SET_RBTREE m
158 set_kernel_config CONFIG_NFT_SET_RBTREE m
157 set_kernel_config CONFIG_NFT_SET_HASH m
159 set_kernel_config CONFIG_NFT_SET_HASH m
158 set_kernel_config CONFIG_NFT_COUNTER m
160 set_kernel_config CONFIG_NFT_COUNTER m
159 set_kernel_config CONFIG_NFT_LOG m
161 set_kernel_config CONFIG_NFT_LOG m
160 set_kernel_config CONFIG_NFT_LIMIT m
162 set_kernel_config CONFIG_NFT_LIMIT m
161 set_kernel_config CONFIG_NFT_MASQ m
163 set_kernel_config CONFIG_NFT_MASQ m
162 set_kernel_config CONFIG_NFT_REDIR m
164 set_kernel_config CONFIG_NFT_REDIR m
163 set_kernel_config CONFIG_NFT_NAT m
165 set_kernel_config CONFIG_NFT_NAT m
164 set_kernel_config CONFIG_NFT_QUEUE m
166 set_kernel_config CONFIG_NFT_QUEUE m
165 set_kernel_config CONFIG_NFT_QUOTA m
167 set_kernel_config CONFIG_NFT_QUOTA m
166 set_kernel_config CONFIG_NFT_REJECT m
168 set_kernel_config CONFIG_NFT_REJECT m
167 set_kernel_config CONFIG_NFT_REJECT_INET m
169 set_kernel_config CONFIG_NFT_REJECT_INET m
168 set_kernel_config CONFIG_NFT_COMPAT m
170 set_kernel_config CONFIG_NFT_COMPAT m
169 set_kernel_config CONFIG_NFT_HASH m
171 set_kernel_config CONFIG_NFT_HASH m
170 set_kernel_config CONFIG_NFT_DUP_NETDEV m
172 set_kernel_config CONFIG_NFT_DUP_NETDEV m
171 set_kernel_config CONFIG_NFT_FWD_NETDEV m
173 set_kernel_config CONFIG_NFT_FWD_NETDEV m
172 set_kernel_config CONFIG_NFT_CHAIN_ROUTE_IPV4 m
174 set_kernel_config CONFIG_NFT_CHAIN_ROUTE_IPV4 m
173 set_kernel_config CONFIG_NFT_REJECT_IPV4 m
175 set_kernel_config CONFIG_NFT_REJECT_IPV4 m
174 set_kernel_config CONFIG_NFT_DUP_IPV4 m
176 set_kernel_config CONFIG_NFT_DUP_IPV4 m
175 set_kernel_config CONFIG_NFT_CHAIN_NAT_IPV4 m
177 set_kernel_config CONFIG_NFT_CHAIN_NAT_IPV4 m
176 set_kernel_config CONFIG_NFT_MASQ_IPV4 m
178 set_kernel_config CONFIG_NFT_MASQ_IPV4 m
177 set_kernel_config CONFIG_NFT_REDIR_IPV4 m
179 set_kernel_config CONFIG_NFT_REDIR_IPV4 m
178 set_kernel_config CONFIG_NFT_CHAIN_ROUTE_IPV6 m
180 set_kernel_config CONFIG_NFT_CHAIN_ROUTE_IPV6 m
179 set_kernel_config CONFIG_NFT_REJECT_IPV6 m
181 set_kernel_config CONFIG_NFT_REJECT_IPV6 m
180 set_kernel_config CONFIG_NFT_DUP_IPV6 m
182 set_kernel_config CONFIG_NFT_DUP_IPV6 m
181 set_kernel_config CONFIG_NFT_CHAIN_NAT_IPV6 m
183 set_kernel_config CONFIG_NFT_CHAIN_NAT_IPV6 m
182 set_kernel_config CONFIG_NFT_MASQ_IPV6 m
184 set_kernel_config CONFIG_NFT_MASQ_IPV6 m
183 set_kernel_config CONFIG_NFT_REDIR_IPV6 m
185 set_kernel_config CONFIG_NFT_REDIR_IPV6 m
184 set_kernel_config CONFIG_NFT_BRIDGE_META m
186 set_kernel_config CONFIG_NFT_BRIDGE_META m
185 set_kernel_config CONFIG_NFT_BRIDGE_REJECT m
187 set_kernel_config CONFIG_NFT_BRIDGE_REJECT m
186
188
187 set_kernel_config CONFIG_IP_SET_BITMAP_IPMAC m
189 set_kernel_config CONFIG_IP_SET_BITMAP_IPMAC m
188 set_kernel_config CONFIG_IP_SET_BITMAP_PORT m
190 set_kernel_config CONFIG_IP_SET_BITMAP_PORT m
189 set_kernel_config CONFIG_IP_SET_HASH_IP m
191 set_kernel_config CONFIG_IP_SET_HASH_IP m
190 set_kernel_config CONFIG_IP_SET_HASH_IPMARK m
192 set_kernel_config CONFIG_IP_SET_HASH_IPMARK m
191 set_kernel_config CONFIG_IP_SET_HASH_IPPORT m
193 set_kernel_config CONFIG_IP_SET_HASH_IPPORT m
192 set_kernel_config CONFIG_IP_SET_HASH_IPPORTIP m
194 set_kernel_config CONFIG_IP_SET_HASH_IPPORTIP m
193 set_kernel_config CONFIG_IP_SET_HASH_IPPORTNET m
195 set_kernel_config CONFIG_IP_SET_HASH_IPPORTNET m
194 set_kernel_config CONFIG_IP_SET_HASH_MAC m
196 set_kernel_config CONFIG_IP_SET_HASH_MAC m
195 set_kernel_config CONFIG_IP_SET_HASH_NETPORTNET m
197 set_kernel_config CONFIG_IP_SET_HASH_NETPORTNET m
196 set_kernel_config CONFIG_IP_SET_HASH_NET m
198 set_kernel_config CONFIG_IP_SET_HASH_NET m
197 set_kernel_config CONFIG_IP_SET_HASH_NETNET m
199 set_kernel_config CONFIG_IP_SET_HASH_NETNET m
198 set_kernel_config CONFIG_IP_SET_HASH_NETPORT m
200 set_kernel_config CONFIG_IP_SET_HASH_NETPORT m
199 set_kernel_config CONFIG_IP_SET_HASH_NETIFACE m
201 set_kernel_config CONFIG_IP_SET_HASH_NETIFACE m
200 set_kernel_config CONFIG_IP_SET_LIST_SET m
202 set_kernel_config CONFIG_IP_SET_LIST_SET m
201
203
202 set_kernel_config CONFIG_IP6_NF_IPTABLES m
204 set_kernel_config CONFIG_IP6_NF_IPTABLES m
203 set_kernel_config CONFIG_IP6_NF_MATCH_AH m
205 set_kernel_config CONFIG_IP6_NF_MATCH_AH m
204 set_kernel_config CONFIG_IP6_NF_MATCH_EUI64 m
206 set_kernel_config CONFIG_IP6_NF_MATCH_EUI64 m
205 set_kernel_config CONFIG_IP6_NF_NAT m
207 set_kernel_config CONFIG_IP6_NF_NAT m
206 set_kernel_config CONFIG_IP6_NF_TARGET_MASQUERADE m
208 set_kernel_config CONFIG_IP6_NF_TARGET_MASQUERADE m
207 set_kernel_config CONFIG_IP6_NF_TARGET_NPT m
209 set_kernel_config CONFIG_IP6_NF_TARGET_NPT m
208
210
209 set_kernel_config CONFIG_NF_LOG_BRIDGE m
211 set_kernel_config CONFIG_NF_LOG_BRIDGE m
210 set_kernel_config CONFIG_BRIDGE_NF_EBTABLES m
212 set_kernel_config CONFIG_BRIDGE_NF_EBTABLES m
211 set_kernel_config CONFIG_BRIDGE_EBT_BROUTE m
213 set_kernel_config CONFIG_BRIDGE_EBT_BROUTE m
212 set_kernel_config CONFIG_BRIDGE_EBT_T_FILTER m
214 set_kernel_config CONFIG_BRIDGE_EBT_T_FILTER m
213 fi
215 fi
214
215 #https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA
216 #https://github.com/torvalds/linux/blob/master/init/Kconfig#L848
217 # Enables BPF syscall for systemd-journald
218 if [ "$KERNEL_BPF" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
219 set_kernel_config CONFIG_BPF_SYSCALL y
220 set_kernel_config CONFIG_CGROUP_BPF y
221 fi
222
223 popd
224
216
225 if [ "$KERNELSRC_CONFIG" = true ] ; then
217 #https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA
226 # Load default raspberry kernel configuration
218 #https://github.com/torvalds/linux/blob/master/init/Kconfig#L848
227 make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}"
219 # Enables BPF syscall for systemd-journald
220 if [ "$KERNEL_BPF" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then
221 set_kernel_config CONFIG_BPF_SYSCALL y
222 set_kernel_config CONFIG_CGROUP_BPF y
223 fi
224
225 #Revert to previous directory
226 popd
228
227
229 # Set kernel configuration parameters to enable qemu emulation
228 # Set kernel configuration parameters to enable qemu emulation
230 if [ "$ENABLE_QEMU" = true ] ; then
229 if [ "$ENABLE_QEMU" = true ] ; then
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant