|
@@
-7,9
+7,10
|
|
7
|
|
|
7
|
|
|
8
|
# Need to use kali kernel src if nexmon is enabled
|
|
8
|
# Need to use kali kernel src if nexmon is enabled
|
|
9
|
if [ "$ENABLE_NEXMON" = true ] ; then
|
|
9
|
if [ "$ENABLE_NEXMON" = true ] ; then
|
|
10
|
echo "WARNING: if ENABLE_NEXMON is used remember to put the CORRECT KERNELSRC IN KERNELSRC_DIR!!!!!1!"
|
|
|
|
|
11
|
KERNEL_URL="${KALI_KERNEL_URL}"
|
|
10
|
KERNEL_URL="${KALI_KERNEL_URL}"
|
|
|
|
|
11
|
# Clear Branch and KernelSRC_DIR if using nexmon. Everyone will forget to clone kali kernel instead of nomrla kernel
|
|
12
|
KERNEL_BRANCH=""
|
|
12
|
KERNEL_BRANCH=""
|
|
|
|
|
13
|
KERNELSRC_DIR=""
|
|
13
|
fi
|
|
14
|
fi
|
|
14
|
|
|
15
|
|
|
15
|
# Fetch and build latest raspberry kernel
|
|
16
|
# Fetch and build latest raspberry kernel
|
|
@@
-93,7
+94,7
if [ "$BUILD_KERNEL" = true ] ; then
|
|
93
|
if [ "$KERNELSRC_CONFIG" = true ] ; then
|
|
94
|
if [ "$KERNELSRC_CONFIG" = true ] ; then
|
|
94
|
# Load default raspberry kernel configuration
|
|
95
|
# Load default raspberry kernel configuration
|
|
95
|
make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}"
|
|
96
|
make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}"
|
|
96
|
|
|
97
|
|
|
97
|
#Switch to KERNELSRC_DIR so we can use set_kernel_config
|
|
98
|
#Switch to KERNELSRC_DIR so we can use set_kernel_config
|
|
98
|
cd "${KERNEL_DIR}" || exit
|
|
99
|
cd "${KERNEL_DIR}" || exit
|
|
99
|
|
|
100
|
|
|
@@
-106,7
+107,7
if [ "$BUILD_KERNEL" = true ] ; then
|
|
106
|
set_kernel_config CONFIG_ZSMALLOC y
|
|
107
|
set_kernel_config CONFIG_ZSMALLOC y
|
|
107
|
set_kernel_config CONFIG_PGTABLE_MAPPING y
|
|
108
|
set_kernel_config CONFIG_PGTABLE_MAPPING y
|
|
108
|
fi
|
|
109
|
fi
|
|
109
|
|
|
110
|
|
|
110
|
# enable basic KVM support; see https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453
|
|
111
|
# enable basic KVM support; see https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453
|
|
111
|
if [ "$KERNEL_VIRT" = true ] && { [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
|
|
112
|
if [ "$KERNEL_VIRT" = true ] && { [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
|
|
112
|
set_kernel_config CONFIG_VIRTUALIZATION y
|
|
113
|
set_kernel_config CONFIG_VIRTUALIZATION y
|
|
@@
-114,90
+115,109
if [ "$BUILD_KERNEL" = true ] ; then
|
|
114
|
set_kernel_config CONFIG_VHOST_NET m
|
|
115
|
set_kernel_config CONFIG_VHOST_NET m
|
|
115
|
set_kernel_config CONFIG_VHOST_CROSS_ENDIAN_LEGACY y
|
|
116
|
set_kernel_config CONFIG_VHOST_CROSS_ENDIAN_LEGACY y
|
|
116
|
fi
|
|
117
|
fi
|
|
117
|
|
|
118
|
|
|
118
|
# enable apparmor,integrity audit,
|
|
119
|
# enable apparmor,integrity audit,
|
|
119
|
if [ "$KERNEL_SECURITY" = true ] ; then
|
|
120
|
if [ "$KERNEL_SECURITY" = true ] ; then
|
|
120
|
|
|
121
|
|
|
121
|
# security filesystem, security models and audit
|
|
122
|
# security filesystem, security models and audit
|
|
122
|
set_kernel_config CONFIG_SECURITYFS y
|
|
123
|
set_kernel_config CONFIG_SECURITYFS y
|
|
123
|
set_kernel_config CONFIG_SECURITY y
|
|
124
|
set_kernel_config CONFIG_SECURITY y
|
|
124
|
set_kernel_config CONFIG_AUDIT y
|
|
125
|
set_kernel_config CONFIG_AUDIT y
|
|
125
|
|
|
126
|
|
|
126
|
# harden strcpy and memcpy
|
|
127
|
# harden strcpy and memcpy
|
|
127
|
set_kernel_config CONFIG_HARDENED_USERCOPY=y
|
|
128
|
set_kernel_config CONFIG_HARDENED_USERCOPY=y
|
|
128
|
set_kernel_config CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
|
|
129
|
set_kernel_config CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
|
|
129
|
set_kernel_config CONFIG_FORTIFY_SOURCE=y
|
|
130
|
set_kernel_config CONFIG_FORTIFY_SOURCE=y
|
|
130
|
|
|
131
|
|
|
131
|
# integrity sub-system
|
|
132
|
# integrity sub-system
|
|
132
|
set_kernel_config CONFIG_INTEGRITY=y
|
|
133
|
set_kernel_config CONFIG_INTEGRITY=y
|
|
133
|
set_kernel_config CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
|
|
134
|
set_kernel_config CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
|
|
134
|
set_kernel_config CONFIG_INTEGRITY_AUDIT=y
|
|
135
|
set_kernel_config CONFIG_INTEGRITY_AUDIT=y
|
|
135
|
set_kernel_config CONFIG_INTEGRITY_SIGNATURE=y
|
|
136
|
set_kernel_config CONFIG_INTEGRITY_SIGNATURE=y
|
|
136
|
set_kernel_config CONFIG_INTEGRITY_TRUSTED_KEYRING=y
|
|
137
|
set_kernel_config CONFIG_INTEGRITY_TRUSTED_KEYRING=y
|
|
137
|
|
|
138
|
|
|
138
|
# This option provides support for retaining authentication tokens and access keys in the kernel.
|
|
139
|
# This option provides support for retaining authentication tokens and access keys in the kernel.
|
|
139
|
set_kernel_config CONFIG_KEYS=y
|
|
140
|
set_kernel_config CONFIG_KEYS=y
|
|
140
|
set_kernel_config CONFIG_KEYS_COMPAT=y
|
|
141
|
set_kernel_config CONFIG_KEYS_COMPAT=y
|
|
141
|
|
|
142
|
|
|
142
|
# Apparmor
|
|
143
|
# Apparmor
|
|
143
|
set_kernel_config CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE 0
|
|
144
|
set_kernel_config CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE 0
|
|
144
|
set_kernel_config CONFIG_SECURITY_APPARMOR_HASH_DEFAULT y
|
|
145
|
set_kernel_config CONFIG_SECURITY_APPARMOR_HASH_DEFAULT y
|
|
145
|
set_kernel_config CONFIG_DEFAULT_SECURITY_APPARMOR y
|
|
146
|
set_kernel_config CONFIG_DEFAULT_SECURITY_APPARMOR y
|
|
146
|
set_kernel_config CONFIG_SECURITY_APPARMOR y
|
|
147
|
set_kernel_config CONFIG_SECURITY_APPARMOR y
|
|
147
|
set_kernel_config CONFIG_SECURITY_APPARMOR_HASH y
|
|
148
|
set_kernel_config CONFIG_SECURITY_APPARMOR_HASH y
|
|
148
|
set_kernel_config CONFIG_DEFAULT_SECURITY "apparmor"
|
|
149
|
set_kernel_config CONFIG_DEFAULT_SECURITY "apparmor"
|
|
149
|
|
|
150
|
|
|
150
|
# restrictions on unprivileged users reading the kernel
|
|
151
|
# restrictions on unprivileged users reading the kernel
|
|
151
|
set_kernel_config CONFIG_SECURITY_DMESG_RESTRICT=y
|
|
152
|
set_kernel_config CONFIG_SECURITY_DMESG_RESTRICT=y
|
|
152
|
|
|
153
|
|
|
153
|
# network security hooks
|
|
154
|
# network security hooks
|
|
154
|
set_kernel_config CONFIG_SECURITY_NETWORK y
|
|
155
|
set_kernel_config CONFIG_SECURITY_NETWORK y
|
|
155
|
set_kernel_config CONFIG_SECURITY_NETWORK_XFRM=y
|
|
156
|
set_kernel_config CONFIG_SECURITY_NETWORK_XFRM=y
|
|
156
|
set_kernel_config CONFIG_SECURITY_PATH=y
|
|
157
|
set_kernel_config CONFIG_SECURITY_PATH=y
|
|
157
|
set_kernel_config CONFIG_SECURITY_YAMA=y
|
|
158
|
set_kernel_config CONFIG_SECURITY_YAMA=y
|
|
158
|
|
|
159
|
|
|
159
|
# New Options
|
|
160
|
# New Options
|
|
160
|
if [ "$KERNEL_NF" = true ] ; then
|
|
161
|
if [ "$KERNEL_NF" = true ] ; then
|
|
161
|
set_kernel_config CONFIG_IP_NF_SECURITY m
|
|
162
|
set_kernel_config CONFIG_IP_NF_SECURITY m
|
|
162
|
set_kernel_config CONFIG_NETLABEL m
|
|
163
|
set_kernel_config CONFIG_NETLABEL y
|
|
163
|
set_kernel_config CONFIG_IP6_NF_SECURITY m
|
|
164
|
set_kernel_config CONFIG_IP6_NF_SECURITY m
|
|
164
|
fi
|
|
165
|
fi
|
|
165
|
set_kernel_config CONFIG_SECURITY_SELINUX n
|
|
166
|
set_kernel_config CONFIG_SECURITY_SELINUX n
|
|
166
|
set_kernel_config CONFIG_SECURITY_SMACK n
|
|
167
|
set_kernel_config CONFIG_SECURITY_SMACK n
|
|
167
|
set_kernel_config CONFIG_SECURITY_TOMOYO n
|
|
168
|
set_kernel_config CONFIG_SECURITY_TOMOYO n
|
|
168
|
set_kernel_config CONFIG_SECURITY_APPARMOR_DEBUG n
|
|
169
|
set_kernel_config CONFIG_SECURITY_APPARMOR_DEBUG n
|
|
169
|
set_kernel_config CONFIG_SECURITY_LOADPIN n
|
|
170
|
set_kernel_config CONFIG_SECURITY_LOADPIN n
|
|
170
|
set_kernel_config CONFIG_HARDENED_USERCOPY_PAGESPAN n
|
|
171
|
set_kernel_config CONFIG_HARDENED_USERCOPY_PAGESPAN n
|
|
171
|
set_kernel_config CONFIG_IMA n
|
|
172
|
set_kernel_config CONFIG_IMA n
|
|
172
|
set_kernel_config CONFIG_EVM n
|
|
173
|
set_kernel_config CONFIG_EVM n
|
|
173
|
set_kernel_config CONFIG_FANOTIFY_ACCESS_PERMISSIONS y
|
|
174
|
set_kernel_config CONFIG_FANOTIFY_ACCESS_PERMISSIONS y
|
|
174
|
set_kernel_config CONFIG_NFSD_V4_SECURITY_LABEL y
|
|
175
|
set_kernel_config CONFIG_NFSD_V4_SECURITY_LABEL y
|
|
175
|
set_kernel_config CONFIG_PKCS7_MESSAGE_PARSER y
|
|
176
|
set_kernel_config CONFIG_PKCS7_MESSAGE_PARSER y
|
|
176
|
set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYRING y
|
|
177
|
set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYRING y
|
|
177
|
set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS y
|
|
178
|
set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS y
|
|
178
|
set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE y
|
|
179
|
set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE y
|
|
179
|
set_kernel_config CONFIG_SECONDARY_TRUSTED_KEYRING y
|
|
180
|
set_kernel_config CONFIG_SECONDARY_TRUSTED_KEYRING y
|
|
180
|
set_kernel_config CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY n
|
|
181
|
set_kernel_config CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY n
|
|
181
|
fi
|
|
182
|
set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m
|
|
182
|
|
|
183
|
set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096
|
|
|
|
|
184
|
|
|
|
|
|
185
|
set_kernel_config CONFIG_ARM64_CRYPTO y
|
|
|
|
|
186
|
set_kernel_config CONFIG_CRYPTO_SHA256_ARM64 m
|
|
|
|
|
187
|
set_kernel_config CONFIG_CRYPTO_SHA512_ARM64 m
|
|
|
|
|
188
|
set_kernel_config CONFIG_CRYPTO_SHA1_ARM64_CE m
|
|
|
|
|
189
|
set_kernel_config CRYPTO_GHASH_ARM64_CE m
|
|
|
|
|
190
|
set_kernel_config CRYPTO_SHA2_ARM64_CE m
|
|
|
|
|
191
|
set_kernel_config CONFIG_CRYPTO_CRCT10DIF_ARM64_CE m
|
|
|
|
|
192
|
set_kernel_config CONFIG_CRYPTO_CRC32_ARM64_CE m
|
|
|
|
|
193
|
set_kernel_config CONFIG_CRYPTO_AES_ARM64 m
|
|
|
|
|
194
|
set_kernel_config CONFIG_CRYPTO_AES_ARM64_CE m
|
|
|
|
|
195
|
set_kernel_config CONFIG_CRYPTO_AES_ARM64_CE_CCM y
|
|
|
|
|
196
|
set_kernel_config CONFIG_CRYPTO_AES_ARM64_CE_BLK y
|
|
|
|
|
197
|
set_kernel_config CONFIG_CRYPTO_AES_ARM64_NEON_BLK m
|
|
|
|
|
198
|
set_kernel_config CONFIG_CRYPTO_CHACHA20_NEON m
|
|
|
|
|
199
|
set_kernel_config CONFIG_CRYPTO_AES_ARM64_BS m
|
|
|
|
|
200
|
set_kernel_config SYSTEM_TRUSTED_KEYS
|
|
|
|
|
201
|
fi
|
|
|
|
|
202
|
|
|
183
|
# Netfilter kernel support See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406
|
|
203
|
# Netfilter kernel support See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406
|
|
184
|
if [ "$KERNEL_NF" = true ] ; then
|
|
204
|
if [ "$KERNEL_NF" = true ] ; then
|
|
185
|
set_kernel_config CONFIG_IP_NF_TARGET_SYNPROXY m
|
|
205
|
set_kernel_config CONFIG_IP_NF_TARGET_SYNPROXY m
|
|
186
|
set_kernel_config CONFIG_NETFILTER_XT_TARGET_AUDIT m
|
|
206
|
set_kernel_config CONFIG_NETFILTER_XT_TARGET_AUDIT m
|
|
187
|
set_kernel_config CONFIG_NETFILTER_XT_MATCH_CGROUP m
|
|
207
|
set_kernel_config CONFIG_NETFILTER_XT_MATCH_CGROUP m
|
|
188
|
set_kernel_config CONFIG_NETFILTER_XT_MATCH_IPCOMP m
|
|
208
|
set_kernel_config CONFIG_NETFILTER_XT_MATCH_IPCOMP m
|
|
189
|
set_kernel_config CONFIG_NETFILTER_XT_MATCH_SOCKET m
|
|
209
|
set_kernel_config CONFIG_NETFILTER_XT_MATCH_SOCKET m
|
|
190
|
set_kernel_config CONFIG_NFT_FIB_INET m
|
|
210
|
set_kernel_config CONFIG_NFT_FIB_INET m
|
|
191
|
set_kernel_config CONFIG_NFT_FIB_IPV4 m
|
|
211
|
set_kernel_config CONFIG_NFT_FIB_IPV4 m
|
|
192
|
set_kernel_config CONFIG_NFT_FIB_IPV6 m
|
|
212
|
set_kernel_config CONFIG_NFT_FIB_IPV6 m
|
|
193
|
set_kernel_config CONFIG_NFT_FIB_NETDEV m
|
|
213
|
set_kernel_config CONFIG_NFT_FIB_NETDEV m
|
|
194
|
set_kernel_config CONFIG_NFT_OBJREF m
|
|
214
|
set_kernel_config CONFIG_NFT_OBJREF m
|
|
195
|
set_kernel_config CONFIG_NFT_RT m
|
|
215
|
set_kernel_config CONFIG_NFT_RT m
|
|
196
|
set_kernel_config CONFIG_NFT_SET_BITMAP m
|
|
216
|
set_kernel_config CONFIG_NFT_SET_BITMAP m
|
|
197
|
set_kernel_config CONFIG_NF_CONNTRACK_TIMEOUT y
|
|
217
|
set_kernel_config CONFIG_NF_CONNTRACK_TIMEOUT y
|
|
198
|
set_kernel_config CONFIG_NF_LOG_ARP m
|
|
218
|
set_kernel_config CONFIG_NF_LOG_ARP m
|
|
199
|
set_kernel_config CONFIG_NF_SOCKET_IPV4 m
|
|
219
|
set_kernel_config CONFIG_NF_SOCKET_IPV4 m
|
|
200
|
set_kernel_config CONFIG_NF_SOCKET_IPV6 m
|
|
220
|
set_kernel_config CONFIG_NF_SOCKET_IPV6 m
|
|
201
|
set_kernel_config CONFIG_BRIDGE_EBT_BROUTE m
|
|
221
|
set_kernel_config CONFIG_BRIDGE_EBT_BROUTE m
|
|
202
|
set_kernel_config CONFIG_BRIDGE_EBT_T_FILTER m
|
|
222
|
set_kernel_config CONFIG_BRIDGE_EBT_T_FILTER m
|
|
203
|
set_kernel_config CONFIG_BRIDGE_NF_EBTABLES m
|
|
223
|
set_kernel_config CONFIG_BRIDGE_NF_EBTABLES m
|
|
@@
-207,7
+227,7
if [ "$BUILD_KERNEL" = true ] ; then
|
|
207
|
set_kernel_config CONFIG_IP6_NF_NAT m
|
|
227
|
set_kernel_config CONFIG_IP6_NF_NAT m
|
|
208
|
set_kernel_config CONFIG_IP6_NF_TARGET_MASQUERADE m
|
|
228
|
set_kernel_config CONFIG_IP6_NF_TARGET_MASQUERADE m
|
|
209
|
set_kernel_config CONFIG_IP6_NF_TARGET_NPT m
|
|
229
|
set_kernel_config CONFIG_IP6_NF_TARGET_NPT m
|
|
210
|
set_kernel_config CONFIG_IP_NF_SECURITY m
|
|
230
|
set_kernel_config CONFIG_IP_NF_SECURITY m
|
|
211
|
set_kernel_config CONFIG_IP_SET_BITMAP_IPMAC m
|
|
231
|
set_kernel_config CONFIG_IP_SET_BITMAP_IPMAC m
|
|
212
|
set_kernel_config CONFIG_IP_SET_BITMAP_PORT m
|
|
232
|
set_kernel_config CONFIG_IP_SET_BITMAP_PORT m
|
|
213
|
set_kernel_config CONFIG_IP_SET_HASH_IP m
|
|
233
|
set_kernel_config CONFIG_IP_SET_HASH_IP m
|
|
@@
-296,10
+316,10
if [ "$BUILD_KERNEL" = true ] ; then
|
|
296
|
set_kernel_config CONFIG_BPF_STREAM_PARSER y
|
|
316
|
set_kernel_config CONFIG_BPF_STREAM_PARSER y
|
|
297
|
set_kernel_config CONFIG_CGROUP_BPF y
|
|
317
|
set_kernel_config CONFIG_CGROUP_BPF y
|
|
298
|
fi
|
|
318
|
fi
|
|
299
|
|
|
319
|
|
|
300
|
# KERNEL_DEFAULT_GOV was set by user
|
|
320
|
# KERNEL_DEFAULT_GOV was set by user
|
|
301
|
if [ "$KERNEL_DEFAULT_GOV" != powersave ] && [ -n "$KERNEL_DEFAULT_GOV" ]; then
|
|
321
|
if [ "$KERNEL_DEFAULT_GOV" != powersave ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
|
|
302
|
|
|
322
|
|
|
303
|
case "$KERNEL_DEFAULT_GOV" in
|
|
323
|
case "$KERNEL_DEFAULT_GOV" in
|
|
304
|
performance)
|
|
324
|
performance)
|
|
305
|
set_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE y
|
|
325
|
set_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE y
|
|
@@
-321,12
+341,10
if [ "$BUILD_KERNEL" = true ] ; then
|
|
321
|
exit 1
|
|
341
|
exit 1
|
|
322
|
;;
|
|
342
|
;;
|
|
323
|
esac
|
|
343
|
esac
|
|
324
|
|
|
344
|
|
|
325
|
# unset previous default governor
|
|
345
|
# unset previous default governor
|
|
326
|
unset_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
|
|
346
|
unset_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
|
|
327
|
fi
|
|
347
|
fi
|
|
328
|
|
|
|
|
|
329
|
|
|
|
|
|
330
|
|
|
348
|
|
|
331
|
#Revert to previous directory
|
|
349
|
#Revert to previous directory
|
|
332
|
cd "${WORKDIR}" || exit
|
|
350
|
cd "${WORKDIR}" || exit
|
|
@@
-484,18
+502,18
if [ "$BUILD_KERNEL" = true ] ; then
|
|
484
|
|
|
502
|
|
|
485
|
else # BUILD_KERNEL=false
|
|
503
|
else # BUILD_KERNEL=false
|
|
486
|
if [ "$SET_ARCH" = 64 ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
|
|
504
|
if [ "$SET_ARCH" = 64 ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
|
|
487
|
|
|
505
|
|
|
488
|
# Use Sakakis modified kernel if ZSWAP is active
|
|
506
|
# Use Sakakis modified kernel if ZSWAP is active
|
|
489
|
if [ "$KERNEL_ZSWAP" = true ] || [ "$KERNEL_VIRT" = true ] || [ "$KERNEL_NF" = true ] || [ "$KERNEL_BPF" = true ] ; then
|
|
507
|
if [ "$KERNEL_ZSWAP" = true ] || [ "$KERNEL_VIRT" = true ] || [ "$KERNEL_NF" = true ] || [ "$KERNEL_BPF" = true ] ; then
|
|
490
|
RPI3_64_KERNEL_URL="${RPI3_64_BIS_KERNEL_URL}"
|
|
508
|
RPI3_64_KERNEL_URL="${RPI3_64_BIS_KERNEL_URL}"
|
|
491
|
fi
|
|
509
|
fi
|
|
492
|
|
|
510
|
|
|
493
|
# Create temporary directory for dl
|
|
511
|
# Create temporary directory for dl
|
|
494
|
temp_dir=$(as_nobody mktemp -d)
|
|
512
|
temp_dir=$(as_nobody mktemp -d)
|
|
495
|
|
|
513
|
|
|
496
|
# Fetch kernel dl
|
|
514
|
# Fetch kernel dl
|
|
497
|
as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
|
|
515
|
as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
|
|
498
|
|
|
516
|
|
|
499
|
#extract download
|
|
517
|
#extract download
|
|
500
|
tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
|
|
518
|
tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
|
|
501
|
|
|
519
|
|
|
@@
-506,12
+524,12
else # BUILD_KERNEL=false
|
|
506
|
|
|
524
|
|
|
507
|
# Remove temporary directory for kernel sources
|
|
525
|
# Remove temporary directory for kernel sources
|
|
508
|
rm -fr "${temp_dir}"
|
|
526
|
rm -fr "${temp_dir}"
|
|
509
|
|
|
527
|
|
|
510
|
# Set permissions of the kernel sources
|
|
528
|
# Set permissions of the kernel sources
|
|
511
|
chown -R root:root "${R}/boot/firmware"
|
|
529
|
chown -R root:root "${R}/boot/firmware"
|
|
512
|
chown -R root:root "${R}/lib/modules"
|
|
530
|
chown -R root:root "${R}/lib/modules"
|
|
513
|
fi
|
|
531
|
fi
|
|
514
|
|
|
532
|
|
|
515
|
# Install Kernel from hypriot comptabile with all Raspberry PI
|
|
533
|
# Install Kernel from hypriot comptabile with all Raspberry PI
|
|
516
|
if [ "$SET_ARCH" = 32 ] ; then
|
|
534
|
if [ "$SET_ARCH" = 32 ] ; then
|
|
517
|
# Create temporary directory for dl
|
|
535
|
# Create temporary directory for dl
|
|
@@
-525,7
+543,7
else # BUILD_KERNEL=false
|
|
525
|
|
|
543
|
|
|
526
|
# Set permissions
|
|
544
|
# Set permissions
|
|
527
|
chown -R root:root "${R}"/tmp/kernel.deb
|
|
545
|
chown -R root:root "${R}"/tmp/kernel.deb
|
|
528
|
|
|
546
|
|
|
529
|
# Install kernel
|
|
547
|
# Install kernel
|
|
530
|
chroot_exec dpkg -i /tmp/kernel.deb
|
|
548
|
chroot_exec dpkg -i /tmp/kernel.deb
|
|
531
|
|
|
549
|
|
|
@@
-534,7
+552,7
else # BUILD_KERNEL=false
|
|
534
|
mkdir "${temp_dir}"/firmware
|
|
552
|
mkdir "${temp_dir}"/firmware
|
|
535
|
mv "${R}"/boot/* "${temp_dir}"/firmware/
|
|
553
|
mv "${R}"/boot/* "${temp_dir}"/firmware/
|
|
536
|
mv "${temp_dir}"/firmware "${R}"/boot/
|
|
554
|
mv "${temp_dir}"/firmware "${R}"/boot/
|
|
537
|
|
|
555
|
|
|
538
|
#same for kernel headers
|
|
556
|
#same for kernel headers
|
|
539
|
if [ "$KERNEL_HEADERS" = true ] ; then
|
|
557
|
if [ "$KERNEL_HEADERS" = true ] ; then
|
|
540
|
# Fetch kernel header
|
|
558
|
# Fetch kernel header
|
|
@@
-545,7
+563,7
else # BUILD_KERNEL=false
|
|
545
|
chroot_exec dpkg -i /tmp/kernel-header.deb
|
|
563
|
chroot_exec dpkg -i /tmp/kernel-header.deb
|
|
546
|
rm -f "${R}"/tmp/kernel-header.deb
|
|
564
|
rm -f "${R}"/tmp/kernel-header.deb
|
|
547
|
fi
|
|
565
|
fi
|
|
548
|
|
|
566
|
|
|
549
|
# Remove temporary directory and files
|
|
567
|
# Remove temporary directory and files
|
|
550
|
rm -fr "${temp_dir}"
|
|
568
|
rm -fr "${temp_dir}"
|
|
551
|
rm -f "${R}"/tmp/kernel.deb
|
|
569
|
rm -f "${R}"/tmp/kernel.deb
|