##// END OF EJS Templates
Merge branch 'contribGV' of http://depot.tremplin.ens-lyon.fr/Raspi2-3_GenImage into contribGV
vidal -
r776:3332c4bc4391 Fusion contribGV
parent child
Show More
@@ -207,7 +207,11 The following static networking parameters are only supported if `ENABLE_WIFI_DH
207 |ENABLE_UBOOT|boolean|false|`true`\|`false`|Replace the default RPi 0/1/2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol. RPI4 needs tbd|
207 |ENABLE_UBOOT|boolean|false|`true`\|`false`|Replace the default RPi 0/1/2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol. RPI4 needs tbd|
208 |UBOOTSRC_DIR|string||`FullPathToUBootFolder`|Full path to a directory named `u-boot` of [U-Boot bootloader sources](https://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot|
208 |UBOOTSRC_DIR|string||`FullPathToUBootFolder`|Full path to a directory named `u-boot` of [U-Boot bootloader sources](https://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot|
209 |ENABLE_FBTURBO|boolean|false|`true`\|`false`|Install and enable the [hardware accelerated Xorg video driver](https://github.com/ssvb/xf86-video-fbturbo) `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling|
209 |ENABLE_FBTURBO|boolean|false|`true`\|`false`|Install and enable the [hardware accelerated Xorg video driver](https://github.com/ssvb/xf86-video-fbturbo) `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling|
210 <<<<<<< HEAD
210 |ENABLE_GR_ACCEL|boolean|false|`true`\|`false`|Install and enable [one of the 3D graphics accelerators for Raspi4](https://www.raspberrypi.org/documentation/configuration/config-txt/video.md) `vc4-fkms-v3d`. Not compatible with `fbturbo` mutually excluded and installed for Raspberry4 only|
211 |ENABLE_GR_ACCEL|boolean|false|`true`\|`false`|Install and enable [one of the 3D graphics accelerators for Raspi4](https://www.raspberrypi.org/documentation/configuration/config-txt/video.md) `vc4-fkms-v3d`. Not compatible with `fbturbo` mutually excluded and installed for Raspberry4 only|
212 =======
213 |ENABLE_GR_ACCEL|boolean|true|`true`\|`false`|Install and enable [one of the 3D graphics accelerators for Raspi4](https://www.raspberrypi.org/documentation/configuration/config-txt/video.md) `vc4-fkms-v3d`. Not compatible with `fbturbo` and installed for Raspberry4 only.
214 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
211 |FBTURBOSRC_DIR|string||`FullPathToFbTurboFolder`|Full path to a directory named `xf86-video-fbturbo` of [hardware accelerated Xorg video driver sources](https://github.com/ssvb/xf86-video-fbturbo) that will be copied, configured, build and installed inside the chroot|
215 |FBTURBOSRC_DIR|string||`FullPathToFbTurboFolder`|Full path to a directory named `xf86-video-fbturbo` of [hardware accelerated Xorg video driver sources](https://github.com/ssvb/xf86-video-fbturbo) that will be copied, configured, build and installed inside the chroot|
212 |ENABLE_VIDEOCORE|boolean|false|`true`\|`false`|Install and enable the [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) `vcgencmd`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling|
216 |ENABLE_VIDEOCORE|boolean|false|`true`\|`false`|Install and enable the [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) `vcgencmd`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling|
213 |VIDEOCORESRC_DIR|string||`FullPathToVideoSrcFolder`|Full path to a directory named `userland` of [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot|
217 |VIDEOCORESRC_DIR|string||`FullPathToVideoSrcFolder`|Full path to a directory named `userland` of [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot|
@@ -399,6 +403,6 qemu-system-arm -m 2048M -M vexpress-a15 -cpu cortex-a15 -kernel kernel7.img -no
399 * [Official Raspberry Pi Firmware on github](https://github.com/raspberrypi/firmware)
403 * [Official Raspberry Pi Firmware on github](https://github.com/raspberrypi/firmware)
400 * [Official Raspberry Pi Kernel on github](https://github.com/raspberrypi/linux)
404 * [Official Raspberry Pi Kernel on github](https://github.com/raspberrypi/linux)
401 * [U-BOOT git repository](https://git.denx.de/?p=u-boot.git;a=summary)
405 * [U-BOOT git repository](https://git.denx.de/?p=u-boot.git;a=summary)
402 * [Xorg DDX driver fbturbo](https://github.com/ssvb/xf86-video-fbturbo)
406 * [Xorg DDX driver #FFFFFF#FFFFFF#FFFFFF](https://github.com/ssvb/xf86-video-fbturbo)
403 * [RPi3 Wireless interface firmware](https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm)
407 * [RPi3 Wireless interface firmware](https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm)
404 * [Collabora RPi2 Kernel precompiled](https://repositories.collabora.co.uk/debian/)
408 * [Collabora RPi2 Kernel precompiled](https://repositories.collabora.co.uk/debian/)
@@ -141,11 +141,10 if [ "$BUILD_KERNEL" = true ] ; then
141 #set_kernel_config CONFIG_MMC_SDHCI_IPROC n
141 #set_kernel_config CONFIG_MMC_SDHCI_IPROC n
142 #set_kernel_config CONFIG_USB_DWC2 n
142 #set_kernel_config CONFIG_USB_DWC2 n
143 #sed -i "s|depends on MMC_BCM2835_MMC && MMC_BCM2835_DMA|depends on MMC_BCM2835_MMC|" "${KERNEL_DIR}"/drivers/mmc/host/Kconfig
143 #sed -i "s|depends on MMC_BCM2835_MMC && MMC_BCM2835_DMA|depends on MMC_BCM2835_MMC|" "${KERNEL_DIR}"/drivers/mmc/host/Kconfig
144
145 #VLAN got disabled without reason in arm64bit
144 #VLAN got disabled without reason in arm64bit
146 set_kernel_config CONFIG_IPVLAN m
145 set_kernel_config CONFIG_IPVLAN m
147 fi
146 fi
148
147
149 # enable ZSWAP see https://askubuntu.com/a/472227 or https://wiki.archlinux.org/index.php/zswap
148 # enable ZSWAP see https://askubuntu.com/a/472227 or https://wiki.archlinux.org/index.php/zswap
150 if [ "$KERNEL_ZSWAP" = true ] ; then
149 if [ "$KERNEL_ZSWAP" = true ] ; then
151 set_kernel_config CONFIG_ZPOOL y
150 set_kernel_config CONFIG_ZPOOL y
@@ -156,7 +155,7 if [ "$BUILD_KERNEL" = true ] ; then
156 set_kernel_config CONFIG_PGTABLE_MAPPING y
155 set_kernel_config CONFIG_PGTABLE_MAPPING y
157 set_kernel_config CONFIG_LZO_COMPRESS y
156 set_kernel_config CONFIG_LZO_COMPRESS y
158 fi
157 fi
159
158
160 if [ "$RPI_MODEL" = 4 ] ; then
159 if [ "$RPI_MODEL" = 4 ] ; then
161 # Following are set in current 32-bit LPAE kernel
160 # Following are set in current 32-bit LPAE kernel
162 set_kernel_config CONFIG_CGROUP_PIDS y
161 set_kernel_config CONFIG_CGROUP_PIDS y
@@ -362,7 +361,7 if [ "$BUILD_KERNEL" = true ] ; then
362 set_kernel_config CONFIG_PCIE_BRCMSTB y
361 set_kernel_config CONFIG_PCIE_BRCMSTB y
363 set_kernel_config CONFIG_BCM2835_MMC y
362 set_kernel_config CONFIG_BCM2835_MMC y
364
363
365 # Snap needs squashfs. The ubuntu eoan-preinstalled-server image at
364 # Snap needs squashfs. The ubuntu eoan-preinstalled-server image at
366 # http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/ uses snap
365 # http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/ uses snap
367 # during cloud-init setup at first boot. Without this the login accounts are not
366 # during cloud-init setup at first boot. Without this the login accounts are not
368 # created and the user can not login.
367 # created and the user can not login.
@@ -404,10 +403,10 if [ "$BUILD_KERNEL" = true ] ; then
404 set_kernel_config CONFIG_SLAB_FREELIST_RANDOM=y
403 set_kernel_config CONFIG_SLAB_FREELIST_RANDOM=y
405 set_kernel_config CONFIG_SLAB_FREELIST_HARDENED=y
404 set_kernel_config CONFIG_SLAB_FREELIST_HARDENED=y
406 set_kernel_config CONFIG_MMU_NOTIFIER y
405 set_kernel_config CONFIG_MMU_NOTIFIER y
407
406
408 # erratum
407 # erratum
409 set_kernel_config ARM64_ERRATUM_834220 y
408 set_kernel_config ARM64_ERRATUM_834220 y
410
409
411 # https://sourceforge.net/p/kvm/mailman/message/18440797/
410 # https://sourceforge.net/p/kvm/mailman/message/18440797/
412 set_kernel_config CONFIG_PREEMPT_NOTIFIERS y
411 set_kernel_config CONFIG_PREEMPT_NOTIFIERS y
413 fi
412 fi
@@ -471,7 +470,7 if [ "$BUILD_KERNEL" = true ] ; then
471 set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m
470 set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m
472 set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096
471 set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096
473 fi
472 fi
474
473
475 if [ "$ENABLE_CRYPTFS" = true ] ; then
474 if [ "$ENABLE_CRYPTFS" = true ] ; then
476 set_kernel_config CONFIG_EMBEDDED y
475 set_kernel_config CONFIG_EMBEDDED y
477 set_kernel_config CONFIG_EXPERT y
476 set_kernel_config CONFIG_EXPERT y
@@ -625,7 +624,7 if [ "$BUILD_KERNEL" = true ] ; then
625 set_kernel_config CONFIG_NF_TABLES_BRIDGE y
624 set_kernel_config CONFIG_NF_TABLES_BRIDGE y
626 set_kernel_config CONFIG_NF_CT_NETLINK_TIMEOUT m
625 set_kernel_config CONFIG_NF_CT_NETLINK_TIMEOUT m
627 set_kernel_config CONFIG_NFT_OSF m
626 set_kernel_config CONFIG_NFT_OSF m
628
627
629 fi
628 fi
630
629
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
630 # 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 +636,7 if [ "$BUILD_KERNEL" = true ] ; then
637 set_kernel_config CONFIG_XDP_SOCKETS y
636 set_kernel_config CONFIG_XDP_SOCKETS y
638 fi
637 fi
639
638
640 # KERNEL_DEFAULT_GOV was set by user
639 # KERNEL_DEFAULT_GOV was set by user
641 if [ "$KERNEL_DEFAULT_GOV" != ondemand ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
640 if [ "$KERNEL_DEFAULT_GOV" != ondemand ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
642 case "$KERNEL_DEFAULT_GOV" in
641 case "$KERNEL_DEFAULT_GOV" in
643 performance)
642 performance)
@@ -811,16 +810,16 else # BUILD_KERNEL=false
811 temp_dir=$(as_nobody mktemp -d)
810 temp_dir=$(as_nobody mktemp -d)
812
811
813 # Fetch kernel dl
812 # Fetch kernel dl
814 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
813 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
815 fi
814 fi
816 if [ "$SET_ARCH" = 64 ] && [ "$RPI_MODEL" = 4 ] ; then
815 if [ "$SET_ARCH" = 64 ] && [ "$RPI_MODEL" = 4 ] ; then
817 # Create temporary directory for dl
816 # Create temporary directory for dl
818 temp_dir=$(as_nobody mktemp -d)
817 temp_dir=$(as_nobody mktemp -d)
819
818
820 # Fetch kernel dl
819 # Fetch kernel dl
821 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL"
820 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL"
822 fi
821 fi
823
822
824 #extract download
823 #extract download
825 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
824 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
826
825
@@ -265,6 +265,7 fi
265 echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt"
265 echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt"
266
266
267 # Setup minimal GPU memory allocation size: 16MB (no X)
267 # Setup minimal GPU memory allocation size: 16MB (no X)
268 <<<<<<< HEAD
268 if [ "$ENABLE_MINGPU" = true ] ; then
269 if [ "$ENABLE_MINGPU" = true ] ; then
269 if [ "$ENABLE_GR_ACCEL" = false ] ; then
270 if [ "$ENABLE_GR_ACCEL" = false ] ; then
270 echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt"
271 echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt"
@@ -272,6 +273,10 if [ "$ENABLE_MINGPU" = true ] ; then
272 ### Cannot reduce memory if graphics acceleration is requested
273 ### Cannot reduce memory if graphics acceleration is requested
273 echo "gpu_mem=128" >> "${BOOT_DIR}/config.txt"
274 echo "gpu_mem=128" >> "${BOOT_DIR}/config.txt"
274 fi
275 fi
276 =======
277 if [ "$ENABLE_MINGPU" = true ] && [ "$ENABLE_GR_ACCEL" = false ] ; then
278 echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt"
279 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
275 fi
280 fi
276
281
277 # Setup boot with initramfs
282 # Setup boot with initramfs
@@ -315,6 +320,17 if [ "$ENABLE_SPI" = true ] ; then
315 fi
320 fi
316 fi
321 fi
317
322
323 #Enable graphics acceleration for Model 4
324 if [ "$RPI_MODEL" = 4 ] && [ "$ENABLE_GR_ACCEL" = true ] ; then
325 echo "max_framebuffers=2" >> "${BOOT_DIR}/config.txt"
326 echo "arm_64bit=1" >> "${BOOT_DIR}/config.txt"
327 echo "cmdline=cmdline.txt" >> "${BOOT_DIR}/config.txt"
328 echo "dtparam=audio=on" >> "${BOOT_DIR}/config.txt"
329 echo "gpu_mem=128" >> "${BOOT_DIR}/config.txt"
330 echo "dtoverlay=vc4-fkms-v3d, cma-128" >> "${BOOT_DIR}/config.txt"
331 fi
332
333
318 # Disable RPi2/3 under-voltage warnings
334 # Disable RPi2/3 under-voltage warnings
319 if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then
335 if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then
320 echo "avoid_warnings=${DISABLE_UNDERVOLT_WARNINGS}" >> "${BOOT_DIR}/config.txt"
336 echo "avoid_warnings=${DISABLE_UNDERVOLT_WARNINGS}" >> "${BOOT_DIR}/config.txt"
@@ -42,9 +42,15 set -x
42 # Raspberry Pi model configuration defaults to 3P
42 # Raspberry Pi model configuration defaults to 3P
43 RPI_MODEL=${RPI_MODEL:=3P}
43 RPI_MODEL=${RPI_MODEL:=3P}
44
44
45 <<<<<<< HEAD
45 # Debian release defaults to bullseye
46 # Debian release defaults to bullseye
46 RELEASE=${RELEASE:=bullseye}
47 RELEASE=${RELEASE:=bullseye}
47 if [ "$RELEASE" = "bookworm" ] ; then
48 if [ "$RELEASE" = "bookworm" ] ; then
49 =======
50 # Debian release
51 RELEASE=${RELEASE:=buster}
52 if [ $RELEASE = "bullseye" ] ; then
53 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
48 RELEASE=testing
54 RELEASE=testing
49 fi
55 fi
50 echo "Debian release value used : " $RELEASE
56 echo "Debian release value used : " $RELEASE
@@ -280,7 +286,11 if [ -n "$SET_ARCH" ] ; then
280 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
286 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
281 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
287 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
282
288
289 <<<<<<< HEAD
283 ### Raspberry Pi model specific settings
290 ### Raspberry Pi model specific settings
291 =======
292 ### Raspberry Pi 64-bit model specific settings
293 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
284 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
294 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
285 if [ "$RPI_MODEL" != 4 ] ; then
295 if [ "$RPI_MODEL" != 4 ] ; then
286 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
296 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
@@ -292,7 +302,11 if [ -n "$SET_ARCH" ] ; then
292 RELEASE_ARCH=${RELEASE_ARCH:=arm64}
302 RELEASE_ARCH=${RELEASE_ARCH:=arm64}
293 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
303 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
294 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
304 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
305 <<<<<<< HEAD
295
306
307 =======
308
309 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
296 else
310 else
297 echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit"
311 echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit"
298 exit 1
312 exit 1
@@ -313,25 +327,32 if [ -n "$SET_ARCH" ] ; then
313 RELEASE_ARCH=${RELEASE_ARCH:=armel}
327 RELEASE_ARCH=${RELEASE_ARCH:=armel}
314 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
328 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
315 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
329 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
330 <<<<<<< HEAD
316
331
317 if [ $ENABLE_XORG = true ] ; then
332 if [ $ENABLE_XORG = true ] ; then
318 if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then
333 if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then
319 printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] "
334 printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] "
320 read -r confirm
335 read -r confirm
336 =======
337 if [ $ENABLE_XORG = true ] ; then
338 if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then
339 printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] "
340 read -r confirm
341 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
321 if [ "$confirm" = "y" ] ; then
342 if [ "$confirm" = "y" ] ; then
322 $RELEASE = "stretch"
343 $RELEASE = "stretch"
323 fi
344 fi
324 fi
345 fi
325 fi
346 fi
326 fi
347 fi
327 ### Raspberry Pi (2-4) model specific settings
348 ### Raspberry Pi (2-4) model specific settings
328 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
349 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
329 if [ "$RPI_MODEL" != 4 ] ; then
350 if [ "$RPI_MODEL" != 4 ] ; then
330 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
351 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
331 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img}
352 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img}
332 else
353 else
333 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig}
354 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig}
334 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7l.img}
355 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7l.img}
335 fi
356 fi
336
357
337 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
358 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
@@ -340,7 +361,8 if [ -n "$SET_ARCH" ] ; then
340 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-}
361 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-}
341 fi
362 fi
342 fi
363 fi
343 # SET_ARCH not set
364
365 # SET_ARCH not set
344 else
366 else
345 echo "error: Please set '32' or '64' as value for SET_ARCH"
367 echo "error: Please set '32' or '64' as value for SET_ARCH"
346 exit 1
368 exit 1
@@ -348,37 +370,37 fi
348 # Device specific configuration and U-Boot configuration
370 # Device specific configuration and U-Boot configuration
349 case "$RPI_MODEL" in
371 case "$RPI_MODEL" in
350 0)
372 0)
351 DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb}
373 DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb}
352 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
374 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
353 ;;
375 ;;
354 1)
376 1)
355 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb}
377 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb}
356 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
378 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
357 ;;
379 ;;
358 1P)
380 1P)
359 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb}
381 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb}
360 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
382 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
361 ;;
383 ;;
362 2)
384 2)
363 DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb}
385 DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb}
364 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig}
386 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig}
365 ;;
387 ;;
366 3)
388 3)
367 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
389 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
368 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
390 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
369 ;;
391 ;;
370 3P)
392 3P)
371 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
393 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
372 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
394 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
373 ;;
395 ;;
374 4)
396 4)
375 DTB_FILE=${DTB_FILE:=bcm2711-rpi-4-b.dtb}
397 DTB_FILE=${DTB_FILE:=bcm2711-rpi-4-b.dtb}
376 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_4_defconfig}
398 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_4_defconfig}
377 ;;
399 ;;
378 *)
400 *)
379 echo "error: Raspberry Pi model $RPI_MODEL is not supported!"
401 echo "error: Raspberry Pi model $RPI_MODEL is not supported!"
380 exit 1
402 exit 1
381 ;;
403 ;;
382 esac
404 esac
383
405
384 # Raspberry PI 0,3,3P,4 with Bluetooth and Wifi onboard
406 # Raspberry PI 0,3,3P,4 with Bluetooth and Wifi onboard
@@ -390,8 +412,13 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$
390 if [ "$ENABLE_WIRELESS" = true ] ; then
412 if [ "$ENABLE_WIRELESS" = true ] ; then
391 APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant"
413 APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant"
392 fi
414 fi
415 <<<<<<< HEAD
393 # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard
416 # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard
394 else
417 else
418 =======
419 # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard
420 else
421 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
395 ## Check if the internal wireless interface is not supported by the RPi model
422 ## Check if the internal wireless interface is not supported by the RPi model
396 if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then
423 if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then
397 echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth"
424 echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth"
@@ -445,7 +472,7 if [ "$ENABLE_CRYPTFS" = true ] && [ "$BUILD_KERNEL" = true ] ; then
445 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cryptsetup"
472 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cryptsetup"
446 APT_INCLUDES="${APT_INCLUDES},cryptsetup,busybox,console-setup,cryptsetup-initramfs"
473 APT_INCLUDES="${APT_INCLUDES},cryptsetup,busybox,console-setup,cryptsetup-initramfs"
447
474
448 # If cryptfs,dropbear and initramfs are enabled include dropbear-initramfs package
475 ## If cryptfs,dropbear and initramfs are enabled include dropbear-initramfs package
449 if [ "$CRYPTFS_DROPBEAR" = true ] && [ "$ENABLE_INITRAMFS" = true ]; then
476 if [ "$CRYPTFS_DROPBEAR" = true ] && [ "$ENABLE_INITRAMFS" = true ]; then
450 APT_INCLUDES="${APT_INCLUDES},dropbear-initramfs"
477 APT_INCLUDES="${APT_INCLUDES},dropbear-initramfs"
451 fi
478 fi
@@ -468,10 +495,17 if [ "$ENABLE_UBOOT" = true ] ; then
468 fi
495 fi
469
496
470 if [ "$ENABLE_USBBOOT" = true ] ; then
497 if [ "$ENABLE_USBBOOT" = true ] ; then
498 <<<<<<< HEAD
471 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then
499 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then
472 echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P"
500 echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P"
473 exit 1
501 exit 1
474 fi
502 fi
503 =======
504 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then
505 echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P"
506 exit 1
507 fi
508 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
475 fi
509 fi
476
510
477 # Check if root SSH (v2) public key file exists
511 # Check if root SSH (v2) public key file exists
@@ -706,7 +740,7 fi
706 # Execute custom scripts inside the chroot
740 # Execute custom scripts inside the chroot
707 if [ -n "$CHROOT_SCRIPTS" ] && [ -d "$CHROOT_SCRIPTS" ] ; then
741 if [ -n "$CHROOT_SCRIPTS" ] && [ -d "$CHROOT_SCRIPTS" ] ; then
708 cp -r "${CHROOT_SCRIPTS}" "${R}/chroot_scripts"
742 cp -r "${CHROOT_SCRIPTS}" "${R}/chroot_scripts"
709 chroot_exec /bin/bash -x <<'EOF'
743 chroot_exec /bin/bash -x << EOF
710 for SCRIPT in /chroot_scripts/* ; do
744 for SCRIPT in /chroot_scripts/* ; do
711 if [ -f $SCRIPT -a -x $SCRIPT ] ; then
745 if [ -f $SCRIPT -a -x $SCRIPT ] ; then
712 $SCRIPT
746 $SCRIPT
@@ -826,6 +860,7 if [ "$ENABLE_SPLITFS" = true ] ; then
826 dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count="${TABLE_SECTORS}"
860 dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count="${TABLE_SECTORS}"
827 dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count=0 seek="${ROOT_SECTORS}"
861 dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count=0 seek="${ROOT_SECTORS}"
828
862
863 <<<<<<< HEAD
829 ## Write firmware/boot partition tables
864 ## Write firmware/boot partition tables
830 sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM
865 sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM
831 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
866 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
@@ -833,6 +868,15 EOM
833
868
834 ## Write root partition table
869 ## Write root partition table
835 sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM
870 sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM
871 =======
872 # Write firmware/boot partition tables
873 sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null << EOM
874 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
875 EOM
876
877 # Write root partition table
878 sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null << EOM
879 >>>>>>> 7588b4f62cfa955de0822acf49908044e0504249
836 ${TABLE_SECTORS},${ROOT_SECTORS},83
880 ${TABLE_SECTORS},${ROOT_SECTORS},83
837 EOM
881 EOM
838
882
@@ -845,7 +889,7 else
845 dd if=/dev/zero of="$IMAGE_NAME.img" bs=512 count=0 seek="${IMAGE_SECTORS}"
889 dd if=/dev/zero of="$IMAGE_NAME.img" bs=512 count=0 seek="${IMAGE_SECTORS}"
846
890
847 # Write partition table
891 # Write partition table
848 sfdisk -q -L -uS -f "$IMAGE_NAME.img" 2> /dev/null <<EOM
892 sfdisk -q -L -uS -f "$IMAGE_NAME.img" 2> /dev/null << EOM
849 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
893 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
850 ${ROOT_OFFSET},${ROOT_SECTORS},83
894 ${ROOT_OFFSET},${ROOT_SECTORS},83
851 EOM
895 EOM
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant