##// END OF EJS Templates
- added new kernel features asked in interactive setup while compiling...
Unknown -
r522:b527883a9d40
parent child
Show More
@@ -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
@@ -8,6 +8,11
8 # Install and setup fstab
8 # Install and setup fstab
9 install_readonly files/mount/fstab "${ETC_DIR}/fstab"
9 install_readonly files/mount/fstab "${ETC_DIR}/fstab"
10
10
11 if [ "$ENABLE_UBOOTUSB" = true ] ; then
12 sed -i "s/mmcblk0p1/sda1/" "${ETC_DIR}/fstab"
13 sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab"
14 fi
15
11 # Add usb/sda disk root partition to fstab
16 # Add usb/sda disk root partition to fstab
12 if [ "$ENABLE_SPLITFS" = true ] && [ "$ENABLE_CRYPTFS" = false ] ; then
17 if [ "$ENABLE_SPLITFS" = true ] && [ "$ENABLE_CRYPTFS" = false ] ; then
13 sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/fstab"
18 sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/fstab"
@@ -29,7 +34,7 if [ "$ENABLE_CRYPTFS" = true ] ; then
29 fi
34 fi
30
35
31 # Generate initramfs file
36 # Generate initramfs file
32 if [ "$BUILD_KERNEL" = true ] && [ "$ENABLE_INITRAMFS" = true ] ; then
37 if [ "$ENABLE_INITRAMFS" = true ] ; then
33 if [ "$ENABLE_CRYPTFS" = true ] ; then
38 if [ "$ENABLE_CRYPTFS" = true ] ; then
34 # Include initramfs scripts to auto expand encrypted root partition
39 # Include initramfs scripts to auto expand encrypted root partition
35 if [ "$EXPANDROOT" = true ] ; then
40 if [ "$EXPANDROOT" = true ] ; then
@@ -77,6 +77,11 if [ "$ENABLE_UBOOT" = true ] ; then
77 #in 64bit uboot booti is used instead of bootz [like in KERNEL_BIN_IMAGE=zImage (armv7)|| Image(armv8)]
77 #in 64bit uboot booti is used instead of bootz [like in KERNEL_BIN_IMAGE=zImage (armv7)|| Image(armv8)]
78 sed -i "s|bootz|booti|g" "${BOOT_DIR}/uboot.mkimage"
78 sed -i "s|bootz|booti|g" "${BOOT_DIR}/uboot.mkimage"
79 fi
79 fi
80
81 # instead of sd, boot from usb device
82 if [ "$ENABLE_UBOOTUSB" = true ] ; then
83 sed -i "s|mmc|usb|g" "${BOOT_DIR}/uboot.mkimage"
84 fi
80
85
81 # Set mkfile to use the correct dtb file
86 # Set mkfile to use the correct dtb file
82 sed -i "s|bcm2709-rpi-2-b.dtb|${DTB_FILE}|" "${BOOT_DIR}/uboot.mkimage"
87 sed -i "s|bcm2709-rpi-2-b.dtb|${DTB_FILE}|" "${BOOT_DIR}/uboot.mkimage"
@@ -157,6 +157,7 ENABLE_MINBASE=${ENABLE_MINBASE:=false}
157 ENABLE_REDUCE=${ENABLE_REDUCE:=false}
157 ENABLE_REDUCE=${ENABLE_REDUCE:=false}
158 ENABLE_UBOOT=${ENABLE_UBOOT:=false}
158 ENABLE_UBOOT=${ENABLE_UBOOT:=false}
159 UBOOTSRC_DIR=${UBOOTSRC_DIR:=""}
159 UBOOTSRC_DIR=${UBOOTSRC_DIR:=""}
160 ENABLE_UBOOTUSB=${ENABLE_UBOOTUSB=false}
160 ENABLE_FBTURBO=${ENABLE_FBTURBO:=false}
161 ENABLE_FBTURBO=${ENABLE_FBTURBO:=false}
161 ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=false}
162 ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=false}
162 ENABLE_NEXMON=${ENABLE_NEXMON:=false}
163 ENABLE_NEXMON=${ENABLE_NEXMON:=false}
@@ -318,6 +319,17 case "$RPI_MODEL" in
318 ;;
319 ;;
319 esac
320 esac
320
321
322 if [ "$ENABLE_UBOOTUSB" = true ] ; then
323 if [ "$ENABLE_UBOOT" = false ] ; then
324 echo "error: Enabling UBOOTUSB requires u-boot to be enabled"
325 exit 1
326 fi
327 if [ "$RPI_MODEL" != 3 ] || [ "$RPI_MODEL" != 3P ] ; then
328 echo "error: Enabling UBOOTUSB requires Raspberry 3"
329 exit 1
330 fi
331 fi
332
321 # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard
333 # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard
322 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
334 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
323 # Include bluetooth packages on supported boards
335 # Include bluetooth packages on supported boards
@@ -398,14 +410,6 if [ "$ENABLE_UBOOT" = true ] ; then
398 APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex,bc"
410 APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex,bc"
399 fi
411 fi
400
412
401 if [ "$ENABLE_BLUETOOTH" = true ] ; then
402 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
403 if [ "$ENABLE_CONSOLE" = false ] ; then
404 APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez"
405 fi
406 fi
407 fi
408
409 # Check if root SSH (v2) public key file exists
413 # Check if root SSH (v2) public key file exists
410 if [ -n "$SSH_ROOT_PUB_KEY" ] ; then
414 if [ -n "$SSH_ROOT_PUB_KEY" ] ; then
411 if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then
415 if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant