@@ -31,7 +31,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
31 | 31 | # Create temporary directory for kernel sources |
|
32 | 32 | temp_dir=$(as_nobody mktemp -d) |
|
33 | 33 | |
|
34 | # Fetch current RPi2/3 kernel sources | |
|
34 | # Fetch current RPi2/3/4 kernel sources | |
|
35 | 35 | if [ -z "${KERNEL_BRANCH}" ] ; then |
|
36 | 36 | as_nobody -H git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" linux |
|
37 | 37 | else |
@@ -52,13 +52,13 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
52 | 52 | if [ -n "$KERNEL_THREADS" ] && [ -r /proc/cpuinfo ] ; then |
|
53 | 53 | KERNEL_THREADS=$(grep -c processor /proc/cpuinfo) |
|
54 | 54 | fi |
|
55 | ||
|
56 |
# TODO: Check if defined Threadcount is higher than actual cores |
|
|
55 | ||
|
56 | # TODO: Check if defined Threadcount is higher than actual cores | |
|
57 | 57 | # if [ "$KERNEL_THREADS" > grep -c processor /proc/cpuinfo] ; then |
|
58 | 58 | # echo "Defined more Threads than core assigned to this system" |
|
59 | 59 | # exit 1 |
|
60 | 60 | # fi |
|
61 | ||
|
61 | ||
|
62 | 62 | #Copy 32bit config to 64bit |
|
63 | 63 | if [ "$ENABLE_QEMU" = true ] && [ "$KERNEL_ARCH" = arm64 ]; then |
|
64 | 64 | cp "${KERNEL_DIR}"/arch/arm/configs/vexpress_defconfig "${KERNEL_DIR}"/arch/arm64/configs/ |
@@ -108,7 +108,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
108 | 108 | |
|
109 | 109 | #Switch to KERNELSRC_DIR so we can use set_kernel_config |
|
110 | 110 | cd "${KERNEL_DIR}" || exit |
|
111 | ||
|
111 | ||
|
112 | 112 | # Enable RPI POE HAT fan |
|
113 | 113 | if [ "$KERNEL_POEHAT" = true ]; then |
|
114 | 114 | set_kernel_config CONFIG_SENSORS_RPI_POE_FAN m |
@@ -119,20 +119,20 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
119 | 119 | if [ "$KERNEL_NSPAN" = true ]; then |
|
120 | 120 | set_kernel_config CONFIG_CGROUP_NET_PRIO y |
|
121 | 121 | fi |
|
122 | ||
|
122 | ||
|
123 | 123 | # Compile in BTRFS |
|
124 | 124 | if [ "$KERNEL_BTRFS" = true ]; then |
|
125 | 125 | set_kernel_config CONFIG_BTRFS_FS y |
|
126 | 126 | set_kernel_config CONFIG_BTRFS_FS_POSIX_ACL y |
|
127 | 127 | set_kernel_config CONFIG_BTRFS_FS_REF_VERIFY y |
|
128 | 128 | fi |
|
129 | ||
|
129 | ||
|
130 | 130 | # Diffie-Hellman operations on retained keys |
|
131 | 131 | # (required for >keyutils-1.6) |
|
132 | 132 | if [ "$KERNEL_DHKEY" = true ]; then |
|
133 | 133 | set_kernel_config CONFIG_KEY_DH_OPERATIONS y |
|
134 |
fi |
|
|
135 | ||
|
134 | fi | |
|
135 | ||
|
136 | 136 | if [ "$KERNEL_ARCH" = arm64 ] && [ "$ENABLE_QEMU" = false ]; then |
|
137 | 137 | # Mask this temporarily during switch to rpi-4.19.y |
|
138 | 138 | #Fix SD_DRIVER upstream and downstream mess in 64bit RPIdeb_config |
@@ -141,11 +141,11 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
141 | 141 | #set_kernel_config CONFIG_MMC_SDHCI_IPROC n |
|
142 | 142 | #set_kernel_config CONFIG_USB_DWC2 n |
|
143 | 143 | #sed -i "s|depends on MMC_BCM2835_MMC && MMC_BCM2835_DMA|depends on MMC_BCM2835_MMC|" "${KERNEL_DIR}"/drivers/mmc/host/Kconfig |
|
144 | ||
|
144 | ||
|
145 | 145 | #VLAN got disabled without reason in arm64bit |
|
146 | 146 | set_kernel_config CONFIG_IPVLAN m |
|
147 | 147 | fi |
|
148 | ||
|
148 | ||
|
149 | 149 | # enable ZSWAP see https://askubuntu.com/a/472227 or https://wiki.archlinux.org/index.php/zswap |
|
150 | 150 | if [ "$KERNEL_ZSWAP" = true ] ; then |
|
151 | 151 | set_kernel_config CONFIG_ZPOOL y |
@@ -156,7 +156,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
156 | 156 | set_kernel_config CONFIG_PGTABLE_MAPPING y |
|
157 | 157 | set_kernel_config CONFIG_LZO_COMPRESS y |
|
158 | 158 | fi |
|
159 | ||
|
159 | ||
|
160 | 160 | if [ "$RPI_MODEL" = 4 ] ; then |
|
161 | 161 | # Following are set in current 32-bit LPAE kernel |
|
162 | 162 | set_kernel_config CONFIG_CGROUP_PIDS y |
@@ -362,7 +362,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
362 | 362 | set_kernel_config CONFIG_PCIE_BRCMSTB y |
|
363 | 363 | set_kernel_config CONFIG_BCM2835_MMC y |
|
364 | 364 | |
|
365 |
# Snap needs squashfs. The ubuntu eoan-preinstalled-server image at |
|
|
365 | # Snap needs squashfs. The ubuntu eoan-preinstalled-server image at | |
|
366 | 366 | # http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/ uses snap |
|
367 | 367 | # during cloud-init setup at first boot. Without this the login accounts are not |
|
368 | 368 | # created and the user can not login. |
@@ -404,10 +404,10 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
404 | 404 | set_kernel_config CONFIG_SLAB_FREELIST_RANDOM=y |
|
405 | 405 | set_kernel_config CONFIG_SLAB_FREELIST_HARDENED=y |
|
406 | 406 | set_kernel_config CONFIG_MMU_NOTIFIER y |
|
407 | ||
|
407 | ||
|
408 | 408 | # erratum |
|
409 | 409 | set_kernel_config ARM64_ERRATUM_834220 y |
|
410 | ||
|
410 | ||
|
411 | 411 | # https://sourceforge.net/p/kvm/mailman/message/18440797/ |
|
412 | 412 | set_kernel_config CONFIG_PREEMPT_NOTIFIERS y |
|
413 | 413 | fi |
@@ -471,7 +471,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
471 | 471 | set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m |
|
472 | 472 | set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096 |
|
473 | 473 | fi |
|
474 | ||
|
474 | ||
|
475 | 475 | if [ "$ENABLE_CRYPTFS" = true ] ; then |
|
476 | 476 | set_kernel_config CONFIG_EMBEDDED y |
|
477 | 477 | set_kernel_config CONFIG_EXPERT y |
@@ -625,7 +625,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
625 | 625 | set_kernel_config CONFIG_NF_TABLES_BRIDGE y |
|
626 | 626 | set_kernel_config CONFIG_NF_CT_NETLINK_TIMEOUT m |
|
627 | 627 | set_kernel_config CONFIG_NFT_OSF m |
|
628 | ||
|
628 | ||
|
629 | 629 | fi |
|
630 | 630 | |
|
631 | 631 | # Enables BPF syscall for systemd-journald see https://github.com/torvalds/linux/blob/master/init/Kconfig#L848 or https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA |
@@ -637,7 +637,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
637 | 637 | set_kernel_config CONFIG_XDP_SOCKETS y |
|
638 | 638 | fi |
|
639 | 639 | |
|
640 |
# KERNEL_DEFAULT_GOV was set by user |
|
|
640 | # KERNEL_DEFAULT_GOV was set by user | |
|
641 | 641 | if [ "$KERNEL_DEFAULT_GOV" != ondemand ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then |
|
642 | 642 | case "$KERNEL_DEFAULT_GOV" in |
|
643 | 643 | performance) |
@@ -811,16 +811,16 else # BUILD_KERNEL=false | |||
|
811 | 811 | temp_dir=$(as_nobody mktemp -d) |
|
812 | 812 | |
|
813 | 813 | # Fetch kernel dl |
|
814 |
as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL" |
|
|
814 | as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL" | |
|
815 | 815 | fi |
|
816 | 816 | if [ "$SET_ARCH" = 64 ] && [ "$RPI_MODEL" = 4 ] ; then |
|
817 | 817 | # Create temporary directory for dl |
|
818 | 818 | temp_dir=$(as_nobody mktemp -d) |
|
819 | 819 | |
|
820 | 820 | # Fetch kernel dl |
|
821 |
as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL" |
|
|
821 | as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL" | |
|
822 | 822 | fi |
|
823 | ||
|
823 | ||
|
824 | 824 | #extract download |
|
825 | 825 | tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}" |
|
826 | 826 | |
@@ -883,4 +883,4 else # BUILD_KERNEL=false | |||
|
883 | 883 | cleanup |
|
884 | 884 | exit 1 |
|
885 | 885 | fi |
|
886 | fi No newline at end of file | |
|
886 | fi |
@@ -20,7 +20,7 if [ -n "$RPI_FIRMWARE_DIR" ] && [ -d "$RPI_FIRMWARE_DIR" ] ; then | |||
|
20 | 20 | cp "${RPI_FIRMWARE_DIR}"/boot/fixup4x.dat "${BOOT_DIR}"/fixup4x.dat |
|
21 | 21 | cp "${RPI_FIRMWARE_DIR}"/boot/start4cd.elf "${BOOT_DIR}"/start4cd.elf |
|
22 | 22 | cp "${RPI_FIRMWARE_DIR}"/boot/start4db.elf "${BOOT_DIR}"/start4db.elf |
|
23 |
cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4 |
|
|
23 | cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4.elf | |
|
24 | 24 | cp "${RPI_FIRMWARE_DIR}"/boot/start4x.elf "${BOOT_DIR}"/start4x.elf |
|
25 | 25 | else |
|
26 | 26 | # Create temporary directory for boot binaries |
@@ -40,7 +40,7 else | |||
|
40 | 40 | as_nobody wget -q -O "${temp_dir}/fixup4x.dat" "${FIRMWARE_URL}/fixup4x.dat" |
|
41 | 41 | as_nobody wget -q -O "${temp_dir}/start4cd.elf" "${FIRMWARE_URL}/start4cd.elf" |
|
42 | 42 | as_nobody wget -q -O "${temp_dir}/start4db.elf" "${FIRMWARE_URL}/start4db.elf" |
|
43 |
as_nobody wget -q -O "${temp_dir}/start4 |
|
|
43 | as_nobody wget -q -O "${temp_dir}/start4.elf" "${FIRMWARE_URL}/start4.elf" | |
|
44 | 44 | as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf" |
|
45 | 45 | |
|
46 | 46 | # Move downloaded boot binaries |
@@ -45,7 +45,7 RPI_MODEL=${RPI_MODEL:=3P} | |||
|
45 | 45 | # Debian release |
|
46 | 46 | RELEASE=${RELEASE:=buster} |
|
47 | 47 | if [ $RELEASE = "bullseye" ] ; then |
|
48 | RELEASE=testing | |
|
48 | RELEASE=testing | |
|
49 | 49 | fi |
|
50 | 50 | |
|
51 | 51 | # Kernel Branch |
@@ -65,7 +65,7 SYSTEMDSWAP_URL=${SYSTEMDSWAP_URL:=https://github.com/Nefelim4ag/systemd-swap.gi | |||
|
65 | 65 | # Kernel deb packages for 32bit kernel |
|
66 | 66 | RPI_32_KERNEL_URL=${RPI_32_KERNEL_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel_20180422-141901_armhf.deb} |
|
67 | 67 | RPI_32_KERNELHEADER_URL=${RPI_32_KERNELHEADER_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel-headers_20180422-141901_armhf.deb} |
|
68 |
# Kernel has KVM and zswap enabled - use if KERNEL_* parameters and precompiled kernel are used |
|
|
68 | # Kernel has KVM and zswap enabled - use if KERNEL_* parameters and precompiled kernel are used | |
|
69 | 69 | RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.19.102.20200211/bcmrpi3-kernel-bis-4.19.102.20200211.tar.xz} |
|
70 | 70 | # Default precompiled 64bit kernel |
|
71 | 71 | RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.19.102.20200211/bcmrpi3-kernel-4.19.102.20200211.tar.xz} |
@@ -73,7 +73,7 RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmr | |||
|
73 | 73 | RPI4_64_BIS_KERNEL_URL=${RPI4_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz} |
|
74 | 74 | # Default precompiled 64bit kernel - https://github.com/sakaki-/bcm2711-kernel |
|
75 | 75 | RPI4_64_DEF_KERNEL_URL=${RPI4_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz} |
|
76 |
# Generic |
|
|
76 | # Generic | |
|
77 | 77 | RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_DEF_KERNEL_URL} |
|
78 | 78 | RPI4_64_KERNEL_URL=${RPI4_64_KERNEL_URL:=$RPI4_64_DEF_KERNEL_URL} |
|
79 | 79 | # Kali kernel src - used if ENABLE_NEXMON=true (they patch the wlan kernel modul) |
@@ -270,73 +270,74 fi | |||
|
270 | 270 | |
|
271 | 271 | # Setup architecture specific settings |
|
272 | 272 | if [ -n "$SET_ARCH" ] ; then |
|
273 | # 64-bit configuration | |
|
273 | ## 64-bit configuration | |
|
274 | 274 | if [ "$SET_ARCH" = 64 ] ; then |
|
275 | # General 64-bit depended settings | |
|
275 | ### General 64-bit depended settings | |
|
276 | 276 | QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static} |
|
277 | 277 | KERNEL_ARCH=${KERNEL_ARCH:=arm64} |
|
278 | 278 | KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"} |
|
279 | 279 | |
|
280 | # Raspberry Pi model specific settings | |
|
280 | ### Raspberry Pi 64-bit model specific settings | |
|
281 | 281 | if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then |
|
282 | 282 | if [ "$RPI_MODEL" != 4 ] ; then |
|
283 | 283 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig} |
|
284 | 284 | else |
|
285 | 285 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig} |
|
286 | 286 | fi |
|
287 | ||
|
287 | ||
|
288 | 288 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64" |
|
289 | 289 | RELEASE_ARCH=${RELEASE_ARCH:=arm64} |
|
290 | 290 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img} |
|
291 | 291 | CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-} |
|
292 | ||
|
292 | 293 | else |
|
293 | 294 | echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit" |
|
294 | 295 | exit 1 |
|
295 | 296 | fi |
|
296 | 297 | fi |
|
297 | 298 | |
|
298 | # 32-bit configuration | |
|
299 | ## 32-bit configuration | |
|
299 | 300 | if [ "$SET_ARCH" = 32 ] ; then |
|
300 | # General 32-bit dependend settings | |
|
301 | ### General 32-bit dependend settings | |
|
301 | 302 | QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static} |
|
302 | 303 | KERNEL_ARCH=${KERNEL_ARCH:=arm} |
|
303 | 304 | KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"} |
|
304 | 305 | |
|
305 | # Raspberry Pi model specific settings | |
|
306 | ### Raspberry Pi (0-1P) model specific settings | |
|
306 | 307 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then |
|
307 | 308 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel" |
|
308 | 309 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig} |
|
309 | 310 | RELEASE_ARCH=${RELEASE_ARCH:=armel} |
|
310 | 311 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img} |
|
311 | 312 | CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-} |
|
312 | ||
|
313 | if [ $ENABLE_XORG = true ] ; then | |
|
314 | if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then | |
|
315 | printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] " | |
|
316 | read -r confirm | |
|
313 | if [ $ENABLE_XORG = true ] ; then | |
|
314 | if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then | |
|
315 | printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] " | |
|
316 | read -r confirm | |
|
317 | 317 | if [ "$confirm" = "y" ] ; then |
|
318 |
|
|
|
319 | fi | |
|
320 |
|
|
|
321 |
|
|
|
318 | $RELEASE = "stretch" | |
|
319 | fi | |
|
320 | fi | |
|
321 | fi | |
|
322 | 322 | fi |
|
323 | # Raspberry Pi model specific settings | |
|
323 | ### Raspberry Pi (2-4) model specific settings | |
|
324 | 324 | if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then |
|
325 | 325 | if [ "$RPI_MODEL" != 4 ] ; then |
|
326 | 326 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig} |
|
327 |
|
|
|
327 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img} | |
|
328 | 328 | else |
|
329 | 329 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig} |
|
330 |
|
|
|
330 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7l.img} | |
|
331 | 331 | fi |
|
332 | ||
|
332 | ||
|
333 | 333 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf" |
|
334 | 334 | RELEASE_ARCH=${RELEASE_ARCH:=armhf} |
|
335 | ||
|
335 | ||
|
336 | 336 | CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-} |
|
337 | 337 | fi |
|
338 | 338 | fi |
|
339 | # SET_ARCH not set | |
|
339 | ||
|
340 | # SET_ARCH not set | |
|
340 | 341 | else |
|
341 | 342 | echo "error: Please set '32' or '64' as value for SET_ARCH" |
|
342 | 343 | exit 1 |
@@ -344,50 +345,51 fi | |||
|
344 | 345 | # Device specific configuration and U-Boot configuration |
|
345 | 346 | case "$RPI_MODEL" in |
|
346 | 347 | 0) |
|
347 |
|
|
|
348 |
|
|
|
349 |
|
|
|
348 | DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb} | |
|
349 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} | |
|
350 | ;; | |
|
350 | 351 | 1) |
|
351 |
|
|
|
352 |
|
|
|
353 |
|
|
|
352 | DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb} | |
|
353 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} | |
|
354 | ;; | |
|
354 | 355 | 1P) |
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
|
356 | DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb} | |
|
357 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} | |
|
358 | ;; | |
|
358 | 359 | 2) |
|
359 |
|
|
|
360 |
|
|
|
361 |
|
|
|
360 | DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb} | |
|
361 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig} | |
|
362 | ;; | |
|
362 | 363 | 3) |
|
363 |
|
|
|
364 |
|
|
|
365 |
|
|
|
364 | DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} | |
|
365 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} | |
|
366 | ;; | |
|
366 | 367 | 3P) |
|
367 |
|
|
|
368 |
|
|
|
369 |
|
|
|
368 | DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} | |
|
369 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} | |
|
370 | ;; | |
|
370 | 371 | 4) |
|
371 |
|
|
|
372 |
|
|
|
373 |
|
|
|
372 | DTB_FILE=${DTB_FILE:=bcm2711-rpi-4-b.dtb} | |
|
373 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_4_defconfig} | |
|
374 | ;; | |
|
374 | 375 | *) |
|
375 |
|
|
|
376 |
|
|
|
377 |
|
|
|
376 | echo "error: Raspberry Pi model $RPI_MODEL is not supported!" | |
|
377 | exit 1 | |
|
378 | ;; | |
|
378 | 379 | esac |
|
379 | 380 | |
|
380 | 381 | # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard |
|
381 | 382 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then |
|
382 | # Include bluetooth packages on supported boards | |
|
383 | ## Include bluetooth packages on supported boards | |
|
383 | 384 | if [ "$ENABLE_BLUETOOTH" = true ] ; then |
|
384 | 385 | APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" |
|
385 | 386 | fi |
|
386 | 387 | if [ "$ENABLE_WIRELESS" = true ] ; then |
|
387 | 388 | APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant" |
|
388 | 389 | fi |
|
389 |
|
|
|
390 | # Check if the internal wireless interface is not supported by the RPi model | |
|
390 | # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard | |
|
391 | else | |
|
392 | ## Check if the internal wireless interface is not supported by the RPi model | |
|
391 | 393 | if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then |
|
392 | 394 | echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth" |
|
393 | 395 | exit 1 |
@@ -440,11 +442,11 if [ "$ENABLE_CRYPTFS" = true ] && [ "$BUILD_KERNEL" = true ] ; then | |||
|
440 | 442 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cryptsetup" |
|
441 | 443 | APT_INCLUDES="${APT_INCLUDES},cryptsetup,busybox,console-setup,cryptsetup-initramfs" |
|
442 | 444 | |
|
443 | # If cryptfs,dropbear and initramfs are enabled include dropbear-initramfs package | |
|
445 | ## If cryptfs,dropbear and initramfs are enabled include dropbear-initramfs package | |
|
444 | 446 | if [ "$CRYPTFS_DROPBEAR" = true ] && [ "$ENABLE_INITRAMFS" = true ]; then |
|
445 | 447 | APT_INCLUDES="${APT_INCLUDES},dropbear-initramfs" |
|
446 | 448 | fi |
|
447 | ||
|
449 | ||
|
448 | 450 | if [ -z "$CRYPTFS_PASSWORD" ] ; then |
|
449 | 451 | echo "error: no password defined (CRYPTFS_PASSWORD)!" |
|
450 | 452 | exit 1 |
@@ -462,11 +464,11 if [ "$ENABLE_UBOOT" = true ] ; then | |||
|
462 | 464 | APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bc" |
|
463 | 465 | fi |
|
464 | 466 | |
|
465 |
if [ "$ENABLE_USBBOOT" = true ] ; then |
|
|
466 |
|
|
|
467 |
|
|
|
468 |
|
|
|
469 |
|
|
|
467 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
468 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then | |
|
469 | echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P" | |
|
470 | exit 1 | |
|
471 | fi | |
|
470 | 472 | fi |
|
471 | 473 | |
|
472 | 474 | # Check if root SSH (v2) public key file exists |
@@ -506,7 +508,7 if [ -n "$MISSING_PACKAGES" ] ; then | |||
|
506 | 508 | read -r confirm |
|
507 | 509 | [ "$confirm" != "y" ] && exit 1 |
|
508 | 510 | |
|
509 | # Make sure all missing required packages are installed | |
|
511 | ## Make sure all missing required packages are installed | |
|
510 | 512 | apt-get update && apt-get -qq -y install `echo "${MISSING_PACKAGES}" | sed "s/ //"` |
|
511 | 513 | fi |
|
512 | 514 | |
@@ -554,8 +556,8 fi | |||
|
554 | 556 | |
|
555 | 557 | # Check if specified CHROOT_SCRIPTS directory exists |
|
556 | 558 | if [ -n "$CHROOT_SCRIPTS" ] && [ ! -d "$CHROOT_SCRIPTS" ] ; then |
|
557 |
|
|
|
558 |
|
|
|
559 | echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!" | |
|
560 | exit 1 | |
|
559 | 561 | fi |
|
560 | 562 | |
|
561 | 563 | # Check if specified device mapping already exists (will be used by cryptsetup) |
@@ -649,12 +651,12 fi | |||
|
649 | 651 | |
|
650 | 652 | # Replace selected packages with smaller clones |
|
651 | 653 | if [ "$ENABLE_REDUCE" = true ] ; then |
|
652 | # Add levee package instead of vim-tiny | |
|
654 | ## Add levee package instead of vim-tiny | |
|
653 | 655 | if [ "$REDUCE_VIM" = true ] ; then |
|
654 | 656 | APT_INCLUDES="$(echo ${APT_INCLUDES} | sed "s/vim-tiny/levee/")" |
|
655 | 657 | fi |
|
656 | 658 | |
|
657 | # Add dropbear package instead of openssh-server | |
|
659 | ## Add dropbear package instead of openssh-server | |
|
658 | 660 | if [ "$REDUCE_SSHD" = true ] ; then |
|
659 | 661 | APT_INCLUDES="$(echo "${APT_INCLUDES}" | sed "s/openssh-server/dropbear/")" |
|
660 | 662 | fi |
@@ -702,12 +704,12 fi | |||
|
702 | 704 | if [ -n "$CHROOT_SCRIPTS" ] && [ -d "$CHROOT_SCRIPTS" ] ; then |
|
703 | 705 | cp -r "${CHROOT_SCRIPTS}" "${R}/chroot_scripts" |
|
704 | 706 | chroot_exec /bin/bash -x <<'EOF' |
|
705 | for SCRIPT in /chroot_scripts/* ; do | |
|
706 | if [ -f $SCRIPT -a -x $SCRIPT ] ; then | |
|
707 | $SCRIPT | |
|
708 | fi | |
|
709 | done | |
|
710 | EOF | |
|
707 | for SCRIPT in /chroot_scripts/* ; do | |
|
708 | if [ -f $SCRIPT -a -x $SCRIPT ] ; then | |
|
709 | $SCRIPT | |
|
710 | fi | |
|
711 | done | |
|
712 | EOF | |
|
711 | 713 | rm -rf "${R}/chroot_scripts" |
|
712 | 714 | fi |
|
713 | 715 | |
@@ -823,13 +825,13 if [ "$ENABLE_SPLITFS" = true ] ; then | |||
|
823 | 825 | |
|
824 | 826 | # Write firmware/boot partition tables |
|
825 | 827 | sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM |
|
826 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* | |
|
827 | EOM | |
|
828 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* | |
|
829 | EOM | |
|
828 | 830 | |
|
829 | 831 | # Write root partition table |
|
830 | 832 | sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM |
|
831 | ${TABLE_SECTORS},${ROOT_SECTORS},83 | |
|
832 | EOM | |
|
833 | ${TABLE_SECTORS},${ROOT_SECTORS},83 | |
|
834 | EOM | |
|
833 | 835 | |
|
834 | 836 | # Setup temporary loop devices |
|
835 | 837 | FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME"-frmw.img)" |
@@ -840,9 +842,9 else # ENABLE_SPLITFS=false | |||
|
840 | 842 | |
|
841 | 843 | # Write partition table |
|
842 | 844 | sfdisk -q -L -uS -f "$IMAGE_NAME.img" 2> /dev/null <<EOM |
|
843 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* | |
|
844 | ${ROOT_OFFSET},${ROOT_SECTORS},83 | |
|
845 | EOM | |
|
845 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* | |
|
846 | ${ROOT_OFFSET},${ROOT_SECTORS},83 | |
|
847 | EOM | |
|
846 | 848 | |
|
847 | 849 | # Setup temporary loop devices |
|
848 | 850 | FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME".img)" |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant